JackieTien97 opened a new pull request, #16696:
URL: https://github.com/apache/iotdb/pull/16696

   This pull request introduces improvements to query planning and 
optimization, particularly around the handling of limit and offset pushdown in 
table scan nodes. The changes ensure that limit and offset are not incorrectly 
pushed down to aggregation table scan nodes, add appropriate error handling, 
and introduce a new test for query ordering and limiting. The most important 
changes are grouped below:
   
   ### Query Planning and Optimization
   
   * Updated logic in `TableDistributedPlanGenerator` and 
`PushDownOffsetIntoTableScan` to prevent limit and offset pushdown to 
`AggregationTableScanNode`, ensuring these operations are only applied to 
appropriate node types. 
[[1]](diffhunk://#diff-de445b6db94b8a5d9d6a0c2d85f3a39a0be406f366dd17925b849755d9c2ba44L426-R426)
 
[[2]](diffhunk://#diff-2394c9bebad56a910121fc4939b65416d7524560736169cc6a456eb570e63968L56-R58)
   * Added explicit error handling in `AggregationTableScanNode` by overriding 
`setPushDownLimit` and `setPushDownOffset` to throw exceptions if called, 
clarifying correct usage and preventing unintended behavior.
   * Updated the documentation in `PushLimitOffsetIntoTableScan` to clarify 
that the optimization phase is for logical plan planning, not distributed plan 
planning.
   
   ### Testing
   
   * Added a new test `orderByLimitTest` in `IoTDBTableAggregationIT.java` to 
verify correct behavior for queries using `ORDER BY` and `LIMIT` with groupings.
   
   ### Code Maintenance
   
   * Added import for `AggregationTableScanNode` in 
`PushDownOffsetIntoTableScan.java` to support new logic.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to