-
Notifications
You must be signed in to change notification settings - Fork 839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support MapType in FFI #2042
Support MapType in FFI #2042
Conversation
cc @sunchao |
// Variable-sized binaries: have two buffers. | ||
// "small": first buffer is i32, second is in bytes | ||
(DataType::Utf8, 1) | (DataType::Binary, 1) | (DataType::List(_), 1) => size_of::<i32>() * 8, | ||
(DataType::Utf8, 2) | (DataType::Binary, 2) | (DataType::List(_), 2) => size_of::<u8>() * 8, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to Arrow spec, variable-size list has only one i32 buffer (except for null buffer). This was incorrect. Although we actually iterator array data's buffers so it won't hit issue, it is better to correct it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
arrow/src/datatypes/ffi.rs
Outdated
.unwrap() | ||
.with_name("map") | ||
.unwrap() | ||
.with_flags(flags) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we have to set flags here? shouldn't try_from
already set it from the input type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, it is missed on setting MAP_KEYS_SORTED
in try_from
. Good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DICTIONARY_ORDERED
is also not set too. I will fix it in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea to implement that we'll need to add the property to the dictionary type first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (pending CI)
Thanks @sunchao @HaoYang670 |
Which issue does this PR close?
Closes #2037.
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?