AlvinJ15 commented on code in PR #13009:
URL: https://github.com/apache/arrow/pull/13009#discussion_r865026443
##########
cpp/src/arrow/stl_iterator.h:
##########
@@ -59,11 +62,12 @@ class ArrayIterator {
// Value access
value_type operator*() const {
- return array_->IsNull(index_) ? value_type{} : array_->GetView(index_);
+ return !array_ || array_->IsNull(index_) ? value_type{} :
array_->GetView(index_);
Review Comment:
When a `ChunkedArray` is empty, I initialize an `ArrayIterator` with the
empty constructor which initialize the `array_` with a `NULLPTR`, and this
extra condition is more feasible/short than adding more conditions on
ChunkedArrayIterator for validate multiple cases.
--
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]