liyafan82 commented on a change in pull request #7544: URL: https://github.com/apache/arrow/pull/7544#discussion_r448166650
########## 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)); + return dictionary_memo->UpdateDictionary(id, combinedDict); + } + + if (dictionary_memo->HasDictionary(id)) { Review comment: Thanks for the good suggestion. I have added the AddOrReplaceDictionary 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: us...@infra.apache.org