kou commented on code in PR #37872:
URL: https://github.com/apache/arrow/pull/37872#discussion_r1337983372


##########
cpp/src/arrow/ipc/reader.cc:
##########
@@ -208,6 +208,7 @@ class ArrayLoader {
   Status LoadType(const DataType& type) { return VisitTypeInline(type, this); }
 
   Status Load(const Field* field, ArrayData* out) {
+    DCHECK_NE(nullptr, out);

Review Comment:
   Ah, I assumed that we want to add `DCHECK` to where `out_` is used something 
like:
   
   ```diff
   diff --git a/cpp/src/arrow/ipc/reader.cc b/cpp/src/arrow/ipc/reader.cc
   index 0def0e036..8b99c8321 100644
   --- a/cpp/src/arrow/ipc/reader.cc
   +++ b/cpp/src/arrow/ipc/reader.cc
   @@ -276,6 +276,7 @@ class ArrayLoader {
    
      template <typename TYPE>
      Status LoadPrimitive(Type::type type_id) {
   +    DCHECK_NE(out_, nullptr);
        out_->buffers.resize(2);
    
        RETURN_NOT_OK(LoadCommon(type_id));
   ```
   
   Do we need to add these `DCHECK`s?



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