use of org.apache.flink.table.planner.delegation.hive.copy.HiveParserPTFInvocationSpec.PartitionExpression 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.PartitionExpression in project flink by apache.
the class HiveParserBaseSemanticAnalyzer method getPartitionKeys.
public static List<RexNode> getPartitionKeys(PartitionSpec partitionSpec, HiveParserRexNodeConverter converter, HiveParserRowResolver inputRR, HiveParserTypeCheckCtx typeCheckCtx, HiveParserSemanticAnalyzer semanticAnalyzer) throws SemanticException {
List<RexNode> res = new ArrayList<>();
if (partitionSpec != null) {
List<PartitionExpression> expressions = partitionSpec.getExpressions();
for (PartitionExpression expression : expressions) {
typeCheckCtx.setAllowStatefulFunctions(true);
ExprNodeDesc exp = semanticAnalyzer.genExprNodeDesc(expression.getExpression(), inputRR, typeCheckCtx);
res.add(converter.convert(exp));
}
}
return res;
}
use of org.apache.flink.table.planner.delegation.hive.copy.HiveParserPTFInvocationSpec.PartitionExpression 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