diff --git a/fe/fe-core/src/main/java/com/starrocks/sql/analyzer/BackupRestoreAnalyzer.java b/fe/fe-core/src/main/java/com/starrocks/sql/analyzer/BackupRestoreAnalyzer.java index e9706bf089dde..e01bf889a6bc0 100644 --- a/fe/fe-core/src/main/java/com/starrocks/sql/analyzer/BackupRestoreAnalyzer.java +++ b/fe/fe-core/src/main/java/com/starrocks/sql/analyzer/BackupRestoreAnalyzer.java @@ -165,12 +165,12 @@ public Void visitBackupStatement(BackupStmt backupStmt, ConnectContext context) String fnName = entry.getKey(); List fns = entry.getValue(); - boolean notExisted = fnRefs.stream() - .allMatch(fnRef -> fnRef.getFnName().getFunction().equalsIgnoreCase(fnName)); - - if (notExisted) { - fnRefs.add(new FunctionRef(fns)); + if (fnRefs.stream().anyMatch(x -> x.getFunctions().get(0) + .getFunctionName().getFunction().equalsIgnoreCase(fnName))) { + continue; } + + fnRefs.add(new FunctionRef(fns)); } } else { backupStmt.getFnRefs().stream().forEach(x -> x.analyzeForBackup(database));