use of org.apache.flink.table.planner.delegation.hive.copy.HiveParserPTFInvocationSpec.PartitionSpec in project flink by apache.
the class HiveParserBaseSemanticAnalyzer method processPartitionSpec.
static PartitionSpec processPartitionSpec(HiveParserASTNode node) {
PartitionSpec pSpec = new PartitionSpec();
int exprCnt = node.getChildCount();
for (int i = 0; i < exprCnt; i++) {
PartitionExpression exprSpec = new PartitionExpression();
exprSpec.setExpression((HiveParserASTNode) node.getChild(i));
pSpec.addExpression(exprSpec);
}
return pSpec;
}
use of org.apache.flink.table.planner.delegation.hive.copy.HiveParserPTFInvocationSpec.PartitionSpec in project flink by apache.
the class HiveParserBaseSemanticAnalyzer method processPTFPartitionSpec.
static PartitioningSpec processPTFPartitionSpec(HiveParserASTNode pSpecNode) {
PartitioningSpec partitioning = new PartitioningSpec();
HiveParserASTNode firstChild = (HiveParserASTNode) pSpecNode.getChild(0);
int type = firstChild.getType();
if (type == HiveASTParser.TOK_DISTRIBUTEBY || type == HiveASTParser.TOK_CLUSTERBY) {
PartitionSpec pSpec = processPartitionSpec(firstChild);
partitioning.setPartSpec(pSpec);
HiveParserASTNode sortNode = pSpecNode.getChildCount() > 1 ? (HiveParserASTNode) pSpecNode.getChild(1) : null;
if (sortNode != null) {
OrderSpec oSpec = processOrderSpec(sortNode);
partitioning.setOrderSpec(oSpec);
}
} else if (type == HiveASTParser.TOK_SORTBY || type == HiveASTParser.TOK_ORDERBY) {
OrderSpec oSpec = processOrderSpec(firstChild);
partitioning.setOrderSpec(oSpec);
}
return partitioning;
}
use of org.apache.flink.table.planner.delegation.hive.copy.HiveParserPTFInvocationSpec.PartitionSpec in project flink by apache.
the class HiveParserWindowingSpec method applyConstantPartition.
private void applyConstantPartition(WindowSpec wdwSpec) {
PartitionSpec partSpec = wdwSpec.getPartition();
if (partSpec == null) {
partSpec = new PartitionSpec();
PartitionExpression partExpr = new PartitionExpression();
partExpr.setExpression(new HiveParserASTNode(new CommonToken(HiveASTParser.Number, "0")));
partSpec.addExpression(partExpr);
wdwSpec.setPartition(partSpec);
}
}
Aggregations