-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementation feature list:Union, Remove, ListComprehension, Profile…
… & Tests includes TestUnion, TestRemove, TestListComprehension, TestProfile (#577) * merge cypher_lpp * merge cypher_lpp * rm explicit * fix log_info * fix pattern graph dump plan * fix comment * fix comment * fix comment * fix comment * fix comment * fix comment * fix comment * fix comment * fix comment * fix comment * fix comment * fix comment * fix comment * fix comment * fix comment * fix comment * fix comment * update ci.yml * fix list comprehension * fix list comprehension * fix list comprehension * fix list comprehension * fix list comprehension * fix list comprehension * fix list comprehension
- Loading branch information
1 parent
420357e
commit 1e87fb2
Showing
35 changed files
with
703 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
deps/geax-front-end/include/geax-front-end/ast/clause/RemoveItem.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// Created by lipanpan on 2024/6/18. | ||
// | ||
|
||
#ifndef GEAXFRONTEND_AST_CLAUSE_REMOVEITEM_H_ | ||
#define GEAXFRONTEND_AST_CLAUSE_REMOVEITEM_H_ | ||
|
||
#include "geax-front-end/ast/AstNode.h" | ||
|
||
namespace geax { | ||
namespace frontend { | ||
|
||
class RemoveItem : public AstNode { | ||
public: | ||
explicit RemoveItem(AstNodeType type) : AstNode(type) {} | ||
~RemoveItem() = default; | ||
}; | ||
|
||
} // namespace frontend | ||
} // namespace geax | ||
|
||
#endif // GEAXFRONTEND_AST_CLAUSE_REMOVEITEM_H_ |
35 changes: 35 additions & 0 deletions
35
deps/geax-front-end/include/geax-front-end/ast/clause/RemoveSingleProperty.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// Created by lipanpan on 2024/6/18. | ||
// | ||
|
||
#ifndef GEAXFRONTEND_AST_CLAUSE_REMOVESINGLEPROPERTY_H_ | ||
#define GEAXFRONTEND_AST_CLAUSE_REMOVESINGLEPROPERTY_H_ | ||
|
||
#include "geax-front-end/ast/clause/RemoveItem.h" | ||
#include "geax-front-end/ast/expr/Expr.h" | ||
|
||
namespace geax { | ||
namespace frontend { | ||
|
||
class RemoveSingleProperty : public RemoveItem { | ||
public: | ||
RemoveSingleProperty() : RemoveItem(AstNodeType::kRemoveSingleProperty) {} | ||
~RemoveSingleProperty() = default; | ||
|
||
void setV(std::string&& v) { v_ = std::move(v); } | ||
const std::string& v() const { return v_; } | ||
|
||
void setProperty(std::string&& property) { property_ = property; } | ||
const std::string& property() const { return property_; } | ||
|
||
std::any accept(AstNodeVisitor& visitor) override { return visitor.visit(this); } | ||
|
||
private: | ||
std::string v_; | ||
std::string property_; | ||
}; | ||
|
||
} // namespace frontend | ||
} // namespace geax | ||
|
||
#endif // GEAXFRONTEND_AST_CLAUSE_REMOVESINGLEPROPERTY_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
deps/geax-front-end/include/geax-front-end/ast/expr/ListComprehension.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** | ||
* Copyright 2023 AntGroup CO., Ltd. | ||
* | ||
* Licensed 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. | ||
* | ||
* Author: | ||
* lili <[email protected]> | ||
*/ | ||
|
||
#ifndef GEAXFRONTEND_AST_EXPR_LIST_COMPREHENSION_ | ||
#define GEAXFRONTEND_AST_EXPR_LIST_COMPREHENSION_ | ||
|
||
#include "geax-front-end/ast/expr/Expr.h" | ||
#include <vector> | ||
|
||
namespace geax { | ||
namespace frontend { | ||
|
||
class ListComprehension : public Expr { | ||
public: | ||
ListComprehension() : Expr(AstNodeType::kListComprehension) {} | ||
~ListComprehension() = default; | ||
void setVariable(Expr* expr) {variable_ = expr; } | ||
void setInExpression(Expr* expr) {in_expression_ = expr; } | ||
void setOpExpression(Expr* expr) {op_expression_ = expr; } | ||
Expr* getVariable() {return variable_; } | ||
Expr* getInExpression() {return in_expression_; } | ||
Expr* getOpExpression() {return op_expression_; } | ||
|
||
std::any accept(AstNodeVisitor& visitor) override { return visitor.visit(this); } | ||
|
||
private: | ||
bool equals(const Expr& other) const override; | ||
|
||
// now (variable, in_expression, op_expression), scalable | ||
Expr* variable_; | ||
Expr* in_expression_; | ||
Expr* op_expression_; | ||
}; // class ListComprehension | ||
|
||
inline bool ListComprehension::equals(const Expr& other) const { | ||
const auto& expr = dynamic_cast<const ListComprehension&>(other); | ||
return variable_ != nullptr && expr.variable_ != nullptr && | ||
variable_ == expr.variable_ && in_expression_ != nullptr && | ||
expr.in_expression_ != nullptr && in_expression_ == expr.in_expression_ && | ||
op_expression_ != nullptr && expr.op_expression_ != nullptr && | ||
op_expression_ == expr.op_expression_; | ||
} | ||
|
||
} // namespace frontend | ||
} // namespace geax | ||
|
||
#endif // GEAXFRONTEND_AST_EXPR_LIST_COMPREHENSION_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.