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

ArrowBuf#setBytes(int, ByteBuffer) doesn't check the byte buffer's endianness

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.15.1
    • 1.0.0
    • Java

    Description

      https://github.com/apache/arrow/blob/c9c5f5f2e8e8f5db4141d06b6e1841f0a55d905a/java/memory/src/main/java/org/apache/arrow/memory/ArrowBuf.java#L832

      This should check/set the buffer's endianness. This came up while debugging an issue in Flight; PutResult#fromProtocol asks Protobuf for the byte buffers that underlie a ByteString, but if the implementation is LiteralByteString, Protobuf has no buffers. So it wraps the underlying byte[], and of course the default endianness is BIG_ENDIAN.

      https://github.com/apache/arrow/blob/c9c5f5f2e8e8f5db4141d06b6e1841f0a55d905a/java/flight/flight-core/src/main/java/org/apache/arrow/flight/PutResult.java#L81

      https://github.com/protocolbuffers/protobuf/blob/2b7b7f7f72e3617191972fbafb298cf7ec31e95e/java/core/src/main/java/com/google/protobuf/ByteString.java#L1371

      Attachments

        Issue Links

          Activity

            People

              lidavidm David Li
              lidavidm David Li
              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 - 1h 50m
                  1h 50m