@Test public void testWriteMultipleChunksForOneSegment() throws IOException {

  deleteStorePath();
  CarbonProperties.getInstance()
      .addProperty(CarbonCommonConstants.DICTIONARY_ONE_CHUNK_SIZE, "1");
  // prepare dictionary writer object
  CarbonDictionaryWriterImpl writer = prepareWriter();
  writeDictionaryFile(writer, dataSet1);
  // record file size from where data has to be read
  long end_offset = CarbonUtil.getFileSize(this.dictionaryFilePath);
  // read metadata chunks from file
  List<CarbonDictionaryColumnMetaChunk> carbonDictionaryColumnMetaChunks =
      readDictionaryMetadataFile();
  assertTrue(1 == carbonDictionaryColumnMetaChunks.size());
  // prepare retrieved chunk metadata
  long start_offset = 0L;
  CarbonDictionaryColumnMetaChunk expected =
      new CarbonDictionaryColumnMetaChunk(1, dataSet1.size(), start_offset, end_offset,
          dataSet1.size());
  // validate chunk metadata - actual and expected
  for (CarbonDictionaryColumnMetaChunk chunk : carbonDictionaryColumnMetaChunks) {
    validateDictionaryMetadata(chunk, expected);
  }
  //assert for chunk count
  List<byte[]> dictionaryValues = readDictionaryFile(0L, 0L);
  // prepare expected dictionary chunk list
  List<String> actual = convertByteArrayListToStringValueList(dictionaryValues);
  assertTrue(dataSet1.size() == actual.size());
  // validate the dictionary data
  compareDictionaryData(actual, dataSet1);
  CarbonProperties.getInstance().addProperty(CarbonCommonConstants.DICTIONARY_ONE_CHUNK_SIZE,
      CarbonCommonConstants.DICTIONARY_ONE_CHUNK_SIZE_DEFAULT);
}