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 2020/12/18 20:13:11 UTC

[GitHub] [arrow] carols10cents commented on a change in pull request #8962: ARROW-10960: [C++] [Flight] Default to empty buffer instead of null

carols10cents commented on a change in pull request #8962:
URL: https://github.com/apache/arrow/pull/8962#discussion_r546068440



##########
File path: cpp/src/arrow/flight/serialization_internal.cc
##########
@@ -374,7 +374,18 @@ grpc::Status FlightDataDeserialize(ByteBuffer* buffer, FlightData* out) {
   buffer->Clear();
 
   // TODO(wesm): Where and when should we verify that the FlightData is not
-  // malformed or missing components?
+  // malformed?
+
+  // Set default values for unspecified FlightData fields
+  if (out->app_metadata == nullptr) {
+    out->app_metadata = std::make_shared<Buffer>(nullptr, 0);
+  }
+  if (out->metadata == nullptr) {
+    out->metadata = std::make_shared<Buffer>(nullptr, 0);
+  }

Review comment:
       Whoops! So much for trying to be overly helpful 😅 Pushed a change so this just handles `body`.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org