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


##########
arrow-flight/src/utils.rs:
##########
@@ -49,7 +50,7 @@ pub fn flight_data_from_arrow_batch(
 pub fn flight_data_to_arrow_batch(
     data: &FlightData,
     schema: SchemaRef,
-    dictionaries_by_field: &[Option<ArrayRef>],
+    dictionaries_by_field: &HashMap<i64, ArrayRef>,

Review Comment:
   I think this should be renamed to dictionaries_by_id, here and in all the 
other places?



##########
arrow/src/ipc/reader.rs:
##########
@@ -173,7 +174,9 @@ fn create_array(
                 .iter()
                 .map(|buf| read_buffer(buf, data))
                 .collect();
-            let value_array = dictionaries[node_index].clone().unwrap();
+
+            let value_array =
+                dictionaries.get(&field.dict_id().unwrap()).unwrap().clone();

Review Comment:
   We could maybe return an error 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