Skip to content

Commit 6be2499

Browse files
committed
fix: use is_cached for Weak dictionary cache after merge
Upstream #25652 added Arc::ptr_eq checks against cached_values, which this branch changed to Option<Weak<dyn Array>>. Use the existing is_cached helper instead.
1 parent 2127ab1 commit 6be2499

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

  • datafusion/physical-plan/src/aggregates/group_values/multi_group_by

‎datafusion/physical-plan/src/aggregates/group_values/multi_group_by/dictionary.rs‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,7 @@ impl<K: ArrowDictionaryKeyType + Send + Sync> GroupColumn
362362
let dict_keys = dict.keys();
363363
let dict_values = dict.values();
364364

365-
let cached = self
366-
.cached_values
367-
.as_ref()
368-
.is_some_and(|c| Arc::ptr_eq(c, dict_values));
365+
let cached = self.is_cached(dict_values);
369366
if !cached && rhs_rows.len() < dict_values.len() {
370367
self.equal_to_per_row(
371368
lhs_rows,
@@ -1196,9 +1193,7 @@ mod tests {
11961193
col.vectorized_equal_to(&[group_a], &only_a, &[0], &mut buf);
11971194
assert_eq!(bool_vec(&buf), vec![true]);
11981195
assert!(
1199-
col.cached_values
1200-
.as_ref()
1201-
.is_some_and(|c| Arc::ptr_eq(c, &old_values)),
1196+
col.is_cached(&old_values),
12021197
"fallback must leave the cache on the previous values array"
12031198
);
12041199
}

0 commit comments

Comments
 (0)