gengliangwang commented on code in PR #36212:
URL: https://github.com/apache/spark/pull/36212#discussion_r856129308


##########
sql/core/src/test/scala/org/apache/spark/sql/SQLInsertTestSuite.scala:
##########
@@ -183,35 +183,39 @@ trait SQLInsertTestSuite extends QueryTest with 
SQLTestUtils {
         assert(e2.getMessage.contains(msgs(0)) || 
e2.getMessage.contains(msgs(1)))
       }
     }
-    withSQLConf(SQLConf.ENABLE_DEFAULT_COLUMNS.key -> "false") {
-      test
-    }
-    withSQLConf(SQLConf.ENABLE_DEFAULT_COLUMNS.key -> "true") {
-      test
+    withSQLConf(SQLConf.USE_NULLS_FOR_MISSING_DEFAULT_COLUMN_VALUES.key -> 
"false") {
+      withSQLConf(SQLConf.ENABLE_DEFAULT_COLUMNS.key -> "false") {
+        test
+      }
+      withSQLConf(SQLConf.ENABLE_DEFAULT_COLUMNS.key -> "true") {
+        test
+      }
     }
   }
 
   test("insert with column list - mismatched target table out size after 
rewritten query") {
     val v2Msg = "expected 2 columns but found"
     val cols = Seq("c1", "c2", "c3", "c4")
 
-    withTable("t1") {
-      createTable("t1", cols, Seq.fill(4)("int"))
-      val e1 = intercept[AnalysisException](sql(s"INSERT INTO t1 (c1) 
values(1)"))
-      assert(e1.getMessage.contains("target table has 4 column(s) but the 
inserted data has 1") ||
-        e1.getMessage.contains("expected 4 columns but found 1") ||
-        e1.getMessage.contains("not enough data columns") ||
-        e1.getMessage.contains(v2Msg))
-    }
+    withSQLConf(SQLConf.USE_NULLS_FOR_MISSING_DEFAULT_COLUMN_VALUES.key -> 
"false") {

Review Comment:
   There are so many tests setting this conf. Shall we clean them up?



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