Nandor Kollar has uploaded this change for review. ( 
https://gerrit.cloudera.org/25387


Change subject: IMPALA-15504: ALTER TABLE columns and properties on REST 
catalog tables
......................................................................

IMPALA-15504: ALTER TABLE columns and properties on REST catalog tables

No ALTER TABLE statement worked on a table served by an Iceberg REST
catalog: analysis rejected them as unsupported writes, and the
coordinator-side DDL path added by IMPALA-15493 only handled DROP
TABLE/VIEW.

This change sends ALTER TABLE on REST-backed tables through that path.
The coordinator reloads the table from its REST catalog, applies the
change in an Iceberg transaction and commits it; catalogd is not
involved. Supported statements are ADD COLUMNS, DROP COLUMN, CHANGE /
ALTER COLUMN, SET/UNSET TBLPROPERTIES and SORT BY. All other ALTER
TABLE statements are rejected during analysis with "ALTER TABLE <op> is
not supported for REST-backed Iceberg table". That now includes RENAME
and SET OWNER, which skipped the capability check before.

- The Iceberg side of CatalogOpExecutor.alterIcebergTable() moves to
  IcebergCatalogOpExecutor.applyAlterTable(), which both catalogd and
  the coordinator call. catalogd keeps its catalog version, in-flight
  event, commit and reload handling, so its behavior does not change.
- AlterTableStmt gets isSupportedOnRestCatalog(), which statements
  override to opt in, so further ALTER TABLE statements can be enabled
  one by one.
- IcebergRestDdlRouter routes ALTER TABLE like DROP TABLE: the catalog
  that serves the table must be the one it was analyzed from. As with
  DROP TABLE, this looks the table up in every configured catalog, also
  for ALTER TABLE on tables of the Hive Metastore.
- REST tables skip the Hive ACID check of ALTER TABLE: their HMS
  parameters are their Iceberg table properties, which may contain an
  unrelated 'transactional' property.

Testing:
- Added ALTER TABLE tests to IcebergDdlExecutorTest, running against an
  in-memory Iceberg catalog.
- Added iceberg-rest-alter.test and test_rest_catalog_alter_table, with
  and without catalogd.
- Ran test_iceberg_rest_catalog.py, AnalyzeDDLTest and the ALTER TABLE
  related tests of test_iceberg.py.

Change-Id: Iec64de016a288bf8055072328551a79951ff97e1
Assisted-by: Claude Opus 5.5 (Claude Code)
---
M docs/topics/impala_iceberg_rest_catalog.xml
M fe/src/main/java/org/apache/impala/analysis/AlterTableAddColsStmt.java
M fe/src/main/java/org/apache/impala/analysis/AlterTableAlterColStmt.java
M fe/src/main/java/org/apache/impala/analysis/AlterTableDropColStmt.java
M fe/src/main/java/org/apache/impala/analysis/AlterTableOrViewRenameStmt.java
M fe/src/main/java/org/apache/impala/analysis/AlterTableOrViewSetOwnerStmt.java
M fe/src/main/java/org/apache/impala/analysis/AlterTableSetTblProperties.java
M fe/src/main/java/org/apache/impala/analysis/AlterTableSortByStmt.java
M fe/src/main/java/org/apache/impala/analysis/AlterTableStmt.java
M fe/src/main/java/org/apache/impala/analysis/AlterTableUnSetTblProperties.java
M fe/src/main/java/org/apache/impala/analysis/Analyzer.java
M fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java
M fe/src/main/java/org/apache/impala/service/IcebergCatalogOpExecutor.java
M fe/src/main/java/org/apache/impala/service/IcebergDdlExecutor.java
M fe/src/main/java/org/apache/impala/service/IcebergRestDdlRouter.java
M fe/src/test/java/org/apache/impala/service/IcebergDdlExecutorTest.java
A testdata/workloads/functional-query/queries/QueryTest/iceberg-rest-alter.test
M tests/common/iceberg_rest_test_tables.py
M tests/custom_cluster/test_iceberg_rest_catalog.py
19 files changed, 827 insertions(+), 250 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/87/25387/2
--
To view, visit https://gerrit.cloudera.org/25387
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec64de016a288bf8055072328551a79951ff97e1
Gerrit-Change-Number: 25387
Gerrit-PatchSet: 2
Gerrit-Owner: Nandor Kollar <[email protected]>
Gerrit-Reviewer: Nandor Kollar <[email protected]>
Gerrit-Reviewer: Peter Rozsa <[email protected]>

Reply via email to