zml1206 commented on code in PR #12476:
URL: https://github.com/apache/gluten/pull/12476#discussion_r3542745565


##########
gluten-ut/spark41/src/test/scala/org/apache/spark/sql/sources/GlutenInsertSuite.scala:
##########
@@ -406,195 +406,189 @@ class GlutenInsertSuite
 
   // TODO: fix in Spark-4.0
   ignoreGluten("SPARK-39557 INSERT INTO statements with tables with array 
defaults") {
-    withSQLConf("spark.gluten.sql.complexType.scan.fallback.enabled" -> 
"false") {
-      import testImplicits._
-      // Positive tests: array types are supported as default values.
-      case class Config(dataSource: String, useDataFrames: Boolean = false)
-      Seq(
-        Config("parquet"),
-        Config("parquet", useDataFrames = true),
-        Config("orc"),
-        Config("orc", useDataFrames = true)).foreach {
-        config =>
-          withTable("t") {
-            sql(s"create table t(i boolean) using ${config.dataSource}")
-            if (config.useDataFrames) {
-              Seq(false).toDF.write.insertInto("t")
-            } else {
-              sql("insert into t select false")
-            }
-            sql("alter table t add column s array<int> default array(1, 2)")
-            checkAnswer(spark.table("t"), Row(false, null))
-            sql("insert into t(i) values (true)")
-            checkAnswer(spark.table("t"), Seq(Row(false, null), Row(true, 
Seq(1, 2))))
+    import testImplicits._
+    // Positive tests: array types are supported as default values.
+    case class Config(dataSource: String, useDataFrames: Boolean = false)
+    Seq(
+      Config("parquet"),
+      Config("parquet", useDataFrames = true),
+      Config("orc"),
+      Config("orc", useDataFrames = true)).foreach {
+      config =>
+        withTable("t") {
+          sql(s"create table t(i boolean) using ${config.dataSource}")
+          if (config.useDataFrames) {
+            Seq(false).toDF.write.insertInto("t")
+          } else {
+            sql("insert into t select false")
           }
-      }
-      // Negative tests: provided array element types must match their 
corresponding DEFAULT
-      // declarations, if applicable.
-      val incompatibleDefault =
-        "Failed to execute ALTER TABLE ADD COLUMNS command because the 
destination " +
-          "table column `s` has a DEFAULT value"
-      Seq(Config("parquet"), Config("parquet", useDataFrames = true)).foreach {
-        config =>
-          withTable("t") {
-            sql(s"create table t(i boolean) using ${config.dataSource}")
-            if (config.useDataFrames) {
-              Seq(false).toDF.write.insertInto("t")
-            } else {
-              sql("insert into t select false")
-            }
-            assert(intercept[AnalysisException] {
-              sql("alter table t add column s array<int> default array('abc', 
'def')")
-            }.getMessage.contains(incompatibleDefault))
+          sql("alter table t add column s array<int> default array(1, 2)")
+          checkAnswer(spark.table("t"), Row(false, null))
+          sql("insert into t(i) values (true)")
+          checkAnswer(spark.table("t"), Seq(Row(false, null), Row(true, Seq(1, 
2))))
+        }
+    }
+    // Negative tests: provided array element types must match their 
corresponding DEFAULT
+    // declarations, if applicable.
+    val incompatibleDefault =
+      "Failed to execute ALTER TABLE ADD COLUMNS command because the 
destination " +
+        "table column `s` has a DEFAULT value"
+    Seq(Config("parquet"), Config("parquet", useDataFrames = true)).foreach {
+      config =>
+        withTable("t") {
+          sql(s"create table t(i boolean) using ${config.dataSource}")
+          if (config.useDataFrames) {
+            Seq(false).toDF.write.insertInto("t")
+          } else {
+            sql("insert into t select false")
           }
-      }
+          assert(intercept[AnalysisException] {
+            sql("alter table t add column s array<int> default array('abc', 
'def')")
+          }.getMessage.contains(incompatibleDefault))
+        }
     }
   }
 
   // TODO: fix in Spark-4.0
   ignoreGluten("SPARK-39557 INSERT INTO statements with tables with struct 
defaults") {
-    withSQLConf("spark.gluten.sql.complexType.scan.fallback.enabled" -> 
"false") {
-
-      import testImplicits._
-      // Positive tests: struct types are supported as default values.
-      case class Config(dataSource: String, useDataFrames: Boolean = false)
-      Seq(
-        Config("parquet"),
-        Config("parquet", useDataFrames = true),
-        Config("orc"),
-        Config("orc", useDataFrames = true)).foreach {
-        config =>
-          withTable("t") {
-            sql(s"create table t(i boolean) using ${config.dataSource}")
-            if (config.useDataFrames) {
-              Seq(false).toDF.write.insertInto("t")
-            } else {
-              sql("insert into t select false")
-            }
-            sql(
-              "alter table t add column s struct<x boolean, y string> default 
struct(true, 'abc')")
-            checkAnswer(spark.table("t"), Row(false, null))
-            sql("insert into t(i) values (true)")
-            checkAnswer(spark.table("t"), Seq(Row(false, null), Row(true, 
Row(true, "abc"))))
+
+    import testImplicits._
+    // Positive tests: struct types are supported as default values.
+    case class Config(dataSource: String, useDataFrames: Boolean = false)
+    Seq(
+      Config("parquet"),
+      Config("parquet", useDataFrames = true),
+      Config("orc"),
+      Config("orc", useDataFrames = true)).foreach {
+      config =>
+        withTable("t") {
+          sql(s"create table t(i boolean) using ${config.dataSource}")
+          if (config.useDataFrames) {
+            Seq(false).toDF.write.insertInto("t")
+          } else {
+            sql("insert into t select false")
           }
-      }
+          sql(
+            "alter table t add column s struct<x boolean, y string> default 
struct(true, 'abc')")
+          checkAnswer(spark.table("t"), Row(false, null))
+          sql("insert into t(i) values (true)")
+          checkAnswer(spark.table("t"), Seq(Row(false, null), Row(true, 
Row(true, "abc"))))
+        }
+    }
 
-      // Negative tests: provided map element types must match their 
corresponding DEFAULT
-      // declarations, if applicable.
-      val incompatibleDefault =
-        "Failed to execute ALTER TABLE ADD COLUMNS command because the 
destination " +
-          "table column `s` has a DEFAULT value"
-      Seq(Config("parquet"), Config("parquet", useDataFrames = true)).foreach {
-        config =>
-          withTable("t") {
-            sql(s"create table t(i boolean) using ${config.dataSource}")
-            if (config.useDataFrames) {
-              Seq(false).toDF.write.insertInto("t")
-            } else {
-              sql("insert into t select false")
-            }
-            assert(intercept[AnalysisException] {
-              sql("alter table t add column s struct<x boolean, y string> 
default struct(42, 56)")
-            }.getMessage.contains(incompatibleDefault))
+    // Negative tests: provided map element types must match their 
corresponding DEFAULT
+    // declarations, if applicable.

Review Comment:
   This PR only removes configuration; it does not alter the code logic.



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