viirya commented on a change in pull request #1507:
URL: https://github.com/apache/arrow-rs/pull/1507#discussion_r840119724



##########
File path: arrow/src/array/array_map.rs
##########
@@ -152,6 +155,44 @@ impl MapArray {
             value_offsets,
         })
     }
+
+    /// Creates map array from provided keys, values and entry_offsets.
+    pub fn new_from_strings<'a>(
+        keys: impl Iterator<Item = &'a str>,
+        values: ArrayData,

Review comment:
       For `new_keys_and_offsets`, the keys and offsets are not 1:1 matched.
   
   For example, in the test, the keys is `vec!["a", "b", "c", "d", "e", "f", 
"g", "h"];` and the offsets are `[0, 3, 6, 8]`. So it represents `[[a, b, c], 
[d, e, f], [g, h]]`.
   
    Otherwise, do you mean ("a", 0), ("b", 0), ("c", 0), ("d", 3), ("e", 3), 
("f", 3), ("g", 3), ("h", 6) as `keys_and_offsets`?




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


Reply via email to