private RelNode copyOf(LogicalTableFunctionScan rel) { return new LogicalTableFunctionScan( cluster, copyOf(rel.getTraitSet()), visitAll(rel.getInputs()), copyOf(rel.getCall()), rel.getElementType(), copyOf(rel.getRowType()), rel.getColumnMappings() ); }
ImmutableBitSet fieldsUsed, Set<RelDataTypeField> extraFields) { final RelDataType rowType = tabFun.getRowType(); final int fieldCount = rowType.getFieldCount(); final List<RelNode> newInputs = new ArrayList<>(); for (RelNode input : tabFun.getInputs()) { final int inputFieldCount = input.getRowType().getFieldCount(); ImmutableBitSet inputFieldsUsed = ImmutableBitSet.range(inputFieldCount); if (!tabFun.getInputs().equals(newInputs)) { newTabFun = tabFun.copy(tabFun.getTraitSet(), newInputs, tabFun.getCall(), tabFun.getElementType(), tabFun.getRowType(), tabFun.getColumnMappings());
@Override public LogicalTableFunctionScan copy( RelTraitSet traitSet, List<RelNode> inputs, RexNode rexCall, Type elementType, RelDataType rowType, Set<RelColumnMapping> columnMappings) { assert traitSet.containsIfApplicable(Convention.NONE); return new LogicalTableFunctionScan( getCluster(), traitSet, inputs, rexCall, elementType, rowType, columnMappings); }
@Override public RelNode convert(RelNode rel) { final RelTraitSet traitSet = rel.getTraitSet().replace(EnumerableConvention.INSTANCE); LogicalTableFunctionScan tbl = (LogicalTableFunctionScan) rel; return new EnumerableTableFunctionScan(rel.getCluster(), traitSet, tbl.getInputs(), tbl.getElementType(), tbl.getRowType(), tbl.getCall(), tbl.getColumnMappings()); } }
public void onMatch(RelOptRuleCall call) { LogicalFilter filter = call.rel(0); LogicalTableFunctionScan funcRel = call.rel(1); Set<RelColumnMapping> columnMappings = funcRel.getColumnMappings(); if (columnMappings == null || columnMappings.isEmpty()) { List<RelNode> funcInputs = funcRel.getInputs(); if (funcInputs.size() != 1) { if (funcRel.getRowType().getFieldCount() != funcInputs.get(0).getRowType().getFieldCount()) { return; final RelOptCluster cluster = funcRel.getCluster(); final RexNode condition = filter.getCondition(); List<RelDataTypeField> origFields = funcRel.getRowType().getFieldList(); LogicalTableFunctionScan.create(cluster, newFuncInputs, funcRel.getCall(), funcRel.getElementType(), funcRel.getRowType(), columnMappings); call.transformTo(newFuncRel);
getColumnMappings(operator); LogicalTableFunctionScan callRel = LogicalTableFunctionScan.create( cluster, inputs,
/** Creates a LogicalTableFunctionScan. */ public static LogicalTableFunctionScan create( RelOptCluster cluster, List<RelNode> inputs, RexNode rexCall, Type elementType, RelDataType rowType, Set<RelColumnMapping> columnMappings) { final RelTraitSet traitSet = cluster.traitSetOf(Convention.NONE); return new LogicalTableFunctionScan(cluster, traitSet, inputs, rexCall, elementType, rowType, columnMappings); }
public void onMatch(RelOptRuleCall call) { LogicalFilter filter = call.rel(0); LogicalTableFunctionScan funcRel = call.rel(1); Set<RelColumnMapping> columnMappings = funcRel.getColumnMappings(); if (columnMappings == null || columnMappings.isEmpty()) { List<RelNode> funcInputs = funcRel.getInputs(); if (funcInputs.size() != 1) { if (funcRel.getRowType().getFieldCount() != funcInputs.get(0).getRowType().getFieldCount()) { return; final RelOptCluster cluster = funcRel.getCluster(); final RexNode condition = filter.getCondition(); List<RelDataTypeField> origFields = funcRel.getRowType().getFieldList(); LogicalTableFunctionScan.create(cluster, newFuncInputs, funcRel.getCall(), funcRel.getElementType(), funcRel.getRowType(), columnMappings); call.transformTo(newFuncRel);
@Override public RelNode convert(RelNode rel) { final RelTraitSet traitSet = rel.getTraitSet().replace(EnumerableConvention.INSTANCE); LogicalTableFunctionScan tbl = (LogicalTableFunctionScan) rel; return new EnumerableTableFunctionScan(rel.getCluster(), traitSet, tbl.getInputs(), tbl.getElementType(), tbl.getRowType(), tbl.getCall(), tbl.getColumnMappings()); } }
getColumnMappings(operator); LogicalTableFunctionScan callRel = LogicalTableFunctionScan.create( cluster, inputs,
/** Creates a LogicalTableFunctionScan. */ public static LogicalTableFunctionScan create( RelOptCluster cluster, List<RelNode> inputs, RexNode rexCall, Type elementType, RelDataType rowType, Set<RelColumnMapping> columnMappings) { final RelTraitSet traitSet = cluster.traitSetOf(Convention.NONE); return new LogicalTableFunctionScan(cluster, traitSet, inputs, rexCall, elementType, rowType, columnMappings); }
ImmutableBitSet fieldsUsed, Set<RelDataTypeField> extraFields) { final RelDataType rowType = tabFun.getRowType(); final int fieldCount = rowType.getFieldCount(); final List<RelNode> newInputs = new ArrayList<>(); for (RelNode input : tabFun.getInputs()) { final int inputFieldCount = input.getRowType().getFieldCount(); ImmutableBitSet inputFieldsUsed = ImmutableBitSet.range(inputFieldCount); if (!tabFun.getInputs().equals(newInputs)) { newTabFun = tabFun.copy(tabFun.getTraitSet(), newInputs, tabFun.getCall(), tabFun.getElementType(), tabFun.getRowType(), tabFun.getColumnMappings());
getColumnMappings(operator); LogicalTableFunctionScan callRel = LogicalTableFunctionScan.create( cluster, inputs,
@Override public LogicalTableFunctionScan copy( RelTraitSet traitSet, List<RelNode> inputs, RexNode rexCall, Type elementType, RelDataType rowType, Set<RelColumnMapping> columnMappings) { assert traitSet.containsIfApplicable(Convention.NONE); return new LogicalTableFunctionScan( getCluster(), traitSet, inputs, rexCall, elementType, rowType, columnMappings); }
getColumnMappings(operator); LogicalTableFunctionScan callRel = LogicalTableFunctionScan.create( cluster, inputs,
case TABLE_FUNCTION_SCAN: final MutableTableFunctionScan tableFunctionScan = (MutableTableFunctionScan) node; return LogicalTableFunctionScan.create(tableFunctionScan.cluster, fromMutables(tableFunctionScan.getInputs(), relBuilder), tableFunctionScan.rexCall, tableFunctionScan.elementType, tableFunctionScan.rowType,
case TABLE_FUNCTION_SCAN: final MutableTableFunctionScan tableFunctionScan = (MutableTableFunctionScan) node; return LogicalTableFunctionScan.create(tableFunctionScan.cluster, fromMutables(tableFunctionScan.getInputs(), relBuilder), tableFunctionScan.rexCall, tableFunctionScan.elementType, tableFunctionScan.rowType,