[
https://issues.apache.org/jira/browse/FLINK-21456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17417936#comment-17417936
]
Francesco Guardiani commented on FLINK-21456:
---------------------------------------------
After some investigation on unifying the , I've tried to follow the [~jark]
idea of implementing all the toString semantics like a CAST(x AS STRING). In
order to do that and unify it using the same code, I need the casting to string
code in flink-table-common.
I see in ExprCodeGenerator for casting date/time/timestamps to string we use
some utils in SqlDateTimeUtils from flink-table-runtime and DateTimeUtils from
avatica-core. Now, I see two solutions to the problem:
* We make flink-table-common depending on avatica-core to use DateTimeUtils
* We copy as is all the content of DateTimeUtils in flink-table-common. This
should be an easy copy-paste job as it doesn't depend on any other avatica-core
class
Of course both of the solutions seems a no-go for me, although I still struggle
to find a better alternative. Do you have any opinions about this?
> TableResult#print() should correctly stringify values of all data types in
> SQL format
> -------------------------------------------------------------------------------------
>
> Key: FLINK-21456
> URL: https://issues.apache.org/jira/browse/FLINK-21456
> Project: Flink
> Issue Type: Improvement
> Components: Table SQL / API
> Reporter: Jark Wu
> Assignee: Francesco Guardiani
> Priority: Minor
> Labels: auto-deprioritized-major, auto-unassigned
>
> Currently {{TableResult#print()} simply use {{Object#toString()}} as the
> string representation of the fields. This is not SQL compliant, because for
> TIMESTAMP and TIMESTAMP_LZ, the string representation should be {{2021-02-23
> 17:30:00}} instead of {{2021-02-23T17:30:00Z}}.
> Note: we may need to update {{PrintUtils#rowToString(Row)}} and also SQL
> Client which invokes this method.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)