use of org.apache.calcite.DataContext in project storm by apache.
the class EvaluationCalc method execute.
@Override
public Iterable<Values> execute(TridentTuple input) {
Context calciteContext = new StormContext(dataContext);
calciteContext.values = input.getValues().toArray();
if (filterInstance != null) {
filterInstance.execute(calciteContext, outputValues);
// filtered out
if (outputValues[0] == null || !((Boolean) outputValues[0])) {
return Collections.emptyList();
}
}
if (projectionInstance != null) {
projectionInstance.execute(calciteContext, outputValues);
return Collections.singletonList(new Values(outputValues));
} else {
return Collections.singletonList(new Values(input.getValues()));
}
}
Aggregations