paul-rogers commented on a change in pull request #1897: DRILL-7442: Create
multi-batch row set reader
URL: https://github.com/apache/drill/pull/1897#discussion_r345589747
##########
File path:
exec/vector/src/main/java/org/apache/drill/exec/vector/accessor/reader/AbstractTupleReader.java
##########
@@ -87,6 +87,13 @@ public void bindNullState(NullStateReader nullStateReader) {
this.nullStateReader = nullStateReader;
}
+ @Override
+ public void rebind() {
+ for (int i = 0; i < readers.length; i++) {
+ readers[i].events().rebind();
+ }
Review comment:
Generally I do use the iterator form. However, the readers and writers are
inner-loop code: old-fashioned index looping is faster and avoids creating heap
objects. The code here was specifically designed for index looping. That is why
the implementation uses an array, not a list; no method call is needed to get
the item.
Just to be clear, with an iterator, there are at least two method calls per
item:
* `hasNext()`
* `next()`
While, with an list, there is a third call:
* `get()`
With an array and old-school loop there are no method calls.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services