[ 
https://issues.apache.org/jira/browse/FLINK-17752?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17135462#comment-17135462
 ] 

Dawid Wysakowicz commented on FLINK-17752:
------------------------------------------

Hmm those are valid questions.

Ad. 1 I think there are no concerns about converting the millis to {{TIMESTAMP 
WITH LOCAL TIME ZONE}}. The question is shall we allow to create {{TIMESTAMP}} 
and {{TIMESTAMP WITH TIME ZONE}}. I'd say we should not allow millis for 
{{TIMESTAMP WITH TIME ZONE}}. I don't see a point of using that type along with 
millis. I was/am also unsure if millis and {{TIMESTAMP}} should be a valid 
combination. The reason why I suggested to do so is that some of the formats do 
that already (I am aware that avro stores both as long: 
https://issues.apache.org/jira/browse/AVRO-2328 and also see 
https://github.com/apache/avro/blob/9a33ed5498a68b58fc0d3d667d64899bed1fceeb/doc/src/content/xdocs/spec.xml#L1559)

But we do not need to follow that for JSON. I'd be even fine with forbidding 
expressing the TIMESTAMP as longs whatsoever. 

As for your concerns that it will confuse users. Yes it might, but imo those 
are settings that only users that know what they want to achieve should use. 
For the majority of the users the predefined sets should be more than enough. 
Similarly as it is with {{java.time}} API. You should rarely define your own 
formats, but rather use the predefined ones.

Ad.2 Personally I'd prefer not to give the possibility to override a single 
setting. To make it explicit that user should consider all three cases. The 
predefined settings should be more than enough anyway.

BTW, we do not need to start with the customizable option. We could start with 
the three predefined formats, without an option to override any settings. This 
is mostly in line with what [~twalthr] suggests. It should also cover most of 
the cases imo. Nevertheless we would have the mechanism behind the scenes, 
which would make it easier to expose later on if needed.

> Align the timestamp format with Flink SQL types in JSON format
> --------------------------------------------------------------
>
>                 Key: FLINK-17752
>                 URL: https://issues.apache.org/jira/browse/FLINK-17752
>             Project: Flink
>          Issue Type: Bug
>          Components: Formats (JSON, Avro, Parquet, ORC, SequenceFile), Table 
> SQL / Ecosystem
>            Reporter: Jark Wu
>            Assignee: Shengkai Fang
>            Priority: Critical
>             Fix For: 1.11.0
>
>
> Currently, we are using RFC3339_TIMESTAMP_FORMAT (which will add timezone at 
> the end of string) to as the timestamp format in JSON. However, the string 
> representation fo {{TIMESTAMP (WITHOUT TIME ZONE)}} shoudn't adding 'Z' at 
> the end. 
> Other discussions: 
> [1]: 
> http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/TIME-TIMESTAMP-parse-in-Flink-TABLE-SQL-API-td33061.html
> [2]: 
> http://apache-flink.147419.n8.nabble.com/json-timestamp-json-flink-sql-td1914.html
> [3]: http://apache-flink.147419.n8.nabble.com/FLINK-SQL-td2074.html



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

Reply via email to