You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@iotdb.apache.org by Bryan Yang <y5...@gmail.com> on 2026/06/09 07:16:02 UTC
[PR 17843] Fix table SELECT alias reuse in GROUP BY and ORDER BY
Hi Apache IoTDB,
Thanks for the careful review.
I have pushed updates to PR #17843:
https://github.com/apache/iotdb/pull/17843
The latest changes address the review comments:
- Simplified SelectAlias so it only stores the canonical alias name and
output position. For resolveGroupBySelectAlias, the resolved expression is
now picked from outputExpressions by position, similar to GROUP BY ordinal
handling.
- Fixed SELECT alias resolution for GROUP BY ROLLUP / CUBE / GROUPING SETS,
including resolved-expression mapping for grouping sets.
- Restored ORDER BY analysis to use orderByScope by default, while
preserving explicit SELECT alias precedence.
- Added/updated analyzer unit tests in SelectAliasReuseTest.
- Added table-model integration tests in the existing
IoTDBTableAggregationIT class.
I also verified the changes locally with:
- SelectAliasReuseTest
- IoTDBTableAggregationIT#selectAliasInGroupByAndOrderByTest
- spotless for datanode and integration-test
One note: ROLLUP/CUBE currently still hit the existing execution-layer
limitation “Only support one groupingSet now”, so the IT covers that they
pass alias analysis and reach the current execution limitation, while the
analyzer behavior is covered by UTs.
Best,
Bryan Yang(杨易达)
Re: [PR 17843] Fix table SELECT alias reuse in GROUP BY and ORDER BY
Posted by Yuan Tian <ja...@gmail.com>.
Hi Bryan,
Still one more question in
https://github.com/apache/iotdb/pull/17843#pullrequestreview-4457083200
Best regards,
-------------------
Yuan Tian
On Tue, Jun 9, 2026 at 3:16 PM Bryan Yang <y5...@gmail.com> wrote:
> Hi Apache IoTDB,
>
> Thanks for the careful review.
>
> I have pushed updates to PR #17843:
> https://github.com/apache/iotdb/pull/17843
>
> The latest changes address the review comments:
>
> - Simplified SelectAlias so it only stores the canonical alias name and
> output position. For resolveGroupBySelectAlias, the resolved expression is
> now picked from outputExpressions by position, similar to GROUP BY ordinal
> handling.
> - Fixed SELECT alias resolution for GROUP BY ROLLUP / CUBE / GROUPING SETS,
> including resolved-expression mapping for grouping sets.
> - Restored ORDER BY analysis to use orderByScope by default, while
> preserving explicit SELECT alias precedence.
> - Added/updated analyzer unit tests in SelectAliasReuseTest.
> - Added table-model integration tests in the existing
> IoTDBTableAggregationIT class.
>
> I also verified the changes locally with:
> - SelectAliasReuseTest
> - IoTDBTableAggregationIT#selectAliasInGroupByAndOrderByTest
> - spotless for datanode and integration-test
>
> One note: ROLLUP/CUBE currently still hit the existing execution-layer
> limitation “Only support one groupingSet now”, so the IT covers that they
> pass alias analysis and reach the current execution limitation, while the
> analyzer behavior is covered by UTs.
>
> Best,
> Bryan Yang(杨易达)
>