srowen commented on a change in pull request #23812: [SPARK-26903][SQL] Remove
the TimeZone cache
URL: https://github.com/apache/spark/pull/23812#discussion_r257517088
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala
##########
@@ -843,6 +847,9 @@ class DateExpressionsSuite extends SparkFunSuite with
ExpressionEvalHelper {
test("2015-07-24 00:00:00", null, null)
test(null, null, null)
// Test escaping of timezone
- GenerateUnsafeProjection.generate(FromUTCTimestamp(Literal(0),
Literal("\"quote")) :: Nil)
+ val msg = intercept[java.time.DateTimeException] {
+ GenerateUnsafeProjection.generate(FromUTCTimestamp(Literal(0),
Literal("\"quote")) :: Nil)
+ }.getMessage
+ assert(msg == "Invalid ID for region-based ZoneId, invalid format:
\"quote")
Review comment:
This is fine, but you could weaken this to just check that it includes
`\"quote` to not rely on the specific error message
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]