EnricoMi commented on code in PR #44279: URL: https://github.com/apache/arrow/pull/44279#discussion_r2079128362
########## 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 + DataType* dict_type = array.type.get(); + if (array.type->id() == Type::EXTENSION) { + dict_type = dynamic_cast<ExtensionType*>(dict_type)->storage_type().get(); + } + return dynamic_cast<DictionaryType*>(dict_type)->index_type()->id(); Review Comment: Sure. -- 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