return partitioning;
}
private WindowFunctionSpec processWindowFunction(ASTNode node, ASTNode wsNode)
throws SemanticException {
WindowFunctionSpec wfSpec = new WindowFunctionSpec();
switch(node.getType()) {
case HiveParser.TOK_FUNCTIONSTAR:
wfSpec.setStar(true);
break;
case HiveParser.TOK_FUNCTIONDI:
wfSpec.setDistinct(true);
break;
}
if ( wfSpec.isDistinct() ) {
throw new SemanticException(generateErrorMessage(node,
"Count/Sum distinct not supported with Windowing"));
}
wfSpec.setExpression(node);
ASTNode nameNode = (ASTNode) node.getChild(0);
wfSpec.setName(nameNode.getText());
for(int i=1; i < node.getChildCount()-1; i++) {
ASTNode child = (ASTNode) node.getChild(i);
wfSpec.addArg(child);
}
if ( wsNode != null ) {
WindowSpec ws = processWindowSpec(wsNode);
wfSpec.setWindowSpec(ws);
}
return wfSpec;
}