Skip to content

Fix interpolate: disambiguate interpolated columns with __interpolate function#93197

Merged
KochetovNicolai merged 3 commits intomasterfrom
fix-interpolate-collapse
Jan 2, 2026
Merged

Fix interpolate: disambiguate interpolated columns with __interpolate function#93197
KochetovNicolai merged 3 commits intomasterfrom
fix-interpolate-collapse

Conversation

@yakov-olkhovskiy
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 into CHANGELOG.md):

Prevent different interpolated columns from collapse into the same column in a block when interpolated columns are effectively aliases of the same column

closes #71858
closes #381

The source of the bug is that interpolated columns can be just aliases of another column and as a result they are resolved into that single column and during interpolation transform, rows for different interpolated columns are written into the same resulting column. Solved by introduction of internal __interpolate() function which just returns its first argument (original column), but also accepts second argument (which is an alias of an interpolated column) which creates unique column (by introducing unique function's signature) disambiguating it from original.

@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Dec 30, 2025

Workflow [PR], commit [51e1600]

Summary:

job_name test_name status info comment
BuzzHouse (amd_debug) failure
Logical error: 'Inconsistent AST formatting in Function_globalNotIn: the query: (STID: 1941-1bfa) FAIL cidb

@clickhouse-gh clickhouse-gh bot added the pr-bugfix Pull request with bugfix, not backported by default label Dec 30, 2025
@KochetovNicolai KochetovNicolai added this pull request to the merge queue Jan 2, 2026
Merged via the queue into master with commit a9196d7 Jan 2, 2026
254 of 258 checks passed
@KochetovNicolai KochetovNicolai deleted the fix-interpolate-collapse branch January 2, 2026 10:51
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jan 2, 2026
KochetovNicolai added a commit that referenced this pull request Jan 3, 2026
…lapse"

This reverts commit a9196d7, reversing
changes made to 6c780e3.
maxjustus added a commit to maxjustus/ClickHouse that referenced this pull request Jan 29, 2026
The `__interpolate` function was added in PR ClickHouse#93197 and subsequently
reverted. This branch had code wrapping INTERPOLATE columns in
`__interpolate` function calls, but the function implementation no
longer exists after rebase.

Changes:
- Remove `interpolate_list` parameter from `resolveProjectionExpressionNodeList`
- Remove `__interpolate` wrapping logic from projection resolution
- Remove construction of `interpolate_list` set in `resolveQuery`
maxjustus added a commit to maxjustus/ClickHouse that referenced this pull request Mar 21, 2026
The `__interpolate` function was added in PR ClickHouse#93197 and subsequently
reverted. This branch had code wrapping INTERPOLATE columns in
`__interpolate` function calls, but the function implementation no
longer exists after rebase.

Changes:
- Remove `interpolate_list` parameter from `resolveProjectionExpressionNodeList`
- Remove `__interpolate` wrapping logic from projection resolution
- Remove construction of `interpolate_list` set in `resolveQuery`
maxjustus added a commit to maxjustus/ClickHouse that referenced this pull request Mar 21, 2026
The `__interpolate` function was added in PR ClickHouse#93197 and subsequently
reverted. This branch had code wrapping INTERPOLATE columns in
`__interpolate` function calls, but the function implementation no
longer exists after rebase.

Changes:
- Remove `interpolate_list` parameter from `resolveProjectionExpressionNodeList`
- Remove `__interpolate` wrapping logic from projection resolution
- Remove construction of `interpolate_list` set in `resolveQuery`
maxjustus added a commit to maxjustus/ClickHouse that referenced this pull request Mar 28, 2026
The `__interpolate` function was added in PR ClickHouse#93197 and subsequently
reverted. This branch had code wrapping INTERPOLATE columns in
`__interpolate` function calls, but the function implementation no
longer exists after rebase.

Changes:
- Remove `interpolate_list` parameter from `resolveProjectionExpressionNodeList`
- Remove `__interpolate` wrapping logic from projection resolution
- Remove construction of `interpolate_list` set in `resolveQuery`
@vdimir vdimir added the post-approved Approved, but after the PR is merged. label Mar 30, 2026
maxjustus added a commit to maxjustus/ClickHouse that referenced this pull request Mar 30, 2026
The `__interpolate` function was added in PR ClickHouse#93197 and subsequently
reverted. This branch had code wrapping INTERPOLATE columns in
`__interpolate` function calls, but the function implementation no
longer exists after rebase.

Changes:
- Remove `interpolate_list` parameter from `resolveProjectionExpressionNodeList`
- Remove `__interpolate` wrapping logic from projection resolution
- Remove construction of `interpolate_list` set in `resolveQuery`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

post-approved Approved, but after the PR is merged. pr-bugfix Pull request with bugfix, not backported by default 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.

Invalid number of rows in Chunk column with WITH FILL INTERPOLATE

4 participants