This is an automated email from the ASF dual-hosted git repository.

changchen pushed a commit to branch feature/ansi-ci-baseline
in repository https://gitbox.apache.org/repos/asf/gluten.git

commit a3a98b47509ef9497d5700cd1e176bde6cd03d91
Author: Chang chen <[email protected]>
AuthorDate: Fri Apr 10 08:31:02 2026 +0000

    [GLUTEN-10134][VL] Skip GlutenInsertSuite "remove v1writes sort" under ANSI 
mode
    
    Add testGlutenWithAnsiMode to GlutenTestsBaseTrait for conditionally
    registering testGluten tests based on ANSI mode. The test data contains
    string values "2"/"3"/"4" which are invalid for cast(string as boolean)
    under ANSI mode (both Spark and Velox reject them).
    
    Co-Authored-By: Claude Opus 4 <[email protected]>
---
 .../test/scala/org/apache/spark/sql/GlutenTestsBaseTrait.scala   | 9 +++++++++
 .../scala/org/apache/spark/sql/sources/GlutenInsertSuite.scala   | 2 +-
 .../scala/org/apache/spark/sql/sources/GlutenInsertSuite.scala   | 2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git 
a/gluten-ut/common/src/test/scala/org/apache/spark/sql/GlutenTestsBaseTrait.scala
 
b/gluten-ut/common/src/test/scala/org/apache/spark/sql/GlutenTestsBaseTrait.scala
index a0ab973061..3170d6755a 100644
--- 
a/gluten-ut/common/src/test/scala/org/apache/spark/sql/GlutenTestsBaseTrait.scala
+++ 
b/gluten-ut/common/src/test/scala/org/apache/spark/sql/GlutenTestsBaseTrait.scala
@@ -19,6 +19,7 @@ package org.apache.spark.sql
 import org.apache.gluten.utils.BackendTestSettings
 
 import org.apache.spark.sql.GlutenTestConstants.GLUTEN_TEST
+import org.apache.spark.sql.internal.SQLConf
 
 import org.scalactic.source.Position
 import org.scalatest.Tag
@@ -51,6 +52,14 @@ trait GlutenTestsBaseTrait extends AnyFunSuiteLike {
     test(GLUTEN_TEST + testName, testTag: _*)(testFun)
   }
 
+  /** Run the gluten test only when ANSI mode matches the expected value. */
+  protected def testGlutenWithAnsiMode(testName: String, ansiEnabled: 
Boolean)(testFun: => Any)(
+      implicit pos: Position): Unit = {
+    if (SQLConf.get.ansiEnabled == ansiEnabled) {
+      testGluten(testName)(testFun)
+    }
+  }
+
   protected def ignoreGluten(testName: String, testTag: Tag*)(testFun: => 
Any)(implicit
       pos: Position): Unit = {
     super.ignore(GLUTEN_TEST + testName, testTag: _*)(testFun)
diff --git 
a/gluten-ut/spark40/src/test/scala/org/apache/spark/sql/sources/GlutenInsertSuite.scala
 
b/gluten-ut/spark40/src/test/scala/org/apache/spark/sql/sources/GlutenInsertSuite.scala
index 0437e29a7d..1bbedb2d27 100644
--- 
a/gluten-ut/spark40/src/test/scala/org/apache/spark/sql/sources/GlutenInsertSuite.scala
+++ 
b/gluten-ut/spark40/src/test/scala/org/apache/spark/sql/sources/GlutenInsertSuite.scala
@@ -180,7 +180,7 @@ class GlutenInsertSuite
     }
   }
 
-  testGluten("remove v1writes sort") {
+  testGlutenWithAnsiMode("remove v1writes sort", false) {
     // __HIVE_DEFAULT_PARTITION__ for other types are covered by other tests.
     Seq(
       ("p boolean", "coalesce(cast(c2 as boolean), false)", Set("p=false", 
"p=true")),
diff --git 
a/gluten-ut/spark41/src/test/scala/org/apache/spark/sql/sources/GlutenInsertSuite.scala
 
b/gluten-ut/spark41/src/test/scala/org/apache/spark/sql/sources/GlutenInsertSuite.scala
index 0437e29a7d..1bbedb2d27 100644
--- 
a/gluten-ut/spark41/src/test/scala/org/apache/spark/sql/sources/GlutenInsertSuite.scala
+++ 
b/gluten-ut/spark41/src/test/scala/org/apache/spark/sql/sources/GlutenInsertSuite.scala
@@ -180,7 +180,7 @@ class GlutenInsertSuite
     }
   }
 
-  testGluten("remove v1writes sort") {
+  testGlutenWithAnsiMode("remove v1writes sort", false) {
     // __HIVE_DEFAULT_PARTITION__ for other types are covered by other tests.
     Seq(
       ("p boolean", "coalesce(cast(c2 as boolean), false)", Set("p=false", 
"p=true")),


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

Reply via email to