twalthr commented on code in PR #27929:
URL: https://github.com/apache/flink/pull/27929#discussion_r3098869771
##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/SystemTypeInference.java:
##########
@@ -667,6 +686,48 @@ private static void checkSetSemantics(StaticArgument
staticArg, TableSemantics s
"Table argument '%s' requires a PARTITION BY
clause for parallel processing.",
staticArg.getName()));
}
+
+ checkOrderBy(staticArg, semantics);
}
+
+ private static void checkOrderBy(StaticArgument staticArg,
TableSemantics semantics) {
+ final int[] orderByColumns = semantics.orderByColumns();
+ if (orderByColumns.length == 0) {
+ return;
+ }
+
+ final LogicalType tableType =
semantics.dataType().getLogicalType();
+ final List<String> fieldNames =
LogicalTypeChecks.getFieldNames(tableType);
+ final List<LogicalType> fieldTypes =
LogicalTypeChecks.getFieldTypes(tableType);
+
+ // The first ORDER BY column must be a supported time attribute
+ final int firstOrderByColumn = orderByColumns[0];
+ final LogicalType firstOrderByType =
fieldTypes.get(firstOrderByColumn);
+ if (isUnsupportedOnTimeColumn(firstOrderByType)) {
Review Comment:
Good point, I corrected the docs to avoid any confusion 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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]