viirya commented on code in PR #2042:
URL: https://github.com/apache/arrow-rs/pull/2042#discussion_r918596197
##########
arrow/src/datatypes/ffi.rs:
##########
@@ -404,4 +411,26 @@ mod tests {
assert!(result.is_err());
Ok(())
}
+
+ #[test]
+ fn test_map_keys_sorted() {
+ let keys = Field::new("keys", DataType::Int32, false);
+ let values = Field::new("values", DataType::UInt32, false);
+ let entry_struct = DataType::Struct(vec![keys, values]);
+
+ // Construct a map array from the above two
+ let map_data_type =
+ DataType::Map(Box::new(Field::new("entries", entry_struct, true)),
false);
+
+ let flags = Flags::MAP_KEYS_SORTED;
+
+ let arrow_schema = FFI_ArrowSchema::try_from(map_data_type)
+ .unwrap()
+ .with_name("map")
+ .unwrap()
+ .with_flags(flags)
Review Comment:
Oh, it is missed on setting `MAP_KEYS_SORTED` in `try_from`. Good catch!
--
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]