You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Yang Jie (Jira)" <ji...@apache.org> on 2023/04/13 08:17:00 UTC

[jira] [Created] (SPARK-43121) Use `BytesWritable.copyBytes` instead of manual copy in `HiveInspectors`

Yang Jie created SPARK-43121:
--------------------------------

             Summary: Use `BytesWritable.copyBytes` instead of manual copy in `HiveInspectors`
                 Key: SPARK-43121
                 URL: https://issues.apache.org/jira/browse/SPARK-43121
             Project: Spark
          Issue Type: Improvement
          Components: SQL
    Affects Versions: 3.5.0
            Reporter: Yang Jie


// BytesWritable.copyBytes() only available since Hadoop2
              // In order to keep backward-compatible, we have to copy the
              // bytes with old apis
              val bw = x.getPrimitiveWritableObject(data)
              val result = new Array[Byte](bw.getLength())
              System.arraycopy(bw.getBytes(), 0, result, 0, bw.getLength())
              result



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org