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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
Aggregations