liyafan82 commented on a change in pull request #7544:
URL: https://github.com/apache/arrow/pull/7544#discussion_r448166294
##########
File path: cpp/src/arrow/ipc/reader.cc
##########
@@ -684,7 +685,19 @@ Status ReadDictionary(const Buffer& metadata,
DictionaryMemo* dictionary_memo,
return Status::Invalid("Dictionary record batch must only contain one
field");
}
auto dictionary = batch->column(0);
- return dictionary_memo->AddDictionary(id, dictionary);
+ if (dictionary_batch->isDelta()) {
+ std::shared_ptr<Array> originalDict, combinedDict;
+ RETURN_NOT_OK(dictionary_memo->GetDictionary(id, &originalDict));
+ ArrayVector dictsToCombine{originalDict, dictionary};
+ ARROW_ASSIGN_OR_RAISE(combinedDict, Concatenate(dictsToCombine,
options.memory_pool));
Review comment:
Good suggestion. I have extracted it into the AddDirectoryDelta method.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]