You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@paimon.apache.org by lz...@apache.org on 2026/03/18 14:35:49 UTC
(paimon) branch master updated: [format] Simplify ParquetDecimalVector to a read-only adapter (#7468)
This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 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 6c1b246f42 [format] Simplify ParquetDecimalVector to a read-only adapter (#7468)
6c1b246f42 is described below
commit 6c1b246f421be0b25fd7174c59e1971572c158b7
Author: jackylee <qc...@gmail.com>
AuthorDate: Wed Mar 18 22:35:41 2026 +0800
[format] Simplify ParquetDecimalVector to a read-only adapter (#7468)
---
.../parquet/reader/ParquetDecimalVector.java | 199 +--------------------
1 file changed, 1 insertion(+), 198 deletions(-)
diff --git a/paimon-format/src/main/java/org/apache/paimon/format/parquet/reader/ParquetDecimalVector.java b/paimon-format/src/main/java/org/apache/paimon/format/parquet/reader/ParquetDecimalVector.java
index 5ac0c2e5d2..7f3f8d0ef0 100644
--- a/paimon-format/src/main/java/org/apache/paimon/format/parquet/reader/ParquetDecimalVector.java
+++ b/paimon-format/src/main/java/org/apache/paimon/format/parquet/reader/ParquetDecimalVector.java
@@ -22,14 +22,9 @@ import org.apache.paimon.data.Decimal;
import org.apache.paimon.data.columnar.BytesColumnVector;
import org.apache.paimon.data.columnar.ColumnVector;
import org.apache.paimon.data.columnar.DecimalColumnVector;
-import org.apache.paimon.data.columnar.Dictionary;
import org.apache.paimon.data.columnar.IntColumnVector;
import org.apache.paimon.data.columnar.LongColumnVector;
-import org.apache.paimon.data.columnar.heap.ElementCountable;
-import org.apache.paimon.data.columnar.writable.WritableBytesVector;
import org.apache.paimon.data.columnar.writable.WritableColumnVector;
-import org.apache.paimon.data.columnar.writable.WritableIntVector;
-import org.apache.paimon.data.columnar.writable.WritableLongVector;
import org.apache.paimon.format.parquet.ParquetSchemaConverter;
import static org.apache.paimon.utils.Preconditions.checkArgument;
@@ -38,12 +33,7 @@ import static org.apache.paimon.utils.Preconditions.checkArgument;
* Parquet write decimal as int32 and int64 and binary, this class wrap the real vector to provide
* {@link DecimalColumnVector} interface.
*/
-public class ParquetDecimalVector
- implements DecimalColumnVector,
- WritableLongVector,
- WritableIntVector,
- WritableBytesVector,
- ElementCountable {
+public class ParquetDecimalVector implements DecimalColumnVector {
private final WritableColumnVector vector;
@@ -82,191 +72,4 @@ public class ParquetDecimalVector
public int getCapacity() {
return vector.getCapacity();
}
-
- @Override
- public void reset() {
- vector.reset();
- }
-
- @Override
- public void setNullAt(int rowId) {
- vector.setNullAt(rowId);
- }
-
- @Override
- public void setNulls(int rowId, int count) {
- vector.setNulls(rowId, count);
- }
-
- @Override
- public void fillWithNulls() {
- vector.fillWithNulls();
- }
-
- @Override
- public void setDictionary(Dictionary dictionary) {
- vector.setDictionary(dictionary);
- }
-
- @Override
- public boolean hasDictionary() {
- return vector.hasDictionary();
- }
-
- @Override
- public WritableIntVector reserveDictionaryIds(int capacity) {
- return vector.reserveDictionaryIds(capacity);
- }
-
- @Override
- public WritableIntVector getDictionaryIds() {
- return vector.getDictionaryIds();
- }
-
- @Override
- public void setAllNull() {
- vector.setAllNull();
- }
-
- @Override
- public boolean isAllNull() {
- return vector.isAllNull();
- }
-
- @Override
- public void reserve(int capacity) {
- vector.reserve(capacity);
- }
-
- @Override
- public int getElementsAppended() {
- return vector.getElementsAppended();
- }
-
- @Override
- public void addElementsAppended(int num) {
- vector.addElementsAppended(num);
- }
-
- @Override
- public Bytes getBytes(int i) {
- if (vector instanceof WritableBytesVector) {
- return ((WritableBytesVector) vector).getBytes(i);
- }
- throw new RuntimeException("Child vector must be instance of WritableColumnVector");
- }
-
- @Override
- public void putByteArray(int rowId, byte[] value, int offset, int length) {
- if (vector instanceof WritableBytesVector) {
- ((WritableBytesVector) vector).putByteArray(rowId, value, offset, length);
- }
- }
-
- @Override
- public void appendByteArray(byte[] value, int offset, int length) {
- if (vector instanceof WritableBytesVector) {
- ((WritableBytesVector) vector).appendByteArray(value, offset, length);
- }
- }
-
- @Override
- public void fill(byte[] value) {
- if (vector instanceof WritableBytesVector) {
- ((WritableBytesVector) vector).fill(value);
- }
- }
-
- @Override
- public int getInt(int i) {
- if (vector instanceof WritableIntVector) {
- return ((WritableIntVector) vector).getInt(i);
- }
- throw new RuntimeException("Child vector must be instance of WritableColumnVector");
- }
-
- @Override
- public void setInt(int rowId, int value) {
- if (vector instanceof WritableIntVector) {
- ((WritableIntVector) vector).setInt(rowId, value);
- }
- }
-
- @Override
- public void setIntsFromBinary(int rowId, int count, byte[] src, int srcIndex) {
- if (vector instanceof WritableIntVector) {
- ((WritableIntVector) vector).setIntsFromBinary(rowId, count, src, srcIndex);
- }
- }
-
- @Override
- public void setInts(int rowId, int count, int value) {
- if (vector instanceof WritableIntVector) {
- ((WritableIntVector) vector).setInts(rowId, count, value);
- }
- }
-
- @Override
- public void setInts(int rowId, int count, int[] src, int srcIndex) {
- if (vector instanceof WritableIntVector) {
- ((WritableIntVector) vector).setInts(rowId, count, src, srcIndex);
- }
- }
-
- @Override
- public void fill(int value) {
- if (vector instanceof WritableIntVector) {
- ((WritableIntVector) vector).fill(value);
- }
- }
-
- @Override
- public void appendInt(int v) {
- if (vector instanceof WritableIntVector) {
- ((WritableIntVector) vector).appendInt(v);
- }
- }
-
- @Override
- public void appendInts(int count, int v) {
- if (vector instanceof WritableIntVector) {
- ((WritableIntVector) vector).appendInts(count, v);
- }
- }
-
- @Override
- public long getLong(int i) {
- if (vector instanceof WritableLongVector) {
- return ((WritableLongVector) vector).getLong(i);
- }
- throw new RuntimeException("Child vector must be instance of WritableColumnVector");
- }
-
- @Override
- public void setLong(int rowId, long value) {
- if (vector instanceof WritableLongVector) {
- ((WritableLongVector) vector).setLong(rowId, value);
- }
- }
-
- @Override
- public void appendLong(long v) {
- if (vector instanceof WritableLongVector) {
- ((WritableLongVector) vector).appendLong(v);
- }
- }
-
- @Override
- public void setLongsFromBinary(int rowId, int count, byte[] src, int srcIndex) {
- if (vector instanceof WritableLongVector) {
- ((WritableLongVector) vector).setLongsFromBinary(rowId, count, src, srcIndex);
- }
- }
-
- @Override
- public void fill(long value) {
- if (vector instanceof WritableLongVector) {
- ((WritableLongVector) vector).fill(value);
- }
- }
}