private void verifyDir(int expectedDeltas, boolean expectBaseDir) throws Exception {
    FileSystem fs = FileSystem.get(hiveConf);
    // Verify the content of subdirs
    FileStatus[] status = fs.listStatus(new Path(getWarehouseDir() + "/" +
        (TableExtended.MMTBL).toString().toLowerCase()), FileUtils.HIDDEN_FILES_PATH_FILTER);
    int sawDeltaTimes = 0;
    int sawBaseTimes = 0;
    for (int i = 0; i < status.length; i++) {
      if (status[i].getPath().getName().matches("delta_.*")) {
        sawDeltaTimes++;
        FileStatus[] files = fs.listStatus(status[i].getPath(), FileUtils.HIDDEN_FILES_PATH_FILTER);
        Assert.assertEquals(1, files.length);
        Assert.assertEquals("000000_0", files[0].getPath().getName());
      } else {
        sawBaseTimes++;
      }
    }

    Assert.assertEquals(expectedDeltas, sawDeltaTimes);
    if (expectBaseDir) {
      Assert.assertEquals("1 base directory expected", 1, sawBaseTimes);
    } else {
      Assert.assertEquals("0 base directories expected", 0, sawBaseTimes);
    }
  }
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