Skip to content

Commit

Permalink
format find path (#2957)
Browse files Browse the repository at this point in the history
* format find path

* add test case

* only support yield path

* fix test error

* address comment

* fix error

* add yield clause

* fix ci test

* remove reduncant header file

* fix clang compiler error

* fix spell error
  • Loading branch information
nevermore3 authored Nov 23, 2021
1 parent 80e827f commit 6cdca05
Show file tree
Hide file tree
Showing 67 changed files with 797 additions and 586 deletions.
1 change: 1 addition & 0 deletions .linters/cpp/checkKeyword.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
'KW_WHEN',
'KW_DELETE',
'KW_FIND',
'KW_PATH',
'KW_LOOKUP',
'KW_ALTER',
'KW_STEPS',
Expand Down
1 change: 1 addition & 0 deletions src/graph/context/ast/QueryAstContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ struct PathContext final : AstContext {
StepClause steps;
Over over;
Expression* filter{nullptr};
std::vector<std::string> colNames;

/*
* find path from A to B OR find path from $-.src to $-.dst
Expand Down
4 changes: 0 additions & 4 deletions src/graph/optimizer/OptGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
#ifndef GRAPH_OPTIMIZER_OPTGROUP_H_
#define GRAPH_OPTIMIZER_OPTGROUP_H_

#include <algorithm>
#include <list>
#include <vector>

#include "common/base/Status.h"

namespace nebula {
Expand Down
2 changes: 0 additions & 2 deletions src/graph/optimizer/Optimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#ifndef GRAPH_OPTIMIZER_OPTIMIZER_H_
#define GRAPH_OPTIMIZER_OPTIMIZER_H_

#include <memory>

#include "common/base/Base.h"
#include "common/base/StatusOr.h"

Expand Down
12 changes: 0 additions & 12 deletions src/graph/optimizer/OptimizerUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,9 @@

#include "graph/optimizer/OptimizerUtils.h"

#include <algorithm>
#include <iterator>
#include <memory>
#include <unordered_set>

#include "common/base/Status.h"
#include "common/datatypes/Value.h"
#include "common/expression/ConstantExpression.h"
#include "common/expression/Expression.h"
#include "common/expression/LogicalExpression.h"
#include "common/expression/PropertyExpression.h"
#include "common/expression/RelationalExpression.h"
#include "graph/planner/plan/Query.h"
#include "interface/gen-cpp2/meta_types.h"
#include "interface/gen-cpp2/storage_types.h"

using nebula::meta::cpp2::ColumnDef;
using nebula::meta::cpp2::IndexItem;
Expand Down
2 changes: 0 additions & 2 deletions src/graph/optimizer/rule/CollapseProjectRule.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#ifndef GRAPH_OPTIMIZER_RULE_COLLAPSEPROJECTRULE_H_
#define GRAPH_OPTIMIZER_RULE_COLLAPSEPROJECTRULE_H_

#include <memory>

#include "graph/optimizer/OptRule.h"

namespace nebula {
Expand Down
2 changes: 0 additions & 2 deletions src/graph/optimizer/rule/CombineFilterRule.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#ifndef GRAPH_OPTIMIZER_RULE_COMBINEFILTERRULE_H_
#define GRAPH_OPTIMIZER_RULE_COMBINEFILTERRULE_H_

#include <memory>

#include "graph/optimizer/OptRule.h"

namespace nebula {
Expand Down
3 changes: 0 additions & 3 deletions src/graph/optimizer/rule/GeoPredicateIndexScanBaseRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#include "graph/optimizer/rule/GeoPredicateIndexScanBaseRule.h"

#include "common/expression/Expression.h"
#include "common/expression/LogicalExpression.h"
#include "common/geo/GeoIndex.h"
#include "graph/optimizer/OptContext.h"
#include "graph/optimizer/OptGroup.h"
Expand All @@ -16,7 +14,6 @@
#include "graph/planner/plan/Query.h"
#include "graph/planner/plan/Scan.h"
#include "graph/util/ExpressionUtils.h"
#include "interface/gen-cpp2/storage_types.h"

using nebula::graph::Filter;
using nebula::graph::IndexScan;
Expand Down
2 changes: 0 additions & 2 deletions src/graph/optimizer/rule/IndexScanRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#include "graph/optimizer/rule/IndexScanRule.h"

#include <vector>

#include "common/expression/LabelAttributeExpression.h"
#include "graph/optimizer/OptContext.h"
#include "graph/optimizer/OptGroup.h"
Expand Down
12 changes: 0 additions & 12 deletions src/graph/optimizer/rule/OptimizeEdgeIndexScanByFilterRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,12 @@

#include "graph/optimizer/rule/OptimizeEdgeIndexScanByFilterRule.h"

#include <algorithm>
#include <memory>
#include <vector>

#include "common/base/Base.h"
#include "common/base/Status.h"
#include "common/expression/Expression.h"
#include "common/expression/LogicalExpression.h"
#include "common/expression/PropertyExpression.h"
#include "common/expression/RelationalExpression.h"
#include "graph/context/QueryContext.h"
#include "graph/optimizer/OptContext.h"
#include "graph/optimizer/OptGroup.h"
#include "graph/optimizer/OptimizerUtils.h"
#include "graph/planner/plan/PlanNode.h"
#include "graph/planner/plan/Scan.h"
#include "interface/gen-cpp2/meta_types.h"
#include "interface/gen-cpp2/storage_types.h"

using nebula::Expression;
using nebula::graph::EdgeIndexFullScan;
Expand Down
2 changes: 0 additions & 2 deletions src/graph/optimizer/rule/OptimizeEdgeIndexScanByFilterRule.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#ifndef GRAPH_OPTIMIZER_RULE_OPTIMIZEEDGEINDEXSCANBYFILTERRULE_H_
#define GRAPH_OPTIMIZER_RULE_OPTIMIZEEDGEINDEXSCANBYFILTERRULE_H_

#include <memory>

#include "graph/optimizer/OptRule.h"

namespace nebula {
Expand Down
2 changes: 0 additions & 2 deletions src/graph/optimizer/rule/OptimizeTagIndexScanByFilterRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@

#include "graph/optimizer/rule/OptimizeTagIndexScanByFilterRule.h"

#include "common/expression/Expression.h"
#include "graph/context/QueryContext.h"
#include "graph/optimizer/OptContext.h"
#include "graph/optimizer/OptGroup.h"
#include "graph/optimizer/OptimizerUtils.h"
#include "graph/optimizer/rule/IndexScanRule.h"
#include "graph/planner/plan/PlanNode.h"
#include "graph/planner/plan/Scan.h"
#include "interface/gen-cpp2/storage_types.h"

using nebula::graph::Filter;
using nebula::graph::OptimizerUtils;
Expand Down
2 changes: 0 additions & 2 deletions src/graph/optimizer/rule/OptimizeTagIndexScanByFilterRule.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#ifndef GRAPH_OPTIMIZER_RULE_OPTIMIZETAGINDEXSCANBYFILTERRULE_H_
#define GRAPH_OPTIMIZER_RULE_OPTIMIZETAGINDEXSCANBYFILTERRULE_H_

#include <memory>

#include "graph/optimizer/OptRule.h"

namespace nebula {
Expand Down
2 changes: 0 additions & 2 deletions src/graph/optimizer/rule/PushFilterDownAggregateRule.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#ifndef GRAPH_OPTIMIZER_RULE_PUSHFILTERDOWNAGGREGATERULE_H_
#define GRAPH_OPTIMIZER_RULE_PUSHFILTERDOWNAGGREGATERULE_H_

#include <memory>

#include "graph/optimizer/OptRule.h"

namespace nebula {
Expand Down
5 changes: 0 additions & 5 deletions src/graph/optimizer/rule/PushFilterDownGetNbrsRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@

#include "graph/optimizer/rule/PushFilterDownGetNbrsRule.h"

#include "common/expression/BinaryExpression.h"
#include "common/expression/ConstantExpression.h"
#include "common/expression/Expression.h"
#include "common/expression/FunctionCallExpression.h"
#include "common/expression/LogicalExpression.h"
#include "common/expression/UnaryExpression.h"
#include "graph/optimizer/OptContext.h"
#include "graph/optimizer/OptGroup.h"
#include "graph/planner/plan/PlanNode.h"
Expand Down
2 changes: 0 additions & 2 deletions src/graph/optimizer/rule/PushFilterDownGetNbrsRule.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#ifndef GRAPH_OPTIMIZER_RULE_PUSHFILTERDOWNGETNBRSRULE_H_
#define GRAPH_OPTIMIZER_RULE_PUSHFILTERDOWNGETNBRSRULE_H_

#include <memory>

#include "graph/optimizer/OptRule.h"

namespace nebula {
Expand Down
2 changes: 0 additions & 2 deletions src/graph/optimizer/rule/PushFilterDownLeftJoinRule.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#ifndef GRAPH_OPTIMIZER_RULE_PUSHFILTERDOWNLEFTJOINRULE_H_
#define GRAPH_OPTIMIZER_RULE_PUSHFILTERDOWNLEFTJOINRULE_H_

#include <memory>

#include "graph/optimizer/OptRule.h"

namespace nebula {
Expand Down
2 changes: 0 additions & 2 deletions src/graph/optimizer/rule/PushFilterDownProjectRule.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#ifndef GRAPH_OPTIMIZER_RULE_PUSHFILTERDOWNPROJECTRULE_H_
#define GRAPH_OPTIMIZER_RULE_PUSHFILTERDOWNPROJECTRULE_H_

#include <memory>

#include "graph/optimizer/OptRule.h"

namespace nebula {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@

#include "graph/optimizer/rule/PushLimitDownEdgeIndexFullScanRule.h"

#include "common/expression/BinaryExpression.h"
#include "common/expression/ConstantExpression.h"
#include "common/expression/Expression.h"
#include "common/expression/FunctionCallExpression.h"
#include "common/expression/LogicalExpression.h"
#include "common/expression/UnaryExpression.h"
#include "graph/optimizer/OptContext.h"
#include "graph/optimizer/OptGroup.h"
#include "graph/planner/plan/PlanNode.h"
Expand Down
2 changes: 0 additions & 2 deletions src/graph/optimizer/rule/PushLimitDownEdgeIndexFullScanRule.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#pragma once

#include <memory>

#include "graph/optimizer/OptRule.h"

namespace nebula {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@

#include "graph/optimizer/rule/PushLimitDownEdgeIndexPrefixScanRule.h"

#include "common/expression/BinaryExpression.h"
#include "common/expression/ConstantExpression.h"
#include "common/expression/Expression.h"
#include "common/expression/FunctionCallExpression.h"
#include "common/expression/LogicalExpression.h"
#include "common/expression/UnaryExpression.h"
#include "graph/optimizer/OptContext.h"
#include "graph/optimizer/OptGroup.h"
#include "graph/planner/plan/PlanNode.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#pragma once

#include <memory>

#include "graph/optimizer/OptRule.h"

namespace nebula {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@

#include "graph/optimizer/rule/PushLimitDownEdgeIndexRangeScanRule.h"

#include "common/expression/BinaryExpression.h"
#include "common/expression/ConstantExpression.h"
#include "common/expression/Expression.h"
#include "common/expression/FunctionCallExpression.h"
#include "common/expression/LogicalExpression.h"
#include "common/expression/UnaryExpression.h"
#include "graph/optimizer/OptContext.h"
#include "graph/optimizer/OptGroup.h"
#include "graph/planner/plan/PlanNode.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#pragma once

#include <memory>

#include "graph/optimizer/OptRule.h"

namespace nebula {
Expand Down
7 changes: 0 additions & 7 deletions src/graph/optimizer/rule/PushLimitDownGetNeighborsRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,10 @@

#include "graph/optimizer/rule/PushLimitDownGetNeighborsRule.h"

#include "common/expression/BinaryExpression.h"
#include "common/expression/ConstantExpression.h"
#include "common/expression/Expression.h"
#include "common/expression/FunctionCallExpression.h"
#include "common/expression/LogicalExpression.h"
#include "common/expression/UnaryExpression.h"
#include "graph/optimizer/OptContext.h"
#include "graph/optimizer/OptGroup.h"
#include "graph/planner/plan/PlanNode.h"
#include "graph/planner/plan/Query.h"
#include "graph/visitor/ExtractFilterExprVisitor.h"

using nebula::graph::GetNeighbors;
using nebula::graph::Limit;
Expand Down
2 changes: 0 additions & 2 deletions src/graph/optimizer/rule/PushLimitDownGetNeighborsRule.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#pragma once

#include <memory>

#include "graph/optimizer/OptRule.h"

namespace nebula {
Expand Down
7 changes: 0 additions & 7 deletions src/graph/optimizer/rule/PushLimitDownIndexScanRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,10 @@

#include "graph/optimizer/rule/PushLimitDownIndexScanRule.h"

#include "common/expression/BinaryExpression.h"
#include "common/expression/ConstantExpression.h"
#include "common/expression/Expression.h"
#include "common/expression/FunctionCallExpression.h"
#include "common/expression/LogicalExpression.h"
#include "common/expression/UnaryExpression.h"
#include "graph/optimizer/OptContext.h"
#include "graph/optimizer/OptGroup.h"
#include "graph/planner/plan/PlanNode.h"
#include "graph/planner/plan/Query.h"
#include "graph/visitor/ExtractFilterExprVisitor.h"

using nebula::graph::IndexScan;
using nebula::graph::Limit;
Expand Down
2 changes: 0 additions & 2 deletions src/graph/optimizer/rule/PushLimitDownIndexScanRule.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#pragma once

#include <memory>

#include "graph/optimizer/OptRule.h"

namespace nebula {
Expand Down
7 changes: 0 additions & 7 deletions src/graph/optimizer/rule/PushLimitDownProjectRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,10 @@

#include "graph/optimizer/rule/PushLimitDownProjectRule.h"

#include "common/expression/BinaryExpression.h"
#include "common/expression/ConstantExpression.h"
#include "common/expression/Expression.h"
#include "common/expression/FunctionCallExpression.h"
#include "common/expression/LogicalExpression.h"
#include "common/expression/UnaryExpression.h"
#include "graph/optimizer/OptContext.h"
#include "graph/optimizer/OptGroup.h"
#include "graph/planner/plan/PlanNode.h"
#include "graph/planner/plan/Query.h"
#include "graph/visitor/ExtractFilterExprVisitor.h"

using nebula::graph::Limit;
using nebula::graph::PlanNode;
Expand Down
2 changes: 0 additions & 2 deletions src/graph/optimizer/rule/PushLimitDownProjectRule.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#pragma once

#include <memory>

#include "graph/optimizer/OptRule.h"

namespace nebula {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,10 @@

#include "graph/optimizer/rule/PushLimitDownTagIndexFullScanRule.h"

#include "common/expression/BinaryExpression.h"
#include "common/expression/ConstantExpression.h"
#include "common/expression/Expression.h"
#include "common/expression/FunctionCallExpression.h"
#include "common/expression/LogicalExpression.h"
#include "common/expression/UnaryExpression.h"
#include "graph/optimizer/OptContext.h"
#include "graph/optimizer/OptGroup.h"
#include "graph/planner/plan/PlanNode.h"
#include "graph/planner/plan/Scan.h"
#include "graph/visitor/ExtractFilterExprVisitor.h"

using nebula::graph::Limit;
using nebula::graph::PlanNode;
Expand Down
2 changes: 0 additions & 2 deletions src/graph/optimizer/rule/PushLimitDownTagIndexFullScanRule.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#pragma once

#include <memory>

#include "graph/optimizer/OptRule.h"

namespace nebula {
Expand Down
Loading

0 comments on commit 6cdca05

Please sign in to comment.