@Override
  @SuppressWarnings("unchecked")
  public int run() throws IOException {
    RewriteOptions options = buildOptionsOrFail();
    ParquetRewriter rewriter = new ParquetRewriter(options);
    rewriter.processBlocks();
    rewriter.close();
    return 0;
  }
@Test
  public void testRewriteCommandWithCompression_gzip() throws IOException {
    File file = parquetFile();
    RewriteCommand command = new RewriteCommand(createLogger());
    command.inputs = Arrays.asList(file.getAbsolutePath());
    File output = new File(getTempFolder(), "converted-2.gzip.parquet");
    command.output = output.getAbsolutePath();
    command.codec = "gzip";
    command.setConf(new Configuration());

    Assert.assertEquals(0, command.run());
    Assert.assertTrue(output.exists());
  }