Hi Bryan,
I've just left some review comments[1], plz take a look and let me know what you think. [1] https://github.com/apache/iotdb/pull/17843#pullrequestreview-4454524884 Best regards, ----------------------- Yuan Tian On Fri, Jun 5, 2026 at 4:31 PM Bryan Yang <[email protected]> wrote: > Hi Apache IoTDB > > *PR:*https://github.com/apache/iotdb/pull/17843 > > Thanks for pointing out the two correctness issues in PR apache/iotdb#17843 > <https://github.com/apache/iotdb/pull/17843>. > > I have fixed both problems: > > 1. > > GROUP BY alias resolution now only treats fields from the current query > source scope as input columns, so correlated outer-scope columns no > longer > block SELECT alias resolution in the inner query. > 2. > > ORDER BY references to SELECT aliases now reuse the SELECT output field > instead of re-analyzing the aliased expression. This avoids planning a > SELECT window function again as an ORDER BY window function. > > I also added regression tests for both cases, including the correlated > subquery case and ORDER BY on a window function alias. > > Verification passed with: > ./mvnw test -pl iotdb-core/datanode -am -Dtest=SelectAliasReuseTest > -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false -DskipITs > > Best, > Bryan Yang(杨易达) >
