Search in sources :

Example 11 with QueryMeasure

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;
}
Also used : QueryMeasure(org.apache.carbondata.core.scan.model.QueryMeasure) ArrayList(java.util.ArrayList) BlockletLevelDeleteDeltaDataCache(org.apache.carbondata.core.cache.update.BlockletLevelDeleteDeltaDataCache)

Example 12 with QueryMeasure

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;
}
Also used : QueryMeasure(org.apache.carbondata.core.scan.model.QueryMeasure) ArrayList(java.util.ArrayList) BlockletLevelDeleteDeltaDataCache(org.apache.carbondata.core.cache.update.BlockletLevelDeleteDeltaDataCache)

Aggregations

QueryMeasure (org.apache.carbondata.core.scan.model.QueryMeasure)12 ArrayList (java.util.ArrayList)5 CarbonMeasure (org.apache.carbondata.core.metadata.schema.table.column.CarbonMeasure)5 QueryDimension (org.apache.carbondata.core.scan.model.QueryDimension)4 BlockletLevelDeleteDeltaDataCache (org.apache.carbondata.core.cache.update.BlockletLevelDeleteDeltaDataCache)2 CarbonDimension (org.apache.carbondata.core.metadata.schema.table.column.CarbonDimension)2 BlockExecutionInfo (org.apache.carbondata.core.scan.executor.infos.BlockExecutionInfo)2 MeasureInfo (org.apache.carbondata.core.scan.executor.infos.MeasureInfo)2 BigDecimal (java.math.BigDecimal)1 HashSet (java.util.HashSet)1 LinkedHashSet (java.util.LinkedHashSet)1 CacheProvider (org.apache.carbondata.core.cache.CacheProvider)1 BlockIndexStore (org.apache.carbondata.core.datastore.BlockIndexStore)1 IndexKey (org.apache.carbondata.core.datastore.IndexKey)1 AbstractIndex (org.apache.carbondata.core.datastore.block.AbstractIndex)1 SegmentProperties (org.apache.carbondata.core.datastore.block.SegmentProperties)1 TableBlockUniqueIdentifier (org.apache.carbondata.core.datastore.block.TableBlockUniqueIdentifier)1 KeyGenException (org.apache.carbondata.core.keygenerator.KeyGenException)1 KeyGenerator (org.apache.carbondata.core.keygenerator.KeyGenerator)1 DirectDictionaryGenerator (org.apache.carbondata.core.keygenerator.directdictionary.DirectDictionaryGenerator)1