-DATASET CSV empty

--

-CASE SingleSCC
-LOAD_DYNAMIC_EXTENSION algo
-STATEMENT CREATE NODE TABLE Node(id INT64 PRIMARY KEY);
---- ok
-STATEMENT CREATE REL TABLE Edge(FROM Node to Node, id INT64);
---- ok
-STATEMENT CREATE (u0:Node {id: 0}),
            (u1:Node {id: 1}),
            (u2:Node {id: 2}),
            (u3:Node {id: 3}),
            (u4:Node {id: 4}),
            (u5:Node {id: 5}),
            (u6:Node {id: 6}),
            (u7:Node {id: 7}),
            (u8:Node {id: 8}),
            (u0)-[:Edge {id:10}]->(u1),
            (u1)-[:Edge {id:11}]->(u2),
            (u2)-[:Edge {id:12}]->(u0),
            (u2)-[:Edge {id:13}]->(u3),
            (u2)-[:Edge {id:14}]->(u4),
            (u5)-[:Edge {id:15}]->(u4),
            (u6)-[:Edge {id:16}]->(u4),
            (u6)-[:Edge {id:17}]->(u5),
            (u6)-[:Edge {id:18}]->(u7),
            (u7)-[:Edge {id:19}]->(u4),
            (u6)-[:Edge {id:20}]->(u5);
---- ok
-STATEMENT CALL PROJECT_GRAPH('Graph', ['Node'], ['Edge'])
---- ok
-STATEMENT CALL strongly_connected_components_kosaraju('Graph') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 7
0|3|[0,1,2]
3|1|[3]
4|1|[4]
5|1|[5]
6|1|[6]
7|1|[7]
8|1|[8]
-STATEMENT CALL scc('Graph') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 7
0|3|[0,1,2]
3|1|[3]
4|1|[4]
5|1|[5]
6|1|[6]
7|1|[7]
8|1|[8]
-STATEMENT CALL PROJECT_GRAPH('Graph2', {'Node': 'n.ID > 0'}, ['Edge'])
---- ok
-STATEMENT CALL scc_ko('Graph2') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 8
1|1|[1]
2|1|[2]
3|1|[3]
4|1|[4]
5|1|[5]
6|1|[6]
7|1|[7]
8|1|[8]
-STATEMENT CALL strongly_connected_components('Graph2') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 8
1|1|[1]
2|1|[2]
3|1|[3]
4|1|[4]
5|1|[5]
6|1|[6]
7|1|[7]
8|1|[8]
-STATEMENT CREATE NODE TABLE N (id INT64 PRIMARY KEY);
---- ok
-STATEMENT CREATE REL TABLE R1 (FROM N TO Node);
---- ok
-STATEMENT CREATE REL TABLE R2 (FROM Node TO N);
---- ok
-STATEMENT CREATE (:N {id:10});
---- ok
-STATEMENT MATCH (a:Node {id:2}), (b:N {id:10})
           CREATE (a)-[:R2]->(b), (a)<-[:R1]-(b)
---- ok
-STATEMENT CALL PROJECT_GRAPH('Graph3', ['Node', 'N'], ['Edge', 'R1', 'R2'])
---- ok
-STATEMENT CALL strongly_connected_components('Graph3') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 7
0|4|[0,1,2,10]
3|1|[3]
4|1|[4]
5|1|[5]
6|1|[6]
7|1|[7]
8|1|[8]
-STATEMENT CREATE (:N {id:11});
---- ok
-STATEMENT MATCH (a:Node {id:3}), (b:N {id:11})
           CREATE (a)-[:R2]->(b), (a)<-[:R1]-(b)
---- ok
-STATEMENT MATCH (a:Node {id:6}), (b:N {id:11})
           CREATE (a)-[:R2]->(b), (a)<-[:R1]-(b)
---- ok
-STATEMENT CALL PROJECT_GRAPH('Graph4', ['Node', 'N'], ['Edge', 'R1', 'R2'])
---- ok
-STATEMENT CALL strongly_connected_components('Graph4') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 6
0|4|[0,1,2,10]
3|3|[3,6,11]
4|1|[4]
5|1|[5]
7|1|[7]
8|1|[8]

-CASE SingleSCCIsolated
-LOAD_DYNAMIC_EXTENSION algo
-STATEMENT CREATE NODE TABLE Node(id INT64 PRIMARY KEY);
---- ok
-STATEMENT CREATE REL TABLE Edge(FROM Node to Node);
---- ok
-STATEMENT CREATE (u0:Node {id: 0}),
            (u1:Node {id: 1}),
            (u2:Node {id: 2}),
            (u3:Node {id: 3}),
            (u4:Node {id: 4}),
            (u5:Node {id: 5}),
            (u6:Node {id: 6}),
            (u0)-[:Edge]->(u1),
            (u1)-[:Edge]->(u2),
            (u2)-[:Edge]->(u0),
            (u2)-[:Edge]->(u3),
            (u6)-[:Edge]->(u4),
            (u6)-[:Edge]->(u5);
---- ok
-STATEMENT CALL PROJECT_GRAPH('Graph', ['Node'], ['Edge'])
---- ok
-STATEMENT CALL strongly_connected_components_kosaraju('Graph') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 5
0|3|[0,1,2]
3|1|[3]
4|1|[4]
5|1|[5]
6|1|[6]
-STATEMENT CALL strongly_connected_components('Graph') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 5
0|3|[0,1,2]
3|1|[3]
4|1|[4]
5|1|[5]
6|1|[6]

-CASE SCCMultiple
-LOAD_DYNAMIC_EXTENSION algo
-STATEMENT CREATE NODE TABLE Node(id INT64 PRIMARY KEY);
---- ok
-STATEMENT CREATE REL TABLE Edge(FROM Node to Node, id INT64);
---- ok
-STATEMENT CREATE (u0:Node {id: 0}),
            (u1:Node {id: 1}),
            (u2:Node {id: 2}),
            (u3:Node {id: 3}),
            (u4:Node {id: 4}),
            (u5:Node {id: 5}),
            (u6:Node {id: 6}),
            (u7:Node {id: 7}),
            (u8:Node {id: 8}),
            (u0)-[:Edge {id:10}]->(u1),
            (u1)-[:Edge {id:11}]->(u2),
            (u1)-[:Edge {id:12}]->(u4),
            (u2)-[:Edge {id:13}]->(u2),
            (u2)-[:Edge {id:14}]->(u5),
            (u3)-[:Edge {id:15}]->(u1),
            (u3)-[:Edge {id:16}]->(u6),
            (u4)-[:Edge {id:17}]->(u0),
            (u4)-[:Edge {id:18}]->(u5),
            (u4)-[:Edge {id:19}]->(u3),
            (u5)-[:Edge {id:20}]->(u7),
            (u6)-[:Edge {id:21}]->(u4),
            (u6)-[:Edge {id:22}]->(u5),
            (u7)-[:Edge {id:23}]->(u8),
            (u8)-[:Edge {id:24}]->(u5);
---- ok
-STATEMENT CALL PROJECT_GRAPH('Graph', ['Node'], ['Edge'])
---- ok
-STATEMENT CALL strongly_connected_components('Graph') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 3
0|5|[0,1,3,4,6]
2|1|[2]
5|3|[5,7,8]
-STATEMENT CALL strongly_connected_components_kosaraju('Graph') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 3
0|5|[0,1,3,4,6]
2|1|[2]
5|3|[5,7,8]

-STATEMENT CALL PROJECT_GRAPH('Graph2', ['Node'], {'Edge': 'r.ID <> 17'})
---- ok
-STATEMENT CALL strongly_connected_components_kosaraju('Graph2') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 4
0|1|[0]
1|4|[1,3,4,6]
2|1|[2]
5|3|[5,7,8]
-STATEMENT CALL strongly_connected_components('Graph2') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 4
0|1|[0]
1|4|[1,3,4,6]
2|1|[2]
5|3|[5,7,8]

-STATEMENT CALL PROJECT_GRAPH('Graph3', {'Node': 'n.ID <> 4'}, {'Edge': 'r.ID <> 23 '})
---- ok
-STATEMENT CALL strongly_connected_components_kosaraju('Graph3') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 8
0|1|[0]
1|1|[1]
2|1|[2]
3|1|[3]
5|1|[5]
6|1|[6]
7|1|[7]
8|1|[8]
-STATEMENT CALL strongly_connected_components('Graph3') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 8
0|1|[0]
1|1|[1]
2|1|[2]
3|1|[3]
5|1|[5]
6|1|[6]
7|1|[7]
8|1|[8]

-STATEMENT CREATE NODE TABLE N (id INT64 PRIMARY KEY);
---- ok
-STATEMENT CREATE REL TABLE R1 (FROM N TO Node);
---- ok
-STATEMENT CREATE REL TABLE R2 (FROM Node TO N);
---- ok
-STATEMENT CREATE (:N {id:10});
---- ok
-STATEMENT MATCH (a4:Node {id:4}), (a5:Node {id:5}), (b:N {id:10})
           CREATE (a5)-[:R2]->(b), (a4)<-[:R1]-(b)
---- ok
-STATEMENT CALL PROJECT_GRAPH('Graph4', ['Node', 'N'], ['Edge', 'R1', 'R2'])
---- ok
-STATEMENT CALL strongly_connected_components('Graph4') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 1
0|10|[0,1,2,3,4,5,6,7,8,10]
-STATEMENT CALL PROJECT_GRAPH('Graph5', {'Node': '', 'N':'n.ID < 4'}, ['Edge', 'R1', 'R2'])
---- ok
-STATEMENT CALL strongly_connected_components('Graph5') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 3
0|5|[0,1,3,4,6]
2|1|[2]
5|3|[5,7,8]

-CASE SCCMultiple2
-LOAD_DYNAMIC_EXTENSION algo
-STATEMENT CREATE NODE TABLE Node(id INT64 PRIMARY KEY);
---- ok
-STATEMENT CREATE REL TABLE Edge(FROM Node to Node);
---- ok
-STATEMENT CREATE (u0:Node {id: 0}),
            (u1:Node {id: 1}),
            (u2:Node {id: 2}),
            (u3:Node {id: 3}),
            (u4:Node {id: 4}),
            (u5:Node {id: 5}),
            (u6:Node {id: 6}),
            (u7:Node {id: 7}),
            (u8:Node {id: 8}),
            (u9:Node {id: 9}),
            (u10:Node {id: 10}),
            (u0)-[:Edge]->(u1),
            (u0)-[:Edge]->(u3),
            (u1)-[:Edge]->(u2),
            (u1)-[:Edge]->(u4),
            (u2)-[:Edge]->(u0),
            (u2)-[:Edge]->(u6),
            (u3)-[:Edge]->(u2),
            (u4)-[:Edge]->(u5),
            (u4)-[:Edge]->(u6),
            (u5)-[:Edge]->(u6),
            (u5)-[:Edge]->(u7),
            (u5)-[:Edge]->(u8),
            (u5)-[:Edge]->(u9),
            (u6)-[:Edge]->(u4),
            (u7)-[:Edge]->(u9),
            (u8)-[:Edge]->(u9),
            (u9)-[:Edge]->(u8);
---- ok
-STATEMENT CALL PROJECT_GRAPH('Graph', ['Node'], ['Edge']);
---- ok
-STATEMENT CALL strongly_connected_components_kosaraju('Graph') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 5
0|4|[0,1,2,3]
4|3|[4,5,6]
7|1|[7]
8|2|[8,9]
10|1|[10]
-STATEMENT CALL strongly_connected_components('Graph') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 5
0|4|[0,1,2,3]
4|3|[4,5,6]
7|1|[7]
8|2|[8,9]
10|1|[10]
-STATEMENT CALL strongly_connected_components('Graph', maxIterations:=21) WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 5
0|4|[0,1,2,3]
4|3|[4,5,6]
7|1|[7]
8|2|[8,9]
10|1|[10]

-CASE NoScc
-LOAD_DYNAMIC_EXTENSION algo
-STATEMENT CREATE NODE TABLE Node(id INT64 PRIMARY KEY);
---- ok
-STATEMENT CREATE REL TABLE Edge(FROM Node to Node);
---- ok
-STATEMENT CREATE (u0:Node {id: 0}),
            (u1:Node {id: 1}),
            (u2:Node {id: 2}),
            (u3:Node {id: 3}),
            (u4:Node {id: 4}),
            (u5:Node {id: 5}),
            (u6:Node {id: 6}),
            (u7:Node {id: 7}),
            (u8:Node {id: 8}),
            (u9:Node {id: 9}),
            (u10:Node {id: 10}),
            (u0)-[:Edge]->(u1),
            (u0)-[:Edge]->(u3),
            (u1)-[:Edge]->(u2),
            (u1)-[:Edge]->(u4),
            (u2)-[:Edge]->(u3),
            (u2)-[:Edge]->(u6),
            (u3)-[:Edge]->(u4),
            (u4)-[:Edge]->(u5),
            (u4)-[:Edge]->(u6),
            (u5)-[:Edge]->(u6),
            (u5)-[:Edge]->(u7),
            (u5)-[:Edge]->(u8),
            (u5)-[:Edge]->(u9),
            (u7)-[:Edge]->(u9),
            (u8)-[:Edge]->(u9);
---- ok
-STATEMENT CALL PROJECT_GRAPH('Graph', ['Node'], ['Edge']);
---- ok
-STATEMENT CALL strongly_connected_components_kosaraju('Graph') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 11
0|1|[0]
1|1|[1]
2|1|[2]
3|1|[3]
4|1|[4]
5|1|[5]
6|1|[6]
7|1|[7]
8|1|[8]
9|1|[9]
10|1|[10]
-STATEMENT CALL strongly_connected_components('Graph') WITH group_id, min(node.id) as sccId, count(*) as nodeCount, list_sort(collect(node.id)) as nodeIds RETURN sccId, nodeCount, nodeIds ORDER BY sccId;
---- 11
0|1|[0]
1|1|[1]
2|1|[2]
3|1|[3]
4|1|[4]
5|1|[5]
6|1|[6]
7|1|[7]
8|1|[8]
9|1|[9]
10|1|[10]

-CASE ErrorHandling
-LOAD_DYNAMIC_EXTENSION algo
-STATEMENT CREATE NODE TABLE Person(id INT64 PRIMARY KEY);
---- ok
-STATEMENT CREATE NODE TABLE City(id INT64 PRIMARY KEY);
---- ok
-STATEMENT CREATE REL TABLE Knows(FROM Person to Person);
---- ok
-STATEMENT CREATE REL TABLE LivesWith(FROM Person to Person);
---- ok
-STATEMENT CREATE REL TABLE LivesIn(FROM Person to City);
---- ok
-STATEMENT CALL PROJECT_GRAPH('SCC1', ['Person', 'City'], ['Knows', 'LivesIn']);
---- ok
-STATEMENT CALL strongly_connected_components('SCC1', maxIterations:='abc') RETURN node.id, group_id;
---- error
Binder exception: Expression abc has data type STRING but expected INT64. Implicit cast is not supported.
-STATEMENT CALL strongly_connected_components_kosaraju('SCC1') RETURN node.id, group_id;
---- error
Runtime exception: Kosaraju's SCC only supports operations on one node table.
-STATEMENT CALL PROJECT_GRAPH('SCC2', ['Person'], ['Knows', 'LivesWith']);
---- ok
-STATEMENT CALL strongly_connected_components_kosaraju('SCC2') RETURN node.id, group_id;
---- error
Runtime exception: Kosaraju's SCC only supports operations on one edge table.
