Skip to content

Commit

Permalink
Improvement of CarbonRecord build time
Browse files Browse the repository at this point in the history
  • Loading branch information
NamanRastogi committed Nov 22, 2018
1 parent ceb1351 commit 721b9bb
Showing 1 changed file with 5 additions and 14 deletions.
Expand Up @@ -39,9 +39,6 @@ public class ChunkRowIterator extends CarbonIterator<Object[]> {

public ChunkRowIterator(CarbonIterator<RowBatch> iterator) {
this.iterator = iterator;
if (iterator.hasNext()) {
currentChunk = iterator.next();
}
}

/**
Expand All @@ -52,17 +49,11 @@ public ChunkRowIterator(CarbonIterator<RowBatch> iterator) {
* @return {@code true} if the iteration has more elements
*/
@Override public boolean hasNext() {
if (null != currentChunk) {
if ((currentChunk.hasNext())) {
return true;
} else if (!currentChunk.hasNext()) {
while (iterator.hasNext()) {
currentChunk = iterator.next();
if (currentChunk != null && currentChunk.hasNext()) {
return true;
}
}
}
if (currentChunk != null && currentChunk.hasNext()) {
return true;
} else if (iterator != null & iterator.hasNext()) {
currentChunk = iterator.next();
return hasNext();
}
return false;
}
Expand Down

0 comments on commit 721b9bb

Please sign in to comment.