use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.plan.RelTraitSet in project calcite by apache.
the class EnumerableTableModifyRule method convert.
@Override
public RelNode convert(RelNode rel) {
final LogicalTableModify modify = (LogicalTableModify) rel;
final ModifiableTable modifiableTable = modify.getTable().unwrap(ModifiableTable.class);
if (modifiableTable == null) {
return null;
}
final RelTraitSet traitSet = modify.getTraitSet().replace(EnumerableConvention.INSTANCE);
return new EnumerableTableModify(modify.getCluster(), traitSet, modify.getTable(), modify.getCatalogReader(), convert(modify.getInput(), traitSet), modify.getOperation(), modify.getUpdateColumnList(), modify.getSourceExpressionList(), modify.isFlattened());
}
use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.plan.RelTraitSet in project calcite by apache.
the class EnumerableTableFunctionScanRule method convert.
@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());
}
use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.plan.RelTraitSet in project calcite by apache.
the class EnumerableAggregateRule method convert.
public RelNode convert(RelNode rel) {
final LogicalAggregate agg = (LogicalAggregate) rel;
final RelTraitSet traitSet = agg.getTraitSet().replace(EnumerableConvention.INSTANCE);
try {
return new EnumerableAggregate(rel.getCluster(), traitSet, convert(agg.getInput(), EnumerableConvention.INSTANCE), agg.indicator, agg.getGroupSet(), agg.getGroupSets(), agg.getAggCallList());
} catch (InvalidRelException e) {
EnumerableRules.LOGGER.debug(e.toString());
return null;
}
}
use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.plan.RelTraitSet in project calcite by apache.
the class EnumerableCalc method create.
/**
* Creates an EnumerableCalc.
*/
public static EnumerableCalc create(final RelNode input, final RexProgram program) {
final RelOptCluster cluster = input.getCluster();
final RelMetadataQuery mq = cluster.getMetadataQuery();
final RelTraitSet traitSet = cluster.traitSet().replace(EnumerableConvention.INSTANCE).replaceIfs(RelCollationTraitDef.INSTANCE, new Supplier<List<RelCollation>>() {
public List<RelCollation> get() {
return RelMdCollation.calc(mq, input, program);
}
}).replaceIf(RelDistributionTraitDef.INSTANCE, new Supplier<RelDistribution>() {
public RelDistribution get() {
return RelMdDistribution.calc(mq, input, program);
}
});
return new EnumerableCalc(cluster, traitSet, input, program);
}
use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.plan.RelTraitSet in project calcite by apache.
the class EnumerableCollectRule method convert.
public RelNode convert(RelNode rel) {
final Collect collect = (Collect) rel;
final RelTraitSet traitSet = collect.getTraitSet().replace(EnumerableConvention.INSTANCE);
final RelNode input = collect.getInput();
return new EnumerableCollect(rel.getCluster(), traitSet, convert(input, input.getTraitSet().replace(EnumerableConvention.INSTANCE)), collect.getFieldName());
}
Aggregations