cloud-fan commented on a change in pull request #33215:
URL: https://github.com/apache/spark/pull/33215#discussion_r663968258
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/ExpressionParserSuite.scala
##########
@@ -463,6 +464,17 @@ class ExpressionParserSuite extends AnalysisTest {
Literal(Timestamp.valueOf("2016-03-11 20:54:00.000")))
intercept("timestamP '2016-33-11 20:54:00.000'", "Cannot parse the
TIMESTAMP value")
+ // Timestamp without time zone
+ withSQLConf(SQLConf.TIMESTAMP_TYPE.key ->
TimestampTypes.TIMESTAMP_NTZ.toString) {
+ assertEqual("tImEstAmp '2016-03-11 20:54:00.000'",
+ Literal(LocalDateTime.parse("2016-03-11T20:54:00.000")))
+
+ intercept("timestamP '2016-33-11 20:54:00.000'", "Cannot parse the
TIMESTAMP value")
+
+ // If the timestamp string contains time zone, return a timestamp with
local time zone literal
+ assertEqual("tImEstAmp '2019-01-16 20:50:00.567000+01:00'",
+ Literal(1547668200567000L, TimestampType))
Review comment:
This test is hard to read. Can we create the literal from a `Instant`?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]