From cae76fd0743d48816ffbb03caa2fe1d6e30630c6 Mon Sep 17 00:00:00 2001 From: Andrew Gazelka Date: Fri, 4 Oct 2024 16:05:18 -0700 Subject: [PATCH] improve comment --- src/daft-core/src/array/ops/list.rs | 7 ++++++- src/daft-schema/src/dtype.rs | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/daft-core/src/array/ops/list.rs b/src/daft-core/src/array/ops/list.rs index 068cd681bf..2e8d969904 100644 --- a/src/daft-core/src/array/ops/list.rs +++ b/src/daft-core/src/array/ops/list.rs @@ -318,7 +318,12 @@ impl ListArray { } } - // indexmap so ordered + // IndexMap maintains insertion order, so we iterate over its values + // in the same order that elements were added. This ensures that + // the count_array values correspond to the same order in which + // the include_mask was set earlier in the loop. Each 'true' in + // include_mask represents a unique key, and its corresponding + // count is now added to count_array in the same sequence. for v in map.values() { count_array.push(*v); } diff --git a/src/daft-schema/src/dtype.rs b/src/daft-schema/src/dtype.rs index af53aefcf3..1da8adc066 100644 --- a/src/daft-schema/src/dtype.rs +++ b/src/daft-schema/src/dtype.rs @@ -257,7 +257,6 @@ impl DataType { arrow2::datatypes::Field::new("value", value.to_arrow()?, true), ]); - // entries let struct_field = arrow2::datatypes::Field::new("entries", struct_type.clone(), true);