wuchong commented on a change in pull request #15485:
URL: https://github.com/apache/flink/pull/15485#discussion_r607482453



##########
File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/TableSchema.java
##########
@@ -519,18 +520,19 @@ private static void validateColumnsAndWatermarkSpecs(
                                                     String.format(
                                                             "Rowtime attribute 
'%s' is not defined in schema.",
                                                             
rowtimeAttribute)));
-            if (rowtimeType.getTypeRoot() != TIMESTAMP_WITHOUT_TIME_ZONE) {
+            if (!(rowtimeType.getTypeRoot() == 
LogicalTypeRoot.TIMESTAMP_WITH_LOCAL_TIME_ZONE
+                    || rowtimeType.getTypeRoot() == 
LogicalTypeRoot.TIMESTAMP_WITHOUT_TIME_ZONE)) {
                 throw new ValidationException(
                         String.format(
-                                "Rowtime attribute '%s' must be of type 
TIMESTAMP but is of type '%s'.",
+                                "Rowtime attribute '%s' must be of type 
TIMESTAMP or TIMESTAMP_LTZ but is of type '%s'.",
                                 rowtimeAttribute, rowtimeType));
             }
             LogicalType watermarkOutputType =
                     watermark.getWatermarkExprOutputType().getLogicalType();
-            if (watermarkOutputType.getTypeRoot() != 
TIMESTAMP_WITHOUT_TIME_ZONE) {
+            if (!supportedWatermarkType(watermarkOutputType)) {

Review comment:
       We can just compare type root then. There will be problem if rowtime is 
TIMESTAMP, but watermark is TIMESTAMP_LTZ. 




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