Skip to content

Native CREATE TABLE / DROP TABLE for DataLakeCatalog; optionally prune on DROP - #2305

Open
zvonand wants to merge 2 commits into
antalya-26.6from
releasy/port/pr-98670-2f540f
Open

zvonand wants to merge 2 commits into
antalya-26.6from
releasy/port/pr-98670-2f540f

Conversation

@zvonand

@zvonand zvonand commented Sep 2, 2026 •

Copy link
Copy Markdown
Member

Cherry-picked from ClickHouse#98670.

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Supports CREATE TABLE, CREATE TABLE … AS source, and DROP TABLE for DataLakeCatalog; DROP TABLE can request catalog-side data purge via the new data_lake_delete_data_on_drop setting

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Unit tests
  • Performance tests
  • Aarch64 tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • CAS (content-addressed storage; Antalya only)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • OAuth (5m)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

@zvonand

zvonand commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

RelEasy — resolution kept with warnings

The AI resolution was pushed, but a post-resolution check is still failing on it. Nothing was rolled back — please review the point(s) below before merging and either fix them or dismiss them as false positives.

  • src/Core/SettingsChangesHistory.cpp: 1 unauthorized setting row(s) added during resolution: data_lake_delete_data_on_drop — these names are not in the source PR's diff for this file. This registry is append-only: only rows the source PR itself adds may land in the port. Re-resolve and drop the extras (likely context lines from "ours" that got swept in alongside a real edit). (still failing after 2 correction pass(es))

@github-actions

github-actions Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Workflow [PR], commit [2d2e7bc]

@zvonand zvonand added antalya antalya-26.6 port-antalya PRs to be ported to all new Antalya releases labels Sep 2, 2026
@zvonand zvonand changed the title Cherry-pick: Native CREATE TABLE / DROP TABLE for DataLakeCatalog; optionally prune on DROP Native CREATE TABLE / DROP TABLE for DataLakeCatalog; optionally prune on DROP Sep 2, 2026
@zvonand

zvonand commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

@blau-ai

@blau-ai

This comment was marked as outdated.

@blau-ai

This comment was marked as outdated.

zvonand added a commit that referenced this pull request Sep 4, 2026
`-Wdocumentation-html` treats `<table>` in a `///` comment as an unclosed
HTML start tag (backticks are Markdown and the Doxygen-style parser does
not honor them), which is fatal under `-Weverything -Werror`:

    src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergMetadata.cpp:942:32:
    error: HTML tag 'table' requires an end tag [-Werror,-Wdocumentation-html]

Build report:
https://altinity-build-artifacts.s3.amazonaws.com/json.html?PR=2305&sha=7809d87ff19fbda330d3238b289f338c146bb533&name_0=PR&name_1=Build%20%28amd_binary%29
#2305
@zvonand

zvonand commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

@blau-ai

@blau-ai

This comment was marked as outdated.

@Selfeer

Selfeer commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

For the initial check, here is what audit review was able to hit.

PR #2305 Audit Findings

1) DROP TABLE ... SETTINGS data_lake_delete_data_on_drop = 1 may silently keep data for lazy, never-loaded tables

  • Severity: Medium
  • Affected code: StorageTableProxy::prepareForDrop, StorageTableProxy::drop, StorageObjectStorage::drop
  • Why this is an issue: The query explicitly requests purge, but the setting is not propagated when the table is still a lazy proxy with unresolved nested storage. The later background drop then defaults to delete_data = false, so files are kept despite explicit user intent.
  • Human-readable impact: Users can run a purge drop and still leave table data/metadata behind, causing silent storage leaks and violating expected semantics of data_lake_delete_data_on_drop.
  • Reproduction steps:
    1. Enable lazy table loading (so table objects are proxied after restart).
    2. Create an Iceberg table and insert data.
    3. Restart the server, then run DROP TABLE <table> SYNC SETTINGS data_lake_delete_data_on_drop = 1 before any read/write on that table.
    4. Check object storage/filesystem path: table files remain instead of being deleted.

2) S3TablesCatalog::dropTable swallows “table not found” even when IF EXISTS is not used

  • Severity: Low
  • Affected code: S3TablesCatalog::dropTable
  • Why this is an issue: The HTTP_NOT_FOUND case is treated as success unconditionally. For non-IF EXISTS drops, this hides state races and violates normal SQL expectation that dropping a missing table should error.
  • Human-readable impact: Concurrent or racey automation can report a successful DROP TABLE even though the table was already removed by another actor, masking real state transitions and making troubleshooting harder.
  • Reproduction steps:
    1. Create a table in an S3 Tables-backed DataLake catalog.
    2. Start two concurrent sessions and run DROP TABLE <same_table> SETTINGS data_lake_delete_data_on_drop = 1 (without IF EXISTS) nearly simultaneously.
    3. First drop succeeds; second hits catalog 404.
    4. Observe second drop is reported as success instead of throwing a “table does not exist” exception.

@Selfeer

Selfeer commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

PR #2305 fix verification

Run from clickhouse-regression/iceberg. Set BUILD to the package URL or docker image of the build to check. A fix is in when the listed scenarios report OK instead of XFail / XError.

BUILD="https://altinity-build-artifacts.s3.amazonaws.com/PRs/2305/<sha>/build_amd_release/clickhouse-common-static_26.6.2.20001.altinityantalya_amd64.deb"

Backport 114864 (transform names day / hour)

python3 regression.py --clickhouse-binary-path "$BUILD" -o classic --only \
  "/iceberg/native create/rest catalog/sanity/create as source copies keys/*" \
  "/iceberg/native create/rest catalog/schema/accepted transforms/*" \
  "/iceberg/native create/rest catalog/metadata/initial file/*"

Backport 111786 (Avro field-ids in manifest lists)

python3 regression.py --clickhouse-binary-path "$BUILD" -o classic --only \
  "/iceberg/native create/rest catalog/schema/partition values in manifest/*" \
  "/iceberg/native create/rest catalog/metadata/first commit has no parent/*" \
  "/iceberg/native create/rest catalog/metadata/pyiceberg reads clickhouse rows/*"

Backport 109812 (.gz extension for gzip metadata)

sed -i 's/\.gzip\.metadata\.json/.gz.metadata.json/' tests/iceberg_engine/native_create/metadata.py
python3 regression.py --clickhouse-binary-path "$BUILD" -o classic --only \
  "/iceberg/native create/rest catalog/metadata/gzip metadata/*"

Bug: CREATE TABLE stalls ~33 s when the namespace exists

python3 regression.py --clickhouse-binary-path "$BUILD" -o classic --only \
  "/iceberg/native create/rest catalog/namespaces/second table lands beside the first/*"
grep -c "Failed to make request to 'http://ice-rest-catalog:5000/v1/namespaces'" _instances/clickhouse1/logs/clickhouse-server.log

Fixed when the scenario takes a few seconds, not ~35 s, and the grep prints 0.

Bug: orphan metadata files on REST (purge leaves files, re-create refused)

python3 regression.py --clickhouse-binary-path "$BUILD" -o classic --only \
  "/iceberg/native create/rest catalog/sanity/drop with purge/*" \
  "/iceberg/native create/rest catalog/sanity/explicit engine create/*" \
  "/iceberg/native create/rest catalog/drop/drop routes/*" \
  "/iceberg/native create/rest catalog/lifecycle/recreate after purge drop/*" \
  "/iceberg/native create/rest catalog/explicit engine/initial file naming/*"

Everything

python3 regression.py --clickhouse-binary-path "$BUILD" -o classic --only "/iceberg/native create/*"

@arthurpassos arthurpassos left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a big PR, I'll do it partially. Below are my human generated comments

Comment thread tests/integration/test_database_iceberg/test.py Outdated
Comment thread tests/integration/test_database_iceberg/test.py Outdated
Comment thread src/Databases/DataLake/Common.h Outdated
Comment thread src/Databases/DataLake/Common.cpp
Comment thread src/Databases/DataLake/DatabaseDataLake.cpp Outdated
Comment thread src/Databases/DataLake/DatabaseDataLake.cpp Outdated
Comment thread src/Databases/DataLake/DatabaseDataLake.cpp Outdated
Comment thread src/Databases/DataLake/DatabaseDataLake.cpp
Comment thread src/Databases/DataLake/DatabaseDataLake.cpp
Comment thread src/Databases/DataLake/GlueCatalog.cpp Outdated
@arthurpassos

Copy link
Copy Markdown
Collaborator

Below you can find AI comments:

6. Confirmed defects
High
None under the crash/UB/corruption/deadlock rubric. D2 is the closest (data left behind + CREATE blocked).

Medium
D1: Iceberg REST 409 is retried ~33s before catalog code treats it as success

Impact: Second CREATE TABLE in an existing REST namespace stalls ~33s (http_max_tries=10, backoff 100ms…10s ≈ 32.7s). Same stall for CREATE IF NOT EXISTS that loses the catalog race. Matches [#2386](https://github.com/Altinity/ClickHouse/issues/2386).
Anchor: src/IO/HTTPCommon.cpp isRetriableHTTPError; RestCatalog::sendRequest; RestCatalog::createNamespaceIfNotExists / createTable
Trigger: CREATE TABLE catalog.\ns.t2`afternsalready exists (GET miss or catalog without GET), or concurrentIF NOT EXISTS`.
Why defect: The catalog handlers already catch HTTP_CONFLICT, but ReadWriteBufferFromHTTP::doWithRetries retries 409 because it is not in the non-retriable list. The catch runs only after retries.
Fix: Treat 409 as non-retriable for these calls (max_tries=1 or add HTTP_CONFLICT to the local non-retriable set). Do not make 409 globally non-retriable without checking other HTTP users.
Regression test: Second native CREATE in the same REST namespace must finish in seconds; log must not show 10 failed POSTs to /v1/namespaces.

HTTPCommon.cpp
Ln 65–76
bool isRetriableHTTPError(const Poco::Net::HTTPResponse::HTTPStatus http_status) noexcept
{
    static constexpr std::array non_retriable_errors{
        Poco::Net::HTTPResponse::HTTPStatus::HTTP_BAD_REQUEST,
        // ... HTTP_NOT_FOUND, HTTP_FORBIDDEN, HTTP_NOT_IMPLEMENTED, HTTP_METHOD_NOT_ALLOWED
        // HTTP_CONFLICT (409) is NOT listed → retried
    };
D2: REST CREATE with ENGINE writes metadata the catalog never references; purge DROP cannot remove it

Impact: Orphan v1-<uuid>.metadata.json (and version-hint.text) under the table prefix. DROP … SETTINGS data_lake_delete_data_on_drop = 1 removes catalog-tracked files only. Recreate with an explicit engine then hits TableAlreadyExistsInCatalogException (“metadata files are already present”). Matches [#2387](https://github.com/Altinity/ClickHouse/issues/2387).
Anchor: IcebergMetadata::createInitial; RestCatalog::createTable (new_metadata_path unused); S3TablesCatalog::managesTableLocation only
Trigger: CREATE TABLE catalog.\ns.t` ENGINE = IcebergS3('s3://…')in a RESTDataLakeCatalog`, then purge DROP, then CREATE again.
Why defect: managesTableLocation means “catalog assigns the location” (S3 Tables). REST still lets the client propose a location and write metadata, but REST CreateTable generates its own metadata and ignores new_metadata_path. Engine-less CREATE is fine (empty path, catalog writes).
Fix: Do not write client metadata when the catalog will write it (separate flag from managesTableLocation), or pass the written path into the REST create body (metadata-location / equivalent). Align DROP with the files that were actually written.
Regression test: Explicit-engine REST create → purge drop → recreate; object listing of …/metadata/ must be empty after purge.
D3: Engine-argument location check is a string prefix of storage_endpoint, not a storage prefix

Impact: CREATE TABLE … ENGINE = IcebergS3('s3://warehouse-rest/ns/tbl', …) is rejected when the database uses storage_endpoint = 'http://minio:9000/warehouse-rest', even though constructTableLocation itself emits that s3:// form.
Anchor: DatabaseDataLake::validateCreateTableEngineArguments
Trigger: Explicit engine + HTTP(S) storage_endpoint + s3:// / abfss:// location.
Why defect: Reopen uses the catalog location plus database engine args, not a string prefix of storage_endpoint. The check fires on scheme mismatch (http:// vs s3://).
Fix: Compare parsed bucket/prefix (same rules as constructTableLocation / TableMetadata::setLocation), or skip the prefix check when schemes differ and the constructed warehouse URI matches.
Regression test: Database with MinIO HTTP endpoint; CREATE with s3://<bucket>/… engine location that constructTableLocation would produce.
D4: prepareForDrop is not applied to an unresolved lazy nested storage

Impact: For Iceberg ENGINE tables in a lazy_load_tables database, DROP TABLE … SETTINGS data_lake_delete_data_on_drop = 1 after restart (never read) keeps files. StorageObjectStorage::drop uses value_or(false) and only logs if the server-wide setting is on.
Anchor: StorageTableProxy::prepareForDrop; StorageTableFunctionProxy::prepareForDrop; StorageObjectStorage::drop
Trigger: Atomic/Ordinary DB with lazy_load_tables, Iceberg engine table, drop without prior access.
Why defect: DROP is supposed to honor the query setting. Capture is skipped; later drop() never sees it. Not the DataLakeCatalog path (that one purges via DatabaseDataLake::dropTable).
Fix: Resolve nested storage in prepareForDrop (without startup), or pass delete_data into IStorage::drop.
Regression test: Create Iceberg engine table, restart with lazy load, drop with purge, assert objects gone.
D5: Glue initial metadata uses HTTP encoding gzip, not Iceberg’s gz

Impact: With iceberg_metadata_compression_method = 'gzip' (or 'gz'), Glue CREATE writes v1.gzip.metadata.json. Spark/pyiceberg and the PR’s own test expect v1.gz.metadata.json.
Anchor: GlueCatalog::createTable (toContentEncodingName); contrast IcebergMetadata::createInitial (raw setting string)
Trigger: Glue native CREATE with metadata compression enabled.
Why defect: Iceberg’s compressed metadata extension is gz. toContentEncodingName(Gzip) is "gzip" (HTTP Content-Encoding). Upstream uses toIcebergMetadataCompressionExtension, which this port does not have.
Fix: Map gzip → gz for Iceberg filenames (shared helper used by Glue and createInitial).
Regression test: The assertion already in the PR (endswith(".gz.metadata.json") and not .gzip.).
Low
None additional after dedup (gzip/gz is Medium because it breaks external readers).

@Selfeer

Selfeer commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

@zvonand does this need to be addressed in this PR? #2387 ?

@zvonand

zvonand commented Sep 23, 2026

Copy link
Copy Markdown
Member Author

@zvonand does this need to be addressed in this PR? #2387 ?

I think so

…prune on `DROP`

Adds native `CREATE TABLE`, `CREATE TABLE ... AS source` and `DROP TABLE`
support for `DataLakeCatalog` databases, so tables can be created and removed
in the catalog itself instead of only being read through it.

`CREATE TABLE` registers the table in the catalog (REST, Glue, Unity,
S3 Tables), honouring `IF NOT EXISTS` and rolling the staged metadata back
when the creation fails or loses a race. `iceberg_metadata_compression_method`
is respected by `GlueCatalog::createTable`.

`DROP TABLE` unregisters the table and, when the new
`data_lake_delete_data_on_drop` setting is enabled, asks the catalog to purge
the table data as well. `IF EXISTS` and `IF NOT EXISTS` are passed down to the
catalog so the backends can honour them before rejecting an unsupported purge.

The engine named in `CREATE TABLE` is validated against the catalog backend,
including its arguments: `tryGetTableImpl` reopens a table from its catalog
location plus the database engine arguments, so any other argument given in
`CREATE` - storage credentials above all - would apply only to the creation and
then be replaced on the first read. Engine `SETTINGS` are accepted with an
explicit engine. Clauses unsupported for a catalog table are rejected when
inherited from a `CREATE TABLE ... AS` source, also when the destination gives
its own engine; `datalake_create_table_as_ignore_unsupported_source_properties`
drops them instead.

The accepted engine family is the catalog's own, so
`CREATE TABLE ... ENGINE = DeltaLakeLocal(...)` is accepted in a Unity-backed
database. Only Iceberg metadata is generated for a `CREATE TABLE` without a
table engine, so that path throws `NOT_IMPLEMENTED` for a catalog of another
family before resolving the table location.

`OneLakeCatalog`, `BigLakeCatalog` and `S3TablesCatalog` report their fixed
backend from `getStorageType`, so every backend check reads
`ICatalog::getStorageType`. A catalog that assigns table locations itself
rejects an explicit `ENGINE` and `storage_endpoint` as the placement for a new
table and asks for `default_base_location`; `SHOW CREATE TABLE` omits the
`ENGINE` clause for such a catalog. `SHOW CREATE TABLE` now includes the
Iceberg `PARTITION BY` / `ORDER BY` keys when they can be represented.

A lost `IF NOT EXISTS` race throws `TABLE_ALREADY_EXISTS`, which
`InterpreterCreateQuery` matches on to turn into a no-op, and the Glue rollback
removes the staged metadata file only after `GetTable` confirms that nothing
still points at it. A transactional (REST) catalog writes the initial metadata
file itself, so ClickHouse no longer leaves an orphaned one next to it.
`ON CLUSTER` DDL, including `DROP DATABASE ... ON CLUSTER`, is rejected for
`DataLakeCatalog`.

ClickHouse#98670

(cherry picked from the state of ClickHouse#98670 at b3b0b22, squashed)

Adaptations for antalya-26.6:

* Dropped: `UnityV2Catalog`, `DatabaseRemote` and
  `DeltaLakeCatalogRegistration.cpp` do not exist here, nor do the Delta Lake
  `createTable` path of `DeltaLakeMetadataDeltaKernel` and `UnityCatalog`, so
  their changes are not applied. Upstream-only tests that the PR merely
  touched (`test_create_gzip_metadata`, `test_cluster_insert`,
  `test_database_unity_v2`) are not added.
* Added: `ICatalog::managesTableLocation` and the `S3TablesCatalog` override,
  which upstream already had in its base.
* Adapted: `ICatalog::getTableEngineName` does not exist here, so the engine
  family comes from `table_engine_definition`, and `getCreateTableQueryImpl`
  keeps this branch's engine name for unreadable tables.
* Adapted: `toIcebergMetadataCompressionExtension` and
  `Iceberg::makeIcebergLocationURI` do not exist here, so `GlueCatalog` and
  `IcebergMetadata::createInitial` keep this branch's file naming and
  location construction.
* Adapted: `parseTransformAndArgument` takes a time zone here; the new
  `getPartitionAndSortingKeyASTsFromMetadata` passes an empty one.
* Adapted: the Iceberg REST namespace-identifier fix (`namespaceToJSONArray`)
  was applied inside `buildUpdateMetadataRequestBody` and
  `buildUpdateSchemaRequestBody`, where this branch builds those request bodies.
* Adapted: `IcebergMetadata::drop` keeps this branch's reachable-file
  enumeration and takes the resolved `delete_data` flag.
* Adapted: `StorageObjectStorageCluster` delegates to `pure_storage` here, so
  `prepareForDrop` forwards there instead of capturing the setting and calling
  `StorageObjectStorage::dropImpl` itself.
* Adapted: `writeMetadataFiles` in `Iceberg/Mutations.cpp` gained
  `previous_metadata_file_path` beside this branch's `content_type` and
  `write_metadata_json_file` parameters.
* Adapted: the namespace filter (`allowed_namespaces` / `isNamespaceAllowed`)
  of `RestCatalog` and `GlueCatalog`, `GlueCatalog::getOrFetchMetadataObject`,
  and the `NoSuchBucket` wrapping in `createInitial` are kept.
  `TableMetadata::hasDataLakeSpecificProperties` does not exist here, so
  `GlueCatalog` checks `getDataLakeSpecificProperties().has_value()`.
* Adapted: the new settings are registered in `SettingsChangesHistory.cpp`,
  since this branch does not declare the history inline.
@zvonand
zvonand force-pushed the releasy/port/pr-98670-2f540f branch from 49215ff to 9c43382 Compare September 29, 2026 13:22
@arthurpassos

Copy link
Copy Markdown
Collaborator

@zvonand have you had time to look into #2305 (comment)?

"(got {})", datalake_unsupported_storage_clause);
}

if (!ignore_unsupported_source_properties || columns_user_specified)

@arthurpassos arthurpassos Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the amount of times ignore_unsupported_source_properties is checked surprised me. Asked AI for a simplification - not sure it looks better, I'll leave it up to you to decide:

auto reject_unsupported_columns = [&]
{
    for (const auto & column : properties.columns)
    {
        if (column.default_desc.expression || column.default_desc.kind != ColumnDefaultKind::Default)
            throw Exception(ErrorCodes::BAD_ARGUMENTS,
                "Column '{}': {} is not yet supported by DataLakeCatalog table creation",
                column.name, toString(column.default_desc.kind));

        if (!column.comment.empty() || column.codec || column.ttl
            || !column.settings.empty() || column.statistics.hasExplicitStatistics())
            throw Exception(ErrorCodes::BAD_ARGUMENTS,
                "Column '{}': COMMENT, CODEC, TTL, STATISTICS, SETTINGS, and PRIMARY KEY "
                "are not supported by DataLakeCatalog table creation",
                column.name);
    }

    if (!properties.indices.empty() || !properties.constraints.empty() || !properties.projections.empty()
        || (create.columns_list && (create.columns_list->primary_key || create.columns_list->primary_key_from_columns)))
        throw Exception(ErrorCodes::BAD_ARGUMENTS,
            "DataLakeCatalog CREATE TABLE does not support PRIMARY KEY, indices, constraints, or projections");
};

if (ignore_unsupported_source_properties)
{
    if (columns_user_specified)
        reject_unsupported_columns();
    else
    {
        ColumnsDescription plain_columns;
        for (const auto & column : properties.columns)
            plain_columns.add(ColumnDescription(column.name, column.type));

        properties.columns = std::move(plain_columns);
        properties.indices = {};
        properties.constraints = {};
        properties.projections = {};

        auto columns_list = make_intrusive<ASTColumns>();
        columns_list->set(columns_list->columns, formatColumns(properties.columns));
        create.set(create.columns_list, columns_list);
    }

    if (comment_user_specified)
    {
        if (create.comment)
            throw Exception(ErrorCodes::BAD_ARGUMENTS,
                "Table COMMENT is not supported by DataLakeCatalog table creation "
                "(note: CREATE TABLE ... AS inherits the comment from the source table)");
    }
    else
        create.reset(create.comment);
}
else
{
    reject_unsupported_columns();

    if (create.comment)
        throw Exception(ErrorCodes::BAD_ARGUMENTS,
            "Table COMMENT is not supported by DataLakeCatalog table creation "
            "(note: CREATE TABLE ... AS inherits the comment from the source table)");

    if (!as_table_saved.empty())
    {
        // existing source-storage lookup and findUnsupportedDatalakeStorageClause call
    }
}

@zvonand

zvonand commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

have you had time to look into

only partially. now I'll make AI look into AI findings first :)

assert "stores Iceberg-family tables" in err


def test_create_table_unsupported_clauses(started_cluster):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be a duplicate of test_create_table_as_rejects_source_storage_clauses, except that it is not using as but rather specifying all the fields manually. Ok to keep, just wanted to flag that

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'd keep it -- create and create as are different things.

assert "is not yet supported" in err


def test_create_table_with_engine_unsupported_clauses(started_cluster):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm.. maybe this is bloated?

node.query(f"DROP TABLE {target_table}", settings=settings)


def test_show_create_table_omits_unrepresentable_partition_and_sort_order(started_cluster):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need a test for that? What is a "unrepresentable partition by" clause?

Even if such thing exists (which probably exists, I just didn't quite understand), it sounds like we are testing a limitation of clickhouse

@zvonand zvonand Sep 30, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw this comment made me notice wrong behavior with ignoring some of the unsupported stuff :) I will fix the behavior a bit and make the test more useful

arthurpassos
arthurpassos previously approved these changes Sep 30, 2026

@arthurpassos arthurpassos left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read the drop code, and parts of the create as. Left a couple of comments. I also went through the tests, left a couple of comments regarding test duplication. Regardless, it seems like it works and that's how far I can go with a human review in a reasonable time.

I'll leave it to the author to fix the AI comments.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-needs-verify antalya antalya-26.6 port-antalya PRs to be ported to all new Antalya releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants