You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Nandor Kollar (Code Review)" <ge...@cloudera.org> on 2026/09/25 07:44:38 UTC
[Impala-ASF-CR] IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
Nandor Kollar has uploaded this change for review. ( http://gerrit.cloudera.org:8080/24944
Change subject: IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
......................................................................
IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
Previously, ALTER TABLE ADD COLUMNS on an Iceberg table silently
accepted NOT NULL columns without a default value. The NOT NULL
constraint was then quietly dropped, making the column nullable.
This is incorrect because existing rows would have no valid value
for the new required column.
This patch adds an analysis-time check in AlterTableAddColsStmt
that rejects adding a NOT NULL column without a default value on
Iceberg tables, mirroring the existing validation for Kudu tables.
The error message is: "A new non-null column must have a default
value: <column definition>".
Note that since Iceberg v2 tables do not support default values,
this means NOT NULL columns cannot be added via ALTER TABLE on v2
tables at all. Users can either add the column as nullable, or
upgrade to format version 3 which supports default values:
ALTER TABLE t ADD COLUMNS (j INT NOT NULL DEFAULT 0)
Testing:
- Updated AnalyzeDDLTest#TestAlterTableAddColumn to expect an
AnalysisError for NOT NULL without default on Iceberg.
- Added a new AnalysisError case in TestAlterTableAddColumns for
multi-column ADD COLUMNS on Iceberg.
- Added an end-to-end test case in iceberg-alter-v2.test.
Change-Id: I9bf294664ef83d26ca90db28df0993805d5ce67e
Assisted-by: Claude Opus 4.6 (Claude Code)
---
M fe/src/main/java/org/apache/impala/analysis/AlterTableAddColsStmt.java
M fe/src/test/java/org/apache/impala/analysis/AnalyzeDDLTest.java
M testdata/workloads/functional-query/queries/QueryTest/iceberg-alter-v2.test
3 files changed, 24 insertions(+), 5 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/44/24944/1
--
To view, visit http://gerrit.cloudera.org:8080/24944
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9bf294664ef83d26ca90db28df0993805d5ce67e
Gerrit-Change-Number: 24944
Gerrit-PatchSet: 1
Gerrit-Owner: Nandor Kollar <ko...@gmail.com>
[Impala-ASF-CR] IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
Posted by "Peter Rozsa (Code Review)" <ge...@cloudera.org>.
Peter Rozsa has removed a vote on this change.
Change subject: IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
......................................................................
Removed Code-Review+2 by Peter Rozsa <pr...@cloudera.com>
--
To view, visit http://gerrit.cloudera.org:8080/24944
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: I9bf294664ef83d26ca90db28df0993805d5ce67e
Gerrit-Change-Number: 24944
Gerrit-PatchSet: 1
Gerrit-Owner: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>
[Impala-ASF-CR] IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
Posted by "Peter Rozsa (Code Review)" <ge...@cloudera.org>.
Peter Rozsa has posted comments on this change. ( http://gerrit.cloudera.org:8080/24944 )
Change subject: IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit http://gerrit.cloudera.org:8080/24944
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9bf294664ef83d26ca90db28df0993805d5ce67e
Gerrit-Change-Number: 24944
Gerrit-PatchSet: 2
Gerrit-Owner: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>
Gerrit-Comment-Date: Thu, 01 Oct 2026 11:23:54 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
Posted by "Peter Rozsa (Code Review)" <ge...@cloudera.org>.
Peter Rozsa has posted comments on this change. ( http://gerrit.cloudera.org:8080/24944 )
Change subject: IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit http://gerrit.cloudera.org:8080/24944
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9bf294664ef83d26ca90db28df0993805d5ce67e
Gerrit-Change-Number: 24944
Gerrit-PatchSet: 1
Gerrit-Owner: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>
Gerrit-Comment-Date: Tue, 29 Sep 2026 12:15:49 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24944 )
Change subject: IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
......................................................................
Patch Set 3: Verified+1
--
To view, visit http://gerrit.cloudera.org:8080/24944
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9bf294664ef83d26ca90db28df0993805d5ce67e
Gerrit-Change-Number: 24944
Gerrit-PatchSet: 3
Gerrit-Owner: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>
Gerrit-Comment-Date: Mon, 05 Oct 2026 16:46:10 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24944 )
Change subject: IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
......................................................................
Patch Set 3:
Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/14199/ DRY_RUN=false
--
To view, visit http://gerrit.cloudera.org:8080/24944
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9bf294664ef83d26ca90db28df0993805d5ce67e
Gerrit-Change-Number: 24944
Gerrit-PatchSet: 3
Gerrit-Owner: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>
Gerrit-Comment-Date: Mon, 05 Oct 2026 12:15:30 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
Posted by "Nandor Kollar (Code Review)" <ge...@cloudera.org>.
Hello Peter Rozsa, Csaba Ringhofer, Impala Public Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/24944
to look at the new patch set (#2).
Change subject: IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
......................................................................
IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
Previously, ALTER TABLE ADD COLUMNS on an Iceberg table silently
accepted NOT NULL columns without a default value. The NOT NULL
constraint was then quietly dropped, making the column nullable.
This is incorrect because existing rows would have no valid value
for the new required column.
This patch adds an analysis-time check in AlterTableAddColsStmt
that rejects adding a NOT NULL column without a default value on
Iceberg tables, mirroring the existing validation for Kudu tables.
The error message is: "A new non-null column must have a default
value: <column definition>".
Note that since Iceberg v2 tables do not support default values,
this means NOT NULL columns cannot be added via ALTER TABLE on v2
tables at all. Users can either add the column as nullable, or
upgrade to format version 3 which supports default values:
ALTER TABLE t ADD COLUMNS (j INT NOT NULL DEFAULT 0)
Testing:
- Updated AnalyzeDDLTest#TestAlterTableAddColumn to expect an
AnalysisError for NOT NULL without default on Iceberg.
- Added a new AnalysisError case in TestAlterTableAddColumns for
multi-column ADD COLUMNS on Iceberg.
- Added an end-to-end test case in iceberg-alter-v2.test.
Change-Id: I9bf294664ef83d26ca90db28df0993805d5ce67e
Assisted-by: Claude Opus 4.6 (Claude Code)
---
M fe/src/main/java/org/apache/impala/analysis/AlterTableAddColsStmt.java
M fe/src/test/java/org/apache/impala/analysis/AnalyzeDDLTest.java
M testdata/workloads/functional-query/queries/QueryTest/iceberg-alter-v2.test
3 files changed, 23 insertions(+), 4 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/44/24944/2
--
To view, visit http://gerrit.cloudera.org:8080/24944
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I9bf294664ef83d26ca90db28df0993805d5ce67e
Gerrit-Change-Number: 24944
Gerrit-PatchSet: 2
Gerrit-Owner: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>
[Impala-ASF-CR] IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
Posted by "Peter Rozsa (Code Review)" <ge...@cloudera.org>.
Peter Rozsa has posted comments on this change. ( http://gerrit.cloudera.org:8080/24944 )
Change subject: IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
......................................................................
Patch Set 1: Code-Review+2
(1 comment)
Csaba, if you have some time, please take a look.
http://gerrit.cloudera.org:8080/#/c/24944/1/fe/src/main/java/org/apache/impala/analysis/AlterTableAddColsStmt.java
File fe/src/main/java/org/apache/impala/analysis/AlterTableAddColsStmt.java:
http://gerrit.cloudera.org:8080/#/c/24944/1/fe/src/main/java/org/apache/impala/analysis/AlterTableAddColsStmt.java@135
PS1, Line 135: // For Iceberg tables, only default values are supported as column options
nit: indent
--
To view, visit http://gerrit.cloudera.org:8080/24944
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9bf294664ef83d26ca90db28df0993805d5ce67e
Gerrit-Change-Number: 24944
Gerrit-PatchSet: 1
Gerrit-Owner: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>
Gerrit-Comment-Date: Tue, 29 Sep 2026 12:17:01 +0000
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24944 )
Change subject: IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
......................................................................
Patch Set 3: Code-Review+2
--
To view, visit http://gerrit.cloudera.org:8080/24944
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9bf294664ef83d26ca90db28df0993805d5ce67e
Gerrit-Change-Number: 24944
Gerrit-PatchSet: 3
Gerrit-Owner: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>
Gerrit-Comment-Date: Mon, 05 Oct 2026 12:15:29 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24944 )
Change subject: IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
......................................................................
Patch Set 1:
Build Successful
https://jenkins.impala.io/job/gerrit-code-review-checks/24181/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.
--
To view, visit http://gerrit.cloudera.org:8080/24944
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9bf294664ef83d26ca90db28df0993805d5ce67e
Gerrit-Change-Number: 24944
Gerrit-PatchSet: 1
Gerrit-Owner: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>
Gerrit-Comment-Date: Fri, 25 Sep 2026 08:05:30 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/24944 )
Change subject: IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
......................................................................
IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
Previously, ALTER TABLE ADD COLUMNS on an Iceberg table silently
accepted NOT NULL columns without a default value. The NOT NULL
constraint was then quietly dropped, making the column nullable.
This is incorrect because existing rows would have no valid value
for the new required column.
This patch adds an analysis-time check in AlterTableAddColsStmt
that rejects adding a NOT NULL column without a default value on
Iceberg tables, mirroring the existing validation for Kudu tables.
The error message is: "A new non-null column must have a default
value: <column definition>".
Note that since Iceberg v2 tables do not support default values,
this means NOT NULL columns cannot be added via ALTER TABLE on v2
tables at all. Users can either add the column as nullable, or
upgrade to format version 3 which supports default values:
ALTER TABLE t ADD COLUMNS (j INT NOT NULL DEFAULT 0)
Testing:
- Updated AnalyzeDDLTest#TestAlterTableAddColumn to expect an
AnalysisError for NOT NULL without default on Iceberg.
- Added a new AnalysisError case in TestAlterTableAddColumns for
multi-column ADD COLUMNS on Iceberg.
- Added an end-to-end test case in iceberg-alter-v2.test.
Change-Id: I9bf294664ef83d26ca90db28df0993805d5ce67e
Assisted-by: Claude Opus 4.6 (Claude Code)
Reviewed-on: http://gerrit.cloudera.org:8080/24944
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
M fe/src/main/java/org/apache/impala/analysis/AlterTableAddColsStmt.java
M fe/src/test/java/org/apache/impala/analysis/AnalyzeDDLTest.java
M testdata/workloads/functional-query/queries/QueryTest/iceberg-alter-v2.test
3 files changed, 23 insertions(+), 4 deletions(-)
Approvals:
Impala Public Jenkins: Looks good to me, approved; Verified
--
To view, visit http://gerrit.cloudera.org:8080/24944
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I9bf294664ef83d26ca90db28df0993805d5ce67e
Gerrit-Change-Number: 24944
Gerrit-PatchSet: 4
Gerrit-Owner: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>
[Impala-ASF-CR] IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24944 )
Change subject: IMPALA-15364: Reject ALTER TABLE ADD COLUMNS with NOT NULL and no default on Iceberg tables
......................................................................
Patch Set 2:
Build Successful
https://jenkins.impala.io/job/gerrit-code-review-checks/24246/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.
--
To view, visit http://gerrit.cloudera.org:8080/24944
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9bf294664ef83d26ca90db28df0993805d5ce67e
Gerrit-Change-Number: 24944
Gerrit-PatchSet: 2
Gerrit-Owner: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Nandor Kollar <ko...@gmail.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>
Gerrit-Comment-Date: Tue, 29 Sep 2026 17:04:03 +0000
Gerrit-HasComments: No