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/03/26 11:34:33 UTC

[GitHub] [spark] gengliangwang commented on a change in pull request #31971: [SPARK-34744][SQL] Improve error message for casting cause overflow error

gengliangwang commented on a change in pull request #31971:
URL: https://github.com/apache/spark/pull/31971#discussion_r602211038



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
##########
@@ -1695,6 +1695,15 @@ class CastSuite extends CastSuiteBase {
   test("SPARK-34727: cast from float II") {
     checkCast(16777215.0f, java.time.Instant.ofEpochSecond(16777215))
   }
+
+  test("SPARK-34744: Improve error message for casting cause overflow error") {
+    withSQLConf(SQLConf.ANSI_ENABLED.key -> "true") {
+      val e = intercept[ArithmeticException] {
+        Cast(Literal(128), ByteType).eval()

Review comment:
       Let's test all of Byte/Short/Int types.




-- 
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