Skip to content

Fix attempt to create table from table function#1701

Open
ianton-ru wants to merge 2 commits intoantalya-25.8from
bugfix/antalya-25.8/fix_wrong_create
Open

Fix attempt to create table from table function#1701
ianton-ru wants to merge 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

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.

3 participants