philo-he commented on code in PR #13170:
URL: https://github.com/apache/gluten/pull/13170#discussion_r4180491011


##########
backends-velox/src/test/scala/org/apache/gluten/functions/ArithmeticAnsiValidateSuite.scala:
##########
@@ -93,4 +93,137 @@ class ArithmeticAnsiValidateSuite extends 
FunctionsValidateSuite {
     }
   }
 
+  test("decimal add overflow") {
+    // Normal decimal add should succeed and match Spark results
+    runQueryAndCompare(
+      "SELECT CAST(1.0 AS DECIMAL(10,2)) + CAST(2.0 AS DECIMAL(10,2))") {
+      checkGlutenPlan[ProjectExecTransformer]
+    }
+
+    // Overflow: max DECIMAL(38,0) + 1 should throw in ANSI mode
+    if (isSparkVersionGE("4.0")) {

Review Comment:
   Can we use withSQLConf to test ANSI ON and OFF instead? This is more 
explicit and allows testing non-ANSI behavior even when the support for Spark 
3.5 and earlier versions is dropped in the future.
   
   Ditto for other code where if (isSparkVersionGE("4.0")) is used.



##########
backends-velox/src/test/scala/org/apache/gluten/functions/ArithmeticAnsiValidateSuite.scala:
##########
@@ -93,4 +93,137 @@ class ArithmeticAnsiValidateSuite extends 
FunctionsValidateSuite {
     }
   }
 
+  test("decimal add overflow") {
+    // Normal decimal add should succeed and match Spark results
+    runQueryAndCompare(
+      "SELECT CAST(1.0 AS DECIMAL(10,2)) + CAST(2.0 AS DECIMAL(10,2))") {
+      checkGlutenPlan[ProjectExecTransformer]
+    }
+
+    // Overflow: max DECIMAL(38,0) + 1 should throw in ANSI mode
+    if (isSparkVersionGE("4.0")) {

Review Comment:
   Can we use withSQLConf to test ANSI ON and OFF instead? This is more 
explicit and allows testing non-ANSI behavior even when the support for Spark 
3.5 and earlier versions is dropped in the future.
   
   Ditto for other test code where if (isSparkVersionGE("4.0")) is used.



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

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