nooneuse commented on code in PR #66307:
URL: https://github.com/apache/doris/pull/66307#discussion_r3886050076
##########
fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java:
##########
@@ -1063,6 +1067,28 @@ private void checkAndPrepareMeta() {
setState(RestoreJobState.CREATING);
}
+ private boolean validateDistributionMappingConstraintsForRestore() {
+ boolean featureCompatibilityValidated = false;
+ for (String tableName : jobInfo.backupOlapTableObjects.keySet()) {
+ OlapTable restoredTable = (OlapTable)
backupMeta.getTable(tableName);
+ if
(env.getConstraintManager().getDistributionMappingConstraints(restoredTable).isEmpty())
{
+ continue;
+ }
+ try {
+ if (!featureCompatibilityValidated) {
+
env.getConstraintManager().validateDistributionMappingFeatureCompatibility();
+ featureCompatibilityValidated = true;
+ }
+
env.getConstraintManager().validateDistributionMappingConstraints(restoredTable);
Review Comment:
ok
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/DropConstraintCommand.java:
##########
@@ -101,6 +113,30 @@ public void run(ConnectContext ctx, StmtExecutor executor)
throws Exception {
String.format("after drop constraint %s on table %s",
constraint.getName(), tableNameInfo));
}
+ private void dropDistributionMapping(TableNameInfo tableNameInfo,
+ TableIf analyzedTable) throws Exception {
+ EditLog.EditLogItem logItem;
+ analyzedTable.getDatabase().readLock();
+ try {
+ if
(analyzedTable.getDatabase().getCatalog().getDbNullable(tableNameInfo.getDb())
+ != analyzedTable.getDatabase()
+ ||
analyzedTable.getDatabase().getTableNullable(tableNameInfo.getTbl()) !=
analyzedTable) {
+ throw new AnalysisException("Table changed while dropping
constraint on " + tableNameInfo);
+ }
+ analyzedTable.writeLock();
+ try {
+ logItem = Env.getCurrentEnv().getConstraintManager()
Review Comment:
okay
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]