Skip to content

Ignore cte name when calculate hash for In SET name. - #80757

Merged
KochetovNicolai merged 3 commits into
masterfrom
fix-THERE_IS_NO_COLUMN-for-distributed-in-from-cte
May 27, 2025
Merged

KochetovNicolai merged 3 commits into
masterfrom
fix-THERE_IS_NO_COLUMN-for-distributed-in-from-cte

Conversation

@KochetovNicolai

Copy link
Copy Markdown
Member

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 THERE_IS_NO_COLUMN error for distributed queries with IN cte.
Fixes #75032

The IN CTE part is substituted with IN (subquery) for distributed queries (because otherwise the CTE definition would not be sent). Because of this, the query tree hash was inconsistent, so the executable column name was. This PR ignores the CTE name while calculating the hash for the right IN arg.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

@KochetovNicolai KochetovNicolai added pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-cloud labels May 23, 2025
@clickhouse-gh

clickhouse-gh Bot commented May 23, 2025 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [7dd846d]

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label May 23, 2025
@novikd novikd self-assigned this May 26, 2025

@novikd novikd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. I don't think there are other options to fix this case on top of AST.

{
bool compare_aliases = true;
bool compare_types = true;
bool ignore_cte = false;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Requires adding a comment. Other options in this structure are self explanatory, but this flag is unclear if you don't see the usage.

@KochetovNicolai
KochetovNicolai added this pull request to the merge queue May 27, 2025
Merged via the queue into master with commit bd9d910 May 27, 2025
@KochetovNicolai
KochetovNicolai deleted the fix-THERE_IS_NO_COLUMN-for-distributed-in-from-cte branch May 27, 2025 14:04
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label May 27, 2025
@robot-clickhouse robot-clickhouse added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label May 27, 2025
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-backports-created-cloud deprecated label, NOOP label May 27, 2025
KochetovNicolai added a commit that referenced this pull request May 28, 2025
Backport #80757 to 25.3: Ignore cte name when calculate hash for In SET name.
KochetovNicolai added a commit that referenced this pull request May 28, 2025
Backport #80757 to 25.4: Ignore cte name when calculate hash for In SET name.
KochetovNicolai added a commit that referenced this pull request May 28, 2025
Backport #80757 to 25.5: Ignore cte name when calculate hash for In SET name.
@robot-clickhouse robot-clickhouse added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Jul 2, 2025
@clickgapai

Copy link
Copy Markdown
Contributor

Hi @KochetovNicolai @novikd — while reviewing this PR I found the following:

Happy to discuss — close anything that's wrong or already addressed.

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

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-backports-created-cloud deprecated label, NOOP pr-bugfix Pull request with bugfix, not backported by default pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

THERE_IS_NO_COLUMN for complex distributed query with the analyzer (different sets)

6 participants