use of org.apache.calcite.rex.RexPatternFieldRef in project beam by apache.
the class CEPCall method of.
public static CEPCall of(RexCall operation) {
SqlOperator call = operation.getOperator();
CEPOperator myOp = CEPOperator.of(call);
ArrayList<CEPOperation> operandsList = new ArrayList<>();
for (RexNode i : operation.getOperands()) {
if (i.getClass() == RexCall.class) {
CEPCall callToAdd = CEPCall.of((RexCall) i);
operandsList.add(callToAdd);
} else if (i.getClass() == RexLiteral.class) {
RexLiteral lit = (RexLiteral) i;
CEPLiteral litToAdd = CEPLiteral.of(lit);
operandsList.add(litToAdd);
} else if (i.getClass() == RexPatternFieldRef.class) {
RexPatternFieldRef fieldRef = (RexPatternFieldRef) i;
CEPFieldRef fieldRefToAdd = CEPFieldRef.of(fieldRef);
operandsList.add(fieldRefToAdd);
} else {
throw new UnsupportedOperationException("RexNode not supported: " + i.getClass().getName());
}
}
return new CEPCall(myOp, operandsList);
}
Aggregations