@Test public void testReadFactMetadata() throws IOException {

  deleteFile();
  createFile();
  CarbonFooterWriter writer = new CarbonFooterWriter(filePath);
  List<BlockletInfoColumnar> infoColumnars = getBlockletInfoColumnars();
  int[] cardinalities = new int[] { 2, 4, 5, 7, 9, 10};
  List<ColumnSchema> columnSchema = Arrays.asList(new ColumnSchema[]{getDimensionColumn("IMEI1"),
				getDimensionColumn("IMEI2"),
				getDimensionColumn("IMEI3"),
				getDimensionColumn("IMEI4"),
				getDimensionColumn("IMEI5"),
				getDimensionColumn("IMEI6")});
  List<org.apache.carbondata.core.carbon.metadata.schema.table.column.ColumnSchema> wrapperColumnSchema = Arrays.asList(new org.apache.carbondata.core.carbon.metadata.schema.table.column.ColumnSchema[]{getWrapperDimensionColumn("IMEI1"),
  	getWrapperDimensionColumn("IMEI2"),
  	getWrapperDimensionColumn("IMEI3"),
  	getWrapperDimensionColumn("IMEI4"),
  	getWrapperDimensionColumn("IMEI5"),
  	getWrapperDimensionColumn("IMEI6")});
  int[] colCardinality = CarbonUtil.getFormattedCardinality(cardinalities, wrapperColumnSchema);
  SegmentProperties segmentProperties = new SegmentProperties(wrapperColumnSchema, cardinalities);
  writer.writeFooter(CarbonMetadataUtil
      .convertFileFooter(infoColumnars, 6, colCardinality,
      		columnSchema,segmentProperties), 0);
  CarbonFooterReader metaDataReader = new CarbonFooterReader(filePath, 0);
  List<BlockletInfoColumnar> nodeInfoColumnars =
      CarbonMetadataUtil.convertBlockletInfo(metaDataReader.readFooter());
  assertTrue(nodeInfoColumnars.size() == infoColumnars.size());
}