asubiotto commented on code in PR #7519:
URL: https://github.com/apache/arrow-rs/pull/7519#discussion_r2126443138
##########
arrow-select/src/concat.rs:
##########
@@ -1010,6 +1010,43 @@ mod tests {
assert!((30..40).contains(&values_len), "{values_len}")
}
+ #[test]
+ fn test_primitive_dictionary_merge() {
+ // Same value repeated 5 times.
+ let keys = vec![1; 5];
+ let values = (10..20).collect::<Vec<_>>();
+ let dict = DictionaryArray::new(
+ Int8Array::from(keys.clone()),
+ Arc::new(Int32Array::from(values.clone())),
+ );
+ let other = DictionaryArray::new(
+ Int8Array::from(keys.clone()),
+ Arc::new(Int32Array::from(values.clone())),
+ );
+
+ let result_same_dictionary = concat(&[&dict, &dict]).unwrap();
+ // Verify pointer equality check succeeds, and therefore the
+ // dictionaries are not merged. A single values buffer should be reused
+ // in this case.
+ assert_eq!(
Review Comment:
Good catch, I think I forgot to add this. Added.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]