Java Code Examples for scala.collection.mutable.ArrayBuffer#size()
The following examples show how to use
scala.collection.mutable.ArrayBuffer#size() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PythonCorrelateSplitRule.java From flink with Apache License 2.0 | 5 votes |
private FlinkLogicalCalc createTopCalc( int primitiveLeftFieldCount, RexBuilder rexBuilder, ArrayBuffer<RexNode> extractedRexNodes, RelDataType calcRowType, FlinkLogicalCorrelate newCorrelate) { RexProgram rexProgram = new RexProgramBuilder(newCorrelate.getRowType(), rexBuilder).getProgram(); int offset = extractedRexNodes.size() + primitiveLeftFieldCount; // extract correlate output RexNode. List<RexNode> newTopCalcProjects = rexProgram .getExprList() .stream() .filter(x -> x instanceof RexInputRef) .filter(x -> { int index = ((RexInputRef) x).getIndex(); return index < primitiveLeftFieldCount || index >= offset; }) .collect(Collectors.toList()); return new FlinkLogicalCalc( newCorrelate.getCluster(), newCorrelate.getTraitSet(), newCorrelate, RexProgram.create( newCorrelate.getRowType(), newTopCalcProjects, null, calcRowType, rexBuilder)); }
Example 2
Source File: PythonCorrelateSplitRule.java From flink with Apache License 2.0 | 5 votes |
private FlinkLogicalCalc createTopCalc( int primitiveLeftFieldCount, RexBuilder rexBuilder, ArrayBuffer<RexNode> extractedRexNodes, RelDataType calcRowType, FlinkLogicalCorrelate newCorrelate) { RexProgram rexProgram = new RexProgramBuilder(newCorrelate.getRowType(), rexBuilder).getProgram(); int offset = extractedRexNodes.size() + primitiveLeftFieldCount; // extract correlate output RexNode. List<RexNode> newTopCalcProjects = rexProgram .getExprList() .stream() .filter(x -> x instanceof RexInputRef) .filter(x -> { int index = ((RexInputRef) x).getIndex(); return index < primitiveLeftFieldCount || index >= offset; }) .collect(Collectors.toList()); return new FlinkLogicalCalc( newCorrelate.getCluster(), newCorrelate.getTraitSet(), newCorrelate, RexProgram.create( newCorrelate.getRowType(), newTopCalcProjects, null, calcRowType, rexBuilder)); }