Search in sources :

Example 1 with BeamTableFunctionScanRel

use of org.apache.beam.sdk.extensions.sql.impl.rel.BeamTableFunctionScanRel in project beam by apache.

the class BeamTableFunctionScanRule method convert.

@Override
public RelNode convert(RelNode relNode) {
    TableFunctionScan tableFunctionScan = (TableFunctionScan) relNode;
    // only support one input for table function scan.
    List<RelNode> inputs = new ArrayList<>();
    checkArgument(relNode.getInputs().size() == 1, "Wrong number of inputs for %s, expected 1 input but received: %s", BeamTableFunctionScanRel.class.getSimpleName(), relNode.getInputs().size());
    inputs.add(convert(relNode.getInput(0), relNode.getInput(0).getTraitSet().replace(BeamLogicalConvention.INSTANCE)));
    return new BeamTableFunctionScanRel(tableFunctionScan.getCluster(), tableFunctionScan.getTraitSet().replace(BeamLogicalConvention.INSTANCE), inputs, tableFunctionScan.getCall(), null, tableFunctionScan.getCall().getType(), Collections.EMPTY_SET);
}
Also used : BeamTableFunctionScanRel(org.apache.beam.sdk.extensions.sql.impl.rel.BeamTableFunctionScanRel) LogicalTableFunctionScan(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.logical.LogicalTableFunctionScan) TableFunctionScan(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.core.TableFunctionScan) RelNode(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.RelNode) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 BeamTableFunctionScanRel (org.apache.beam.sdk.extensions.sql.impl.rel.BeamTableFunctionScanRel)1 RelNode (org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.RelNode)1 TableFunctionScan (org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.core.TableFunctionScan)1 LogicalTableFunctionScan (org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.logical.LogicalTableFunctionScan)1