From 886666b3bc51f0fe02107125d1d18468be1c5e40 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Thu, 11 Jan 2024 07:18:43 -0500 Subject: [PATCH] fmt --- .../src/aggregates/group_values/binary.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/datafusion/physical-plan/src/aggregates/group_values/binary.rs b/datafusion/physical-plan/src/aggregates/group_values/binary.rs index 763e05b102dcb..d09d167742619 100644 --- a/datafusion/physical-plan/src/aggregates/group_values/binary.rs +++ b/datafusion/physical-plan/src/aggregates/group_values/binary.rs @@ -15,17 +15,19 @@ // specific language governing permissions and limitations // under the License. -use std::sync::Arc; use crate::aggregates::group_values::GroupValues; use ahash::RandomState; use arrow_array::{Array, ArrayRef, RecordBatch, StringArray}; -use arrow_buffer::{BooleanBufferBuilder, BufferBuilder, NullBuffer, OffsetBuffer, ScalarBuffer}; +use arrow_buffer::{ + BooleanBufferBuilder, BufferBuilder, NullBuffer, OffsetBuffer, ScalarBuffer, +}; use arrow_schema::DataType; use datafusion_common::cast::as_string_array; use datafusion_common::hash_utils::create_hashes; use datafusion_execution::memory_pool::proxy::{RawTableAllocExt, VecAllocExt}; use datafusion_physical_expr::EmitTo; use hashbrown::raw::RawTable; +use std::sync::Arc; /// A [`GroupValues`] storing single column of Utf8/LargeUtf8/Binary/LargeBinary values /// @@ -198,7 +200,7 @@ impl GroupValues for GroupValuesBinary { fn emit(&mut self, emit_to: EmitTo) -> datafusion_common::Result> { match emit_to { - EmitTo::All => {}, + EmitTo::All => {} EmitTo::First(n) => todo!(), }; @@ -215,7 +217,7 @@ impl GroupValues for GroupValuesBinary { self.map.drain().for_each(|group_entry| { // since we created each group sequentially, // we know the offsets will be sequential as well - offsets[group_entry.group_idx+1] = group_entry.len as i32 + offsets[group_entry.group_idx + 1] = group_entry.len as i32 }); // transform lengths to offsets. For example lengths of `[1, 2, 3]` becomes // offsets of `[0, 1, 3, 6]` @@ -239,11 +241,7 @@ impl GroupValues for GroupValuesBinary { // TODO update memory accounting memory let offsets = ScalarBuffer::from(offsets); - let string_array = StringArray::new( - OffsetBuffer::new(offsets), - values, - nulls, - ); + let string_array = StringArray::new(OffsetBuffer::new(offsets), values, nulls); Ok(vec![Arc::new(string_array)]) }