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

UnsafeRow writeToStream has incorrect offsetInByteArray calculation for non-zero offset

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0, 2.1.0
    • Fix Version/s: 2.1.2, 2.2.1, 2.3.0
    • Component/s: SQL
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: