Skip to content

Cypher queries broken in 22.1.3 #314

Closed

Description

@artturimatias

ArcadeDB Version: 22.1.3

JDK Version: what is included in official docker image

OS: Debian 11

Expected behavior

I create a database with two vertices with labels "First" and "Second".
Following query should return both nodes:
MATCH (a),(b) WHERE a.label = "First" AND b.label = "Second" RETURN a,b

NOTE: this worked in 21.10.1

Actual behavior

Query returns empty array for vertices

Steps to reproduce

CREATE (p:Person {label:"First"}) return p
CREATE (p:Person {label:"Second"}) return p
MATCH (a),(b) WHERE a.label = "First" AND b.label = "Second" RETURN a,b

ADDITION: CURL commans used

curl -X POST -H "Content-Type: application/json" \
  -d '{"command": "CREATE (n:Person {label:\"First\"}) return n", "language": "cypher", "serializer": "graph"}' \
  http://localhost:2480/api/v1/command/kukakukin --user "root:rootroot"
curl -X POST -H "Content-Type: application/json" \
  -d '{"command": "CREATE (n:Person {label:\"Second\"}) return n", "language": "cypher", "serializer": "graph"}' \
   http://localhost:2480/api/v1/command/kukakukin --user "root:rootroot"
curl -X POST -H "Content-Type: application/json" \
  -d '{"command": "MATCH (a),(b) WHERE a.label = \"First\" AND b.label = \"Second\" RETURN a,b", "language": "cypher", "serializer": "graph"}' \
   http://localhost:2480/api/v1/command/kukakukin --user "root:rootroot"

result:
{"result":{"vertices":[],"records":[],"edges":[]},"user":"root","version":"22.1.3 (build 440ab28fffef33b043815beebe78fb7e65a0a664/1643746379060/main)"}

Activity

  1. self-assigned this
    on Feb 4, 2022
  2. added this to the 22.2.1 milestone on Feb 4, 2022
  3. lvca commented on Feb 4, 2022

    @lvca
    Member

    @artturimatias I created this test case and works:

    @Test
    public void testIssue314() throws ExecutionException, InterruptedException {
      final ArcadeGraph graph = ArcadeGraph.open("./target/testcypher");
      try {
    
        graph.getDatabase().getSchema().getOrCreateVertexType("Person");
    
        ResultSet p1 = graph.cypher("CREATE (p:Person {label:\"First\"}) return p").execute();
        Assertions.assertTrue(p1.hasNext());
        RID p1RID = p1.next().getIdentity().get();
    
        ResultSet p2 = graph.cypher("CREATE (p:Person {label:\"Second\"}) return p").execute();
        Assertions.assertTrue(p2.hasNext());
        RID p2RID = p2.next().getIdentity().get();
    
        final ArcadeCypher query = graph.cypher("MATCH (a),(b) WHERE a.label = \"First\" AND b.label = \"Second\" RETURN a,b");
        final ResultSet result = query.execute();
    
        Assertions.assertTrue(result.hasNext());
        final Result row = result.next();
        Assertions.assertNotNull(row.getProperty("a"));
        Assertions.assertEquals(p1RID, ((Result) row.getProperty("a")).getIdentity().get());
        Assertions.assertNotNull(row.getProperty("b"));
        Assertions.assertEquals(p2RID, ((Result) row.getProperty("b")).getIdentity().get());
    
      } finally {
        graph.drop();
      }
    }
  4. lvca commented on Feb 4, 2022

    @lvca
    Member

    I guess it must be in the HTTP layer. Checking it.

  5. lvca commented on Feb 4, 2022

    @lvca
    Member

    The issue seems in the serializer. If you omit the serializer = graph works. This is a nice workaround for now, looking for the cause.

  6. artturimatias commented on Feb 4, 2022

    @artturimatias
    Author

    This also explains why visualiser in ArcadeDb Studio does not work with Cypher queries.

  7. added a commit that references this issue on Feb 4, 2022
  8. lvca commented on Feb 4, 2022

    @lvca
    Member

    Fixed in the main branch, it will be released with 22.2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions