Skip to content

refactor(parser): Extract GROUP BY sort utilities to ParserUtils (#1051)#1051

Open
peterenescu wants to merge 1 commit intofacebookincubator:mainfrom
peterenescu:export-D96411887
Open

refactor(parser): Extract GROUP BY sort utilities to ParserUtils (#1051)#1051
peterenescu wants to merge 1 commit intofacebookincubator:mainfrom
peterenescu:export-D96411887

Conversation

@peterenescu
Copy link
Contributor

@peterenescu peterenescu commented Mar 13, 2026

Summary:

Extracts GROUP BY sort handling utilities into reusable functions in ParserUtils.cpp/h:

  • widenProjectionsForSort(): Matches sort key expressions against projections by pointer identity, widens projection list if needed to include referenced column names not in SELECT list
  • sortAndTrimProjections(): Applies sort and trims extra columns

Refactored GroupByPlanner::resolveSortOrdinals() and addSort() to use these utilities, reducing code duplication and improving maintainability.

Differential Revision: D96411887

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 13, 2026
@meta-codesync
Copy link

meta-codesync bot commented Mar 13, 2026

@peterenescu has exported this pull request. If you are a Meta employee, you can view the originating Diff in D96411887.

peterenescu added a commit to peterenescu/verax that referenced this pull request Mar 13, 2026
…ebookincubator#1051)

Summary:

Extracts GROUP BY sort handling utilities into reusable functions in ParserUtils.cpp/h:
- `widenProjectionsForSort()`: Matches sort key expressions against projections by pointer identity, widens projection list if needed to include referenced column names not in SELECT list
- `sortAndTrimProjections()`: Applies sort and trims extra columns

Refactored `GroupByPlanner::resolveSortOrdinals()` and `addSort()` to use these utilities, reducing code duplication and improving maintainability.

Differential Revision: D96411887
@meta-codesync meta-codesync bot changed the title refactor(parser): Extract GROUP BY sort utilities to ParserUtils refactor(parser): Extract GROUP BY sort utilities to ParserUtils (#1051) Mar 13, 2026
peterenescu added a commit to peterenescu/verax that referenced this pull request Mar 13, 2026
…ebookincubator#1051)

Summary:

Extracts GROUP BY sort handling utilities into reusable functions in ParserUtils.cpp/h:
- `widenProjectionsForSort()`: Matches sort key expressions against projections by pointer identity, widens projection list if needed to include referenced column names not in SELECT list
- `sortAndTrimProjections()`: Applies sort and trims extra columns

Refactored `GroupByPlanner::resolveSortOrdinals()` and `addSort()` to use these utilities, reducing code duplication and improving maintainability.

Differential Revision: D96411887
…ebookincubator#1051)

Summary:

Extracts GROUP BY sort handling utilities into reusable functions in ParserUtils.cpp/h:
- `widenProjectionsForSort()`: Matches sort key expressions against projections by pointer identity, widens projection list if needed to include referenced column names not in SELECT list
- `sortAndTrimProjections()`: Applies sort and trims extra columns

Refactored `GroupByPlanner::resolveSortOrdinals()` and `addSort()` to use these utilities, reducing code duplication and improving maintainability.

Differential Revision: D96411887
peterenescu added a commit to peterenescu/verax that referenced this pull request Mar 13, 2026
…ebookincubator#1051)

Summary:

Extracts GROUP BY sort handling utilities into reusable functions in ParserUtils.cpp/h:
- `widenProjectionsForSort()`: Matches sort key expressions against projections by pointer identity, widens projection list if needed to include referenced column names not in SELECT list
- `sortAndTrimProjections()`: Applies sort and trims extra columns

Refactored `GroupByPlanner::resolveSortOrdinals()` and `addSort()` to use these utilities, reducing code duplication and improving maintainability.

Differential Revision: D96411887
peterenescu added a commit to peterenescu/verax that referenced this pull request Mar 13, 2026
…ebookincubator#1051)

Summary:

Extracts GROUP BY sort handling utilities into reusable functions in ParserUtils.cpp/h:
- `widenProjectionsForSort()`: Matches sort key expressions against projections by pointer identity, widens projection list if needed to include referenced column names not in SELECT list
- `sortAndTrimProjections()`: Applies sort and trims extra columns

Refactored `GroupByPlanner::resolveSortOrdinals()` and `addSort()` to use these utilities, reducing code duplication and improving maintainability.

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

Labels

CLA Signed This label is managed by the Meta Open Source bot. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant