public void truncateTable(String dbDotTableName, Map<String, String> partSpec, Long writeId) throws HiveException {
    try {
      Table table = getTable(dbDotTableName, true);
      AcidUtils.TableSnapshot snapshot = null;
      if (AcidUtils.isTransactionalTable(table)) {
        if (writeId <= 0) {
          snapshot = AcidUtils.getTableSnapshot(conf, table, true);
        } else {
          String fullTableName = getFullTableName(table.getDbName(), table.getTableName());
          ValidWriteIdList writeIdList = getMSC().getValidWriteIds(fullTableName, writeId);
          snapshot = new TableSnapshot(writeId, writeIdList.writeToString());
        }
      }

      // TODO: APIs with catalog names
      List<String> partNames = (partSpec != null) ? getPartitionNames(table, partSpec, (short) -1) : null;
      if (snapshot == null) {
        getMSC().truncateTable(table.getFullTableName(), partNames);
      } else {
        boolean truncateUseBase = HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_ACID_TRUNCATE_USE_BASE)
          || HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_ACID_LOCKLESS_READS_ENABLED);
        getMSC().truncateTable(table.getDbName(), table.getTableName(), partNames,
            snapshot.getValidWriteIdList(), snapshot.getWriteId(), !truncateUseBase);
      }
    } catch (Exception e) {
      throw new HiveException(e);
    }
  }
Truncates the table/partition as per specifications. Just trash the data files

@param dbDotTableName
         name of the table
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java