You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/06/09 16:12:05 UTC
[GitHub] [spark] cloud-fan commented on a change in pull request #32846: [SPARK-35698][SQL] Support casting of timestamp without time zone to strings
cloud-fan commented on a change in pull request #32846:
URL: https://github.com/apache/spark/pull/32846#discussion_r648466058
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
##########
@@ -1711,6 +1708,17 @@ class CastSuite extends CastSuiteBase {
}
}
+ test("SPARK-35698: cast timestamp without time zone to string") {
+ Seq(
+ "0001-01-01 00:00:00", // the fist timestamp of Common Era
+ "1582-10-15 23:59:59", // the cutover date from Julian to Gregorian calendar
+ "1970-01-01 00:00:00", // the epoch timestamp
+ "9999-12-31 23:59:59" // the last supported timestamp according to SQL standard
+ ).foreach { s =>
+ checkEvaluation(cast(LocalDateTime.parse(s.replace(" ", "T")), StringType), s)
Review comment:
can we put `T` in the strings directly?
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org