kosiew commented on code in PR #19285: URL: https://github.com/apache/datafusion/pull/19285#discussion_r2635358919
########## datafusion/physical-plan/src/aggregates/topk/heap.rs: ########## @@ -15,10 +15,22 @@ // specific language governing permissions and limitations // under the License. -//! A custom binary heap implementation for performant top K aggregation +//! A custom binary heap implementation for performant top K aggregation. +//! +//! This module uses the **Strategy pattern** with runtime polymorphism: the `new_heap` +//! factory function selects an appropriate heap implementation (`PrimitiveHeap` or `StringHeap`) +//! based on the Arrow data type. All implementations conform to the `ArrowHeap` trait, +//! enabling dynamic dispatch while keeping the interface uniform. +//! +//! Supported value types include Arrow primitives (integers, floats, decimals, intervals) +//! and UTF-8 strings (`Utf8`, `LargeUtf8`, `Utf8View`) using lexicographic ordering. +//! +//! Note: String values are owned/cloned on insertion. For very high cardinality or large Review Comment: I'll remove it. -- 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]
