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


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/SystemTypeInference.java:
##########
@@ -374,14 +375,20 @@ private List<Field> deriveRowtimeField(CallContext 
callContext) {
                                 if (!staticArg.is(StaticArgumentTrait.TABLE)) {
                                     return;
                                 }
+                                final String argName = staticArg.getName();
                                 final RowType rowType =
                                         
LogicalTypeUtils.toRowType(args.get(pos).getLogicalType());
                                 final int onTimeColumn =
-                                        findUniqueOnTimeColumn(
-                                                staticArg.getName(), rowType, 
onTimeFields);
+                                        findUniqueOnTimeColumn(argName, 
rowType, onTimeFields);
                                 if (onTimeColumn >= 0) {
                                     
usedOnTimeFields.add(rowType.getFieldNames().get(onTimeColumn));
                                     
onTimeColumns.add(rowType.getTypeAt(onTimeColumn));
+                                    // If ORDER BY is defined, it must match 
the on_time column

Review Comment:
   I don't think SQL forbids this. What does DB2 or MySql do in this case?



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