You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "Zouxxyy (via GitHub)" <gi...@apache.org> on 2024/03/06 07:26:49 UTC

[PR] [core] Change usage of RecordWithPositionIterator [incubator-paimon]

Zouxxyy opened a new pull request, #2953:
URL: https://github.com/apache/incubator-paimon/pull/2953

   <!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
   
   ### Purpose
   
   <!-- Linking this pull request to the issue -->
   Linked issue: close #xxx
   
   <!-- What is the purpose of the change -->
   
   ### Tests
   
   <!-- List UT and IT cases to verify this change -->
   
   ### API and Format
   
   <!-- Does this change affect API or storage format -->
   
   ### Documentation
   
   <!-- Does this change introduce a new feature -->
   


-- 
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


Re: [PR] [core] Redefine the usage of RecordWithPositionIterator [incubator-paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
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


Re: [PR] [core] Redefine the usage of RecordWithPositionIterator [incubator-paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #2953:
URL: https://github.com/apache/incubator-paimon/pull/2953


-- 
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