use of org.apache.carbondata.core.scan.result.RowBatch in project carbondata by apache.
the class DetailQueryResultIterator method getBatchResult.
private RowBatch getBatchResult() {
RowBatch rowBatch = new RowBatch();
synchronized (lock) {
updateDataBlockIterator();
if (dataBlockIterator != null) {
rowBatch.setRows(dataBlockIterator.next());
rowBatch.setCarbonDataFileWrittenVersion(carbonDataFileWrittenVersion);
}
}
return rowBatch;
}
use of org.apache.carbondata.core.scan.result.RowBatch in project carbondata by apache.
the class SecondaryIndexQueryResultProcessor method processResult.
/**
* This method will iterate over the query result and perform row sorting operation
*/
private void processResult(List<CarbonIterator<RowBatch>> detailQueryResultIteratorList) throws SecondaryIndexException {
for (CarbonIterator<RowBatch> detailQueryIterator : detailQueryResultIteratorList) {
DetailQueryResultIterator queryIterator = (DetailQueryResultIterator) detailQueryIterator;
BlockExecutionInfo blockExecutionInfo = queryIterator.getBlockExecutionInfo();
// get complex dimension info map from block execution info
Map<Integer, GenericQueryType> complexDimensionInfoMap = blockExecutionInfo.getComplexDimensionInfoMap();
int[] complexColumnParentBlockIndexes = blockExecutionInfo.getComplexColumnParentBlockIndexes();
while (detailQueryIterator.hasNext()) {
RowBatch batchResult = detailQueryIterator.next();
while (batchResult.hasNext()) {
addRowForSorting(prepareRowObjectForSorting(batchResult.next(), complexDimensionInfoMap, complexColumnParentBlockIndexes));
isRecordFound = true;
}
}
}
try {
sortDataRows.startSorting();
} catch (CarbonSortKeyAndGroupByException e) {
this.sortDataRows.close();
LOGGER.error(e);
throw new SecondaryIndexException("Problem loading data while creating secondary index: " + e.getMessage());
}
}
use of org.apache.carbondata.core.scan.result.RowBatch in project carbondata by apache.
the class CarbonSecondaryIndexExecutor method executeBlockList.
/**
* get executor and execute the query model.
*/
private CarbonIterator<RowBatch> executeBlockList(List<TableBlockInfo> blockList) throws QueryExecutionException {
queryModel.setTableBlockInfos(blockList);
CarbonIterator<RowBatch> iter = null;
try {
iter = queryExecutor.execute(queryModel);
} catch (IOException e) {
LOGGER.error(e.getMessage());
throw new QueryExecutionException(e);
}
return iter;
}
Aggregations