use of org.apache.flink.table.planner.plan.nodes.physical.stream.StreamPhysicalPythonGroupTableAggregate in project flink by apache.
the class StreamPhysicalPythonGroupTableAggregateRule method convert.
@Override
public RelNode convert(RelNode rel) {
FlinkLogicalTableAggregate agg = (FlinkLogicalTableAggregate) rel;
FlinkRelDistribution requiredDistribution;
if (agg.getGroupSet().cardinality() != 0) {
requiredDistribution = FlinkRelDistribution.hash(agg.getGroupSet().asList(), true);
} else {
requiredDistribution = FlinkRelDistribution.SINGLETON();
}
RelTraitSet requiredTraitSet = rel.getCluster().getPlanner().emptyTraitSet().replace(requiredDistribution).replace(FlinkConventions.STREAM_PHYSICAL());
RelTraitSet providedTraitSet = rel.getTraitSet().replace(FlinkConventions.STREAM_PHYSICAL());
RelNode newInput = RelOptRule.convert(agg.getInput(), requiredTraitSet);
return new StreamPhysicalPythonGroupTableAggregate(rel.getCluster(), providedTraitSet, newInput, rel.getRowType(), agg.getGroupSet().toArray(), JavaScalaConversionUtil.toScala(agg.getAggCallList()));
}
Aggregations