Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-10960

[C++][FlightRPC] Missing protobuf data_body should result in default value of empty bytes, not null

    XMLWordPrintableJSON

Details

    Description

      Problem

      ProtoBuf proto3 specifies that if a message does not contain a particular singular element, the field should get the default value. However, when the C++ flight-test-integration-server gets a DoPut request with a FlightData message for a record batch containing no items, and the FlightData is missing the data_body field, the server responds with an error "Expected body in IPC message of type record batch".

      What happens

      If I run the C++ flight-test-integration-server and the C++ flight-test-integration-client with the generated_null_trivial test case, the test passes and I see the protobuf in wireshark shown in the cpp-client-empty-data-body.png attachment.

      Note the data_body field is present but has no value.

      If I run the Rust flight-test-integration-client that I'm working on developing, it does not send the data_body field at all if there are no bytes to send. I see the protobuf in wireshark shown in the rust-client-missing-data-body.png attachment.

      Note the data_body field is not present.

      The C++ server then returns the error message "Expected body in IPC message of type record batch", which comes from this check for message body called in ReadNext of the record batch stream reader.

      What I expect to happen

      Instead of returning an error message because of a null pointer, the Message should get the default value of empty bytes.

      Attachments

        1. cpp-client-empty-data-body.png
          67 kB
          Carol Nichols
        2. rust-client-missing-data-body.png
          52 kB
          Carol Nichols

        Issue Links

          Activity

            People

              carols10cents Carol Nichols
              carols10cents Carol Nichols
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 10m
                  2h 10m