Search in sources :

Example 1 with ColumnDictionaryChunkIterator

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);
}
Also used : ColumnDictionaryChunkIterator(org.apache.carbondata.core.cache.dictionary.ColumnDictionaryChunkIterator) Iterator(java.util.Iterator) ColumnDictionaryChunkIterator(org.apache.carbondata.core.cache.dictionary.ColumnDictionaryChunkIterator) ColumnDictionaryChunk(org.apache.carbondata.format.ColumnDictionaryChunk)

Aggregations

Iterator (java.util.Iterator)1 ColumnDictionaryChunkIterator (org.apache.carbondata.core.cache.dictionary.ColumnDictionaryChunkIterator)1 ColumnDictionaryChunk (org.apache.carbondata.format.ColumnDictionaryChunk)1