lidavidm commented on code in PR #44279: URL: https://github.com/apache/arrow/pull/44279#discussion_r1955591342
########## cpp/src/arrow/util/align_util.cc: ########## @@ -44,9 +47,13 @@ namespace { Type::type GetTypeForBuffers(const ArrayData& array) { Type::type type_id = array.type->storage_id(); if (type_id == Type::DICTIONARY) { - return ::arrow::internal::checked_pointer_cast<DictionaryType>(array.type) - ->index_type() - ->id(); + // return index type id, provided by the DictionaryType array.type or + // array.type->storage_type() if array.type is an ExtensionType + std::shared_ptr<DataType> dict_type = array.type; Review Comment: ```suggestion const std::shared_ptr<DataType>& dict_type = array.type; ``` can we get rid of the extra shared pointer copy here? -- 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. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org