felipecrv commented on code in PR #35036:
URL: https://github.com/apache/arrow/pull/35036#discussion_r1196469343
##########
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:
> it feels a bit complicated though
It's faster than going through the switch of `MakeScalar`, so let's go with
your new solution.
--
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]