rok commented on code in PR #13901:
URL: https://github.com/apache/arrow/pull/13901#discussion_r1737541940
##########
cpp/src/arrow/array/validate.cc:
##########
@@ -985,10 +985,23 @@ Status ValidateArrayFull(const Array& array) { return
ValidateArrayFull(*array.d
ARROW_EXPORT
Status ValidateUTF8(const ArrayData& data) {
- DCHECK(data.type->id() == Type::STRING || data.type->id() ==
Type::STRING_VIEW ||
- data.type->id() == Type::LARGE_STRING);
- UTF8DataValidator validator{data};
- return VisitTypeInline(*data.type, &validator);
+ if (data.type->id() == Type::EXTENSION) {
+ const auto& storage_type =
+ checked_pointer_cast<ExtensionType>(data.type)->storage_type();
+ DCHECK(storage_type->id() == Type::STRING ||
+ storage_type->id() == Type::STRING_VIEW ||
+ storage_type->id() == Type::LARGE_STRING);
+ auto ext_array_data =
+ std::make_shared<ArrayData>(storage_type, data.length, data.buffers,
+ data.child_data, data.null_count,
data.offset);
+ UTF8DataValidator validator{*ext_array_data};
Review Comment:
Storage type apparently wouldn't be correct.
Simplified this to:
```cpp
const auto& ext_data = std::make_shared<ArrayData>(data);
ext_data->type = storage_type;
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]