@Test
  public void testTruncateWithBaseOnePartition() throws Exception {
    HiveConf.setBoolVar(hiveConf, HiveConf.ConfVars.HIVE_ACID_TRUNCATE_USE_BASE, true);

    runStatementOnDriver("insert into " + TableExtended.MMTBLPART + " partition(p='a') values(1,2),(3,4)");
    runStatementOnDriver("insert into " + TableExtended.MMTBLPART+ " partition(p='b') values(5,5),(4,4)");
    runStatementOnDriver("truncate table " + TableExtended.MMTBLPART + " partition(p='b')");

    FileSystem fs = FileSystem.get(hiveConf);
    FileStatus[] stat =
        fs.listStatus(new Path(getWarehouseDir(), TableExtended.MMTBLPART.toString().toLowerCase() + "/p=b"), AcidUtils.baseFileFilter);
    if (1 != stat.length) {
      Assert.fail("Expecting 1 base and found " + stat.length + " files " + Arrays.toString(stat));
    }
    String name = stat[0].getPath().getName();
    Assert.assertEquals("base_0000003", name);
    stat =
        fs.listStatus(new Path(getWarehouseDir(), TableExtended.MMTBLPART.toString().toLowerCase() + "/p=a"), AcidUtils.deltaFileFilter);
    if (1 != stat.length) {
      Assert.fail("Expecting 1 delta and found " + stat.length + " files " + Arrays.toString(stat));
    }

    List<String> r = runStatementOnDriver("select * from " + TableExtended.MMTBLPART);
    Assert.assertEquals(2, r.size());
  }
Impala truncates insert-only tables by writing a base directory (like insert overwrite) containing a completely
empty file. Make sure that Hive reads these bases correctly.

@throws Exception
ql/src/test/org/apache/hadoop/hive/ql/TestTxnCommandsForMmTable.java