You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/12/27 00:44:09 UTC
[GitHub] [arrow] edponce commented on pull request #12036: ARROW-15194: [C++] ChunkedArray constructor is missing size and type validation
edponce commented on pull request #12036:
URL: https://github.com/apache/arrow/pull/12036#issuecomment-1001266817
Adding the `nullptr` check to the long-form constructor makes both `ChunkedArrays` constructor and `ChunkedArray::Make` be consistent in terms of allowed parameters and error checking. Constructors are not explicitly tested in [`chunked_array_test.cc`](https://github.com/apache/arrow/blob/master/cpp/src/arrow/chunked_array_test.cc), but I performed the following local checks:
```c++
ArrayVector empty_array{};
auto array = ArrayFromJSON(int8(), "[0, 1, 2]");
// Invalid, failed ARROW_CHECK triggers abort
ChunkedArray chunked_array{empty_array};
// Invalid, failed ARROW_CHECK triggers abort
ChunkedArray chunked_array{empty_array, nullptr};
// Valid
ChunkedArray chunked_array{empty_array, null()};
// Valid
ChunkedArray chunked_array{empty_array, int16()};
// Invalid, failed ARROW_CHECK triggers abort
ChunkedArray chunked_array{{array, array}, nullptr};
// Valid
ChunkedArray chunked_array{{array, array}, int8()};
```
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org