thisisnic commented on code in PR #46675:
URL: https://github.com/apache/arrow/pull/46675#discussion_r2153237651
##########
cpp/src/arrow/array/util.cc:
##########
@@ -829,7 +829,17 @@ class RepeatedArrayFactory {
}
Status Visit(const ExtensionType& type) {
- return Status::NotImplemented("construction from scalar of type ",
*scalar_.type);
+ // Retrieve the underlying storage scalar from the ExtensionScalar
+ const auto& ext_scalar = checked_cast<const ExtensionScalar&>(scalar_);
+ const auto& storage_scalar = ext_scalar.value;
+
+ // Create an array from the storage scalar
+ ARROW_ASSIGN_OR_RAISE(auto storage_array,
+ MakeArrayFromScalar(*storage_scalar, length_,
pool_));
+
+ // Wrap the storage array in the ExtensionType
+ out_ = type.MakeArray(storage_array->data());
Review Comment:
Nice, thanks for the review!
--
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]