You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "JingsongLi (via GitHub)" <gi...@apache.org> on 2024/03/06 08:36:47 UTC
Re: [PR] [core] Redefine the usage of RecordWithPositionIterator [incubator-paimon]
JingsongLi commented on code in PR #2953:
URL: https://github.com/apache/incubator-paimon/pull/2953#discussion_r1514031814
##########
paimon-common/src/main/java/org/apache/paimon/data/columnar/ColumnarRowIterator.java:
##########
@@ -45,7 +45,6 @@ public ColumnarRowIterator(ColumnarRow rowData, @Nullable Runnable recycler) {
super(recycler);
this.rowData = rowData;
this.recycler = recycler;
- this.rowPosition = 0;
Review Comment:
currently, we have `pos` and `rowPosition`.
Can we rename them to `nextPos` and `nextGlobalPosition`?
##########
paimon-common/src/main/java/org/apache/paimon/reader/RecordWithPositionIterator.java:
##########
@@ -33,8 +33,7 @@
public interface RecordWithPositionIterator<T> extends RecordReader.RecordIterator<T> {
/**
- * Get the row position of the row that will be returned by the following call to {@link
- * RecordReader.RecordIterator#next}.
+ * Get the row position of the row called by {@link RecordReader.RecordIterator#next}.
*
* @return the row position from 0 to the number of rows in the file
*/
Review Comment:
rename to `returnedPosition`?
##########
paimon-format/src/main/java/org/apache/paimon/format/orc/OrcReaderFactory.java:
##########
@@ -183,7 +183,7 @@ private RecordIterator<InternalRow> convertAndGetIterator(
int batchSize = orcBatch.size;
paimonColumnBatch.setNumRows(batchSize);
result.reset(batchSize);
- result.resetRowPosition(rowNumber);
Review Comment:
Just keep it as it is.
We can implement `ColumnarRowIterator.returnedPosition` to `nextGlobalPosition - 1`?
##########
paimon-common/src/main/java/org/apache/paimon/data/columnar/ColumnarRowIterator.java:
##########
@@ -90,9 +96,7 @@ public ColumnarRowIterator mapping(
if (indexMapping != null) {
vectors = VectorMappingUtils.createIndexMappedVectors(indexMapping, vectors);
}
- ColumnarRowIterator iterator = new ColumnarRowIterator(rowData.copy(vectors), recycler);
- iterator.reset(num);
Review Comment:
Can we merge these two reset methods? Introduce only one reset?
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org