huaxingao commented on code in PR #9841:
URL: https://github.com/apache/iceberg/pull/9841#discussion_r1585767596
##########
spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/ColumnarBatchReader.java:
##########
@@ -74,48 +71,23 @@ public final ColumnarBatch read(ColumnarBatch reuse, int
numRowsToRead) {
return columnarBatch;
}
- private class ColumnBatchLoader {
- private final int numRowsToRead;
- // the rowId mapping to skip deleted rows for all column vectors inside a
batch, it is null when
- // there is no deletes
- private int[] rowIdMapping;
- // the array to indicate if a row is deleted or not, it is null when there
is no "_deleted"
- // metadata column
- private boolean[] isDeleted;
+ private class ColumnBatchLoader extends BaseColumnBatchLoader {
ColumnBatchLoader(int numRowsToRead) {
- Preconditions.checkArgument(
- numRowsToRead > 0, "Invalid number of rows to read: %s",
numRowsToRead);
- this.numRowsToRead = numRowsToRead;
- if (hasIsDeletedColumn) {
- isDeleted = new boolean[numRowsToRead];
- }
+ super(numRowsToRead, hasIsDeletedColumn, deletes, rowStartPosInBatch);
}
- ColumnarBatch loadDataToColumnBatch() {
+ @Override
+ public ColumnarBatch loadDataToColumnBatch() {
int numRowsUndeleted = initRowIdMapping();
-
ColumnVector[] arrowColumnVectors = readDataToColumnVectors();
-
- ColumnarBatch newColumnarBatch = new ColumnarBatch(arrowColumnVectors);
- newColumnarBatch.setNumRows(numRowsUndeleted);
-
- if (hasEqDeletes()) {
- applyEqDelete(newColumnarBatch);
- }
-
- if (hasIsDeletedColumn && rowIdMapping != null) {
- // reset the row id mapping array, so that it doesn't filter out the
deleted rows
- for (int i = 0; i < numRowsToRead; i++) {
- rowIdMapping[i] = i;
- }
- newColumnarBatch.setNumRows(numRowsToRead);
- }
-
+ ColumnarBatch newColumnarBatch =
Review Comment:
Changed. Thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]