mirror of
https://github.com/apache/impala.git
synced 2026-01-05 12:01:11 -05:00
Kudu recently added the ability to alter a column's default value and storage attributes (KUDU-861). This patch adds the ability to modify these from Impala using ALTER. It also supports altering a column's comment for non-Kudu tables. It does not support setting a column to be a primary key or changing a column's nullability, because those are not supported on the Kudu side yet. Syntax: ALTER TABLE <table> ALTER [COLUMN] <column> SET <attr> <value> [<attr> <value> [<attr> <value>...]] where <attr> is one of: - DEFAULT, BLOCK_SIZE, ENCODING, COMPRESSION (Kudu tables) - COMMENT (non-Kudu tables) ALTER TABLE <table> ALTER [COLUMN] <column> DROP DEFAULT This is similar to the existing CHANGE statement: ALTER TABLE <table> CHANGE <column> <new_col_name> <type> [COMMENT <comment>] but the new syntax is more natural for setting column properties when the column name and type are not being changed. Both ALTER COLUMN and CHANGE COLUMN operations use AlterTableAlterColStmt and are sent to the catalog as ALTER_COLUMN operations. Testing: - Added FE tests to ParserTest and AnalyzeDDLTest - Added EE tests to test_kudu.py Change-Id: Id2e8bd65342b79644a0fdcd925e6f17797e89ad6 Reviewed-on: http://gerrit.cloudera.org:8080/6955 Reviewed-by: Thomas Tauber-Marshall <tmarshall@cloudera.com> Tested-by: Impala Public Jenkins
41 KiB
41 KiB