tustvold commented on code in PR #4625:
URL: https://github.com/apache/arrow-rs/pull/4625#discussion_r1282668460


##########
arrow-row/src/lib.rs:
##########
@@ -2442,4 +2442,25 @@ mod tests {
             assert_eq!(&back[0], &array);
         }
     }
+
+    #[test]
+    fn test_append_codec_dictionary_binary() {
+        use DataType::*;
+        // Dictionary RowConverter
+        let mut converter = RowConverter::new(vec![SortField::new(Dictionary(
+            Box::new(Int8),
+            Box::new(Binary),
+        ))])
+        .unwrap();
+        let mut rows = converter.empty_rows(3, 128);
+
+        let keys = Int8Array::from_iter_values([0, 0, 1, 2]);
+        let values = BinaryArray::from(vec![None, Some("a".as_bytes()), 
Some(b"b")]);
+        let dict_array = DictionaryArray::new(keys, Arc::new(values));
+
+        rows.clear();
+        let array = Arc::new(dict_array) as ArrayRef;
+        converter.append(&mut rows, &[array.clone()]).unwrap();
+        converter.convert_rows(&rows).unwrap();

Review Comment:
   ```suggestion
           let back = converter.convert_rows(&rows).unwrap();
           assert_eq!(back.as_ref(), array):
   ```
   



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