use of org.apache.carbondata.core.cache.dictionary.ColumnDictionaryChunkIterator in project carbondata by apache.
the class CarbonDictionaryReaderImpl method read.
/**
* This method will be used to read data between given start and end offset.
* Applicable scenarios:
* 1. Truncate operation. If there is any inconsistency while writing the dictionary file
* then we can give the start and end offset till where the data has to be retained.
*
* @param startOffset start offset of dictionary file
* @param endOffset end offset of dictionary file
* @return iterator over byte array. Each byte array is unique dictionary value
* @throws IOException if an I/O error occurs
*/
@Override
public Iterator<byte[]> read(long startOffset, long endOffset) throws IOException {
List<CarbonDictionaryColumnMetaChunk> carbonDictionaryColumnMetaChunks = readDictionaryMetadataFile();
List<ColumnDictionaryChunk> columnDictionaryChunks = read(carbonDictionaryColumnMetaChunks, startOffset, endOffset);
return (Iterator<byte[]>) new ColumnDictionaryChunkIterator(columnDictionaryChunks);
}
Aggregations