public boolean cleanTable() {
        boolean allRemoved = true;
        Set<String> removedPaths = new HashSet<>();
        for (PhysicalPartition partition : table.getAllPhysicalPartitions()) {
            try {
                WarehouseManager manager = GlobalStateMgr.getCurrentState().getWarehouseMgr();
                Warehouse warehouse = manager.getBackgroundWarehouse();
                ShardInfo shardInfo = LakeTableHelper.getAssociatedShardInfo(partition, warehouse.getId()).orElse(null);
                if (shardInfo == null || removedPaths.contains(shardInfo.getFilePath().getFullPath())) {
                    continue;
                }
                removedPaths.add(shardInfo.getFilePath().getFullPath());
                if (!LakeTableHelper.removeShardRootDirectory(shardInfo)) {
                    allRemoved = false;
                }
            } catch (StarClientException e) {
                LOG.warn("Fail to get shard info of partition {}: {}", partition.getId(), e.getMessage());
                allRemoved = false;
            }
        }
        return allRemoved;
    }
@Test
    public void test(@Mocked LakeTable table,
                     @Mocked PhysicalPartition partition,
                     @Mocked MaterializedIndex index,
                     @Mocked LakeTablet tablet,
                     @Mocked LakeService lakeService) throws StarClientException {
        LakeTableCleaner cleaner = new LakeTableCleaner(table);

        new MockUp<Utils>() {
            @Mock
            public ComputeNode chooseNode(ShardInfo info) {
                return new ComputeNode();
            }
        };

        new MockUp<BrpcProxy>() {
            @Mock
            public LakeService getLakeService(TNetworkAddress address) {
                return lakeService;
            }
        };

        new MockUp<WarehouseManager>() {
            @Mock
            public Warehouse getWarehouse(String warehouseName) {
                return new DefaultWarehouse(WarehouseManager.DEFAULT_WAREHOUSE_ID, WarehouseManager.DEFAULT_WAREHOUSE_NAME);
            }

            @Mock
            public Warehouse getWarehouse(long warehouseId) {
                return new DefaultWarehouse(WarehouseManager.DEFAULT_WAREHOUSE_ID, WarehouseManager.DEFAULT_WAREHOUSE_NAME);
            }
        };

        new Expectations() {
            {
                table.getAllPhysicalPartitions();
                result = Lists.newArrayList(partition);
                minTimes = 1;
                maxTimes = 1;

                partition.getMaterializedIndices(MaterializedIndex.IndexExtState.ALL);
                result = Lists.newArrayList(index);
                minTimes = 1;
                maxTimes = 1;

                index.getTablets();
                result = Lists.newArrayList(tablet);
                minTimes = 1;
                maxTimes = 1;

                lakeService.dropTable((DropTableRequest) any);
                result = CompletableFuture.completedFuture(new DropTableResponse());
                minTimes = 1;
                maxTimes = 1;
            }
        };

        Assert.assertTrue(cleaner.cleanTable());
    }