Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-21312

UnsafeRow writeToStream has incorrect offsetInByteArray calculation for non-zero offset

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0, 2.1.0
    • 2.1.2, 2.2.1, 2.3.0
    • SQL
    • None

    Description

      The following code in UnsafeRow has an incorrect offset calculation:

        public void writeToStream(OutputStream out, byte[] writeBuffer) throws IOException {
          if (baseObject instanceof byte[]) {
            int offsetInByteArray = (int) (Platform.BYTE_ARRAY_OFFSET - baseOffset);
      

      which should be:

            int offsetInByteArray = (int) (baseOffset - Platform.BYTE_ARRAY_OFFSET);
      

      Attachments

        Activity

          People

            swale Sumedh Wale
            swale Sumedh Wale
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: