maropu commented on a change in pull request #25615:
[SPARK-28495][SQL][FOLLOW-UP] Disallow conversions between timestamp and long
in ASNI mode
URL: https://github.com/apache/spark/pull/25615#discussion_r318906581
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/types/DataTypeWriteCompatibilitySuite.scala
##########
@@ -133,6 +133,18 @@ class ANSIDataTypeWriteCompatibilitySuite extends
DataTypeWriteCompatibilityBase
assert(err.contains("Cannot safely cast"))
}
}
+
+ test("Conversions between timestamp and long are not allowed") {
+ assertSingleError(LongType, TimestampType, "longToTimestamp",
+ "Should not allow long to timestamp") { err =>
+ assert(err.contains("Cannot safely cast 'longToTimestamp': LongType to
TimestampType"))
+ }
+
+ assertSingleError(TimestampType, LongType, "timestampToLong",
+ "Should not allow timestamp to long") { err =>
+ assert(err.contains("Cannot safely cast 'timestampToLong': TimestampType
to LongType"))
+ }
+ }
Review comment:
yea, ok.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]