wuchong commented on a change in pull request #10877:
[FLINK-15602][table-planner-blink] Padding TIMESTAMP type to respect …
URL: https://github.com/apache/flink/pull/10877#discussion_r368274502
##########
File path:
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/expressions/TemporalTypesTest.scala
##########
@@ -795,8 +794,8 @@ class TemporalTypesTest extends ExpressionTestBase {
def testTemporalShanghai(): Unit = {
config.setLocalTimeZone(ZoneId.of("Asia/Shanghai"))
- testSqlApi(timestampTz("2018-03-14 19:01:02.123"), "2018-03-14
19:01:02.123")
- testSqlApi(timestampTz("2018-03-14 19:00:00.010"), "2018-03-14
19:00:00.01")
+ testSqlApi(timestampTz("2018-03-14 19:01:02.123"), "2018-03-14
19:01:02.123000")
Review comment:
Currently, we don't have a way to construct TIMESTAMP WITH LOCAL TIME ZONE
literal. `timestampTz` will lose the original timestamp literal precision and
use a default 6 precision. The tests are counter-intuitive because we are
padding zeros for a timestamp literal.
Could we improve the `timestampTz` a little bit? It can extract precision
from the literal string, and cast to the local timestamp with the extracted
precison.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services