bkietz commented on code in PR #46660:
URL: https://github.com/apache/arrow/pull/46660#discussion_r2127160724
##########
cpp/src/arrow/c/bridge.cc:
##########
@@ -586,8 +586,12 @@ struct ArrayExporter {
++buffers_begin;
}
+ Type::type storage_id =
+ data->type->id() == Type::EXTENSION
+ ? (checked_cast<const
ExtensionType&>(*data->type).storage_type()->id())
+ : data->type->id();
bool need_variadic_buffer_sizes =
- data->type->id() == Type::BINARY_VIEW || data->type->id() ==
Type::STRING_VIEW;
+ storage_id == Type::BINARY_VIEW || storage_id == Type::STRING_VIEW;
Review Comment:
There's a special accessor for this
https://github.com/apache/arrow/blob/219d207f97152a5017cc61c0f925dc4387adc6f7/cpp/src/arrow/type.h#L184
```suggestion
data->type->storage_id() == Type::BINARY_VIEW || storage_id ==
Type::STRING_VIEW;
```
##########
cpp/src/arrow/testing/extension_type.h:
##########
@@ -132,6 +132,23 @@ class ARROW_TESTING_EXPORT DictExtensionType : public
ExtensionType {
std::string Serialize() const override { return "dict-extension-serialized";
}
};
+class ARROW_TESTING_EXPORT BinaryViewExtensionType : public ExtensionType {
+ public:
+ BinaryViewExtensionType() : ExtensionType(binary_view()) {}
+
+ std::string extension_name() const override { return "binary_view"; }
+
+ bool ExtensionEquals(const ExtensionType& other) const override;
+
+ std::shared_ptr<Array> MakeArray(std::shared_ptr<ArrayData> data) const
override;
+
+ Result<std::shared_ptr<DataType>> Deserialize(
+ std::shared_ptr<DataType> storage_type,
+ const std::string& serialized) const override;
+
+ std::string Serialize() const override { return "binary_view_serializeds"; }
Review Comment:
typo?
```suggestion
std::string Serialize() const override { return "binary_view_serialized"; }
```
--
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]