Rachelint commented on code in PR #16136: URL: https://github.com/apache/datafusion/pull/16136#discussion_r2101922845
########## datafusion/physical-plan/src/aggregates/group_values/single_group_by/primitive/large_primitive.rs: ########## @@ -0,0 +1,139 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +use crate::aggregates::group_values::single_group_by::primitive::{ + emit_internal, HashValue, +}; +use crate::aggregates::group_values::GroupValues; +use ahash::RandomState; +use arrow::array::{ + cast::AsArray, ArrayRef, ArrowNativeTypeOp, ArrowPrimitiveType, PrimitiveArray, +}; +use arrow::datatypes::DataType; +use arrow::record_batch::RecordBatch; +use datafusion_common::Result; +use datafusion_execution::memory_pool::proxy::VecAllocExt; +use datafusion_expr::EmitTo; +use hashbrown::hash_table::HashTable; +use std::mem::size_of; + +/// A [`GroupValues`] storing a single column of large primitive values (bits > 64) +/// +/// This specialization is significantly faster than using the more general +/// purpose `Row`s format +pub struct GroupValuesLargePrimitive<T: ArrowPrimitiveType> { Review Comment: > Hm I think the storage of a value inside `HashTable` will not be very different from `Vec` besides being inline? I think for the `value <= 64bits`, storing it inside `HashTable`: - Can decrease the size of `HashTable` comparing to store their hashes? - And when probing and rehashing of `HashTable` totally in-place, and eliminting the random read to a the outside `Vec`? -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org