Skip to content

Fix logical errors in analyzer with column names collision in lambda used in prewhere - #103627

Merged
Avogar merged 12 commits into
masterfrom
fix-logical-err-lambda
May 21, 2026
Merged

Avogar merged 12 commits into
masterfrom
fix-logical-err-lambda

Conversation

@Avogar

@Avogar Avogar commented Apr 28, 2026 •

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):

Fix logical errors in analyzer with column names collision in lambda used in prewhere. Closes #103584

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.5.1.939

@clickhouse-gh

clickhouse-gh Bot commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [f8feaaf]

Summary: ❌

job_name test_name status info comment
Integration tests (arm_binary, distributed plan, 1/4) FAIL
test_storage_iceberg_with_trino/test.py::test_clickhouse_writes_trino_reads FAIL cidb, issue ISSUE CREATED
Integration tests (amd_msan, 2/6) FAIL
test_storage_kafka/test_batch_slow_6.py::test_kafka_rebalance[generate_new_create_table_query-{}.*Saved offset] FAIL cidb, issue ISSUE CREATED
Finish Workflow FAIL
python3 ./ci/jobs/scripts/workflow_hooks/check_report_messages.py FAIL IGNORED

AI Review

Summary

This PR fixes lambda column-name collision handling in analyzer PREWHERE/WHERE paths by introducing deterministic disambiguation with proper scope propagation, and adds focused stateless coverage for sibling and nested lambda shadowing cases. I reviewed the current diff and existing discussion threads, and I did not find any remaining correctness, safety, or compatibility issues in the updated code.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Apr 28, 2026
Comment thread src/Planner/PlannerActionsVisitor.cpp Resolved
Comment thread src/Interpreters/ActionsDAG.cpp Resolved
Comment thread src/Interpreters/ActionsDAG.cpp Resolved
Comment thread src/Interpreters/ActionsDAG.cpp Resolved
Comment thread src/Planner/PlannerActionsVisitor.cpp Resolved
Comment thread src/Planner/PlannerActionsVisitor.cpp Resolved
Comment thread src/Planner/PlannerActionsVisitor.cpp Resolved
Comment thread src/Planner/PlannerActionsVisitor.cpp Resolved
@alexey-milovidov

Copy link
Copy Markdown
Member

This was fixed by #105146. Let's update the branch.

Comment thread src/Planner/PlannerActionsVisitor.cpp Resolved
@clickhouse-gh

clickhouse-gh Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.10% 84.20% +0.10%
Functions 91.40% 91.40% +0.00%
Branches 76.60% 76.60% +0.00%

Changed lines: 93.55% (29/31) · Uncovered code

Full report · Diff report

@Avogar
Avogar added this pull request to the merge queue May 21, 2026
Merged via the queue into master with commit c2d6a58 May 21, 2026
162 of 166 checks passed
@Avogar
Avogar deleted the fix-logical-err-lambda branch May 21, 2026 13:20
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label May 21, 2026
DavidHe-2008 pushed a commit to DavidHe-2008/ClickHouse that referenced this pull request Jun 1, 2026
…lambda

Fix logical errors in analyzer with column names collision in lambda used in prewhere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Logical error: 'Unexpected return type from FunctionExpression' in the query with lambda with analyzer

4 participants