You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "Hisoka-X (via GitHub)" <gi...@apache.org> on 2023/03/31 03:22:49 UTC

[GitHub] [spark] Hisoka-X commented on a diff in pull request #40609: [SPARK-42316][SQL] Assign name to _LEGACY_ERROR_TEMP_2044

Hisoka-X commented on code in PR #40609:
URL: https://github.com/apache/spark/pull/40609#discussion_r1153973500


##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionErrorsSuite.scala:
##########
@@ -625,6 +625,20 @@ class QueryExecutionErrorsSuite
     }
   }
 
+  test("BINARY_ARITHMETIC_CAUSE_OVERFLOW: byte plus byte result overflow") {
+    checkError(
+      exception = intercept[SparkArithmeticException] {
+        sql(s"select CAST('5' AS TINYINT) + CAST('5' AS TINYINT)").collect()
+      },
+      errorClass = "BINARY_ARITHMETIC_CAUSE_OVERFLOW",
+      parameters = Map(
+        "value1" -> "5",
+        "symbol" -> "+",

Review Comment:
   Hi, I use `select CAST('32767' AS TINYINT) + CAST('32767' AS TINYINT)` but result null, is it acceptable? If not, I will fix it.
   <img width="764" alt="image" src="https://user-images.githubusercontent.com/32387433/229014398-cbae18d7-a7bb-4de2-a44e-a44703ce0f99.png">
   



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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