Skip to content

Commit 1132fb7

Browse files
committed
fix: allow with_values on a compacted dictionary in aggregate spill
Main now disallows DictionaryArray::with_values in clippy.toml. The dictionary was just garbage collected, so it holds no more values than rows.
1 parent 29c6661 commit 1132fb7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • datafusion/physical-plan/src/spill

‎datafusion/physical-plan/src/spill/mod.rs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,11 @@ fn gc_array(array: &ArrayRef, dictionaries: bool) -> Result<(ArrayRef, bool)> {
934934
if !shrunk && !values_mutated {
935935
return Ok((Arc::clone(array), false));
936936
}
937-
Ok((gc.with_values(values), true))
937+
// `gc` holds only the values its rows reference, so there are no more
938+
// than it has rows.
939+
#[expect(clippy::disallowed_methods)]
940+
let compacted = gc.with_values(values);
941+
Ok((compacted, true))
938942
}
939943
DataType::Dictionary(_, _)
940944
if array.as_any_dictionary().values().len() > array.len() =>

0 commit comments

Comments
 (0)