Skip to content

Commit d195381

Browse files
godfreyheKurtYoung
authored andcommitted
[FLINK-12559][table-planner-blink] Introduce metadata handlers on window aggregate
This closes apache#8487
1 parent aca9c01 commit d195381

File tree

44 files changed

+1896
-395
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1896
-395
lines changed

flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/metadata/AggCallSelectivityEstimator.scala

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
package org.apache.flink.table.plan.metadata
2020

2121
import org.apache.flink.table.JDouble
22-
import org.apache.flink.table.plan.nodes.physical.batch.BatchExecGroupAggregateBase
22+
import org.apache.flink.table.plan.nodes.physical.batch.{BatchExecGroupAggregateBase, BatchExecLocalHashWindowAggregate, BatchExecLocalSortWindowAggregate, BatchExecWindowAggregateBase}
2323
import org.apache.flink.table.plan.stats._
2424
import org.apache.flink.table.plan.util.AggregateUtil
2525

@@ -62,6 +62,14 @@ class AggCallSelectivityEstimator(agg: RelNode, mq: FlinkRelMetadataQuery)
6262
(rel.getGroupSet.toArray ++ auxGroupSet, otherAggCalls)
6363
case rel: BatchExecGroupAggregateBase =>
6464
(rel.getGrouping ++ rel.getAuxGrouping, rel.getAggCallList)
65+
case rel: BatchExecLocalHashWindowAggregate =>
66+
val fullGrouping = rel.getGrouping ++ Array(rel.inputTimeFieldIndex) ++ rel.getAuxGrouping
67+
(fullGrouping, rel.getAggCallList)
68+
case rel: BatchExecLocalSortWindowAggregate =>
69+
val fullGrouping = rel.getGrouping ++ Array(rel.inputTimeFieldIndex) ++ rel.getAuxGrouping
70+
(fullGrouping, rel.getAggCallList)
71+
case rel: BatchExecWindowAggregateBase =>
72+
(rel.getGrouping ++ rel.getAuxGrouping, rel.getAggCallList)
6573
case _ => throw new IllegalArgumentException(s"Cannot handle ${agg.getRelTypeName}!")
6674
}
6775
require(outputIdx >= fullGrouping.length)

0 commit comments

Comments
 (0)