public void dropTable(Table table, boolean ifPurge) throws HiveException {
    boolean tableWithSuffix = AcidUtils.isTableSoftDeleteEnabled(table, conf);
    long txnId = Optional.ofNullable(SessionState.get())
      .map(ss -> ss.getTxnMgr().getCurrentTxnId()).orElse(0L);
    table.getTTable().setTxnId(txnId);

    dropTable(table.getTTable(), !tableWithSuffix, true, ifPurge);
  }
Drops table along with the data in it. If the table doesn't exist then it
is a no-op. If ifPurge option is specified it is passed to the
hdfs command that removes table data from warehouse to make it skip trash.

@param tableName
         table to drop
@param ifPurge
         completely purge the table (skipping trash) while removing data from warehouse
@throws HiveException
          thrown if the drop fails
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java