use of org.apache.flink.table.expressions.TableReferenceExpression in project flink by apache.
the class InConverter method convert.
@Override
public RexNode convert(CallExpression call, CallExpressionConvertRule.ConvertContext context) {
checkArgument(call, call.getChildren().size() > 1);
Expression headExpr = call.getChildren().get(1);
if (headExpr instanceof TableReferenceExpression) {
QueryOperation tableOperation = ((TableReferenceExpression) headExpr).getQueryOperation();
RexNode child = context.toRexNode(call.getChildren().get(0));
return RexSubQuery.in(((FlinkRelBuilder) context.getRelBuilder()).queryOperation(tableOperation).build(), ImmutableList.of(child));
} else {
List<RexNode> child = toRexNodes(context, call.getChildren());
return context.getRelBuilder().getRexBuilder().makeIn(child.get(0), child.subList(1, child.size()));
}
}
Aggregations