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


##########
sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala:
##########
@@ -142,17 +142,30 @@ class InsertSuite extends DataSourceTest with 
SharedSparkSession {
     )
   }
 
-  test("SELECT clause generating a different number of columns is not 
allowed.") {
+  test("SELECT clause generating a different number of columns: negative 
test.") {
     val message = intercept[AnalysisException] {
       sql(
         s"""
-        |INSERT OVERWRITE TABLE jsonTable SELECT a FROM jt
-      """.stripMargin)
+            |INSERT OVERWRITE TABLE jsonTable SELECT a FROM jt
+         """.stripMargin)
     }.getMessage
     assert(message.contains("target table has 2 column(s) but the inserted 
data has 1 column(s)")
     )
   }
 
+  test("SELECT clause generating a different number of columns: positive 
test.") {
+    withSQLConf(SQLConf.USE_NULLS_FOR_MISSING_DEFAULT_COLUMN_VALUES.key -> 
"true") {

Review Comment:
   A little bit different, but you're right, I've move this to the "Allow user 
to insert specified columns into insertable view".



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