Skip to content

Commit

Permalink
remove useless dc
Browse files Browse the repository at this point in the history
  • Loading branch information
jievince committed Aug 17, 2022
1 parent 0f75120 commit e4bce6d
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 71 deletions.
26 changes: 0 additions & 26 deletions src/graph/planner/SequentialPlanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ bool SequentialPlanner::match(AstContext* astCtx) {
StatusOr<SubPlan> SequentialPlanner::transform(AstContext* astCtx) {
SubPlan subPlan;
auto* seqCtx = static_cast<SequentialAstContext*>(astCtx);
auto* qctx = seqCtx->qctx;
const auto& validators = seqCtx->validators;
subPlan.root = validators.back()->root();
ifBuildDataCollect(subPlan, qctx);
for (auto iter = validators.begin(); iter < validators.end() - 1; ++iter) {
// Remove left tail kStart plannode before append plan.
// It allows that kUse sentence to append kMatch Sentence.
Expand All @@ -40,30 +38,6 @@ StatusOr<SubPlan> SequentialPlanner::transform(AstContext* astCtx) {
return subPlan;
}

void SequentialPlanner::ifBuildDataCollect(SubPlan& subPlan, QueryContext* qctx) {
switch (subPlan.root->kind()) {
case PlanNode::Kind::kSort:
case PlanNode::Kind::kLimit:
case PlanNode::Kind::kSample:
case PlanNode::Kind::kDedup:
case PlanNode::Kind::kUnion:
case PlanNode::Kind::kUnionAllVersionVar:
case PlanNode::Kind::kIntersect:
case PlanNode::Kind::kCartesianProduct:
case PlanNode::Kind::kMinus:
case PlanNode::Kind::kFilter: {
auto* dc = DataCollect::make(qctx, DataCollect::DCKind::kRowBasedMove);
dc->addDep(subPlan.root);
dc->setInputVars({subPlan.root->outputVar()});
dc->setColNames(subPlan.root->colNames());
subPlan.root = dc;
break;
}
default:
break;
}
}

// When appending plans, it need to remove left tail plannode.
// Because the left tail plannode is StartNode which needs to be removed,
// and remain one size for add dependency
Expand Down
2 changes: 0 additions & 2 deletions src/graph/planner/SequentialPlanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ class SequentialPlanner final : public Planner {
*/
StatusOr<SubPlan> transform(AstContext* astCtx) override;

void ifBuildDataCollect(SubPlan& subPlan, QueryContext* qctx);

void rmLeftTailStartNode(Validator* validator, Sentence::Kind appendPlanKind);

private:
Expand Down
8 changes: 0 additions & 8 deletions tests/tck/features/lookup/LookUpLimit.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Feature: Push Limit down IndexScan Rule
| /[a-zA-Z ']+/ |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | Sort | 6 | |
| 6 | Project | 7 | |
| 7 | Limit | 8 | {"count": "2"} |
Expand All @@ -33,7 +32,6 @@ Feature: Push Limit down IndexScan Rule
| /[a-zA-Z ']+/ | /[a-zA-Z ']+/ | /\d+/ |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | Sort | 6 | |
| 6 | Project | 7 | |
| 7 | Limit | 8 | {"count": "2"} |
Expand All @@ -49,7 +47,6 @@ Feature: Push Limit down IndexScan Rule
| /[a-zA-Z ']+/ |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | Sort | 6 | |
| 6 | Project | 7 | |
| 7 | Limit | 8 | {"count": "2"} |
Expand All @@ -65,7 +62,6 @@ Feature: Push Limit down IndexScan Rule
| /[a-zA-Z ']+/ | /[a-zA-Z ']+/ | /\d+/ |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | Sort | 6 | |
| 6 | Project | 7 | |
| 7 | Limit | 8 | {"count": "2"} |
Expand All @@ -84,7 +80,6 @@ Feature: Push Limit down IndexScan Rule
| /[a-zA-Z ']+/ |
And the execution plan should be:
| id | name | dependencies | operator info |
| 3 | DataCollect | 4 | |
| 4 | Sort | 5 | |
| 5 | Project | 7 | |
| 7 | Limit | 8 | |
Expand All @@ -101,7 +96,6 @@ Feature: Push Limit down IndexScan Rule
| /[a-zA-Z ']+/ | /[a-zA-Z ']+/ | /\d+/ |
And the execution plan should be:
| id | name | dependencies | operator info |
| 3 | DataCollect | 4 | |
| 4 | Sort | 5 | |
| 5 | Project | 7 | |
| 7 | Limit | 8 | |
Expand All @@ -118,7 +112,6 @@ Feature: Push Limit down IndexScan Rule
| /[a-zA-Z ']+/ |
And the execution plan should be:
| id | name | dependencies | operator info |
| 3 | DataCollect | 4 | |
| 4 | Sort | 5 | |
| 5 | Project | 7 | |
| 7 | Limit | 8 | |
Expand All @@ -135,7 +128,6 @@ Feature: Push Limit down IndexScan Rule
| /[a-zA-Z ']+/ | /[a-zA-Z ']+/ | /\d+/ |
And the execution plan should be:
| id | name | dependencies | operator info |
| 3 | DataCollect | 4 | |
| 4 | Sort | 5 | |
| 5 | Project | 7 | |
| 7 | Limit | 8 | |
Expand Down
22 changes: 0 additions & 22 deletions tests/tck/features/lookup/LookUpTopN.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ Feature: Push TopN down IndexScan Rule
| "Aron Baynes" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | {"count": "2"} |
| 6 | Project | 7 | |
| 7 | TagIndexFullScan | 0 | {"limit": "9223372036854775807" } |
| 0 | Start | | |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | |
| 6 | Project | 7 | |
| 7 | TagIndexFullScan | 0 | {"orderBy": "[]"} |
Expand All @@ -39,14 +37,12 @@ Feature: Push TopN down IndexScan Rule
| "DeAndre Jordan" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | {"count": "2"} |
| 6 | Project | 7 | |
| 7 | TagIndexPrefixScan | 0 | {"limit": "9223372036854775807" } |
| 0 | Start | | |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | |
| 6 | Project | 7 | |
| 7 | TagIndexPrefixScan | 0 | {"orderBy": "[]"} |
Expand All @@ -61,14 +57,12 @@ Feature: Push TopN down IndexScan Rule
| "Tim Duncan" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | {"count": "2"} |
| 6 | Project | 7 | |
| 7 | TagIndexRangeScan | 0 | {"limit": "9223372036854775807" } |
| 0 | Start | | |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | |
| 6 | Project | 7 | |
| 7 | TagIndexRangeScan | 0 | {"orderBy": "[]"} |
Expand All @@ -83,14 +77,12 @@ Feature: Push TopN down IndexScan Rule
| "Aron Baynes" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | {"count": "2"} |
| 6 | Project | 7 | |
| 7 | TagIndexFullScan | 0 | {"limit": "9223372036854775807" } |
| 0 | Start | | |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | |
| 6 | Project | 7 | |
| 7 | TagIndexFullScan | 0 | {"orderBy": "[]"} |
Expand All @@ -105,14 +97,12 @@ Feature: Push TopN down IndexScan Rule
| "Aron Baynes" | "Tim Duncan" | 0 |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | {"count": "2"} |
| 6 | Project | 7 | |
| 7 | EdgeIndexFullScan | 0 | {"limit": "9223372036854775807" } |
| 0 | Start | | |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | |
| 6 | Project | 7 | |
| 7 | EdgeIndexFullScan | 0 | {"orderBy": "[]"} |
Expand All @@ -127,14 +117,12 @@ Feature: Push TopN down IndexScan Rule
| "Carmelo Anthony" | "Chris Paul" | 0 |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | {"count": "2"} |
| 6 | Project | 7 | |
| 7 | EdgeIndexPrefixScan | 0 | {"limit": "9223372036854775807" } |
| 0 | Start | | |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | |
| 6 | Project | 7 | |
| 7 | EdgeIndexPrefixScan | 0 | {"orderBy": "[]"} |
Expand All @@ -149,14 +137,12 @@ Feature: Push TopN down IndexScan Rule
| "Dejounte Murray" | "Chris Paul" | 0 |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | {"count": "2"} |
| 6 | Project | 7 | |
| 7 | EdgeIndexRangeScan | 0 | {"limit": "9223372036854775807" } |
| 0 | Start | | |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | |
| 6 | Project | 7 | |
| 7 | EdgeIndexRangeScan | 0 | {"orderBy": "[]"} |
Expand All @@ -173,7 +159,6 @@ Feature: Push TopN down IndexScan Rule
| "Aron Baynes" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | {"count": "2"} |
| 6 | Project | 7 | |
| 7 | TagIndexFullScan | 0 | {"limit": "2" } |
Expand All @@ -188,7 +173,6 @@ Feature: Push TopN down IndexScan Rule
| "Kevin Durant" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | {"count": "2"} |
| 6 | Project | 7 | |
| 7 | TagIndexPrefixScan | 0 | {"limit": "2" } |
Expand All @@ -203,7 +187,6 @@ Feature: Push TopN down IndexScan Rule
| "DeAndre Jordan" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | {"count": "2"} |
| 6 | Project | 7 | |
| 7 | TagIndexPrefixScan | 0 | {"limit": "2" } |
Expand All @@ -218,7 +201,6 @@ Feature: Push TopN down IndexScan Rule
| "Tim Duncan" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | {"count": "2"} |
| 6 | Project | 7 | |
| 7 | TagIndexRangeScan | 0 | {"limit": "2" } |
Expand All @@ -233,7 +215,6 @@ Feature: Push TopN down IndexScan Rule
| -1 |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | {"count": "2"} |
| 6 | Project | 7 | |
| 7 | EdgeIndexFullScan | 0 | {"limit": "2" } |
Expand All @@ -248,7 +229,6 @@ Feature: Push TopN down IndexScan Rule
| 100 |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | {"count": "2"} |
| 6 | Project | 7 | |
| 7 | EdgeIndexFullScan | 0 | {"limit": "2" } |
Expand All @@ -263,7 +243,6 @@ Feature: Push TopN down IndexScan Rule
| 90 |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | {"count": "2"} |
| 6 | Project | 7 | |
| 7 | EdgeIndexPrefixScan | 0 | {"limit": "2" } |
Expand All @@ -278,7 +257,6 @@ Feature: Push TopN down IndexScan Rule
| 95 |
And the execution plan should be:
| id | name | dependencies | operator info |
| 4 | DataCollect | 5 | |
| 5 | TopN | 6 | {"count": "2"} |
| 6 | Project | 7 | |
| 7 | EdgeIndexRangeScan | 0 | {"limit": "2" } |
Expand Down
1 change: 0 additions & 1 deletion tests/tck/features/optimizer/CollapseProjectRule.feature
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ Feature: Collapse Project Rule
| 29 | "Dejounte Murray" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 11 | DataCollect | 10 | |
| 10 | Dedup | 14 | |
| 14 | Project | 12 | |
| 12 | Filter | 6 | |
Expand Down
Loading

0 comments on commit e4bce6d

Please sign in to comment.