Search in sources :

Example 6 with Dictionary

use of com.linkedin.pinot.core.segment.index.readers.Dictionary in project pinot by linkedin.

the class DataFetcher method fetchLongValues.

/**
   * Fetch the long values for a multi-valued column.
   *
   * @param column column name.
   * @param inDocIds dictionary Id array.
   * @param inStartPos input start position.
   * @param length input length.
   * @param outValues value array buffer.
   * @param outStartPos output start position.
   */
public void fetchLongValues(String column, int[] inDocIds, int inStartPos, int length, long[][] outValues, int outStartPos) {
    Dictionary dictionary = getDictionaryForColumn(column);
    BlockMultiValIterator iterator = (BlockMultiValIterator) getBlockValIteratorForColumn(column);
    int inEndPos = inStartPos + length;
    for (int i = inStartPos; i < inEndPos; i++, outStartPos++) {
        iterator.skipTo(inDocIds[i]);
        int numValues = iterator.nextIntVal(_reusableMVDictIds);
        outValues[outStartPos] = new long[numValues];
        dictionary.readLongValues(_reusableMVDictIds, 0, numValues, outValues[outStartPos], 0);
    }
}
Also used : Dictionary(com.linkedin.pinot.core.segment.index.readers.Dictionary)

Example 7 with Dictionary

use of com.linkedin.pinot.core.segment.index.readers.Dictionary in project pinot by linkedin.

the class DataFetcher method fetchDoubleValues.

/**
   * Fetch the double values for a multi-valued column.
   *
   * @param column column name.
   * @param inDocIds dictionary Id array.
   * @param inStartPos input start position.
   * @param length input length.
   * @param outValues value array buffer.
   * @param outStartPos output start position.
   */
public void fetchDoubleValues(String column, int[] inDocIds, int inStartPos, int length, double[][] outValues, int outStartPos) {
    Dictionary dictionary = getDictionaryForColumn(column);
    BlockMultiValIterator iterator = (BlockMultiValIterator) getBlockValIteratorForColumn(column);
    int inEndPos = inStartPos + length;
    for (int i = inStartPos; i < inEndPos; i++, outStartPos++) {
        iterator.skipTo(inDocIds[i]);
        int numValues = iterator.nextIntVal(_reusableMVDictIds);
        outValues[outStartPos] = new double[numValues];
        dictionary.readDoubleValues(_reusableMVDictIds, 0, numValues, outValues[outStartPos], 0);
    }
}
Also used : Dictionary(com.linkedin.pinot.core.segment.index.readers.Dictionary)

Example 8 with Dictionary

use of com.linkedin.pinot.core.segment.index.readers.Dictionary in project pinot by linkedin.

the class DataFetcher method fetchLongValues.

/**
   * Fetch the values for a single long value column.
   *
   * @param column column name.
   * @param inDocIds doc Id array.
   * @param inStartPos input start position.
   * @param length input length.
   * @param outValues value array buffer.
   * @param outStartPos output start position.
   */
public void fetchLongValues(String column, int[] inDocIds, int inStartPos, int length, long[] outValues, int outStartPos) {
    Dictionary dictionary = getDictionaryForColumn(column);
    if (dictionary != null) {
        fetchSingleDictIds(column, inDocIds, inStartPos, length, _reusableDictIds, 0);
        dictionary.readLongValues(_reusableDictIds, 0, length, outValues, outStartPos);
    } else {
        BlockValSet blockValSet = _columnToBlockValSetMap.get(column);
        blockValSet.getLongValues(inDocIds, inStartPos, length, outValues, outStartPos);
    }
}
Also used : Dictionary(com.linkedin.pinot.core.segment.index.readers.Dictionary)

Example 9 with Dictionary

use of com.linkedin.pinot.core.segment.index.readers.Dictionary in project pinot by linkedin.

the class DataFetcher method fetchStringValues.

/**
   *
   * @param column Column for which to fetch the values
   * @param inDocIds Array of docIds for which to fetch the values
   * @param outValues Array of strings where output will be written
   * @param length Length of input docIds
   */
public void fetchStringValues(String column, int[] inDocIds, int inStartPos, int length, String[] outValues, int outStartPos) {
    Dictionary dictionary = getDictionaryForColumn(column);
    if (dictionary != null) {
        fetchSingleDictIds(column, inDocIds, inStartPos, length, _reusableDictIds, 0);
        dictionary.readStringValues(_reusableDictIds, 0, length, outValues, outStartPos);
    } else {
        BlockValSet blockValSet = _columnToBlockValSetMap.get(column);
        blockValSet.getStringValues(inDocIds, inStartPos, length, outValues, outStartPos);
    }
}
Also used : Dictionary(com.linkedin.pinot.core.segment.index.readers.Dictionary)

Example 10 with Dictionary

use of com.linkedin.pinot.core.segment.index.readers.Dictionary in project pinot by linkedin.

the class DataFetcher method fetchFloatValues.

/**
   * Fetch the values for a single float value column.
   *
   * @param column column name.
   * @param inDocIds doc Id array.
   * @param inStartPos input start position.
   * @param length input length.
   * @param outValues value array buffer.
   * @param outStartPos output start position.
   */
public void fetchFloatValues(String column, int[] inDocIds, int inStartPos, int length, float[] outValues, int outStartPos) {
    Dictionary dictionary = getDictionaryForColumn(column);
    if (dictionary != null) {
        fetchSingleDictIds(column, inDocIds, inStartPos, length, _reusableDictIds, 0);
        dictionary.readFloatValues(_reusableDictIds, 0, length, outValues, outStartPos);
    } else {
        BlockValSet blockValSet = _columnToBlockValSetMap.get(column);
        blockValSet.getFloatValues(inDocIds, inStartPos, length, outValues, outStartPos);
    }
}
Also used : Dictionary(com.linkedin.pinot.core.segment.index.readers.Dictionary)

Aggregations

Dictionary (com.linkedin.pinot.core.segment.index.readers.Dictionary)22 BlockSingleValIterator (com.linkedin.pinot.core.common.BlockSingleValIterator)4 DataSource (com.linkedin.pinot.core.common.DataSource)4 HashMap (java.util.HashMap)4 FieldSpec (com.linkedin.pinot.common.data.FieldSpec)2 Pair (com.linkedin.pinot.core.query.utils.Pair)2 HyperLogLog (com.clearspring.analytics.stream.cardinality.HyperLogLog)1 SegmentMetadata (com.linkedin.pinot.common.segment.SegmentMetadata)1 Block (com.linkedin.pinot.core.common.Block)1 BlockMultiValIterator (com.linkedin.pinot.core.common.BlockMultiValIterator)1 BlockValIterator (com.linkedin.pinot.core.common.BlockValIterator)1 BlockValSet (com.linkedin.pinot.core.common.BlockValSet)1 DataSourceMetadata (com.linkedin.pinot.core.common.DataSourceMetadata)1 Predicate (com.linkedin.pinot.core.common.Predicate)1 GenericRow (com.linkedin.pinot.core.data.GenericRow)1 IndexSegment (com.linkedin.pinot.core.indexsegment.IndexSegment)1 PredicateEvaluator (com.linkedin.pinot.core.operator.filter.predicate.PredicateEvaluator)1 SingleValueRawIndexCreator (com.linkedin.pinot.core.segment.creator.SingleValueRawIndexCreator)1 SegmentMetadataImpl (com.linkedin.pinot.core.segment.index.SegmentMetadataImpl)1 DoubleDictionary (com.linkedin.pinot.core.segment.index.readers.DoubleDictionary)1