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

Timo Walther commented on FLINK-17752:
--------------------------------------

Thanks for the nice summary [~jark]. It helps a lot in understanding the issue 
and should end up in the docs later. When I read "drop the time zone 
information" or "convert the timestamp to local timezone and drop the time 
zone" I'm wondering if we are actually doing the right thing. All the different 
standards have introduced these completely different data types for a reason 
and we should not try to reinvent the wheel. We should not try reinterpret/cast 
because this means that we are modifying the data. A simple `INSERT INTO t 
SELECT * FROM t;` would not be an identify operation and could cause confusion 
in the future as well. Instead we should support `ZonedTimestampType` in the 
planner (at least as a valid column without further built-in functions).

This would make it straight forward for users to declare a JSON format:
- Timestamp has a time zone? Use `TIMESTAMP WITH TIME ZONE`
- Timestamp is epoch? Use `TIMESTAMP WITH LOCAL TIME ZONE`
- Timestamp is a string? Use `TIMESTAMP WITHOUT TIME ZONE`

Everything else is just formatting whether `T` or ` ` is used.

> 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