wuchong commented on a change in pull request #10268: 
[Flink-14599][table-planner-blink] Support precision of TimestampType in blink 
planner
URL: https://github.com/apache/flink/pull/10268#discussion_r349456919
 
 

 ##########
 File path: 
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/types/TypeInfoDataTypeConverter.java
 ##########
 @@ -98,6 +105,20 @@ private static void addDefaultTypeInfo(Class<?> clazz, 
TypeInformation<?> typeIn
                }
                LogicalType logicalType = fromDataTypeToLogicalType(dataType);
                switch (logicalType.getTypeRoot()) {
+                       case TIMESTAMP_WITHOUT_TIME_ZONE:
+                               TimestampType timestampType = (TimestampType) 
logicalType;
+                               int precision = timestampType.getPrecision();
+                               if (timestampType.getKind() == 
TimestampKind.REGULAR) {
+                                       return clazz == SqlTimestamp.class ?
+                                               new 
SqlTimestampTypeInfo(precision) :
+                                               (clazz == LocalDateTime.class ?
+                                                       ((3 == precision) ?
 
 Review comment:
   I think this is for backward compatibility, because `Types.LOCAL_DATE_TIME` 
is recognized as `TIMESTAMP(3)` in `LegacyTypeInfoDataTypeConverter`.

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


With regards,
Apache Git Services

Reply via email to