morvenhuang opened a new pull request, #36212: URL: https://github.com/apache/spark/pull/36212
### What changes were proposed in this pull request? Allow user to insert specified columns into insertable view, for example, ``` CREATE TEMPORARY VIEW v1 (c1 int, c2 string) USING org.apache.spark.sql.json.DefaultSource OPTIONS (path 'json_dir') INSERT INTO v1(c1) VALUES(100) SELECT c1, c2 FROM v1; +---+----+ | c1| c2| +---+----+ |100|null| +---+----+ ``` ### Why are the changes needed? The option spark.sql.defaultColumn.useNullsForMissingDefautValues allows us to insert specified columns into table (https://issues.apache.org/jira/browse/SPARK-38795), but currently this option does not work for insertable view, To keep consistenct with the behavior of INSERT INTO table, we should also allow user to specify columns when running INSERT INTO view. ### Does this PR introduce _any_ user-facing change? Yes. ### How was this patch tested? New unit tests added. -- 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]
