@Override
    public void dropTable(DropTableStmt stmt) {
        Table icebergTable = getTable(stmt.getDbName(), stmt.getTableName());

        if (icebergTable != null && icebergTable.isIcebergView()) {
            icebergCatalog.dropView(stmt.getDbName(), stmt.getTableName());
            return;
        }

        if (icebergTable == null) {
            return;
        }

        icebergCatalog.dropTable(stmt.getDbName(), stmt.getTableName(), stmt.isForceDrop());
        tables.remove(TableIdentifier.of(stmt.getDbName(), stmt.getTableName()));
        StatisticUtils.dropStatisticsAfterDropTable(icebergTable);
        asyncRefreshOthersFeMetadataCache(stmt.getDbName(), stmt.getTableName());
    }
@Test
    public void testDropTable() {
        IcebergHiveCatalog icebergHiveCatalog = new IcebergHiveCatalog(CATALOG_NAME, new Configuration(), DEFAULT_CONFIG);
        IcebergMetadata metadata = new IcebergMetadata(CATALOG_NAME, HDFS_ENVIRONMENT, icebergHiveCatalog,
                Executors.newSingleThreadExecutor(), Executors.newSingleThreadExecutor(), null);
        List<TableIdentifier> mockTables = new ArrayList<>();
        mockTables.add(TableIdentifier.of("table1"));
        mockTables.add(TableIdentifier.of("table2"));

        new MockUp<GlobalStateMgr>() {
            @Mock
            public long getNextId() {
                return 1;
            }

            @Mock
            public EditLog getEditLog() {
                return new EditLog(new ArrayBlockingQueue<>(100));
            }
        };

        new MockUp<EditLog>() {
            @Mock
            public void logAddAnalyzeJob(AnalyzeJob job) {
                return;
            }

            @Mock
            public void logRemoveAnalyzeJob(AnalyzeJob job) {
                return;
            }
        };

        GlobalStateMgr.getCurrentState().getAnalyzeMgr().addAnalyzeJob(new ExternalAnalyzeJob(CATALOG_NAME,
                "iceberg_db", "table1", Lists.newArrayList(), Lists.newArrayList(),
                StatsConstants.AnalyzeType.FULL, StatsConstants.ScheduleType.ONCE, Maps.newHashMap(),
                StatsConstants.ScheduleStatus.PENDING, LocalDateTime.MIN));

        new MockUp<IcebergMetadata>() {
            @Mock
            Table getTable(String dbName, String tblName) {
                return new IcebergTable(1, "table1", CATALOG_NAME,
                        CATALOG_NAME, "iceberg_db",
                        "table1", "", Lists.newArrayList(), mockedNativeTableA, Maps.newHashMap());

            }
        };

        new Expectations(icebergHiveCatalog) {
            {
                icebergHiveCatalog.dropTable("iceberg_db", "table1", true);
                result = true;
                minTimes = 0;
            }
        };

        try {
            metadata.dropTable(new DropTableStmt(false, new TableName(CATALOG_NAME,
                    "iceberg_db", "table1"), true));
        } catch (Exception e) {
            Assert.fail();
        }

        new MockUp<IcebergMetadata>() {
            // mock table not exist
            @Mock
            Table getTable(String dbName, String tblName) {
                return null;

            }
        };
        try {
            metadata.dropTable(new DropTableStmt(false, new TableName(CATALOG_NAME,
                    "iceberg_db", "table1"), true));
        } catch (Exception e) {
            Assert.fail();
        }
    }