Skip to content

CASE in WITH works is incorrect if some property empty #279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mad opened this issue May 21, 2019 · 1 comment
Closed

CASE in WITH works is incorrect if some property empty #279

mad opened this issue May 21, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@mad
Copy link
Contributor

mad commented May 21, 2019

Example of graph

        graph.traversal()
             .addV("Org").property("Name", "Org1").as("org")
             .addV("Person").property("Name", "Foo").as("p1")
             .addV("Person").property("Name", "Boo").as("p2")
             .addV("Person").property("Name", "Woo").as("p3")
             .addE("E").from("org").to("p1").property("e", true)
             .addE("E").from("org").to("p2").property("e", false)
             .addE("E").from("org").to("p3")
             .iterate();

Query 1:

MATCH (n:Org)-[r]-(p:Person)
WHERE id(n) IN [{nID}]
WITH p.Name as Name, CASE r.e WHEN true THEN 'Yes' WHEN false THEN 'No' ELSE r.e END AS Work
RETURN Name, Work

Expected:

[{Name=Foo, Work=Yes}, {Name=Boo, Work=No}, {Name=Woo, Work=null}]

Actual:

[{Name=Foo, Work=Yes}, {Name=Boo, Work=No}]

Query 2:

MATCH (n:Org)-[r]-(p:Person)
WHERE id(n) IN [{nID}]
RETURN p.Name as Name, CASE r.e WHEN true THEN 'Yes' WHEN false THEN 'No' ELSE r.e END AS Work

Work is correct:

[{Name=Woo, Work=null}, {Name=Boo, Work=No}, {Name=Foo, Work=Yes}]
dwitry added a commit to dwitry/cypher-for-gremlin that referenced this issue May 27, 2019
dwitry added a commit that referenced this issue May 27, 2019
@dwitry dwitry closed this as completed in 7b42ab0 May 27, 2019
@dwitry
Copy link
Contributor

dwitry commented May 27, 2019

Fix pushed to tinkerpop334 as well.

@dwitry dwitry added the bug Something isn't working label May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants