bkietz commented on code in PR #38504:
URL: https://github.com/apache/arrow/pull/38504#discussion_r1392930361


##########
cpp/src/arrow/array/util.cc:
##########
@@ -669,11 +671,27 @@ class RepeatedArrayFactory {
   enable_if_base_binary<T, Status> Visit(const T&) {
     const std::shared_ptr<Buffer>& value = scalar<T>().value;
     std::shared_ptr<Buffer> values_buffer, offsets_buffer;
-    RETURN_NOT_OK(CreateBufferOf(value->data(), value->size(), 
&values_buffer));
     auto size = static_cast<typename T::offset_type>(value->size());
+
+    typename T::offset_type length_casted;
+    if (length_ > std::numeric_limits<typename T::offset_type>::max()) {

Review Comment:
   This check is not correct; please remove it. We only need to check whether 
`(length of repeated string) * (number of repeats)` can be represented as an 
offset, and I think it'd be better for that check to reside in 
CreateOffsetsBuffer (since then it will also be applied to list types)



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

Reply via email to