leonardBang commented on a change in pull request #14905:
URL: https://github.com/apache/flink/pull/14905#discussion_r580077060



##########
File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/calcite/RelTimeIndicatorConverter.scala
##########
@@ -352,31 +360,33 @@ class RelTimeIndicatorConverter(rexBuilder: RexBuilder) 
extends RelShuttle {
   }
 
   private def gatherIndicesToMaterialize(aggregate: Aggregate, input: 
RelNode): Set[Int] = {
+    val fmq = 
FlinkRelMetadataQuery.reuseOrCreate(aggregate.getCluster.getMetadataQuery)
+    val windowProps = fmq.getRelWindowProperties(input)
     val indicesToMaterialize = mutable.Set[Int]()
 
     // check arguments of agg calls
-    aggregate.getAggCallList.foreach(call => if (call.getArgList.size() == 0) {
-      // count(*) has an empty argument list
-      (0 until 
input.getRowType.getFieldCount).foreach(indicesToMaterialize.add)
-    } else {
-      // for other aggregations

Review comment:
       ```
   SELECT
     COUNT(*)
   FROM TABLE(
      TUMBLE(TABLE T1, DESCRIPTOR(rowtime), INTERVAL '5' SECOND))
   GROUP BY window_start, window_end
   ```
   I just tried this pattern in `WindowAggregateITCase`, the test result is 
unexpected although it's not related to here. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to