Skip to content

Fix attempt to create table from table function#1701

Merged
zvonand merged 2 commits intoantalya-25.8from
bugfix/antalya-25.8/fix_wrong_create
Apr 30, 2026
Merged

Fix attempt to create table from table function#1701
zvonand merged 2 commits intoantalya-25.8from
bugfix/antalya-25.8/fix_wrong_create

Conversation

@ianton-ru
Copy link
Copy Markdown

@ianton-ru ianton-ru commented Apr 28, 2026

Solved #1683

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

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

Fix attempt to create table from table function

Documentation entry for user-facing changes

After rewrite query to object storage with using remote initiator ClickHouse tried to create table.
Call of create relies on fact of column definitions on start, but with remote initiator feature column definitions are added during query rewrite.

CI/CD Options

Exclude tests:

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

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

Workflow [PR], commit [66a0ce1]

@ianton-ru
Copy link
Copy Markdown
Author

@codex review

@ianton-ru
Copy link
Copy Markdown
Author

PR #1701 audit (Altinity/ClickHouse)

AI audit note: This review was generated by AI (gpt-5.3-codex).

PR: Fix attempt to create table from table function
Scope: Skip configuration->create() in StorageObjectStorageCluster when the storage is constructed as a table function (!is_table_function added to the existing guard).


Confirmed defects

No confirmed defects in reviewed scope.


Coverage summary

Item Detail
Scope reviewed StorageObjectStorageCluster constructor and the configuration->create guard; all std::make_shared<StorageObjectStorageCluster>(...) call sites (registerStorageObjectStorage.cpp, TableFunctionObjectStorage.cpp, TableFunctionObjectStorageCluster.cpp, DatabaseDataLake.cpp); base vs DataLakeConfiguration::create / DataLakeMetadata::createInitial; PR integration changes in tests/integration/test_storage_iceberg/test.py, tests/integration/test_s3_cluster/test.py, and cluster config.
Categories failed None
Categories passed Ephemeral table-function path must not run datalake createInitial (fix adds !is_table_function); persistent engine path still calls create (is_table_function == false in registerStorageObjectStorage.cpp); DatabaseDataLake with is_datalake_query == true already skipped create before this PR—unchanged.
Assumptions/limits Static review only (tests not executed in this environment); commit message typo (“attemppt”) is cosmetic and not a runtime defect.

Fault-category matrix (in-scope)

Category Status Outcome
Table function must not trigger create / createInitial after query rewrite supplies columns Executed Pass
Persistent CREATE TABLE / engine registration must still invoke create Executed Pass
is_datalake_query interaction (DatabaseDataLake) Executed Pass (pre-existing !is_datalake_query guard)
Concurrency / lock-order / lifetime around this change Not applicable Constructor-only change
Exception / partial-update rollback Not applicable No change to surrounding try/catch

Call graph (anchor)

TableFunctionObjectStorage*::executeImpl / TableFunctionObjectStorageCluster::executeImpl / registerStorageObjectStorage / DatabaseDataLake::…StorageObjectStorageCluster::StorageObjectStorageCluster → guarded configuration->create → (for datalake configs) DataLakeConfiguration::createDataLakeMetadata::createInitial.


Code reference (change under review)

    if (!is_table_function
        && !columns_in_table_or_function_definition.empty()
        && !is_datalake_query
        && mode_ == LoadingStrictnessLevel::CREATE)
    {
        configuration->create(
            object_storage,
            context_,
            columns_in_table_or_function_definition,
            partition_by,
            if_not_exists,
            catalog,
            table_id_
        );
    }

@ianton-ru
Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ianton-ru
Copy link
Copy Markdown
Author

Failed tests looks unrelated to current PR

@zvonand
Copy link
Copy Markdown
Collaborator

zvonand commented Apr 29, 2026

Please, do not write "Solved .." in changelog

It belongs to PR body indeed -- just put it someplace else next time

@zvonand
Copy link
Copy Markdown
Collaborator

zvonand commented Apr 30, 2026

  • Unit test fail is fixed in antalya-25.8 branch already.
  • 03707_set_index_bad_get_null_bug is pre-existing
  • 03212_variant_dynamic_cast_or_default seems to be flaky and not related
  • test_startup_without_zookeeper is also pre-existing
  • test_filesystem_cache -- looks like it hit a timeout

@zvonand zvonand merged commit 53a7a1f into antalya-25.8 Apr 30, 2026
370 of 396 checks passed
@alsugiliazova
Copy link
Copy Markdown
Member

@zvonand stop merging prs before verification. I did not had a chance to look at it.

@alsugiliazova
Copy link
Copy Markdown
Member

Verification report: Altinity/ClickHouse PR #1701

Conclusion

PR is merged. CI on head was red but every failure is a pre-existing flake or known broken job; no PR-caused regression. No follow-up required.


CI on head 66a0ce1c — failures

PR test workflow

Check Test FAIL Class
Integration tests (amd_asan, old analyzer, 4/6) test_replication_without_zookeeper::test_startup_without_zookeeper (×2) Pre-existing flake — 104 fails / 9 PRs / 90d, since 2026-03-30
Integration tests (amd_binary, 1/5) same same
Integration tests (arm_binary, distributed plan, 2/4) same same
Integration tests (amd_asan, old analyzer, 6/6) test_storage_s3_queue::test_persistent_processing New occurrence (1/1); s3_queue suite, no diff overlap
Integration tests (amd_asan, flaky check) test_storage_iceberg::test_filesystem_cache[s3-1-5], [s3-4-5], [s3-5-5], test_metadata_cache[s3-4-5] Pre-existing flake — 2 fails / 2 PRs / 90d each. Caught by dedicated flaky-check job.
Stateless tests (amd_binary, ParallelReplicas, s3 storage, parallel) 03707_set_index_bad_get_null_bug Pre-existing flake — 17 / 10
Stateless tests (amd_binary, old analyzer, s3 storage, DatabaseReplicated, parallel) 03212_variant_dynamic_cast_or_default Pre-existing flake — 11 / 8
Stress test (amd_debug) Server died + cascade (Killed by signal, Hung check, Fatal message, gdb signal) Pre-existing instability — 8 SIGABRT / 3 PRs / 30d, also on master (PR=0 commit 5c9d5236 2026-04-29 and 35573c93 2026-04-25)
Unit tests (asan) IOTestAwsS3Client.AppendExtraSSE{C,KMS}HeadersRead/Write (4 unit tests) Pre-existing broken unit tests — 35 fails / 6 PRs / 90d each on antalya-25.8 base

Regression workflow

Check Top failure Baseline
RegressionTestsRelease / Swarms / swarms swarms node-failure / network-failure scenarios Known broken/flaky swarms suite

Regression DB on /PRs/1701/ builds (30d): 19 Fail / 11,524 OK ≈ 0.16%. Failures concentrated in swarms (10) and s3_export_part (5) — both already known flaky/broken, not caused by this PR.


Related to PR #1701's diff?

PR is a 25.8 bugfix for CREATE TABLE … AS <table_function> rejecting/handling the remote-initiator + cluster-fallback path correctly (sibling to #1608/#1638's design issue #3.1 in AUDIT_PR_1608.md).

Failing test Diff overlap Related?
test_replication_without_zookeeper::test_startup_without_zookeeper none (replication startup) No
test_storage_iceberg::test_filesystem_cache / metadata_cache none (cache layer) No
test_storage_s3_queue::test_persistent_processing none No
03707_set_index_bad_get_null_bug none (set index NULL) No
03212_variant_dynamic_cast_or_default none (Variant cast) No
Stress test SIGABRT none — also crashes on master No
IOTestAwsS3Client.AppendExtraSSE* none (S3 SSE headers) No
Swarms regression none No

No failure intersects the TableFunctionObjectStorageClusterFallback / validateUseToCreateTable code path touched by this PR.


@alsugiliazova
Copy link
Copy Markdown
Member

Code Audit: PR #1701 — Fix attempt to create table from table function

AI audit note: This review was generated by AI (Sonnet 4.6).

PR: Fix attempt to create table from table function
Commit: 17f55b0be08 merged as 53a7a1f695c into antalya-25.8
Fixes: #1683TABLE_ALREADY_EXISTS on SELECT from Iceberg table function on 25.8


Confirmed defects

No confirmed defects in reviewed scope.


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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants