This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 7a50e54a499 [chore](backup) remove AbstractBackupTableRefClause
(#60801)
7a50e54a499 is described below
commit 7a50e54a499c82c997ca68029a5b61124779e496
Author: morrySnow <[email protected]>
AuthorDate: Wed Feb 25 10:37:07 2026 +0800
[chore](backup) remove AbstractBackupTableRefClause (#60801)
---
.../analysis/AbstractBackupTableRefClause.java | 96 ----------------------
.../apache/doris/service/FrontendServiceImpl.java | 13 +--
2 files changed, 2 insertions(+), 107 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/AbstractBackupTableRefClause.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/AbstractBackupTableRefClause.java
deleted file mode 100644
index 6a5f27c5073..00000000000
---
a/fe/fe-core/src/main/java/org/apache/doris/analysis/AbstractBackupTableRefClause.java
+++ /dev/null
@@ -1,96 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package org.apache.doris.analysis;
-
-import org.apache.doris.common.AnalysisException;
-import org.apache.doris.common.UserException;
-import org.apache.doris.info.TableRefInfo;
-import org.apache.doris.qe.GlobalVariable;
-
-import com.google.common.base.Joiner;
-import com.google.common.collect.Maps;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-
-import java.util.List;
-import java.util.Map;
-
-public class AbstractBackupTableRefClause implements ParseNode {
- private static final Logger LOG =
LogManager.getLogger(AbstractBackupTableRefClause.class);
-
- private boolean isExclude;
- private List<TableRefInfo> tableRefList;
-
- public AbstractBackupTableRefClause(boolean isExclude, List<TableRefInfo>
tableRefList) {
- this.isExclude = isExclude;
- this.tableRefList = tableRefList;
- }
-
- @Override
- public void analyze() throws UserException {
- // normalize
- // table name => table ref
- Map<String, TableRefInfo> tblPartsMap;
- if (GlobalVariable.lowerCaseTableNames == 0) {
- // comparisons case sensitive
- tblPartsMap = Maps.newTreeMap();
- } else {
- tblPartsMap = Maps.newTreeMap(String.CASE_INSENSITIVE_ORDER);
- }
- for (TableRefInfo tblRef : tableRefList) {
- String tblName = tblRef.getTableNameInfo().getTbl();
- if (!tblPartsMap.containsKey(tblName)) {
- tblPartsMap.put(tblName, tblRef);
- } else {
- throw new AnalysisException("Duplicated table: " + tblName);
- }
- }
-
- // update table ref
- tableRefList.clear();
- for (TableRefInfo tableRef : tblPartsMap.values()) {
- tableRefList.add(tableRef);
- }
-
- if (LOG.isDebugEnabled()) {
- LOG.debug("table refs after normalization: {}",
Joiner.on(",").join(tableRefList));
- }
- }
-
- public boolean isExclude() {
- return isExclude;
- }
-
- public List<TableRefInfo> getTableRefList() {
- return tableRefList;
- }
-
- @Override
- public String toSql() {
- StringBuilder sb = new StringBuilder();
- if (isExclude) {
- sb.append("EXCLUDE ");
- } else {
- sb.append("ON ");
- }
- sb.append("\n(");
- sb.append(Joiner.on(",\n").join(tableRefList));
- sb.append("\n)");
- return sb.toString();
- }
-}
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
b/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
index 732d77057d0..aefd77ce7c7 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
@@ -17,7 +17,6 @@
package org.apache.doris.service;
-import org.apache.doris.analysis.AbstractBackupTableRefClause;
import org.apache.doris.analysis.PartitionExprUtil;
import org.apache.doris.analysis.SetType;
import org.apache.doris.analysis.UserIdentity;
@@ -3179,9 +3178,8 @@ public class FrontendServiceImpl implements
FrontendService.Iface {
properties.put(RestoreCommand.PROP_FORCE_REPLACE, "true");
}
- AbstractBackupTableRefClause restoreTableRefClause = null;
+ List<TableRefInfo> tableRefs = new ArrayList<>();
if (request.isSetTableRefs()) {
- List<TableRefInfo> tableRefs = new ArrayList<>();
for (TTableRef tTableRef : request.getTableRefs()) {
tableRefs.add(new TableRefInfo(new
TableNameInfo(tTableRef.getTable()),
null,
@@ -3192,11 +3190,6 @@ public class FrontendServiceImpl implements
FrontendService.Iface {
null,
new ArrayList<>()));
}
-
- if (tableRefs.size() > 0) {
- boolean isExclude = false;
- restoreTableRefClause = new
AbstractBackupTableRefClause(isExclude, tableRefs);
- }
}
BackupMeta backupMeta;
@@ -3232,9 +3225,7 @@ public class FrontendServiceImpl implements
FrontendService.Iface {
//instantiate RestoreCommand
LabelNameInfo labelNameInfo = new LabelNameInfo(label.getDb(),
label.getLabel());
- List<TableRefInfo> tableRefInfos = restoreTableRefClause == null
- ? new ArrayList<>() : restoreTableRefClause.getTableRefList();
- RestoreCommand restoreCommand = new RestoreCommand(labelNameInfo,
repoName, tableRefInfos, properties, false);
+ RestoreCommand restoreCommand = new RestoreCommand(labelNameInfo,
repoName, tableRefs, properties, false);
restoreCommand.setMeta(backupMeta);
restoreCommand.setJobInfo(backupJobInfo);
restoreCommand.setIsBeingSynced();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]