edponce edited a comment 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) bc they abort in case of an error, but I performed the following local checks to validate this change. ```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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
