You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by "zml1206 (via GitHub)" <gi...@apache.org> on 2026/07/10 07:06:30 UTC

[PR] [VL] Enable GlutenGroupBasedUpdateTableSuite in Spark 4.x [gluten]

zml1206 opened a new pull request, #12493:
URL: https://github.com/apache/gluten/pull/12493

   (no comment)


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [VL] Fix GlutenGroupBasedUpdateTableSuite in Spark 4.x [gluten]

Posted by "zml1206 (via GitHub)" <gi...@apache.org>.
zml1206 commented on code in PR #12493:
URL: https://github.com/apache/gluten/pull/12493#discussion_r3575424664


##########
gluten-ut/spark40/src/test/scala/org/apache/spark/sql/connector/GlutenGroupBasedUpdateTableSuite.scala:
##########
@@ -16,8 +16,34 @@
  */
 package org.apache.spark.sql.connector
 
+import org.apache.spark.SparkException
 import org.apache.spark.sql.GlutenSQLTestsTrait
 
 class GlutenGroupBasedUpdateTableSuite
   extends GroupBasedUpdateTableSuite
-  with GlutenSQLTestsTrait {}
+  with GlutenSQLTestsTrait {
+
+  private def assertNotNullViolation(f: => Unit): Unit = {
+    val exception = intercept[SparkException](f)
+    val messages = Iterator
+      .iterate[Throwable](exception)(_.getCause)
+      .takeWhile(_ != null)
+      .flatMap(e => Option(e.getMessage))
+
+    assert(messages.exists(_.contains("Null value appeared in non-nullable field")))
+  }
+
+  testGluten("update with NOT NULL checks") {
+    createAndInitTable(
+      "pk INT NOT NULL, s STRUCT<n_i: INT NOT NULL, n_l: LONG>, dep STRING",
+      """{ "pk": 1, "s": { "n_i": 1, "n_l": 11 }, "dep": "hr" }
+        |{ "pk": 2, "s": { "n_i": 2, "n_l": 22 }, "dep": "software" }
+        |{ "pk": 3, "s": { "n_i": 3, "n_l": 33 }, "dep": "hr" }
+        |""".stripMargin
+    )
+
+    assertNotNullViolation {

Review Comment:
   Thanks for the suggestion. We tried overriding checkError, but this case fails before the helper is invoked: the upstream test uses intercept[SparkRuntimeException], while Velox wraps the native NOT NULL violation in a SparkException.
   Therefore, unlike the SQL view case, overriding the error assertion helper cannot handle this difference. 



-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [VL] Fix GlutenGroupBasedUpdateTableSuite in Spark 4.x [gluten]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #12493:
URL: https://github.com/apache/gluten/pull/12493#discussion_r3567712954


##########
gluten-ut/spark41/src/test/scala/org/apache/gluten/utils/velox/VeloxTestSettings.scala:
##########
@@ -272,7 +272,9 @@ class VeloxTestSettings extends BackendTestSettings {
   enableSuite[GlutenDataSourceV2MetricsSuite]
   enableSuite[GlutenDataSourceV2OptionSuite]
   enableSuite[GlutenDataSourceV2UtilsSuite]
-  // TODO: 4.x enableSuite[GlutenGroupBasedUpdateTableSuite]  // 1 failure
+  enableSuite[GlutenGroupBasedUpdateTableSuite]
+    // Velox assert_not_null throws VeloxUserError instead of SparkRuntimeException
+    .exclude("update with NOT NULL checks")

Review Comment:
   `GlutenGroupBasedUpdateTableSuite` defines this case via `testGluten(...)`, so the registered test name is prefixed with `"Gluten - "`. Using `exclude("update with NOT NULL checks")` will only exclude the unprefixed Spark test inherited from `GroupBasedUpdateTableSuite`, but it will NOT exclude the new Gluten-prefixed test, so the intended exclusion won’t take effect.



##########
gluten-ut/spark40/src/test/scala/org/apache/gluten/utils/velox/VeloxTestSettings.scala:
##########
@@ -262,7 +262,9 @@ class VeloxTestSettings extends BackendTestSettings {
   enableSuite[GlutenDataSourceV2MetricsSuite]
   enableSuite[GlutenDataSourceV2OptionSuite]
   enableSuite[GlutenDataSourceV2UtilsSuite]
-  // TODO: 4.x enableSuite[GlutenGroupBasedUpdateTableSuite]  // 1 failure
+  enableSuite[GlutenGroupBasedUpdateTableSuite]
+    // Velox assert_not_null throws VeloxUserError instead of SparkRuntimeException
+    .exclude("update with NOT NULL checks")

Review Comment:
   `GlutenGroupBasedUpdateTableSuite` defines this case via `testGluten(...)`, so the registered test name is prefixed with `"Gluten - "`. Using `exclude("update with NOT NULL checks")` will only exclude the unprefixed Spark test inherited from `GroupBasedUpdateTableSuite`, but it will NOT exclude the new Gluten-prefixed test, so the intended exclusion won’t take effect.



-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [VL] Fix GlutenGroupBasedUpdateTableSuite in Spark 4.x [gluten]

Posted by "zml1206 (via GitHub)" <gi...@apache.org>.
zml1206 commented on code in PR #12493:
URL: https://github.com/apache/gluten/pull/12493#discussion_r3575424664


##########
gluten-ut/spark40/src/test/scala/org/apache/spark/sql/connector/GlutenGroupBasedUpdateTableSuite.scala:
##########
@@ -16,8 +16,34 @@
  */
 package org.apache.spark.sql.connector
 
+import org.apache.spark.SparkException
 import org.apache.spark.sql.GlutenSQLTestsTrait
 
 class GlutenGroupBasedUpdateTableSuite
   extends GroupBasedUpdateTableSuite
-  with GlutenSQLTestsTrait {}
+  with GlutenSQLTestsTrait {
+
+  private def assertNotNullViolation(f: => Unit): Unit = {
+    val exception = intercept[SparkException](f)
+    val messages = Iterator
+      .iterate[Throwable](exception)(_.getCause)
+      .takeWhile(_ != null)
+      .flatMap(e => Option(e.getMessage))
+
+    assert(messages.exists(_.contains("Null value appeared in non-nullable field")))
+  }
+
+  testGluten("update with NOT NULL checks") {
+    createAndInitTable(
+      "pk INT NOT NULL, s STRUCT<n_i: INT NOT NULL, n_l: LONG>, dep STRING",
+      """{ "pk": 1, "s": { "n_i": 1, "n_l": 11 }, "dep": "hr" }
+        |{ "pk": 2, "s": { "n_i": 2, "n_l": 22 }, "dep": "software" }
+        |{ "pk": 3, "s": { "n_i": 3, "n_l": 33 }, "dep": "hr" }
+        |""".stripMargin
+    )
+
+    assertNotNullViolation {

Review Comment:
   Thanks for the suggestion. We tried overriding checkError, but this case fails before the helper is invoked: the upstream test uses intercept[SparkRuntimeException], while Velox wraps the native NOT NULL violation in a SparkException.
   Therefore, unlike the GlutenSimpleSQLViewSuite case, overriding the error assertion helper cannot handle this difference. 



-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [VL] Fix GlutenGroupBasedUpdateTableSuite in Spark 4.x [gluten]

Posted by "philo-he (via GitHub)" <gi...@apache.org>.
philo-he commented on code in PR #12493:
URL: https://github.com/apache/gluten/pull/12493#discussion_r3574523874


##########
gluten-ut/spark40/src/test/scala/org/apache/spark/sql/connector/GlutenGroupBasedUpdateTableSuite.scala:
##########
@@ -16,8 +16,34 @@
  */
 package org.apache.spark.sql.connector
 
+import org.apache.spark.SparkException
 import org.apache.spark.sql.GlutenSQLTestsTrait
 
 class GlutenGroupBasedUpdateTableSuite
   extends GroupBasedUpdateTableSuite
-  with GlutenSQLTestsTrait {}
+  with GlutenSQLTestsTrait {
+
+  private def assertNotNullViolation(f: => Unit): Unit = {
+    val exception = intercept[SparkException](f)
+    val messages = Iterator
+      .iterate[Throwable](exception)(_.getCause)
+      .takeWhile(_ != null)
+      .flatMap(e => Option(e.getMessage))
+
+    assert(messages.exists(_.contains("Null value appeared in non-nullable field")))
+  }
+
+  testGluten("update with NOT NULL checks") {
+    createAndInitTable(
+      "pk INT NOT NULL, s STRUCT<n_i: INT NOT NULL, n_l: LONG>, dep STRING",
+      """{ "pk": 1, "s": { "n_i": 1, "n_l": 11 }, "dep": "hr" }
+        |{ "pk": 2, "s": { "n_i": 2, "n_l": 22 }, "dep": "software" }
+        |{ "pk": 3, "s": { "n_i": 3, "n_l": 33 }, "dep": "hr" }
+        |""".stripMargin
+    )
+
+    assertNotNullViolation {

Review Comment:
   Can we override Spark's checkError in this test suite? 



-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [VL] Fix GlutenGroupBasedUpdateTableSuite in Spark 4.x [gluten]

Posted by "zml1206 (via GitHub)" <gi...@apache.org>.
zml1206 merged PR #12493:
URL: https://github.com/apache/gluten/pull/12493


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org