zanmato1984 commented on code in PR #43760:
URL: https://github.com/apache/arrow/pull/43760#discussion_r1734647636


##########
cpp/src/arrow/compute/light_array_internal.cc:
##########
@@ -235,6 +237,7 @@ void ResizableArrayData::Clear(bool release_buffers) {
 
 Status ResizableArrayData::ResizeFixedLengthBuffers(int num_rows_new) {
   ARROW_DCHECK(num_rows_new >= 0);
+  ARROW_DCHECK(data_type_ != nullptr);

Review Comment:
   Why do we need this (and several other similar) check? I think we can assume 
that these functions will always be called after an `Init` call, where 
`data_type_` would be set to a non-null.
   
   Rather we should add such a check in `Init` instead: the first use of passed 
`data_type` in `Init` is:
   
https://github.com/apache/arrow/pull/43760/files/990e9a15042a31fa8e9cfc07cb62da65cd11092e..87b5d061a8fe2c027b29335b07d2c66969688a23#diff-dca2a0b71d9a10c8634649df065d2631cadf93e3a05eefa5b83ae9d55348b63fR219
   will give NPE.



-- 
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]

Reply via email to