use of com.linkedin.pinot.core.common.BlockMultiValIterator in project pinot by linkedin.
the class ChunkIndexCreationDriverImplTest method test3.
@Test
public void test3() throws Exception {
final IndexSegmentImpl segment = (IndexSegmentImpl) Loaders.IndexSegment.load(INDEX_DIR.listFiles()[0], ReadMode.mmap);
final DataSource ds = segment.getDataSource("column7");
final Block bl = ds.nextBlock();
final BlockValSet valSet = bl.getBlockValueSet();
final int maxValue = ((SegmentMetadataImpl) segment.getSegmentMetadata()).getColumnMetadataFor("column7").getMaxNumberOfMultiValues();
final BlockMultiValIterator it = (BlockMultiValIterator) valSet.iterator();
while (it.hasNext()) {
final int[] entry = new int[maxValue];
it.nextIntVal(entry);
LOGGER.trace(Arrays.toString(entry));
}
}
use of com.linkedin.pinot.core.common.BlockMultiValIterator in project pinot by linkedin.
the class Projection method run.
public ResultTable run() {
ResultTable resultTable = new ResultTable(_columnList, _filteredDocIds.size());
resultTable.setResultType(ResultTable.ResultType.Selection);
for (Pair pair : _columnList) {
String column = (String) pair.getFirst();
if (!_mvColumns.contains(column)) {
BlockSingleValIterator bvIter = (BlockSingleValIterator) _indexSegment.getDataSource(column).getNextBlock().getBlockValueSet().iterator();
int rowId = 0;
for (Integer docId : _filteredDocIds) {
bvIter.skipTo(docId);
resultTable.add(rowId++, bvIter.nextIntVal());
}
} else {
BlockMultiValIterator bvIter = (BlockMultiValIterator) _indexSegment.getDataSource(column).getNextBlock().getBlockValueSet().iterator();
int rowId = 0;
for (Integer docId : _filteredDocIds) {
bvIter.skipTo(docId);
int[] dictIds = _mvColumnArrayMap.get(column);
int numMVValues = bvIter.nextIntVal(dictIds);
dictIds = Arrays.copyOf(dictIds, numMVValues);
resultTable.add(rowId++, ArrayUtils.toObject(dictIds));
}
}
}
return transformFromIdToValues(resultTable, _dictionaryMap, _addCountStar);
}
Aggregations