Skip to content

fix(query): prefer columns in group by resolution#19810

Closed
KKould wants to merge 1 commit intodatabendlabs:mainfrom
KKould:fix/group-by-column-resolution-base-e2e
Closed

fix(query): prefer columns in group by resolution#19810
KKould wants to merge 1 commit intodatabendlabs:mainfrom
KKould:fix/group-by-column-resolution-base-e2e

Conversation

@KKould
Copy link
Copy Markdown
Member

@KKould KKould commented May 7, 2026

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

  • Prefer input columns over SELECT aliases when resolving unqualified names in GROUP BY
  • Keep alias fallback for non-conflicting GROUP BY aliases, including existing SRF/aggregate alias paths
  • Add regression coverage in Databend's own sqllogictest suite instead of modifying DuckDB e2e files in this repo

Fixes #19806

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Validation commands:

cargo fmt --check -p databend-common-sql
cargo test -p databend-common-sql --test it semantic::binder -- --nocapture

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions Bot added the pr-bugfix this PR patches a bug in codebase label May 7, 2026
@KKould
Copy link
Copy Markdown
Member Author

KKould commented May 7, 2026

Closing because this PR was opened from the wrong local branch. The intended work continues in #19809.

@KKould KKould closed this May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix this PR patches a bug in codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: GROUP BY resolves alias over column name when both share the same identifier

1 participant