Hello Zoltan Borok-Nagy, Peter Rozsa, Mihaly Szjatinya, Daniel Vanko, Impala 
Public Jenkins,

I'd like you to reexamine a change. Please visit

    https://gerrit.cloudera.org/25387

to look at the new patch set (#6).

Change subject: IMPALA-15504: ALTER TABLE SET/UNSET TBLPROPERTIES on REST 
catalog tables
......................................................................

IMPALA-15504: ALTER TABLE SET/UNSET TBLPROPERTIES 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 are table-level SET/UNSET TBLPROPERTIES, which
includes SORT BY. Every other ALTER TABLE statement fails with "ALTER
TABLE <op> is not supported for REST-backed Iceberg table".

- 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.
- applyAlterTable() decides which changes are supported on a REST-backed
  table, in one place. Analysis no longer filters ALTER TABLE statements
  on these tables, so further statements can be enabled there. SERDE
  properties and partition-level properties are rejected, since only
  table-level properties are stored in Iceberg.
- The 'owner' table property cannot be set or unset on REST-backed
  tables, case-insensitively and also with UNSET IF EXISTS: with
  IMPALA-15508 it is to become the owner of the table, which the ALTER
  privilege must not change. applyAlterTable() rejects it with the other
  unsupported changes; Iceberg tables of the Hive Metastore still
  accept it.
- 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. ALTER TABLE SET OWNER
  now records its table, so that it is routed too.
- 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.
- IcebergCatalogOpExecutor becomes a final, package-private utility
  class that cannot be instantiated, and its methods get the lowest
  visibility their callers allow.

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.
- Added tests that SET/UNSET TBLPROPERTIES of 'owner' is rejected on
  REST tables, in IcebergDdlExecutorTest, iceberg-rest-alter.test and
  test_rest_catalog_alter_table, and accepted on Iceberg tables of the
  Hive Metastore, in iceberg-alter-default.test.
- 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/AlterTableOrViewSetOwnerStmt.java
M fe/src/main/java/org/apache/impala/analysis/AlterTableSetTblProperties.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
M 
testdata/workloads/functional-query/queries/QueryTest/iceberg-alter-default.test
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
18 files changed, 941 insertions(+), 271 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/87/25387/6
--
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: newpatchset
Gerrit-Change-Id: Iec64de016a288bf8055072328551a79951ff97e1
Gerrit-Change-Number: 25387
Gerrit-PatchSet: 6
Gerrit-Owner: Nandor Kollar <[email protected]>
Gerrit-Reviewer: Daniel Vanko <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Mihaly Szjatinya <[email protected]>
Gerrit-Reviewer: Nandor Kollar <[email protected]>
Gerrit-Reviewer: Peter Rozsa <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>

Reply via email to