jorisvandenbossche commented on code in PR #35036:
URL: https://github.com/apache/arrow/pull/35036#discussion_r1196185132


##########
cpp/src/arrow/array/data.cc:
##########
@@ -422,6 +426,13 @@ void ArraySpan::FillFromScalar(const Scalar& value) {
         this->child_data[i].FillFromScalar(*scalar.value[i]);
       }
     }
+  } else if (type_id == Type::RUN_END_ENCODED) {
+    const auto& scalar = checked_cast<const RunEndEncodedScalar&>(value);
+    this->child_data.resize(2);
+    auto& run_end_type = scalar.run_end_type();
+    auto run_end = MakeScalar(run_end_type, 1).ValueOrDie();
+    this->child_data[0].FillFromScalar(*run_end);

Review Comment:
   Here I am setting a child ArraySpan for the run ends from a newly created 
scalar. Similarly to `SetOffsetsForScalar` for list-like types, I should be 
creating this child array using the scratch space? 
   (the main difference is that here I need to create a child ArraySpan from 
the scratch space, instead of just setting the scratch space to some value and 
assigning it to one of the span's buffers.



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