@Override
    public void dropTable(DropTableStmt stmt) throws DdlException {
        String dbName = stmt.getDbName();
        String tableName = stmt.getTableName();
        if (isResourceMappingCatalog(catalogName)) {
            Table table = GlobalStateMgr.getCurrentState()
                    .getMetadata().getTable(dbName, tableName);
            HiveMetaStoreTable hmsTable = (HiveMetaStoreTable) table;
            if (hmsTable != null) {
                cacheUpdateProcessor.ifPresent(processor -> processor.invalidateTable(
                        hmsTable.getDbName(), hmsTable.getTableName(), table));
            }
        } else {
            HiveTable hiveTable = null;
            try {
                hiveTable = (HiveTable) getTable(dbName, tableName);
            } catch (Exception e) {
                // ignore not found exception
            }
            if (hiveTable == null && stmt.isSetIfExists()) {
                LOG.warn("Table {}.{} doesn't exist", dbName, tableName);
                return;
            }
            if (hiveTable.getHiveTableType() == HiveTable.HiveTableType.MANAGED_TABLE && !stmt.isForceDrop()) {
                throw new DdlException(String.format("Table location will be cleared." +
                        " 'Force' must be set when dropping a hive table." +
                        " Please execute 'drop table %s.%s.%s force'", stmt.getCatalogName(), dbName, tableName));
            }

            hmsOps.dropTable(dbName, tableName);
            StatisticUtils.dropStatisticsAfterDropTable(hiveTable);
        }
    }
@Test
    public void testDropTable() throws DdlException {
        TableName tableName = new TableName("hive_catalog", "hive_db", "hive_table");
        ExceptionChecker.expectThrowsWithMsg(DdlException.class,
                "Table location will be cleared. 'Force' must be set when dropping a hive table." +
                        " Please execute 'drop table hive_catalog.hive_db.hive_table force",
                () -> hiveMetadata.dropTable(new DropTableStmt(false, tableName, false)));

        hiveMetadata.dropTable(new DropTableStmt(false, tableName, true));

        new MockUp<HiveMetadata>() {
            @Mock
            public Table getTable(String dbName, String tblName) {
                return null;
            }
        };

        hiveMetadata.dropTable(new DropTableStmt(true, tableName, true));
    }