@Override public T getCurrentValue() throws IOException, InterruptedException { rowCount += 1; if (null != inputMetricsStats) { inputMetricsStats.incrementRecordRead(1L); } return readSupport.readRow(carbonIterator.next()); }
private List<Object[]> fetchRows() throws Exception { List<Object[]> converted = new ArrayList<>(); if (detailRawQueryResultIterator.hasNext()) { for (Object[] r : detailRawQueryResultIterator.next().getRows()) { converted.add(convertRow(r)); } } return converted; }
@Override public boolean hasNext() { if (null == batch || checkBatchEnd(batch)) { if (iterator.hasNext()) { batch = iterator.next(); counter = 0; } else { return false; } } return !checkBatchEnd(batch); }
/** * Returns {@code true} if the iteration has more elements. (In other words, * returns {@code true} if {@link #next} would return an element rather than * throwing an exception.) * * @return {@code true} if the iteration has more elements */ @Override public boolean hasNext() { if (currentChunk != null && currentChunk.hasNext()) { return true; } else if (iterator != null && iterator.hasNext()) { currentChunk = iterator.next(); return hasNext(); } return false; }
private CarbonRowBatch getBatch() { // Create batch and fill it. CarbonRowBatch carbonRowBatch = new CarbonRowBatch(batchSize); int count = 0; while (internalHasNext() && count < batchSize) { carbonRowBatch.addRow( new CarbonRow(convertToNoDictionaryToBytes(currentIterator.next(), dataFields))); count++; } rowCounter.getAndAdd(carbonRowBatch.getSize()); return carbonRowBatch; }
private CarbonRowBatch getBatch() { // Create batch and fill it. CarbonRowBatch carbonRowBatch = new CarbonRowBatch(batchSize); int count = 0; if (isRawDataRequired) { while (internalHasNext() && count < batchSize) { Object[] rawRow = currentIterator.next(); carbonRowBatch.addRow(new CarbonRow(rowParser.parseRow(rawRow), rawRow)); count++; } } else { while (internalHasNext() && count < batchSize) { carbonRowBatch.addRow(new CarbonRow(rowParser.parseRow(currentIterator.next()))); count++; } } rowCounter.getAndAdd(carbonRowBatch.getSize()); return carbonRowBatch; } }
int blockletRowCount = 0; while (inputIterators.hasNext()) { writer.write(null, inputIterators.next()); blockletRowCount++;