Skip to content
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

Merged
merged 24 commits into from
Sep 5, 2023

Conversation

shirly121
Copy link
Collaborator

What do these changes do?

as titled.

Related issue number

Fixes

@Test
public void where_7_test() {
RelNode multiMatch =
Utils.eval("Match (a) Optional Match (a)-[]->(b) Where b is null Return a").build();
Copy link
Collaborator

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?

Copy link
Collaborator Author

@shirly121 shirly121 Sep 4, 2023

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-commenter
Copy link

Codecov Report

Merging #3167 (ff8d5c7) into main (698f5c3) will not change coverage.
Report is 2 commits behind head on main.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3515e8...ff8d5c7. Read the comment docs.

@longbinlai longbinlai merged commit 5c2e0c1 into alibaba:main Sep 5, 2023
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants