dtenedor commented on pull request #35690: URL: https://github.com/apache/spark/pull/35690#issuecomment-1058385738
> Thanks for the work. > > For the parser change itself, looks okay. As this is a breaking change, I'd like to see some clarification on why this is necessary to have. What issue we have if we don't have this (because we don't have the default value for long time) and do we have any workaround now? This is for supporting the ANSI SQL syntax to specify default column values in DDL commands and then referencing them later in INSERT/UPDATE/MERGE commands. Examples: CREATE TABLE T(a INT, b INT NOT NULL); -- The default default is NULL INSERT INTO T VALUES (DEFAULT, 0); INSERT INTO T(b) VALUES (1); SELECT * FROM T; (NULL, 0) (NULL, 1) -- Adding a default to a table with rows, sets the values for the -- existing rows (exist default) and new rows (current default). ALTER TABLE T ADD COLUMN c INT DEFAULT 5; INSERT INTO T VALUES (1, 2, DEFAULT); SELECT * FROM T; (NULL, 0, 5) (NULL, 1, 5) (1, 2, 5) -- 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]
