alamb opened a new pull request, #27211:
URL: https://github.com/apache/datafusion/pull/27211

   ## Which issue does this PR close?
   
   - N/A (documentation only)
   
   ## Rationale for this change
   
   While reading 
https://pivotlake.io/blog/know-your-limit-faster-top-k-aggregation/ I went 
looking for what the equivalent optimization is called in DataFusion and how to 
tell from a plan whether it applied. The information is spread across the 
`aggregates` module docs, the config docs, and the metrics docs, and the 
`TopKAggregation` optimizer rule itself only said it "passes a `limit` hint to 
aggregations", which does not explain that the aggregate switches to a 
different implementation (`GroupedTopKAggregateStream`).
   
   ## What changes are included in this PR?
   
   Expands the rustdoc on the `TopKAggregation` physical optimizer rule to:
   
   - Explain that it switches the `AggregateExec` to the specialized Grouped 
TopK aggregation implementation (bounded priority map instead of a hash table)
   - Show an example query and the plan shape, and point out the `lim=[N]` 
marker in `EXPLAIN` output and the `topk_maintenance_time` metric in `EXPLAIN 
ANALYZE`
   - Summarize the eligible query shapes and link to 
`AggregateExec::try_optimize_topk`, the `aggregates` module docs, and the 
`datafusion.optimizer.enable_topk_aggregation` setting
   
   Also fixes the stale `LimitAggregation` name in the constructor doc comment 
and the stale `aggregate.slt` test pointer (the tests are in 
`aggregates_topk.slt`).
   
   ## What is the testing strategy for this PR?
   
   Documentation only. Verified the intra-doc links resolve with 
`RUSTDOCFLAGS="-D warnings" cargo doc --no-deps -p 
datafusion-physical-optimizer`.
   
   ## Are there any user-facing changes?
   
   No, documentation only.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to