This is an automated email from the ASF dual-hosted git repository.
junhao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new 88aa434aa [parquet] Optimize parquet to use getBytesUnsafe for
dictionary (#3468)
88aa434aa is described below
commit 88aa434aad2321226d6a1c927bd3db687d3e5262
Author: Jingsong Lee <[email protected]>
AuthorDate: Tue Jun 4 15:16:58 2024 +0800
[parquet] Optimize parquet to use getBytesUnsafe for dictionary (#3468)
---
.../java/org/apache/paimon/format/parquet/reader/BytesColumnReader.java | 2 +-
.../apache/paimon/format/parquet/reader/FixedLenBytesColumnReader.java | 2 +-
.../java/org/apache/paimon/format/parquet/reader/ParquetDictionary.java | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git
a/paimon-format/src/main/java/org/apache/paimon/format/parquet/reader/BytesColumnReader.java
b/paimon-format/src/main/java/org/apache/paimon/format/parquet/reader/BytesColumnReader.java
index da64d7db5..e83115c8a 100644
---
a/paimon-format/src/main/java/org/apache/paimon/format/parquet/reader/BytesColumnReader.java
+++
b/paimon-format/src/main/java/org/apache/paimon/format/parquet/reader/BytesColumnReader.java
@@ -75,7 +75,7 @@ public class BytesColumnReader extends
AbstractColumnReader<WritableBytesVector>
int rowId, int num, WritableBytesVector column, WritableIntVector
dictionaryIds) {
for (int i = rowId; i < rowId + num; ++i) {
if (!column.isNullAt(i)) {
- byte[] bytes =
dictionary.decodeToBinary(dictionaryIds.getInt(i)).getBytes();
+ byte[] bytes =
dictionary.decodeToBinary(dictionaryIds.getInt(i)).getBytesUnsafe();
column.appendBytes(i, bytes, 0, bytes.length);
}
}
diff --git
a/paimon-format/src/main/java/org/apache/paimon/format/parquet/reader/FixedLenBytesColumnReader.java
b/paimon-format/src/main/java/org/apache/paimon/format/parquet/reader/FixedLenBytesColumnReader.java
index de001065e..1fc9d9e91 100644
---
a/paimon-format/src/main/java/org/apache/paimon/format/parquet/reader/FixedLenBytesColumnReader.java
+++
b/paimon-format/src/main/java/org/apache/paimon/format/parquet/reader/FixedLenBytesColumnReader.java
@@ -70,7 +70,7 @@ public class FixedLenBytesColumnReader<VECTOR extends
WritableColumnVector>
WritableBytesVector bytesVector = (WritableBytesVector) column;
for (int i = 0; i < num; i++) {
if (runLenDecoder.readInteger() == maxDefLevel) {
- byte[] bytes = readDataBinary(bytesLen).getBytes();
+ byte[] bytes = readDataBinary(bytesLen).getBytesUnsafe();
bytesVector.appendBytes(rowId + i, bytes, 0, bytes.length);
} else {
bytesVector.setNullAt(rowId + i);
diff --git
a/paimon-format/src/main/java/org/apache/paimon/format/parquet/reader/ParquetDictionary.java
b/paimon-format/src/main/java/org/apache/paimon/format/parquet/reader/ParquetDictionary.java
index cc636f080..a8deafa0f 100644
---
a/paimon-format/src/main/java/org/apache/paimon/format/parquet/reader/ParquetDictionary.java
+++
b/paimon-format/src/main/java/org/apache/paimon/format/parquet/reader/ParquetDictionary.java
@@ -54,7 +54,7 @@ public final class ParquetDictionary implements Dictionary {
@Override
public byte[] decodeToBinary(int id) {
- return dictionary.decodeToBinary(id).getBytes();
+ return dictionary.decodeToBinary(id).getBytesUnsafe();
}
@Override