Rich-T-kid commented on code in PR #12113:
URL: https://github.com/apache/arrow-rs/pull/12113#discussion_r4503113861


##########
arrow-row/src/lib.rs:
##########
@@ -3387,6 +3456,92 @@ mod tests {
         dictionary_eq(&decoded[0], &expected);
     }
 
+    #[test]
+    fn test_gather_dictionary_byte_values() {

Review Comment:
   I think we can simplify this test, all binary types go through 
`gather_dictionary_byte_values` so just testing the stringArray values is fine



##########
arrow-row/src/lib.rs:
##########
@@ -2293,6 +2296,72 @@ pub fn encode_dictionary_values<K: 
ArrowDictionaryKeyType>(
 
 fn gather_dictionary_values<K: ArrowDictionaryKeyType>(
     array: &DictionaryArray<K>,
+) -> Result<ArrayRef, ArrowError> {
+    let values = array.values();
+    match values.data_type() {
+        DataType::Utf8 => gather_dictionary_byte_values::<K, Utf8Type>(
+            array,
+            values.as_any().downcast_ref::<StringArray>().unwrap(),
+        ),
+        DataType::LargeUtf8 => gather_dictionary_byte_values::<K, 
LargeUtf8Type>(
+            array,
+            values.as_any().downcast_ref::<LargeStringArray>().unwrap(),
+        ),
+        DataType::Binary => gather_dictionary_byte_values::<K, BinaryType>(
+            array,
+            values.as_any().downcast_ref::<BinaryArray>().unwrap(),
+        ),
+        DataType::LargeBinary => gather_dictionary_byte_values::<K, 
LargeBinaryType>(
+            array,
+            values.as_any().downcast_ref::<LargeBinaryArray>().unwrap(),
+        ),
+        _ => gather_dictionary_values_generic(array),
+    }
+}
+
+fn gather_dictionary_byte_values<K: ArrowDictionaryKeyType, T: ByteArrayType>(

Review Comment:
   can we add a small doc comment here



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