Mihaly Szjatinya has uploaded a new patch set (#7). ( 
https://gerrit.cloudera.org/25375 )

Change subject: IMPALA-15499: Support CREATE TABLE on Iceberg REST catalogs
......................................................................

IMPALA-15499: Support CREATE TABLE on Iceberg REST catalogs

Impala had no way to create a table in an Iceberg REST namespace:
CREATE TABLE always went to CatalogD, which does not know REST
catalogs. It now runs on the coordinator through the REST catalog that
serves the database, like DROP TABLE and CREATE/DROP DATABASE.

The statement is routed by getCatalogRef(db) of IMPALA-15503: a
database that several catalogs list is rejected as ambiguous, also
when one of them is the Hive Metastore, as is a database whose catalog
cannot be decided. In a database of a REST catalog:
- the table is created through the REST catalog, which needs a unique
  name;
- only Iceberg tables are accepted, without the 'iceberg.catalog'
  table property, as the REST catalog is the Iceberg catalog, without
  foreign keys and without CACHED IN;
- the 'owner' table property is rejected, case-insensitively, as
  IMPALA-15508 will read the owner from it;
- IF NOT EXISTS on an existing table is a no-op on the coordinator.

The schema, the partition spec and the table properties are the ones
CatalogD passes to Iceberg, including the comment and the sort
columns. The 'owner' property is set to the creating user. Without
LOCATION the REST server picks the location. CREATE TABLE LIKE
PARQUET/ORC is a CREATE TABLE too and takes the same path.

Testing:
- IcebergDdlExecutorTest: CREATE TABLE, including the owner, the
  rejected 'owner' property, existing tables, missing databases and
  blacklisted tables.
- test_iceberg_rest_catalog.py: test_rest_catalog_create_table with
  and without CatalogD, checking the created metadata and owner and
  an INSERT/SELECT round trip, rejected formats and properties, IF
  NOT EXISTS keeping the owner of an existing table, CREATE TABLE
  LIKE PARQUET, and an ambiguous database; CREATE TABLE without a
  unique catalog name. Each clause of CREATE TABLE is checked to be
  applied to the REST metadata (LOCATION, PARTITIONED BY columns and
  transforms, column comments and defaults, UUID, NOT ENFORCED
  primary keys, ROW FORMAT, UNCACHED, LIKE ORC, LIKE PARQUET with
  options) or rejected (CACHED IN, CLUSTERED BY, enforced primary
  keys, Kudu options, EXTERNAL, data sources, LIKE AVRO).

Regression:
- test_iceberg_rest_catalog.py: DROP TABLE, CREATE/DROP DATABASE and
  REST DML share the router, the executor and the catalog providers.
- MultiMetaProviderTest, MetaProviderDecoratorTest: database routing.

Change-Id: I4e8b7a3afa4cbc7d818013272d22d00c91194caa
Assisted-by: Claude Opus 5.5 (GitHub Copilot)
---
M docs/topics/impala_iceberg_rest_catalog.xml
M fe/src/main/java/org/apache/impala/catalog/iceberg/IcebergRESTCatalog.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/main/java/org/apache/impala/util/IcebergUtil.java
M fe/src/test/java/org/apache/impala/service/IcebergDdlExecutorTest.java
M tests/custom_cluster/test_iceberg_rest_catalog.py
7 files changed, 529 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/75/25375/7
--
To view, visit https://gerrit.cloudera.org/25375
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4e8b7a3afa4cbc7d818013272d22d00c91194caa
Gerrit-Change-Number: 25375
Gerrit-PatchSet: 7
Gerrit-Owner: Mihaly Szjatinya <[email protected]>
Gerrit-Reviewer: Aleksandr Efimov <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Mihaly Szjatinya <[email protected]>
Gerrit-Reviewer: Peter Rozsa <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>

Reply via email to