-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-7372: [C++] Allow creating dictionary array from simple JSON #8309
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
Conversation
bkietz
left a comment
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.
Very neatly done, just a few nits
cpp/src/arrow/ipc/json_simple.cc
Outdated
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.
I think the converters would be simplified by passing the BuilderType as the template parameter directly, rather than passing a trait with which to look it up. value_type need not be a trait member at all, I think:
inline const std::shared_ptr<DataType>& value_type(const std::shared_ptr<DataType>& type) {
if (type->id() != Type::DICTIONARY) return type;
return checked_cast<const DictionaryType&>(*type).value_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.
Ah, right, thank you.
cpp/src/arrow/array/builder_dict.h
Outdated
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.
This is probably fine. Nit: I'd prefer to get the FixedSizeBinaryType inside the converter and use it's byte_width() over propagating the property to builders
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.
The property is already exposed in FixedSizeBinaryBuilder.
Simple value types are supported: integers, string-like, decimal
6205857 to
b31a8fb
Compare
|
Thanks for the suggestions. I'm going to merge when CI is green. |
Simple value types are supported: integers, string-like, decimal