stoty commented on a change in pull request #1112:
URL: https://github.com/apache/phoenix/pull/1112#discussion_r564791378
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/iterate/RoundRobinResultIterator.java
##########
@@ -114,12 +114,15 @@ public Tuple next() throws SQLException {
index = (index + 1) % size;
}
}
+ close();
Review comment:
This is the fix
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/iterate/RoundRobinResultIterator.java
##########
@@ -300,7 +305,11 @@ public Tuple call() throws Exception {
private RoundRobinIterator(PeekingResultIterator itr, Tuple tuple) {
this.delegate = itr;
this.tuple = tuple;
- this.numRecordsRead = 0;
+ if (tuple != null) {
Review comment:
This is meant to be a performance fix.
The tuple was peek() -ed from the delegate, so that element is actually the
first of the cached rows.
Fixing this SHOULD enable processing the 2nd and later batches parallelly,
but I didn't thest this.
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/iterate/RoundRobinResultIterator.java
##########
@@ -176,13 +179,15 @@ QueryPlan getQueryPlan() {
private List<RoundRobinIterator> getIterators() throws SQLException {
if (closed) { return Collections.emptyList(); }
- if (openIterators.size() > 0 && openIterators.size() ==
numScannersCacheExhausted) {
+ if (openIterators.size() > 0 && openIterators.size() <=
numScannersCacheExhausted) {
Review comment:
Ths probably does nothing, just a belts + suspenders change.
----------------------------------------------------------------
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]