This is an automated email from the ASF dual-hosted git repository.
dianfu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new e47cb6eeb4c [FLINK-28822][python] Avoid creating VectorizedColumnBatch
for each read in ArrowReader (#20458)
e47cb6eeb4c is described below
commit e47cb6eeb4ceac13db4b8b357a0885b77651826c
Author: Aitozi <[email protected]>
AuthorDate: Mon Aug 8 09:21:41 2022 +0800
[FLINK-28822][python] Avoid creating VectorizedColumnBatch for each read in
ArrowReader (#20458)
---
.../main/java/org/apache/flink/table/runtime/arrow/ArrowReader.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/flink-python/src/main/java/org/apache/flink/table/runtime/arrow/ArrowReader.java
b/flink-python/src/main/java/org/apache/flink/table/runtime/arrow/ArrowReader.java
index 3f9eb79e7d8..5475c9ec171 100644
---
a/flink-python/src/main/java/org/apache/flink/table/runtime/arrow/ArrowReader.java
+++
b/flink-python/src/main/java/org/apache/flink/table/runtime/arrow/ArrowReader.java
@@ -35,11 +35,12 @@ public final class ArrowReader {
private final ColumnVector[] columnVectors;
/** Reusable row used to hold the deserialized result. */
- private ColumnarRowData reuseRow;
+ private final ColumnarRowData reuseRow;
public ArrowReader(ColumnVector[] columnVectors) {
this.columnVectors = Preconditions.checkNotNull(columnVectors);
this.reuseRow = new ColumnarRowData();
+ this.reuseRow.setVectorizedColumnBatch(new
VectorizedColumnBatch(columnVectors));
}
/** Gets the column vectors. */
@@ -49,7 +50,6 @@ public final class ArrowReader {
/** Read the specified row from underlying Arrow format data. */
public RowData read(int rowId) {
- reuseRow.setVectorizedColumnBatch(new
VectorizedColumnBatch(columnVectors));
reuseRow.setRowId(rowId);
return reuseRow;
}