twalthr commented on code in PR #27616:
URL: https://github.com/apache/flink/pull/27616#discussion_r2811258064


##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/rules/physical/stream/StreamPhysicalOverAggregateRule.scala:
##########
@@ -83,6 +82,52 @@ class StreamPhysicalOverAggregateRule(config: Config) 
extends ConverterRule(conf
       outputRowType,
       logicWindow)
   }
+
+  private def inferOutputRowType(
+      rel: RelNode,
+      logicWindow: FlinkLogicalOverAggregate): RelDataType = {
+    // only supports one group now
+    val aggCalls = 
logicWindow.groups.get(0).getAggregateCalls(logicWindow).asScala
+
+    if (aggCalls.isEmpty) {
+      return rel.getRowType
+    }
+
+    val logicWindowInputFieldCount = 
logicWindow.getInput.getRowType.getFieldCount
+    val relTypes = rel.getRowType.getFieldList.asScala.map(f => 
f.getType).toList.asJava
+    val windowInputTypes =
+      logicWindow.getInput.getRowType.getFieldList.asScala.map(f => 
f.getType).toList.asJava
+
+    // Type might be different because of 
RelTimeIndicatorConverter#materializeTimeIndicators

Review Comment:
   Can we fix in the RelTimeIndicatorConverter instead? The output of the 
materializeTimeIndicators should be consistent and correct for all RexNode but 
also for RelNode data types.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to