Q Kang created FLINK-18611:
------------------------------

             Summary: Include `m` as time unit expression for MINUTE in SQL
                 Key: FLINK-18611
                 URL: https://issues.apache.org/jira/browse/FLINK-18611
             Project: Flink
          Issue Type: Improvement
          Components: Connectors / FileSystem
    Affects Versions: 1.11.0
            Reporter: Q Kang


According to the 
[documentation|[https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/connectors/filesystem.html]]
 of FileSystem SQL Connector, if we try to create a table with the following 
parameter:
{code:java}
'sink.partition-commit.delay'='1 m'
{code}
The program will fail with exception messages as below:
{code:java}
java.lang.IllegalArgumentException: Could not parse value '1 m' for key 
'sink.partition-commit.delay'.java.lang.IllegalArgumentException: Could not 
parse value '1 m' for key 'sink.partition-commit.delay'. 
..........
Caused by: java.lang.IllegalArgumentException: Time interval unit label 'm' 
does not match any of the recognized units: DAYS: (d | day | days), HOURS: (h | 
hour | hours), MINUTES: (min | minute | minutes), SECONDS: (s | sec | secs | 
second | seconds), MILLISECONDS: (ms | milli | millis | millisecond | 
milliseconds), MICROSECONDS: (µs | micro | micros | microsecond | 
microseconds), NANOSECONDS: (ns | nano | nanos | nanosecond | nanoseconds){code}
In org/apache/flink/util/TimeUtils.java#TimeUnit, the definition of MINUTE 
seems doesn't match with other units.
{code:java}
DAYS(ChronoUnit.DAYS, singular("d"), plural("day")),
HOURS(ChronoUnit.HOURS, singular("h"), plural("hour")),
MINUTES(ChronoUnit.MINUTES, singular("min"), plural("minute")),
SECONDS(ChronoUnit.SECONDS, singular("s"), plural("sec"), plural("second")),
...{code}
That is, `m` is not a valid expression for MINUTE, but `d`/`h`/`s` etc. are all 
valid expressions regarding to DAY/HOUR/SECOND, which might be a little 
confusing to users.

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to