amoeba commented on code in PR #46675:
URL: https://github.com/apache/arrow/pull/46675#discussion_r2151312361


##########
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_));

Review Comment:
   You could simplify this if you like:
   
   ```suggestion
       // Retrieve the underlying storage scalar from the ExtensionScalar
       const auto& value = checked_cast<const ExtensionScalar&>(scalar_).value;
   
       // Create an array from the storage scalar
       ARROW_ASSIGN_OR_RAISE(auto storage_array,
                             MakeArrayFromScalar(*value, length_, pool_));
   ```



-- 
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

Reply via email to