dtenedor opened a new pull request #35982:
URL: https://github.com/apache/spark/pull/35982


   ### What changes were proposed in this pull request?
   
   Extend INSERT INTO statements to support omitting default values or 
referring to them explicitly with the DEFAULT keyword, in which case the Spark 
analyzer will automatically insert the appropriate corresponding values in the 
right places.
   
   NOTE: Please note this is a stacked PR based on 
https://github.com/apache/spark/pull/35855.
   
   Example:
   ```
   CREATE TABLE T(a INT DEFAULT 4, b INT NOT NULL DEFAULT 5);
   INSERT INTO T VALUES (1);
   INSERT INTO T VALUES (1, DEFAULT);
   INSERT INTO T VALUES (DEFAULT, 6);
   SELECT * FROM T;
   (1, 5)
   (1, 5)
   (4, 6)
   ```
   
   ### Why are the changes needed?
   
   This helps users issue INSERT INTO statements with less effort, and helps 
people creating or updating tables to add custom optional columns for use in 
specific circumstances as desired. 
   
   ### How was this patch tested?
   
   This change is covered by new and existing unit test coverage as well as new 
INSERT INTO query test cases covering a variety of positive and negative 
scenarios.


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