Skip to content

Review #2297 for code improvements: grouped columns looked up by bare name #2640

Backlog

Description

@mathiasrw

This is not a bug report. It is an invitation to look at #2297 again, because it may treat a symptom rather than the cause. The goal is to understand the change and decide whether anything should be improved. The notes below come from a quick read of the diff, not from a full analysis.

The concern:

  • A fallback to the bare column name instead of resolving the group key. In a grouped query, a column inside an expression has no nick. Fix GROUP BY with table-prefixed columns in arithmetic expressions #2297 makes Column.toJS read g[this.nick || this.columnid], so a table-qualified column is looked up by its bare name. That works while the name is unique among the grouped columns, and gives a wrong result when it is not: with GROUP BY a.id, b.id, a.id + 1 reads b.id (GROUP BY a.id, b.id: a.id inside an expression reads b.id #2637).
  • The cause seems to be that grouped expressions are not resolved to their group key by table and column, the way GROUP BY stores it. Resolving them there would remove the need for the fallback.

Related: #2637, #536.

Activity

  1. mathiasrw commented on Oct 20, 2026

    @mathiasrw
    MemberAuthor

    Part of the GROUP BY design in #2722.

  2. mathiasrw commented on Nov 26, 2026

    @mathiasrw
    MemberAuthor

    Will be covered by #2647.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions