-
Notifications
You must be signed in to change notification settings - Fork 443
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
feat(interactive): Support IS_NULL
and IS_NOT_NULL
in Cypher Queries
#3167
Conversation
…uery to anti join
@Test | ||
public void where_7_test() { | ||
RelNode multiMatch = | ||
Utils.eval("Match (a) Optional Match (a)-[]->(b) Where b is null Return a").build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do we control whether b is null
can or cannot be pushed down? how about
Match (a) Optional Match (a)-[]->(b) Where b.age is null Return a
can b.age is null be pushed down?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The official Calcite FilterIntoJoinRule
determines whether filter conditions can be pushed down into a join. The condition b.age is null
is actually equivalent to b is not null and b.age is null
, and in such cases, it can be pushed down into the join.
However, currently, when the compiler interfaces with the Calcite type system, it assumes that types coming from storage cannot be null, so b.age is null
is inferred to produce no results and generate the following logical plan:
// Match (a) Optional Match (a)-[]->(b) Where b.age is null Return a
GraphLogicalProject(a=[a], isAppend=[false])
LogicalValues(tuples=[[]])
Here LogicalValues
denotes the logical plan before the Return a
produces no results.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3167 +/- ##
=======================================
Coverage 42.05% 42.05%
=======================================
Files 101 101
Lines 10985 10985
=======================================
Hits 4620 4620
Misses 6365 6365 Continue to review full report in Codecov by Sentry.
|
What do these changes do?
as titled.
Related issue number
Fixes