Skip to content

Commit

Permalink
add command
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteYue committed Jul 10, 2024
1 parent 30436a7 commit f6076d4
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.apache.doris.nereids.DorisParser.AliasQueryContext;
import org.apache.doris.nereids.DorisParser.AliasedQueryContext;
import org.apache.doris.nereids.DorisParser.AlterMTMVContext;
import org.apache.doris.nereids.DorisParser.AlterStorageVaultContext;
import org.apache.doris.nereids.DorisParser.AlterViewContext;
import org.apache.doris.nereids.DorisParser.ArithmeticBinaryContext;
import org.apache.doris.nereids.DorisParser.ArithmeticUnaryContext;
Expand Down Expand Up @@ -364,6 +365,7 @@
import org.apache.doris.nereids.trees.plans.algebra.SetOperation.Qualifier;
import org.apache.doris.nereids.trees.plans.commands.AddConstraintCommand;
import org.apache.doris.nereids.trees.plans.commands.AlterMTMVCommand;
import org.apache.doris.nereids.trees.plans.commands.AlterStorageVaultCommand;
import org.apache.doris.nereids.trees.plans.commands.AlterViewCommand;
import org.apache.doris.nereids.trees.plans.commands.CallCommand;
import org.apache.doris.nereids.trees.plans.commands.CancelMTMVTaskCommand;
Expand Down Expand Up @@ -873,6 +875,14 @@ public LogicalPlan visitAlterView(AlterViewContext ctx) {
return new AlterViewCommand(info);
}

@Override
public LogicalPlan visitAlterStorageVault(AlterStorageVaultContext ctx) {
List<String> nameParts = this.visitMultipartIdentifier(ctx.name);
String vaultName = nameParts.get(0);
Map<String, String> properties = this.visitPropertyClause(ctx.properties);
return new AlterStorageVaultCommand(vaultName, properties);
}

@Override
public LogicalPlan visitShowConstraint(ShowConstraintContext ctx) {
List<String> parts = visitMultipartIdentifier(ctx.table);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ public enum PlanType {
SHOW_CREATE_PROCEDURE_COMMAND,
CREATE_VIEW_COMMAND,
ALTER_VIEW_COMMAND,
ALTER_STORAGE_VAULT,
DROP_CATALOG_RECYCLE_BIN_COMMAND,
UNSUPPORTED_COMMAND,
CREATE_TABLE_LIKE_COMMAND,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// 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.nereids.trees.plans.commands;

import org.apache.doris.nereids.trees.plans.PlanType;
import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
import org.apache.doris.qe.ConnectContext;
import org.apache.doris.qe.StmtExecutor;

import java.util.Map;

public class AlterStorageVaultCommand extends Command implements ForwardWithSync {
private final Map<String, String> properties;
private final String name;

public AlterStorageVaultCommand(String name, final Map<String, String> properties) {
super(PlanType.ALTER_STORAGE_VAULT);
this.name = name;
this.properties = properties;
}

@Override
public void run(ConnectContext ctx, StmtExecutor executor) throws Exception {
}

@Override
public <R, C> R accept(PlanVisitor<R, C> visitor, C context) {
return visitor.visitCommand(this, context);
}
}

0 comments on commit f6076d4

Please sign in to comment.