@Test public void testReadingOfDictionaryChunkBetweenStartAndEndOffset() throws Exception {

  // delete store path
  deleteStorePath();
  // prepare the writer to write dataset1
  CarbonDictionaryWriterImpl writer = prepareWriter();
  // write dataset1 data
  writeDictionaryFile(writer, dataSet1);
  // record dictionary file start offset
  long dictionaryStartOffset = CarbonUtil.getFileSize(this.dictionaryFilePath);
  // prepare the writer to write dataset2
  writer = prepareWriter();
  // write dataset2
  writeDictionaryFile(writer, dataSet2);
  // record the end offset for dictionary file
  long dictionaryFileEndOffset = CarbonUtil.getFileSize(this.dictionaryFilePath);
  // prepare writer to write dataset3
  writer = prepareWriter();
  // write dataset 3
  writeDictionaryFile(writer, dataSet3);
  // read dictionary chunk from dictionary file
  List<byte[]> dictionaryData =
      readDictionaryFile(dictionaryStartOffset, dictionaryFileEndOffset);
  // prepare the retrieved data
  List<String> actual = convertByteArrayListToStringValueList(dictionaryData);
  // compare dictionary data set
  compareDictionaryData(actual, dataSet2);
  // read chunk metadata file
  List<CarbonDictionaryColumnMetaChunk> carbonDictionaryColumnMetaChunks =
      readDictionaryMetadataFile();
  // assert for metadata chunk size
  assertTrue(3 == carbonDictionaryColumnMetaChunks.size());
  CarbonDictionaryColumnMetaChunk expected =
      new CarbonDictionaryColumnMetaChunk(3, 4, dictionaryStartOffset, dictionaryFileEndOffset,
          1);
  validateDictionaryMetadata(carbonDictionaryColumnMetaChunks.get(1), expected);
}