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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to