eddyxu opened a new issue, #3837:
URL: https://github.com/apache/arrow-rs/issues/3837

   **Describe the bug**
   <!--
   A clear and concise description of what the bug is.
   -->
   
   I was trying to concatenate a few DictionaryArrays using 
`arrow_select::concat::concat`. While the each Dictionary Array shares the same 
value strings. The resulted array however have all values from each 
DictionaryArray copied (duplicated) in the final output. 
   
   **To Reproduce**
   <!--
   Steps to reproduce the behavior:
   -->
   
   ```rust
   let arrs: Vec<Arc<DictionaryArray<Int32Type>>> = (0..10).map(|v| {
             let mut dict_builder = StringDictionaryBuilder::<Int32Type>::new();
             dict_builder.append_null();
             dict_builder.append("a").unwrap();
             dict_builder.append("b").unwrap();
             dict_builder.append("c").unwrap();
             Arc::new(dict_builder.finish())
       }).collect();
       let mut arrays: Vec<&dyn Array> = vec![];
       for b in arrs.iter() {
           arrays.push(b.as_ref());
       }
       let b = concat(arrays.as_slice()).unwrap();
       println!("Batch is: {:?}", b);
   ```
   
   Output
   ```
   Batch is: DictionaryArray {keys: PrimitiveArray<Int32>
   [
     null,
     0,
     1,
     2,
     null,
     3,
     4,
     5,
   ] values: StringArray
   [
     "a",
     "b",
     "c",
     "a",
     "b",
     "c",
   ]}
   
   ```
   **Expected behavior**
   <!--
   A clear and concise description of what you expected to happen.
   -->
   
   I'd expect the output will be
   
   ```
   DictionaryArray {keys: PrimitiveArray<Int32>
   [
     null,
     0,
     1,
     2,
     null,
     0,
     1,
      2
   ] values: StringArray
   [
     "a",
     "b",
     "c",
   ]}
   ```
   
   **Additional context**
   <!--
   Add any other context about the problem here.
   -->
   
   N/A


-- 
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]

Reply via email to