alamb commented on code in PR #7519: URL: https://github.com/apache/arrow-rs/pull/7519#discussion_r2126305949
########## 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: Maybe I am missing it, but this test only verifies that there are 2 values in the dictionary, not that the pointers are the same I suppose before this PR the number of values in the result dictionary would be 4 so it does cover the code, but I found the comment misleading -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org