Skip to content

Commit

Permalink
add tck match1
Browse files Browse the repository at this point in the history
  • Loading branch information
andyfengHKU committed Jul 13, 2023
1 parent 2f2d68c commit b7d0af1
Show file tree
Hide file tree
Showing 17 changed files with 482 additions and 99 deletions.
Empty file added dataset/tck/schema.cypher
Empty file.
54 changes: 28 additions & 26 deletions src/binder/bind/bind_graph_pattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,39 +432,41 @@ void Binder::bindQueryNodeProperties(NodeExpression& node) {
}
}

std::vector<table_id_t> Binder::bindTableIDs(
const std::vector<std::string>& tableNames, LogicalTypeID nodeOrRelType) {
std::vector<common::table_id_t> Binder::bindNodeTableIDs(
const std::vector<std::string>& tableNames) {
if (!catalog.getReadOnlyVersion()->hasNodeTable()) {
throw common::BinderException("No node table exists in database.");
}
std::unordered_set<table_id_t> tableIDs;
switch (nodeOrRelType) {
case LogicalTypeID::NODE: {
if (tableNames.empty()) {
for (auto tableID : catalog.getReadOnlyVersion()->getNodeTableIDs()) {
tableIDs.insert(tableID);
}
} else {
for (auto& tableName : tableNames) {
tableIDs.insert(bindNodeTableID(tableName));
}
}
} break;
case LogicalTypeID::REL: {
if (tableNames.empty()) {
for (auto tableID : catalog.getReadOnlyVersion()->getRelTableIDs()) {
tableIDs.insert(tableID);
}
if (tableNames.empty()) {
for (auto tableID : catalog.getReadOnlyVersion()->getNodeTableIDs()) {
tableIDs.insert(tableID);
}
} else {
for (auto& tableName : tableNames) {
tableIDs.insert(bindRelTableID(tableName));
tableIDs.insert(bindNodeTableID(tableName));
}
} break;
default:
throw NotImplementedException(
"bindTableIDs(" + LogicalTypeUtils::dataTypeToString(nodeOrRelType) + ").");
}
auto result = std::vector<table_id_t>{tableIDs.begin(), tableIDs.end()};
if (result.empty() && tableNames.empty()) {
throw common::BinderException{"Expected a valid node name in MATCH clause."};
std::sort(result.begin(), result.end());
return result;
}

std::vector<common::table_id_t> Binder::bindRelTableIDs(
const std::vector<std::string>& tableNames) {
if (!catalog.getReadOnlyVersion()->hasRelTable()) {
throw common::BinderException("No rel table exists in database.");

Check warning on line 458 in src/binder/bind/bind_graph_pattern.cpp

View check run for this annotation

Codecov / codecov/patch

src/binder/bind/bind_graph_pattern.cpp#L458

Added line #L458 was not covered by tests
}
std::unordered_set<table_id_t> tableIDs;
if (tableNames.empty()) {
for (auto tableID : catalog.getReadOnlyVersion()->getRelTableIDs()) {
tableIDs.insert(tableID);
}
}
for (auto& tableName : tableNames) {
tableIDs.insert(bindRelTableID(tableName));
}
auto result = std::vector<table_id_t>{tableIDs.begin(), tableIDs.end()};
std::sort(result.begin(), result.end());
return result;
}
Expand Down
12 changes: 6 additions & 6 deletions src/common/types/value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,13 @@ std::string Value::toString() const {
auto fieldNames = StructType::getFieldNames(&dataType);
for (auto i = 0u; i < nestedTypeVal.size(); ++i) {
if (nestedTypeVal[i]->isNull_) {
// Avoid printing null key value pair.
continue;
}
result += fieldNames[i] + ": ";
result += nestedTypeVal[i]->toString();
if (i != nestedTypeVal.size() - 1) {
if (i != 0) {
result += ", ";
}
result += fieldNames[i] + ": " + nestedTypeVal[i]->toString();
}
result += "}";
return result;
Expand All @@ -356,13 +356,13 @@ std::string Value::toString() const {
auto fieldNames = StructType::getFieldNames(&dataType);
for (auto i = 2u; i < nestedTypeVal.size(); ++i) {
if (nestedTypeVal[i]->isNull_) {
// Avoid printing null key value pair.
continue;
}
result += fieldNames[i] + ": ";
result += nestedTypeVal[i]->toString();
if (i != nestedTypeVal.size() - 1) {
if (i != 2) {
result += ", ";
}
result += fieldNames[i] + ": " + nestedTypeVal[i]->toString();
}
result += "}->(" + nestedTypeVal[1]->toString() + ")";
return result;
Expand Down
12 changes: 2 additions & 10 deletions src/include/binder/binder.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,8 @@ class Binder {
const std::string& parsedName, const std::vector<common::table_id_t>& tableIDs);
void bindQueryNodeProperties(NodeExpression& node);

inline std::vector<common::table_id_t> bindNodeTableIDs(
const std::vector<std::string>& tableNames) {
return bindTableIDs(tableNames, common::LogicalTypeID::NODE);
}
inline std::vector<common::table_id_t> bindRelTableIDs(
const std::vector<std::string>& tableNames) {
return bindTableIDs(tableNames, common::LogicalTypeID::REL);
}
std::vector<common::table_id_t> bindTableIDs(
const std::vector<std::string>& tableNames, common::LogicalTypeID nodeOrRelType);
std::vector<common::table_id_t> bindNodeTableIDs(const std::vector<std::string>& tableNames);
std::vector<common::table_id_t> bindRelTableIDs(const std::vector<std::string>& tableNames);

/*** validations ***/
// E.g. Optional MATCH (a) RETURN a.age
Expand Down
3 changes: 3 additions & 0 deletions src/include/catalog/catalog.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ class CatalogContent {
common::table_id_t dstTableID, common::LogicalType srcPKDataType,
common::LogicalType dstPKDataType);

inline bool hasNodeTable() const { return !nodeTableSchemas.empty(); }
inline bool hasRelTable() const { return !relTableSchemas.empty(); }

inline bool containNodeTable(common::table_id_t tableID) const {
return nodeTableSchemas.contains(tableID);
}
Expand Down
2 changes: 1 addition & 1 deletion test/test_files/copy/copy_node_csv.test
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
-LOG EmptyStringTest
-STATEMENT MATCH (row:tableOfTypes) WHERE row.id = 49992 RETURN *;
---- 1
{_ID: 0:49992, _LABEL: tableOfTypes, id: 49992, int64Column: 50, doubleColumn: 31.582059, booleanColumn: False, dateColumn: 1551-07-19, timestampColumn: 1551-07-19 16:28:31, }
{_ID: 0:49992, _LABEL: tableOfTypes, id: 49992, int64Column: 50, doubleColumn: 31.582059, booleanColumn: False, dateColumn: 1551-07-19, timestampColumn: 1551-07-19 16:28:31}

-LOG FloatTest
-STATEMENT MATCH (row:tableOfTypes) WHERE row.doubleColumn = 68.73718401556897 RETURN row.dateColumn;
Expand Down
48 changes: 24 additions & 24 deletions test/test_files/demo_db/demo_db.test
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ Adam
-LOG MatchMultipleNodeLabels
-STATEMENT MATCH (a:User:City) RETURN a;
---- 7
{_ID: 0:0, _LABEL: User, name: Adam, age: 30, }
{_ID: 0:1, _LABEL: User, name: Karissa, age: 40, }
{_ID: 0:2, _LABEL: User, name: Zhang, age: 50, }
{_ID: 0:3, _LABEL: User, name: Noura, age: 25, }
{_ID: 0:0, _LABEL: User, name: Adam, age: 30}
{_ID: 0:1, _LABEL: User, name: Karissa, age: 40}
{_ID: 0:2, _LABEL: User, name: Zhang, age: 50}
{_ID: 0:3, _LABEL: User, name: Noura, age: 25}
{_ID: 1:0, _LABEL: City, name: Waterloo, population: 150000}
{_ID: 1:1, _LABEL: City, name: Kitchener, population: 200000}
{_ID: 1:2, _LABEL: City, name: Guelph, population: 75000}

-LOG MatchAnyNodeLabel
-STATEMENT MATCH (a) RETURN a;
---- 7
{_ID: 0:0, _LABEL: User, name: Adam, age: 30, }
{_ID: 0:1, _LABEL: User, name: Karissa, age: 40, }
{_ID: 0:2, _LABEL: User, name: Zhang, age: 50, }
{_ID: 0:3, _LABEL: User, name: Noura, age: 25, }
{_ID: 0:0, _LABEL: User, name: Adam, age: 30}
{_ID: 0:1, _LABEL: User, name: Karissa, age: 40}
{_ID: 0:2, _LABEL: User, name: Zhang, age: 50}
{_ID: 0:3, _LABEL: User, name: Noura, age: 25}
{_ID: 1:0, _LABEL: City, name: Waterloo, population: 150000}
{_ID: 1:1, _LABEL: City, name: Kitchener, population: 200000}
{_ID: 1:2, _LABEL: City, name: Guelph, population: 75000}
Expand All @@ -55,24 +55,24 @@ Zhang|(0:2)-{_LABEL: Follows, _ID: 2:3, since: 2022}->(0:3)|Noura
---- 8
Adam|(0:0)-{_LABEL: Follows, _ID: 2:0, since: 2020}->(0:1)|Karissa
Adam|(0:0)-{_LABEL: Follows, _ID: 2:1, since: 2020}->(0:2)|Zhang
Adam|(0:0)-{_LABEL: LivesIn, _ID: 3:0, }->(1:0)|Waterloo
Adam|(0:0)-{_LABEL: LivesIn, _ID: 3:0}->(1:0)|Waterloo
Karissa|(0:1)-{_LABEL: Follows, _ID: 2:2, since: 2021}->(0:2)|Zhang
Karissa|(0:1)-{_LABEL: LivesIn, _ID: 3:1, }->(1:0)|Waterloo
Noura|(0:3)-{_LABEL: LivesIn, _ID: 3:3, }->(1:2)|Guelph
Karissa|(0:1)-{_LABEL: LivesIn, _ID: 3:1}->(1:0)|Waterloo
Noura|(0:3)-{_LABEL: LivesIn, _ID: 3:3}->(1:2)|Guelph
Zhang|(0:2)-{_LABEL: Follows, _ID: 2:3, since: 2022}->(0:3)|Noura
Zhang|(0:2)-{_LABEL: LivesIn, _ID: 3:2, }->(1:1)|Kitchener
Zhang|(0:2)-{_LABEL: LivesIn, _ID: 3:2}->(1:1)|Kitchener

-LOG MatchAnyRelLabel
-STATEMENT MATCH ()-[e]->() RETURN e;
---- 8
(0:0)-{_LABEL: Follows, _ID: 2:0, since: 2020}->(0:1)
(0:0)-{_LABEL: Follows, _ID: 2:1, since: 2020}->(0:2)
(0:0)-{_LABEL: LivesIn, _ID: 3:0, }->(1:0)
(0:0)-{_LABEL: LivesIn, _ID: 3:0}->(1:0)
(0:1)-{_LABEL: Follows, _ID: 2:2, since: 2021}->(0:2)
(0:1)-{_LABEL: LivesIn, _ID: 3:1, }->(1:0)
(0:1)-{_LABEL: LivesIn, _ID: 3:1}->(1:0)
(0:2)-{_LABEL: Follows, _ID: 2:3, since: 2022}->(0:3)
(0:2)-{_LABEL: LivesIn, _ID: 3:2, }->(1:1)
(0:3)-{_LABEL: LivesIn, _ID: 3:3, }->(1:2)
(0:2)-{_LABEL: LivesIn, _ID: 3:2}->(1:1)
(0:3)-{_LABEL: LivesIn, _ID: 3:3}->(1:2)

-LOG MatchUndirected
-STATEMENT MATCH (a:User)-[e:Follows]-(b:User) WHERE a.name = 'Karissa' RETURN b.name;
Expand Down Expand Up @@ -128,8 +128,8 @@ Zhang
-LOG AllShortestPath
-STATEMENT MATCH p = (a)-[* ALL SHORTEST 1..3 ]-(b) WHERE a.name = 'Zhang' AND b.name='Waterloo' RETURN nodes(p);
---- 2
[{_ID: 0:2, _LABEL: User, name: Zhang, age: 50, },{_ID: 0:0, _LABEL: User, name: Adam, age: 30, },{_ID: 1:0, _LABEL: City, name: Waterloo, population: 150000}]
[{_ID: 0:2, _LABEL: User, name: Zhang, age: 50, },{_ID: 0:1, _LABEL: User, name: Karissa, age: 40, },{_ID: 1:0, _LABEL: City, name: Waterloo, population: 150000}]
[{_ID: 0:2, _LABEL: User, name: Zhang, age: 50},{_ID: 0:0, _LABEL: User, name: Adam, age: 30},{_ID: 1:0, _LABEL: City, name: Waterloo, population: 150000}]
[{_ID: 0:2, _LABEL: User, name: Zhang, age: 50},{_ID: 0:1, _LABEL: User, name: Karissa, age: 40},{_ID: 1:0, _LABEL: City, name: Waterloo, population: 150000}]

-LOG ShortestPath
-STATEMENT MATCH (a:User)-[e* SHORTEST 1..4]->(b:City) WHERE a.name = 'Adam' RETURN b.name, length(e) AS length;
Expand Down Expand Up @@ -181,16 +181,16 @@ Zhang|50|2022
-LOG ReturnPath2
-STATEMENT MATCH p = (a:User)-[:Follows*1..2]->(:User)-[:LivesIn]->(:City) WHERE a.name = 'Adam' RETURN p;
---- 4
{_NODES: [{_ID: 0:0, _LABEL: User, name: Adam, age: 30, },{_ID: 0:1, _LABEL: User, name: Karissa, age: 40, },{_ID: 0:2, _LABEL: User, name: Zhang, age: 50, },{_ID: 1:1, _LABEL: City, name: Kitchener, population: 200000}], _RELS: [(0:0)-{_LABEL: Follows, _ID: 2:0, since: 2020}->(0:1),(0:1)-{_LABEL: Follows, _ID: 2:2, since: 2021}->(0:2),(0:2)-{_LABEL: LivesIn, _ID: 3:2, }->(1:1)]}
{_NODES: [{_ID: 0:0, _LABEL: User, name: Adam, age: 30, },{_ID: 0:1, _LABEL: User, name: Karissa, age: 40, },{_ID: 1:0, _LABEL: City, name: Waterloo, population: 150000}], _RELS: [(0:0)-{_LABEL: Follows, _ID: 2:0, since: 2020}->(0:1),(0:1)-{_LABEL: LivesIn, _ID: 3:1, }->(1:0)]}
{_NODES: [{_ID: 0:0, _LABEL: User, name: Adam, age: 30, },{_ID: 0:2, _LABEL: User, name: Zhang, age: 50, },{_ID: 0:3, _LABEL: User, name: Noura, age: 25, },{_ID: 1:2, _LABEL: City, name: Guelph, population: 75000}], _RELS: [(0:0)-{_LABEL: Follows, _ID: 2:1, since: 2020}->(0:2),(0:2)-{_LABEL: Follows, _ID: 2:3, since: 2022}->(0:3),(0:3)-{_LABEL: LivesIn, _ID: 3:3, }->(1:2)]}
{_NODES: [{_ID: 0:0, _LABEL: User, name: Adam, age: 30, },{_ID: 0:2, _LABEL: User, name: Zhang, age: 50, },{_ID: 1:1, _LABEL: City, name: Kitchener, population: 200000}], _RELS: [(0:0)-{_LABEL: Follows, _ID: 2:1, since: 2020}->(0:2),(0:2)-{_LABEL: LivesIn, _ID: 3:2, }->(1:1)]}
{_NODES: [{_ID: 0:0, _LABEL: User, name: Adam, age: 30},{_ID: 0:1, _LABEL: User, name: Karissa, age: 40},{_ID: 0:2, _LABEL: User, name: Zhang, age: 50},{_ID: 1:1, _LABEL: City, name: Kitchener, population: 200000}], _RELS: [(0:0)-{_LABEL: Follows, _ID: 2:0, since: 2020}->(0:1),(0:1)-{_LABEL: Follows, _ID: 2:2, since: 2021}->(0:2),(0:2)-{_LABEL: LivesIn, _ID: 3:2}->(1:1)]}
{_NODES: [{_ID: 0:0, _LABEL: User, name: Adam, age: 30},{_ID: 0:1, _LABEL: User, name: Karissa, age: 40},{_ID: 1:0, _LABEL: City, name: Waterloo, population: 150000}], _RELS: [(0:0)-{_LABEL: Follows, _ID: 2:0, since: 2020}->(0:1),(0:1)-{_LABEL: LivesIn, _ID: 3:1}->(1:0)]}
{_NODES: [{_ID: 0:0, _LABEL: User, name: Adam, age: 30},{_ID: 0:2, _LABEL: User, name: Zhang, age: 50},{_ID: 0:3, _LABEL: User, name: Noura, age: 25},{_ID: 1:2, _LABEL: City, name: Guelph, population: 75000}], _RELS: [(0:0)-{_LABEL: Follows, _ID: 2:1, since: 2020}->(0:2),(0:2)-{_LABEL: Follows, _ID: 2:3, since: 2022}->(0:3),(0:3)-{_LABEL: LivesIn, _ID: 3:3}->(1:2)]}
{_NODES: [{_ID: 0:0, _LABEL: User, name: Adam, age: 30},{_ID: 0:2, _LABEL: User, name: Zhang, age: 50},{_ID: 1:1, _LABEL: City, name: Kitchener, population: 200000}], _RELS: [(0:0)-{_LABEL: Follows, _ID: 2:1, since: 2020}->(0:2),(0:2)-{_LABEL: LivesIn, _ID: 3:2}->(1:1)]}

-LOG ReturnPath3
-STATEMENT MATCH p1 = (a:User)-[:Follows]->(b:User), p2 = (b)-[:LivesIn]->(:City) WHERE a.name = 'Adam' RETURN p1, p2;
---- 2
{_NODES: [{_ID: 0:0, _LABEL: User, name: Adam, age: 30},{_ID: 0:1, _LABEL: User, name: Karissa, age: 40}], _RELS: [(0:0)-{_LABEL: Follows, _ID: 2:0, since: 2020}->(0:1)]}|{_NODES: [{_ID: 0:1, _LABEL: User, name: Karissa, age: 40, },{_ID: 1:0, _LABEL: City, name: Waterloo, population: 150000}], _RELS: [(0:1)-{_LABEL: LivesIn, _ID: 3:1}->(1:0)]}
{_NODES: [{_ID: 0:0, _LABEL: User, name: Adam, age: 30},{_ID: 0:2, _LABEL: User, name: Zhang, age: 50}], _RELS: [(0:0)-{_LABEL: Follows, _ID: 2:1, since: 2020}->(0:2)]}|{_NODES: [{_ID: 0:2, _LABEL: User, name: Zhang, age: 50, },{_ID: 1:1, _LABEL: City, name: Kitchener, population: 200000}], _RELS: [(0:2)-{_LABEL: LivesIn, _ID: 3:2}->(1:1)]}
{_NODES: [{_ID: 0:0, _LABEL: User, name: Adam, age: 30},{_ID: 0:1, _LABEL: User, name: Karissa, age: 40}], _RELS: [(0:0)-{_LABEL: Follows, _ID: 2:0, since: 2020}->(0:1)]}|{_NODES: [{_ID: 0:1, _LABEL: User, name: Karissa, age: 40},{_ID: 1:0, _LABEL: City, name: Waterloo, population: 150000}], _RELS: [(0:1)-{_LABEL: LivesIn, _ID: 3:1}->(1:0)]}
{_NODES: [{_ID: 0:0, _LABEL: User, name: Adam, age: 30},{_ID: 0:2, _LABEL: User, name: Zhang, age: 50}], _RELS: [(0:0)-{_LABEL: Follows, _ID: 2:1, since: 2020}->(0:2)]}|{_NODES: [{_ID: 0:2, _LABEL: User, name: Zhang, age: 50},{_ID: 1:1, _LABEL: City, name: Kitchener, population: 200000}], _RELS: [(0:2)-{_LABEL: LivesIn, _ID: 3:2}->(1:1)]}

-LOG ReturnPath4
-STATEMENT MATCH p = (a:User)-[:Follows*1..2]->(:User) WHERE a.name = 'Adam' RETURN nodes(p), (rels(p)[1]).since;
Expand Down
2 changes: 1 addition & 1 deletion test/test_files/demo_db/demo_db_create.test
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Noura
-CHECK_ORDER
-STATEMENT MATCH (a:User) WITH a, avg(a.age) AS b, SUM(a.age) AS c, COUNT(a.age) AS d, COUNT(*) AS e RETURN a, b, c,d, e ORDER BY c DESC
---- 5
{_ID: 0:4, _LABEL: User, name: Alice, }|||0|1
{_ID: 0:4, _LABEL: User, name: Alice}|||0|1
{_ID: 0:2, _LABEL: User, name: Zhang, age: 50}|50.000000|50|1|1
{_ID: 0:1, _LABEL: User, name: Karissa, age: 40}|40.000000|40|1|1
{_ID: 0:0, _LABEL: User, name: Adam, age: 30}|30.000000|30|1|1
Expand Down
32 changes: 16 additions & 16 deletions test/test_files/demo_db/demo_db_parquet.test
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ Adam
-LOG MatchMultipleNodeLabels
-STATEMENT MATCH (a:User:City) RETURN a;
---- 7
{_ID: 0:0, _LABEL: User, name: Adam, age: 30, }
{_ID: 0:1, _LABEL: User, name: Karissa, age: 40, }
{_ID: 0:2, _LABEL: User, name: Zhang, age: 50, }
{_ID: 0:3, _LABEL: User, name: Noura, age: 25, }
{_ID: 0:0, _LABEL: User, name: Adam, age: 30}
{_ID: 0:1, _LABEL: User, name: Karissa, age: 40}
{_ID: 0:2, _LABEL: User, name: Zhang, age: 50}
{_ID: 0:3, _LABEL: User, name: Noura, age: 25}
{_ID: 1:0, _LABEL: City, name: Waterloo, population: 150000}
{_ID: 1:1, _LABEL: City, name: Kitchener, population: 200000}
{_ID: 1:2, _LABEL: City, name: Guelph, population: 75000}

-LOG MatchAnyNodeLabel
-STATEMENT MATCH (a) RETURN a;
---- 7
{_ID: 0:0, _LABEL: User, name: Adam, age: 30, }
{_ID: 0:1, _LABEL: User, name: Karissa, age: 40, }
{_ID: 0:2, _LABEL: User, name: Zhang, age: 50, }
{_ID: 0:3, _LABEL: User, name: Noura, age: 25, }
{_ID: 0:0, _LABEL: User, name: Adam, age: 30}
{_ID: 0:1, _LABEL: User, name: Karissa, age: 40}
{_ID: 0:2, _LABEL: User, name: Zhang, age: 50}
{_ID: 0:3, _LABEL: User, name: Noura, age: 25}
{_ID: 1:0, _LABEL: City, name: Waterloo, population: 150000}
{_ID: 1:1, _LABEL: City, name: Kitchener, population: 200000}
{_ID: 1:2, _LABEL: City, name: Guelph, population: 75000}
Expand All @@ -55,24 +55,24 @@ Zhang|(0:2)-{_LABEL: Follows, _ID: 2:3, since: 2022}->(0:3)|Noura
---- 8
Adam|(0:0)-{_LABEL: Follows, _ID: 2:0, since: 2020}->(0:1)|Karissa
Adam|(0:0)-{_LABEL: Follows, _ID: 2:1, since: 2020}->(0:2)|Zhang
Adam|(0:0)-{_LABEL: LivesIn, _ID: 3:0, }->(1:0)|Waterloo
Adam|(0:0)-{_LABEL: LivesIn, _ID: 3:0}->(1:0)|Waterloo
Karissa|(0:1)-{_LABEL: Follows, _ID: 2:2, since: 2021}->(0:2)|Zhang
Karissa|(0:1)-{_LABEL: LivesIn, _ID: 3:1, }->(1:0)|Waterloo
Noura|(0:3)-{_LABEL: LivesIn, _ID: 3:3, }->(1:2)|Guelph
Karissa|(0:1)-{_LABEL: LivesIn, _ID: 3:1}->(1:0)|Waterloo
Noura|(0:3)-{_LABEL: LivesIn, _ID: 3:3}->(1:2)|Guelph
Zhang|(0:2)-{_LABEL: Follows, _ID: 2:3, since: 2022}->(0:3)|Noura
Zhang|(0:2)-{_LABEL: LivesIn, _ID: 3:2, }->(1:1)|Kitchener
Zhang|(0:2)-{_LABEL: LivesIn, _ID: 3:2}->(1:1)|Kitchener

-LOG MatchAnyRelLabel
-STATEMENT MATCH ()-[e]->() RETURN e;
---- 8
(0:0)-{_LABEL: Follows, _ID: 2:0, since: 2020}->(0:1)
(0:0)-{_LABEL: Follows, _ID: 2:1, since: 2020}->(0:2)
(0:0)-{_LABEL: LivesIn, _ID: 3:0, }->(1:0)
(0:0)-{_LABEL: LivesIn, _ID: 3:0}->(1:0)
(0:1)-{_LABEL: Follows, _ID: 2:2, since: 2021}->(0:2)
(0:1)-{_LABEL: LivesIn, _ID: 3:1, }->(1:0)
(0:1)-{_LABEL: LivesIn, _ID: 3:1}->(1:0)
(0:2)-{_LABEL: Follows, _ID: 2:3, since: 2022}->(0:3)
(0:2)-{_LABEL: LivesIn, _ID: 3:2, }->(1:1)
(0:3)-{_LABEL: LivesIn, _ID: 3:3, }->(1:2)
(0:2)-{_LABEL: LivesIn, _ID: 3:2}->(1:1)
(0:3)-{_LABEL: LivesIn, _ID: 3:3}->(1:2)

-LOG MatchTwoHop
-STATEMENT MATCH (a:User)-[:Follows]->(:User)-[:LivesIn]->(c:City) WHERE a.name = "Adam" RETURN a, c.name, c.population;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
-CASE MissingQueryNode
-STATEMENT MATCH () WITH NULL AS a RETURN a;
---- error
Binder exception: Expected a valid node name in MATCH clause.
Binder exception: No node table exists in database.
Loading

0 comments on commit b7d0af1

Please sign in to comment.