DEV Community

Mohamed Mokhtar
Mohamed Mokhtar

Posted on

Analysis of cypher_match at AGE16 failing testcases

Hello, what is going on?

We are currently having the following state in the test suite of Apache AGE (our regression test)

8 are failing out of 24

  • not ok 8 - cypher_match 1696 ms
  • not ok 10 - cypher_set 416 ms
  • not ok 11 - cypher_remove 290 ms
  • not ok 12 - cypher_delete 525 ms
  • not ok 14 - cypher_vle 1872 ms
  • not ok 16 - cypher_call 101 ms
  • not ok 17 - cypher_merge 372 ms
  • not ok 20 - index 232 ms

Let's discuss cypher_match is it all failing? Nope.

What are the cases causes the issues then?

  • Undefined error that we are getting empty results while it should have returned results

SELECT * FROM cypher('cypher_match', $$
    MATCH ()<-[]-(n:v2)-[]->()
    MATCH p=(n)-[]->()
    RETURN p
$$) AS (i agtype);
-- Error here is having an empty results while expecting a result set
Enter fullscreen mode Exit fullscreen mode
  • MATCH & OPTIONAL MATCH together error
SELECT * FROM cypher('cypher_match', $$
    MATCH (u:opt_match_v)
    OPTIONAL MATCH (u)-[m]-(l)
    RETURN u.name as u, type(m), l.name as l
    ORDER BY u, m, l
$$) AS (u agtype, m agtype, l agtype);
ERROR:  graph_oid and label_id must not be null
Enter fullscreen mode Exit fullscreen mode
  • MATCH & OPTIONAL MATCH together error
SELECT * FROM cypher('cypher_match', $$
    MATCH (n:opt_match_v), (m:opt_match_v)
    WHERE id(n) <> id(m)
    OPTIONAL MATCH (n)-[r]->(p), (m)-[s]->(q)
    RETURN n.name AS n, type(r) AS r, p.name AS p,
           m.name AS m, type(s) AS s, q.name AS q
    ORDER BY n, p, m, q
 $$) AS (n agtype, r agtype, p agtype, m agtype, s agtype, q agtype);
ERROR:  graph_oid and label_id must not be null
Enter fullscreen mode Exit fullscreen mode
  • MATCH & OPTIONAL MATCH together error
SELECT * FROM cypher('test_retrieve_var', $$
    MATCH (a:A) WITH a
    OPTIONAL MATCH (a)-[:incs]->(c)
    WHERE EXISTS((c)<-[:incs]-())
    RETURN a, c
$$) AS (a agtype, c agtype);
ERROR:  graph_oid and label_id must not be null
Enter fullscreen mode Exit fullscreen mode
  • Cleanup queries of the script which are dependencies of the above failed quires so that we need to fixed the above which will led to fixing them

So in conclusion we are having two types of errors (main) and one dependent:

  • ERROR: graph_oid and label_id must not be null That happens when having OPTIONAL MATCH with MATCH
  • Undefined error that we are expecting a result set and getting empty result set
  • Cleanup error which should be solved if we have resolved the above ones

Trials and debugging

Recalling that the problem happens in transform_cypher_optional_match_clause
so we trying to resolve the rtindex dependency problems
What has been already gone through and what I am trying now I will mention that in the next blog.

References:

Top comments (0)