hililiwei commented on a change in pull request #17749:
URL: https://github.com/apache/flink/pull/17749#discussion_r754819067



##########
File path: 
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/filesystem/FileSystemConnectorOptions.java
##########
@@ -156,6 +156,22 @@
                     .withDescription(
                             "The extractor class for implement 
PartitionTimeExtractor interface.");
 
+    public static final ConfigOption<String> 
PARTITION_TIME_EXTRACTOR_TIMESTAMP_FORMATTER =
+            key("partition.time-extractor.timestamp-formatter")
+                    .stringType()
+                    .noDefaultValue()

Review comment:
       the default value is broader than  'yyyy-MM-dd HH:mm:ss'。
   ```
       private static final DateTimeFormatter TIMESTAMP_FORMATTER =
               new DateTimeFormatterBuilder()
                       .appendValue(YEAR, 1, 10, SignStyle.NORMAL)
                       .appendLiteral('-')
                       .appendValue(MONTH_OF_YEAR, 1, 2, SignStyle.NORMAL)
                       .appendLiteral('-')
                       .appendValue(DAY_OF_MONTH, 1, 2, SignStyle.NORMAL)
                       .optionalStart()
                       .appendLiteral(" ")
                       .appendValue(HOUR_OF_DAY, 1, 2, SignStyle.NORMAL)
                       .appendLiteral(':')
                       .appendValue(MINUTE_OF_HOUR, 1, 2, SignStyle.NORMAL)
                       .appendLiteral(':')
                       .appendValue(SECOND_OF_MINUTE, 1, 2, SignStyle.NORMAL)
                       .optionalStart()
                       .appendFraction(ChronoField.NANO_OF_SECOND, 1, 9, true)
                       .optionalEnd()
                       .optionalEnd()
                       .toFormatter()
                       .withResolverStyle(ResolverStyle.LENIENT);
   ```
   
   For example, the default values above work for single-digit months, but 
'yyyy-MM-dd HH:mm:ss' does not, the same for  milliseconds.
   Originally, I used  'yyyy-MM-dd HH:mm:ss'  as the default and removed the 
TIMESTAMP_FORMATTER, but I found that this had compatibility issues.
   




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