public static TObjectDependencyRes listObjectDependencies(TObjectDependencyReq req) {
        TAuthInfo auth = req.getAuth_info();
        TObjectDependencyRes response = new TObjectDependencyRes();

        UserIdentity currentUser;
        if (auth.isSetCurrent_user_ident()) {
            currentUser = UserIdentity.fromThrift(auth.getCurrent_user_ident());
        } else {
            currentUser = UserIdentity.createAnalyzedUserIdentWithIp(auth.getUser(), auth.getUser_ip());
        }

        // list dependencies of mv
        Locker locker = new Locker();
        Collection<Database> dbs = GlobalStateMgr.getCurrentState().getLocalMetastore().getFullNameToDb().values();
        for (Database db : CollectionUtils.emptyIfNull(dbs)) {
            String catalog = Optional.ofNullable(db.getCatalogName())
                    .orElse(InternalCatalog.DEFAULT_INTERNAL_CATALOG_NAME);
            locker.lockDatabase(db, LockType.READ);
            try {
                for (Table table : db.getTables()) {
                    // If it is not a materialized view, we do not need to verify permissions
                    if (!table.isMaterializedView()) {
                        continue;
                    }
                    // Only show tables with privilege
                    try {
                        Authorizer.checkAnyActionOnTableLikeObject(currentUser, null, db.getFullName(), table);
                    } catch (AccessDeniedException e) {
                        continue;
                    }

                    MaterializedView mv = (MaterializedView) table;
                    for (BaseTableInfo refObj : CollectionUtils.emptyIfNull(mv.getBaseTableInfos())) {
                        TObjectDependencyItem item = new TObjectDependencyItem();
                        item.setObject_id(mv.getId());
                        item.setObject_name(mv.getName());
                        item.setDatabase(db.getFullName());
                        item.setCatalog(catalog);
                        item.setObject_type(mv.getType().toString());

                        item.setRef_object_id(refObj.getTableId());
                        item.setRef_database(refObj.getDbName());
                        item.setRef_catalog(refObj.getCatalogName());
                        Optional<Table> refTable = MvUtils.getTableWithIdentifier(refObj);
                        item.setRef_object_type(getRefObjectType(refTable, mv.getName()));
                        // If the ref table is dropped/swapped/renamed, the actual info would be inconsistent with
                        // BaseTableInfo, so we use the source-of-truth information
                        if (refTable.isEmpty()) {
                            item.setRef_object_name(refObj.getTableName());
                        } else {
                            item.setRef_object_name(refTable.get().getName());
                        }

                        response.addToItems(item);
                    }
                }
            } finally {
                locker.unLockDatabase(db, LockType.READ);
            }
        }

        return response;
    }
@Test
    public void testUnknownCatalogObjectDependencies() throws Exception {
        String mvName = "test.iceberg_mv";
        starRocksAssert.withMaterializedView("create materialized view " + mvName + " " +
                        "partition by str2date(d,'%Y-%m-%d') " +
                        "distributed by hash(a) " +
                        "REFRESH DEFERRED MANUAL " +
                        "PROPERTIES (\n" +
                        "'replication_num' = '1'" +
                        ") " +
                        "as select a, b, d, bitmap_union(to_bitmap(t1.c))" +
                        " from iceberg0.partitioned_db.part_tbl1 as t1 " +
                        " group by a, b, d;");

        String grantSql1 = "GRANT ALL ON MATERIALIZED VIEW test.iceberg_mv TO USER `test_mv`@`%`;";
        DDLStmtExecutor.execute(UtFrameUtils.parseStmtWithNewParser(grantSql1, connectContext), connectContext);
        TObjectDependencyReq dependencyReq = buildRequest();
        TObjectDependencyRes objectDependencyRes = SysObjectDependencies.listObjectDependencies(dependencyReq);
        Assert.assertTrue(objectDependencyRes.getItems().stream().anyMatch(x -> x.getRef_object_type().equals("ICEBERG")));
    }