Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

[opencypher compatibility] Support using exists with dynamic map #973

Merged
merged 7 commits into from
Apr 23, 2021

Conversation

Aiee
Copy link
Contributor

@Aiee Aiee commented Apr 20, 2021

As title.
Support query: match (n:player) WHERE exists(n['name']) return n
Fixes #841

Depends on vesoft-inc/nebula-common#509

@Aiee Aiee added bug Type: something is unexpected ready-for-testing PR: ready for the CI test depend on common labels Apr 20, 2021
@Aiee Aiee removed the ready-for-testing PR: ready for the CI test label Apr 20, 2021
@Aiee Aiee changed the title Support using exists with dynamic map [opencypher compatibility] Support using exists with dynamic map Apr 20, 2021
Given a graph with space named "nba"
When executing query:
"""
MATCH(n:player) WHERE EXISTS(n['name'])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a test case for only a part vertex contains property.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add case : match (a:player )-[b:like|:serve]->(c) where exists(b['likeness']) return a

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add case : match (a:player )-[b:like|:serve]->(c) where exists(b['likeness']) return a

This case has been added. Thanks for pointing that out.

Copy link
Contributor

@czpmango czpmango Apr 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

match (v:player)-[]->(n) where exists(n["age"]) return n.age

@Aiee Aiee force-pushed the fix-exists branch 2 times, most recently from 6982044 to 3e4c11f Compare April 21, 2021 02:59
nevermore3
nevermore3 previously approved these changes Apr 21, 2021
Copy link
Contributor

@yixinglu yixinglu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test variable length pattern match.

tests/tck/features/expression/Predicate.feature Outdated Show resolved Hide resolved
yixinglu
yixinglu previously approved these changes Apr 23, 2021
jievince
jievince previously approved these changes Apr 23, 2021
@yixinglu yixinglu added the ready-for-testing PR: ready for the CI test label Apr 23, 2021
When executing query:
"""
MATCH(v:player{name:"Tim Duncan"})-[e:like|serve*2]->(v2)
RETURN DISTINCT e, ALL(e IN e WHERE EXISTS(e['likeness']))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is is valid for this same variable name e as list variable name e @jievince ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it's valid. Because after the parser, the inner var has been rewrited to another name

@Aiee Aiee requested review from jievince and yixinglu April 23, 2021 03:37
@yixinglu yixinglu merged commit 1cc879b into vesoft-inc:master Apr 23, 2021
@Aiee Aiee deleted the fix-exists branch April 23, 2021 16:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Type: something is unexpected ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[opencypher compatibility] [minor] exists() not work with dynamic map reference
6 participants