use of org.apache.carbondata.core.scan.model.QueryMeasure in project carbondata by apache.
the class RawBasedResultCollector method collectData.
/**
* This method will add a record both key and value to list object
* it will keep track of how many record is processed, to handle limit scenario
*/
@Override
public List<Object[]> collectData(AbstractScannedResult scannedResult, int batchSize) {
List<Object[]> listBasedResult = new ArrayList<>(batchSize);
QueryMeasure[] queryMeasures = tableBlockExecutionInfos.getQueryMeasures();
BlockletLevelDeleteDeltaDataCache deleteDeltaDataCache = scannedResult.getDeleteDeltaDataCache();
// scan the record and add to list
int rowCounter = 0;
while (scannedResult.hasNext() && rowCounter < batchSize) {
scanResultAndGetData(scannedResult);
if (null != deleteDeltaDataCache && deleteDeltaDataCache.contains(scannedResult.getCurrentRowId())) {
continue;
}
prepareRow(scannedResult, listBasedResult, queryMeasures);
rowCounter++;
}
return listBasedResult;
}
use of org.apache.carbondata.core.scan.model.QueryMeasure in project carbondata by apache.
the class RestructureBasedRawResultCollector method collectData.
/**
* This method will add a record both key and value to list object
* it will keep track of how many record is processed, to handle limit scenario
*/
@Override
public List<Object[]> collectData(AbstractScannedResult scannedResult, int batchSize) {
List<Object[]> listBasedResult = new ArrayList<>(batchSize);
QueryMeasure[] queryMeasures = tableBlockExecutionInfos.getActualQueryMeasures();
BlockletLevelDeleteDeltaDataCache deleteDeltaDataCache = scannedResult.getDeleteDeltaDataCache();
// scan the record and add to list
int rowCounter = 0;
while (scannedResult.hasNext() && rowCounter < batchSize) {
scanResultAndGetData(scannedResult);
if (null != deleteDeltaDataCache && deleteDeltaDataCache.contains(scannedResult.getCurrentRowId())) {
continue;
}
// re-fill dictionary and no dictionary key arrays for the newly added columns
if (dimensionInfo.isDictionaryColumnAdded()) {
dictionaryKeyArray = fillDictionaryKeyArrayWithLatestSchema(dictionaryKeyArray);
}
if (dimensionInfo.isNoDictionaryColumnAdded()) {
noDictionaryKeyArray = fillNoDictionaryKeyArrayWithLatestSchema(noDictionaryKeyArray);
}
prepareRow(scannedResult, listBasedResult, queryMeasures);
rowCounter++;
}
return listBasedResult;
}
Aggregations