Skip to content
Snippets Groups Projects
Unverified Commit e833d2a2 authored by Shylock Hg's avatar Shylock Hg Committed by GitHub
Browse files

Feature/edge seek with range (#983)


* Support the edge seek with range.

* Remove the debug log.

* Remove the debug log.

* Add the disabled edge with range case.

* Format.

Co-authored-by: default avatarYee <2520865+yixinglu@users.noreply.github.com>
parent 99b060f3
No related branches found
No related tags found
No related merge requests found
......@@ -37,9 +37,14 @@ bool LabelIndexSeek::matchNode(NodeContext* nodeCtx) {
bool LabelIndexSeek::matchEdge(EdgeContext* edgeCtx) {
const auto &edge = *edgeCtx->info;
// require one edge at least
if (edge.edgeTypes.size() != 1 || edge.range != nullptr) {
if (edge.edgeTypes.size() != 1) {
// TODO multiple edge index seek need the IndexScan support
VLOG(2) << "Multiple edge index seek and variable length edge seek are not supported now.";
VLOG(2) << "Multiple edge index seek is not supported now.";
return false;
}
if (edge.range != nullptr && edge.range->min() == 0) {
// The 0 step is NodeScan in fact.
return false;
}
......
......@@ -14,9 +14,14 @@ namespace nebula {
namespace graph {
bool PropIndexSeek::matchEdge(EdgeContext* edgeCtx) {
auto& edge = *edgeCtx->info;
if (edge.types.size() != 1 || edge.range != nullptr) {
if (edge.types.size() != 1) {
// TODO multiple edge index seek need the IndexScan support
VLOG(2) << "Multiple edge index seek and variable length edge seek are not supported now.";
VLOG(2) << "Multiple edge index seek is not supported now.";
return false;
}
if (edge.range != nullptr && edge.range->min() == 0) {
// The 0 step is NodeScan in fact.
return false;
}
......
......@@ -17,6 +17,7 @@ schema: |
CREATE TAG INDEX IF NOT EXISTS team_name_index ON team(name(64));
CREATE TAG INDEX IF NOT EXISTS bachelor_index ON bachelor();
CREATE EDGE INDEX IF NOT EXISTS serve_start_end_index ON serve(start_year, end_year);
CREATE EDGE INDEX IF NOT EXISTS like_likeness_index ON like(likeness);
files:
- path: ./null.csv
withHeader: true
......
......@@ -17,6 +17,7 @@ schema: |
CREATE TAG INDEX IF NOT EXISTS team_name_index ON team(name(64));
CREATE TAG INDEX IF NOT EXISTS bachelor_index ON bachelor();
CREATE EDGE INDEX IF NOT EXISTS serve_start_end_index ON serve(start_year, end_year);
CREATE EDGE INDEX IF NOT EXISTS like_likeness_index ON like(likeness);
files:
- path: ../nba/player.csv
withHeader: true
......
......@@ -444,13 +444,10 @@ Feature: Basic match
MATCH () --> (v) --> () return *
"""
Then a SemanticError should be raised at runtime: Can't solve the start vids from the sentence: MATCH ()-->(v)-->() RETURN *
# The 0 step means node scan in fact, but p and t has no label or properties for index seek
# So it's not workable now
When executing query:
"""
MATCH (p)-[:serve*2..3]->(t) RETURN p
MATCH (p)-[:serve*0..3]->(t) RETURN p
"""
Then a SemanticError should be raised at runtime: Can't solve the start vids from the sentence: MATCH (p)-[:serve*2..3]->(t) RETURN p
When executing query:
"""
MATCH (p)-[:serve*2..3{likeness: 90}]->(t) RETURN p
"""
Then a SemanticError should be raised at runtime: Can't solve the start vids from the sentence: MATCH (p)-[:serve*2..3{likeness:90}]->(t) RETURN p
Then a SemanticError should be raised at runtime: Can't solve the start vids from the sentence: MATCH (p)-[:serve*0..3]->(t) RETURN p
......@@ -488,13 +488,10 @@ Feature: Basic match
MATCH () --> (v) --> () return *
"""
Then a SemanticError should be raised at runtime: Can't solve the start vids from the sentence: MATCH ()-->(v)-->() RETURN *
# The 0 step means node scan in fact, but p and t has no label or properties for index seek
# So it's not workable now
When executing query:
"""
MATCH (p)-[:serve*2..3]->(t) RETURN p
MATCH (p)-[:serve*0..3]->(t) RETURN p
"""
Then a SemanticError should be raised at runtime: Can't solve the start vids from the sentence: MATCH (p)-[:serve*2..3]->(t) RETURN p
When executing query:
"""
MATCH (p)-[:serve*2..3{likeness: 90}]->(t) RETURN p
"""
Then a SemanticError should be raised at runtime: Can't solve the start vids from the sentence: MATCH (p)-[:serve*2..3{likeness:90}]->(t) RETURN p
Then a SemanticError should be raised at runtime: Can't solve the start vids from the sentence: MATCH (p)-[:serve*0..3]->(t) RETURN p
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment