pitrou commented on a change in pull request #10817:
URL: https://github.com/apache/arrow/pull/10817#discussion_r678452118
##########
File path: cpp/src/arrow/array/array_base.cc
##########
@@ -103,26 +103,28 @@ struct ScalarFromArraySlotImpl {
}
Status Visit(const SparseUnionArray& a) {
+ const auto type_code = a.type_code(index_);
// child array which stores the actual value
- auto arr = a.field(a.child_id(index_));
+ const auto arr = a.field(a.child_id(index_));
// no need to adjust the index
ARROW_ASSIGN_OR_RAISE(auto value, arr->GetScalar(index_));
if (value->is_valid) {
- out_ = std::shared_ptr<Scalar>(new SparseUnionScalar(value, a.type()));
+ out_ = std::shared_ptr<Scalar>(new SparseUnionScalar(value, type_code,
a.type()));
} else {
out_ = MakeNullScalar(a.type());
Review comment:
You're right, will do.
--
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]