dtenedor opened a new pull request, #36122:
URL: https://github.com/apache/spark/pull/36122
### What changes were proposed in this pull request?
Support ALTER TABLE ALTER COLUMN commands with DEFAULT values.
For example:
```
CREATE TABLE t(i BOOLEAN, s STRING) USING PARQUET;
ALTER TABLE t ALTER COLUMN s SET DEFAULT CONCAT('abc', 'def');
INSERT INTO t VALUES(TRUE, DEFAULT);
SELECT s FROM t WHERE i = TRUE;
> "abcdef"
```
### Why are the changes needed?
This reduces work for users to write INSERT INTO commands into tables by
allowing them to leave out some of the column values in reasonable ways.
It also helps table owners add columns with values to auto-generate useful
information into the table contents, such as date or time values.
Does this PR introduce any user-facing change?
Yes, it allows ALTER TABLE ALTER COLUMN commands to specify optional DEFAULT
values for the columns. These default values are stored inside the column
metadata.
### How was this patch tested?
Unit test coverage was added as part of this PR.
--
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]