Github user NamanRastogi commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2942#discussion_r235892844
--- Diff:
core/src/main/java/org/apache/carbondata/core/scan/result/iterator/ChunkRowIterator.java
---
@@ -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()) {
--- End diff --
The following tables are the build times of CarbonReader. The exact code is:
```scala
import org.apache.carbondata.sdk.file._
val startTime = System.currentTimeMillis
val reader = CarbonReader
.builder("hdfs://hacluster/carbonfiles", "t1")
.withBatch(50000)
.build
println(s"Time to build: ${System.currentTimeMillis - startTime}")
reader.close
```
**Before**
| DETAIL_QUERY_BATCH_SIZE | 4000 | 50000 |
| -- | -- | -- |
| With Vector Reader | 1870 ms | 1867 ms |
| Without Vector Reader | 12961 ms | 28539 ms |
**After**
| DETAIL_QUERY_BATCH_SIZE | 4000 | 50000 |
| -- | -- | -- |
| With Vector Reader | 1238 ms | 1279 ms |
| Without Vector Reader | 1878 ms | 1913 ms |
---