use of com.linkedin.pinot.core.io.reader.ReaderContext in project pinot by linkedin.
the class UnSortedSingleValueSet method getLongValues.
/**
* Reads int values for the given docIds and returns in the passed in double[].
* Compatible data types ('int' and 'long') can be read in as long.
*
* @param inDocIds DocIds for which to get the values
* @param inStartPos start index in the inDocIds array
* @param inDocIdsSize size of docIds to read
* @param outValues Array where output is written
* @param outStartPos start index into output array
*/
@Override
public void getLongValues(int[] inDocIds, int inStartPos, int inDocIdsSize, long[] outValues, int outStartPos) {
int inEndPos = inStartPos + inDocIdsSize;
ReaderContext context = sVReader.createContext();
switch(columnMetadata.getDataType()) {
case INT:
for (int i = inStartPos; i < inEndPos; i++) {
outValues[outStartPos++] = sVReader.getInt(inDocIds[i], context);
}
break;
case LONG:
for (int i = inStartPos; i < inEndPos; i++) {
outValues[outStartPos++] = sVReader.getLong(inDocIds[i], context);
}
break;
default:
throw new UnsupportedOperationException("Cannot fetch long values for column: " + columnMetadata.getColumnName());
}
}
Aggregations