Skip to content

Summarize aggregate scope includes scalar groupby keys#3055

Open
anderson-joyle wants to merge 1 commit intomainfrom
fix/summarize-groupby-field-ref
Open

Summarize aggregate scope includes scalar groupby keys#3055
anderson-joyle wants to merge 1 commit intomainfrom
fix/summarize-groupby-field-ref

Conversation

@anderson-joyle
Copy link
Copy Markdown
Contributor

Issue: #2876

The Summarize runtime was pushing only the group's subset TableValue into the aggregate lambda's scope. The binder (FunctionThisGroupScopeInfo) builds the scope DType as { : scalar, ..., ThisGroup: table }, so FormulaValueScope.Resolve for any bare name fell through to returning the whole table, making Dec2Hex(, ...) error and Text() hang.

Build a RecordValue matching the binder's shape (scalar key fields plus ThisGroup -> group table) and pass that to WithScopeValues. Adds regression tests covering the Dec2Hex and Text repros from the issue, equivalence with First(ThisGroup)., and a multi-key groupby.

@anderson-joyle anderson-joyle requested a review from a team as a code owner April 21, 2026 23:53
The Summarize runtime was pushing only the group's subset TableValue
into the aggregate lambda's scope. The binder (FunctionThisGroupScopeInfo)
builds the scope DType as { <key>: scalar, ..., ThisGroup: table }, so
FormulaValueScope.Resolve for any bare name fell through to returning the
whole table, making Dec2Hex(<key>, ...) error and Text(<key>) hang.

Build a RecordValue matching the binder's shape (scalar key fields plus
ThisGroup -> group table) and pass that to WithScopeValues. Adds
regression tests covering the Dec2Hex and Text repros from the issue,
equivalence with First(ThisGroup).<field>, and a multi-key groupby.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@anderson-joyle anderson-joyle force-pushed the fix/summarize-groupby-field-ref branch from e18ab7e to aaa4878 Compare April 21, 2026 23:59
@jas-valgotar
Copy link
Copy Markdown
Contributor

✅ No public API change.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants