bvarghese1 commented on code in PR #26407: URL: https://github.com/apache/flink/pull/26407#discussion_r2035654644
########## flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/optimize/program/FlinkChangelogModeInferenceProgram.scala: ########## @@ -310,18 +310,26 @@ class FlinkChangelogModeInferenceProgram extends FlinkOptimizeProgram[StreamOpti .newBuilder() .addContainedKind(ModifyKind.INSERT) - // All aggregates are computed over the same window and order by is supported for only 1 field - val orderKeyIndex = - over.logicWindow.groups.get(0).orderKeys.getFieldCollations.get(0).getFieldIndex - val orderKeyType = over.logicWindow.getRowType.getFieldList.get(orderKeyIndex).getType if ( - !FlinkTypeFactory.isRowtimeIndicatorType(orderKeyType) - && !FlinkTypeFactory.isProctimeIndicatorType(orderKeyType) + !over.logicWindow.groups.isEmpty && !over.logicWindow.groups + .get(0) + .orderKeys + .getFieldCollations + .isEmpty Review Comment: Ideally this one condition should be enough i.e. `!groups.get(0).orderKeys.getFieldCollations.isEmpty` but the condition `!groups.isEmpty` is just a safety check. We can remove the safety check since there will always be 1 group. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org