abidaJustice commented on a change in pull request #15280:
URL: https://github.com/apache/flink/pull/15280#discussion_r598318611



##########
File path: 
flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/stream/StreamExecTemporalSort.java
##########
@@ -78,10 +79,15 @@ public StreamExecTemporalSort(
             TimestampType keyType = (TimestampType) timeType;
             if (keyType.getKind() == TimestampKind.ROWTIME) {
                 return createSortRowTime(inputType, inputTransform, config);
-            } else if (keyType.getKind() == TimestampKind.PROCTIME) {
+            }
+        }
+        if (timeType instanceof LocalZonedTimestampType) {
+            LocalZonedTimestampType keyType = (LocalZonedTimestampType) 
timeType;
+            if (keyType.getKind() == TimestampKind.PROCTIME) {
                 return createSortProcTime(inputType, inputTransform, config);
             }
         }
+
         throw new TableException(
                 String.format(
                         "Sort: Internal Error\n"

Review comment:
       I detect that this code is problematic. According to the [Bad practice 
(BAD_PRACTICE)](https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html#bad-practice-bad-practice),
 [FS: Format string should use %n rather than n 
(VA_FORMAT_STRING_USES_NEWLINE)](https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html#fs-format-string-should-use-n-rather-than-n-va-format-string-uses-newline).
   This format string includes a newline character (\n). In format strings, it 
is generally  preferable to use %n, which will produce the platform-specific 
line separator.
   




-- 
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:
[email protected]


Reply via email to