impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Tauber-Marshall (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-4622: Add ALTER COLUMN statement.
Date Mon, 12 Jun 2017 20:13:17 GMT
Thomas Tauber-Marshall has uploaded a new patch set (#4).

Change subject: IMPALA-4622: Add ALTER COLUMN statement.

IMPALA-4622: Add ALTER COLUMN statement.

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
chaning a column's nullability, because those are not supported on
the Kudu side yet.

ALTER TABLE <table> ALTER [COLUMN] <column>
  SET <attr> <value> [<attr> <value> [<attr> <value>...]]
where <attr> is one of:
  - COMMENT (non-Kudu tables)

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. ALTER COLUMN
operations use AlterTableChangeColStmt and are sent to the catalog
as CHANGE operations where the type and column name are unchanged.

- Added FE tests to ParserTest and AnalyzeDDLTest
- Added EE tests to kudu_alter.test and kudu_describe.test

Change-Id: Id2e8bd65342b79644a0fdcd925e6f17797e89ad6
M fe/src/main/cup/sql-parser.cup
M fe/src/main/java/org/apache/impala/analysis/
M fe/src/main/java/org/apache/impala/analysis/
M fe/src/main/java/org/apache/impala/service/
M fe/src/main/java/org/apache/impala/service/
M fe/src/test/java/org/apache/impala/analysis/
M fe/src/test/java/org/apache/impala/analysis/
M testdata/workloads/functional-query/queries/QueryTest/alter-table.test
M testdata/workloads/functional-query/queries/QueryTest/kudu_alter.test
M testdata/workloads/functional-query/queries/QueryTest/kudu_describe.test
10 files changed, 225 insertions(+), 18 deletions(-)

  git pull ssh:// refs/changes/55/6955/4
To view, visit
To unsubscribe, visit

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id2e8bd65342b79644a0fdcd925e6f17797e89ad6
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Thomas Tauber-Marshall <>
Gerrit-Reviewer: Alex Behm <>
Gerrit-Reviewer: Matthew Jacobs <>
Gerrit-Reviewer: Thomas Tauber-Marshall <>

View raw message