Search in sources :

Example 1 with EvaluationFilter

use of org.apache.storm.sql.runtime.streams.functions.EvaluationFilter in project storm by apache.

the class StreamsFilterRel method streamsPlan.

@Override
public void streamsPlan(StreamsPlanCreator planCreator) throws Exception {
    // SingleRel
    RelNode input = getInput();
    StormRelUtils.getStormRelInput(input).streamsPlan(planCreator);
    Stream<Values> inputStream = planCreator.pop();
    List<RexNode> childExps = getChildExps();
    RelDataType inputRowType = getInput(0).getRowType();
    String filterClassName = StormRelUtils.getClassName(this);
    ExecutableExpression filterInstance = planCreator.createScalarInstance(childExps, inputRowType, filterClassName);
    EvaluationFilter evalFilter = new EvaluationFilter(filterInstance, planCreator.getDataContext());
    final Stream<Values> finalStream = inputStream.filter(evalFilter);
    planCreator.addStream(finalStream);
}
Also used : RelNode(org.apache.calcite.rel.RelNode) EvaluationFilter(org.apache.storm.sql.runtime.streams.functions.EvaluationFilter) Values(org.apache.storm.tuple.Values) RelDataType(org.apache.calcite.rel.type.RelDataType) RexNode(org.apache.calcite.rex.RexNode) ExecutableExpression(org.apache.storm.sql.runtime.calcite.ExecutableExpression)

Aggregations

RelNode (org.apache.calcite.rel.RelNode)1 RelDataType (org.apache.calcite.rel.type.RelDataType)1 RexNode (org.apache.calcite.rex.RexNode)1 ExecutableExpression (org.apache.storm.sql.runtime.calcite.ExecutableExpression)1 EvaluationFilter (org.apache.storm.sql.runtime.streams.functions.EvaluationFilter)1 Values (org.apache.storm.tuple.Values)1