Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 4.3k
GH-49689: [R][C++] Parquets do not support list-columns of ordered factors (ordered dictionaries)#49937
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
Uh oh!
There was an error while loading. Please reload this page.
GH-49689: [R][C++] Parquets do not support list-columns of ordered factors (ordered dictionaries) #49937
Changes from all commits
6ff3cc8fe18d9385830751e8554378bbeef29dfbc7ac3db34c8ac6ef09429c4File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -168,17 +168,21 @@ struct DictionaryBuilderCase { | ||
| template <typename ValueType> | ||
| Status CreateFor() { | ||
| using AdaptiveBuilderType = DictionaryBuilder<ValueType>; | ||
| using ExactBuilderType = | ||
| internal::DictionaryBuilderBase<TypeErasedIntBuilder, ValueType>; | ||
| if (dictionary != nullptr) { | ||
| out->reset(new AdaptiveBuilderType(dictionary, pool)); | ||
| out->reset( | ||
| new AdaptiveBuilderType(dictionary, pool, kDefaultBufferAlignment, ordered)); | ||
| } else if (exact_index_type) { | ||
| if (!is_integer(index_type->id())) { | ||
| return Status::TypeError("MakeBuilder: invalid index type ", *index_type); | ||
| } | ||
| out->reset(new internal::DictionaryBuilderBase<TypeErasedIntBuilder, ValueType>( | ||
| index_type, value_type, pool)); | ||
| out->reset(new ExactBuilderType(index_type, value_type, pool, | ||
| kDefaultBufferAlignment, ordered)); | ||
| } else { | ||
| auto start_int_size = index_type->byte_width(); | ||
| out->reset(new AdaptiveBuilderType(start_int_size, value_type, pool)); | ||
| out->reset(new AdaptiveBuilderType(start_int_size, value_type, pool, | ||
| kDefaultBufferAlignment, ordered)); | ||
| } | ||
| return Status::OK(); | ||
| } | ||
| @@ -188,8 +192,9 @@ struct DictionaryBuilderCase { | ||
| MemoryPool* pool; | ||
| const std::shared_ptr<DataType>& index_type; | ||
| const std::shared_ptr<DataType>& value_type; | ||
| const std::shared_ptr<Array>& dictionary; | ||
| std::shared_ptr<Array> dictionary; | ||
MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was updated as without it, we ended up with a dangling reference when | ||
| bool exact_index_type; | ||
| bool ordered; | ||
| std::unique_ptr<ArrayBuilder>* out; | ||
| }; | ||
| @@ -206,6 +211,7 @@ struct MakeBuilderImpl { | ||
| dict_type.value_type(), | ||
| /*dictionary=*/nullptr, | ||
| exact_index_type, | ||
| dict_type.ordered(), | ||
| &out}; | ||
| return visitor.Make(); | ||
| } | ||
| @@ -332,9 +338,13 @@ Status MakeDictionaryBuilder(MemoryPool* pool, const std::shared_ptr<DataType>& | ||
| const std::shared_ptr<Array>& dictionary, | ||
| std::unique_ptr<ArrayBuilder>* out) { | ||
| const auto& dict_type = static_cast<const DictionaryType&>(*type); | ||
| DictionaryBuilderCase visitor = { | ||
| pool, dict_type.index_type(), dict_type.value_type(), | ||
| dictionary, /*exact_index_type=*/false, out}; | ||
| DictionaryBuilderCase visitor = {pool, | ||
| dict_type.index_type(), | ||
| dict_type.value_type(), | ||
| dictionary, | ||
| /*exact_index_type=*/false, | ||
| dict_type.ordered(), | ||
| out}; | ||
| return visitor.Make(); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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 all AI-generated. I roughly understood what it does but am not confident in it, other than having checked it looks relatively idiomatic, and all of these tests except
UnorderedTypeStaysUnorderedfailed before the PR and passed after.