Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Oct 18, 2021
1 parent 2bfc459 commit 3484b36
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/graph/context/ast/QueryAstContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ struct FetchEdgesContext final : public AstContext {
std::string inputVarName;
};

struct AlterContext final : public AstContext {
struct AlterSchemaContext final : public AstContext {
std::vector<meta::cpp2::AlterSchemaItem> schemaItems;
meta::cpp2::SchemaProp schemaProps;
};

struct CreateContext final : public AstContext {
struct CreateSchemaContext final : public AstContext {
bool ifNotExist{false};
std::string name;
meta::cpp2::Schema schema;
Expand Down
8 changes: 4 additions & 4 deletions src/graph/planner/ngql/MaintainPlanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace nebula {
namespace graph {

StatusOr<SubPlan> CreateTagPlanner::transform(AstContext* astCtx) {
auto createCtx = static_cast<CreateContext*>(astCtx);
auto createCtx = static_cast<CreateSchemaContext*>(astCtx);
SubPlan plan;
plan.root = plan.tail = CreateTag::make(createCtx->qctx,
nullptr,
Expand All @@ -24,7 +24,7 @@ StatusOr<SubPlan> CreateTagPlanner::transform(AstContext* astCtx) {
}

StatusOr<SubPlan> CreateEdgePlanner::transform(AstContext* astCtx) {
auto createCtx = static_cast<CreateContext*>(astCtx);
auto createCtx = static_cast<CreateSchemaContext*>(astCtx);
SubPlan plan;
plan.root = plan.tail = CreateEdge::make(createCtx->qctx,
nullptr,
Expand All @@ -35,7 +35,7 @@ StatusOr<SubPlan> CreateEdgePlanner::transform(AstContext* astCtx) {
}

StatusOr<SubPlan> AlterTagPlanner::transform(AstContext* astCtx) {
auto alterCtx = static_cast<AlterContext*>(astCtx);
auto alterCtx = static_cast<AlterSchemaContext*>(astCtx);
auto qctx = alterCtx->qctx;
auto name = *static_cast<const AlterTagSentence*>(alterCtx->sentence)->name();
SubPlan plan;
Expand All @@ -49,7 +49,7 @@ StatusOr<SubPlan> AlterTagPlanner::transform(AstContext* astCtx) {
}

StatusOr<SubPlan> AlterEdgePlanner::transform(AstContext* astCtx) {
auto alterCtx = static_cast<AlterContext*>(astCtx);
auto alterCtx = static_cast<AlterSchemaContext*>(astCtx);
auto qctx = alterCtx->qctx;
auto name = *static_cast<const AlterEdgeSentence*>(alterCtx->sentence)->name();
SubPlan plan;
Expand Down
8 changes: 4 additions & 4 deletions src/graph/validator/MaintainValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static Status checkColName(const std::vector<ColumnSpecification *> specs) {
}

Status CreateTagValidator::validateImpl() {
createCtx_ = getContext<CreateContext>();
createCtx_ = getContext<CreateSchemaContext>();
auto sentence = static_cast<CreateTagSentence *>(sentence_);
createCtx_->ifNotExist = sentence->isIfNotExist();
auto name = *sentence->name();
Expand All @@ -165,7 +165,7 @@ Status CreateTagValidator::validateImpl() {
}

Status CreateEdgeValidator::validateImpl() {
createCtx_ = getContext<CreateContext>();
createCtx_ = getContext<CreateSchemaContext>();
auto sentence = static_cast<CreateEdgeSentence *>(sentence_);
createCtx_->ifNotExist = sentence->isIfNotExist();
auto name = *sentence->name();
Expand Down Expand Up @@ -210,7 +210,7 @@ Status DescEdgeValidator::toPlan() {
}

Status AlterTagValidator::validateImpl() {
alterCtx_ = getContext<AlterContext>();
alterCtx_ = getContext<AlterSchemaContext>();
auto sentence = static_cast<AlterTagSentence *>(sentence_);
auto schemaItems = validateSchemaOpts(sentence->getSchemaOpts());
NG_RETURN_IF_ERROR(schemaItems);
Expand All @@ -222,7 +222,7 @@ Status AlterTagValidator::validateImpl() {
}

Status AlterEdgeValidator::validateImpl() {
alterCtx_ = getContext<AlterContext>();
alterCtx_ = getContext<AlterSchemaContext>();
auto sentence = static_cast<AlterEdgeSentence *>(sentence_);
auto schemaItems = validateSchemaOpts(sentence->getSchemaOpts());
NG_RETURN_IF_ERROR(schemaItems);
Expand Down
8 changes: 4 additions & 4 deletions src/graph/validator/MaintainValidator.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CreateTagValidator final : public Validator {
private:
Status validateImpl() override;

std::unique_ptr<CreateContext> createCtx_;
std::unique_ptr<CreateSchemaContext> createCtx_;
};

class CreateEdgeValidator final : public Validator {
Expand All @@ -36,7 +36,7 @@ class CreateEdgeValidator final : public Validator {
private:
Status validateImpl() override;

std::unique_ptr<CreateContext> createCtx_;
std::unique_ptr<CreateSchemaContext> createCtx_;
};

class DescTagValidator final : public Validator {
Expand Down Expand Up @@ -90,7 +90,7 @@ class AlterTagValidator final : public Validator {
private:
Status validateImpl() override;

std::unique_ptr<AlterContext> alterCtx_;
std::unique_ptr<AlterSchemaContext> alterCtx_;
};

class AlterEdgeValidator final : public Validator {
Expand All @@ -102,7 +102,7 @@ class AlterEdgeValidator final : public Validator {
private:
Status validateImpl() override;

std::unique_ptr<AlterContext> alterCtx_;
std::unique_ptr<AlterSchemaContext> alterCtx_;
};

class ShowTagsValidator final : public Validator {
Expand Down

0 comments on commit 3484b36

Please sign in to comment.