Peter Rozsa has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/25046 )
Change subject: IMPALA-15495: Enable UPDATE on Iceberg REST catalog tables ...................................................................... IMPALA-15495: Enable UPDATE on Iceberg REST catalog tables The REST finalization infrastructure (IMPALA-15310) was built to be operation-agnostic, but UPDATE was gated by two explicit policy checks. This patch opens those gates while keeping DELETE, MERGE and OPTIMIZE blocked. Analysis-time gate (Analyzer.java): ensureTableWriteSupported() now accepts a boolean indicating whether the caller is a supported REST DML operation. ModifyStmt gets it from a new abstract method, isRestDmlSupported(), which UpdateStmt overrides to return true and DeleteStmt to return false. MergeStmt and OptimizeStmt continue to call checkTableCapability(WRITE) which rejects all non-INSERT DML on REST tables. The method supportsInsert() is renamed to supportsDml() on FeIcebergTable since it now gates all supported REST DML, not just INSERT. The helper ensureRestCatalogInsertEnabled() is renamed to ensureRestCatalogDmlEnabled(). Commit-time gate (IcebergDmlFinalizer.java): validateRestDmlOperation() uses a SUPPORTED_REST_OPS EnumSet to accept both INSERT and UPDATE. Row-lineage virtual columns (IcebergMetaProvider.java): REST tables never exposed _row_id and _last_updated_sequence_number, because IcebergMetaProvider kept its own hard-coded list of Iceberg virtual columns, which missed the format-version 3 additions that IcebergTable has. Both now use VirtualColumn.getIcebergVirtualColumns(formatVersion), backed by immutable ICEBERG_VIRTUAL_COLUMNS and ICEBERG_V3_VIRTUAL_COLUMNS lists, so the two paths cannot drift again. This also fixes SELECT of these columns on V3 REST tables. No backend changes are needed: the C++ sinks are catalog-agnostic, the coordinator-side finalization routing is based on rest_catalog_name (not operation type), and IcebergCatalogOpExecutor.updateRows() already uses the pure Iceberg API (txn.newRowDelta()). Testing: - AnalyzerCapabilityTest updated for renamed methods and new messages. - IcebergRestDmlOperationTest updated: UPDATE validation passes and DELETE is rejected. - test_rest_catalog_insert_into: UPDATE removed from the unsupported list. - New test_rest_catalog_update: runs iceberg-rest-update.test, then injects CommitStateUnknownException (files are kept) and CommitFailedException (written files are cleaned up) for UPDATE. - New iceberg-rest-update.test adapted from iceberg-v3-update.test: basic UPDATE, multi-row, _row_id and _last_updated_sequence_number verification, DV file checks, single-column, all-types (individual and multi-column), JOIN-based UPDATE FROM, duplicate error, NULL handling, column swap, cross-column expression, and SKIP_UNNEEDED_UPDATES_COL_LIMIT. - New iceberg-rest-update-partitions.test adapted from iceberg-v3-update-partitions.test: identity, truncate, bucket+truncate, date year/month/day, timestamp year/month/day/hour, and numeric truncate partition transforms. Partition evolution tests are omitted as ALTER TABLE DDL is not available on REST-backed tables. - Tables are created via the REST API since DDL is not supported. Change-Id: I847f051e9a350b730935326c983c7459215c54e2 Assisted-by: Claude Opus 4.6 (Claude Code) Reviewed-on: http://gerrit.cloudera.org:8080/25046 Tested-by: Impala Public Jenkins <[email protected]> Reviewed-by: Peter Rozsa <[email protected]> --- M docs/topics/impala_iceberg_rest_catalog.xml M fe/src/main/java/org/apache/impala/analysis/Analyzer.java M fe/src/main/java/org/apache/impala/analysis/DeleteStmt.java M fe/src/main/java/org/apache/impala/analysis/ModifyStmt.java M fe/src/main/java/org/apache/impala/analysis/UpdateStmt.java M fe/src/main/java/org/apache/impala/catalog/FeIcebergTable.java M fe/src/main/java/org/apache/impala/catalog/IcebergTable.java M fe/src/main/java/org/apache/impala/catalog/VirtualColumn.java M fe/src/main/java/org/apache/impala/catalog/local/IcebergMetaProvider.java M fe/src/main/java/org/apache/impala/service/IcebergDmlFinalizer.java M fe/src/test/java/org/apache/impala/analysis/AnalyzerCapabilityTest.java M fe/src/test/java/org/apache/impala/service/IcebergRestDmlOperationTest.java A testdata/workloads/functional-query/queries/QueryTest/iceberg-rest-update-partitions.test A testdata/workloads/functional-query/queries/QueryTest/iceberg-rest-update.test A tests/common/iceberg_rest_test_tables.py M tests/custom_cluster/test_iceberg_rest_catalog.py 16 files changed, 973 insertions(+), 82 deletions(-) Approvals: Impala Public Jenkins: Verified Peter Rozsa: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/25046 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I847f051e9a350b730935326c983c7459215c54e2 Gerrit-Change-Number: 25046 Gerrit-PatchSet: 12 Gerrit-Owner: Nandor Kollar <[email protected]> Gerrit-Reviewer: Daniel Vanko <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Nandor Kollar <[email protected]> Gerrit-Reviewer: Noemi Pap-Takacs <[email protected]> Gerrit-Reviewer: Peter Rozsa <[email protected]>
