hasId step fails
To-om opened this issue · comments
The gremlin step hasId
fails with the error:
com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error parsing query:
SELECT FROM `V` WHERE `~id` = :~id
I've done the PR #149 to add unit tests.
Hi @To-om
Thanks for the test cases. I've reproduces it and fixed
I've integrated your tests in our test suite here
82dd280#diff-1494a2e455881effe25f767e3c12679bR160
The fix will be available in the next release 3.0.5 or in the next snapshot
Thank you for your quick fix. I confirm that it solve the parsing error. Unfortunately, I still have issue in my project.
In the same transaction I do create a vertex using defined class (I used strict schema) then
Vertex v = graph.traversal().V(createdVertex.id()).next();
graph.traversal().V().hasId(createdVertex.id()).next(); // fails
I have not yet succeeded in reproducing the problem in an unit test.
Hi @To-om
which error do you get on the second issue?
The vertex is not found
I've just reproduced the error in an unit test. The test hasIdWithString
is not correctly named as ID is not a string but an object. If you stringify it, the test fails.
Assert.assertEquals(1, graph.traversal().V().hasId(v1.id()).toList().size());
: PASS
Assert.assertEquals(1, graph.traversal().V().hasId(v1.id().toString()).toList().size());
: FAIL