alibaba / alibaba/GraphScope

[BUG] GOpt fails in compiling queries that involve `ISNULL` on certain properties

Open
#4,114 0 comments 0 reactions 1 assignee Claimed by @shirly121 View on GitHub
Dominant language
C++
Stars
3.6k
Forks
468
Avg merge
29m
Merged PRs (30d)
1

Description

**Describe the bug**

In the JOB Benchmark, the gopt-based compiler fails to compile queries that involve ISNULL on certain properties, including Job11, 21, and 27.

The issue arises because the graph schema does not inform the compiler that certain properties can be optional. As a result, the compiler treats these properties as non-nullable.

Take Job11a as an example, currently the compiler returns a `null`.
```
@neo4j> MATCH
(mc:MOVIE_COMPANIES)-[:MOVIE_COMPANIES_TITLE]->(t:TITLE)-[:MOVIE_KEYWORD]->(k:KEYWORD),
(mc)-[:MOVIE_COMPANIES_COMPANY_NAME]->(cn:COMPANY_NAME),
(mc)-[:MOVIE_COMPANIES_TYPE]->(ct:COMPANY_TYPE),
(t)<-[:MOVIE_LINK_TITLE]-(ml:MOVIE_LINK)-[:MOVIE_LINK_LINKED_TYPE]->(lt:LINK_TYPE)
WHERE cn.country_code <> '[pl]'
AND (cn.name CONTAINS 'Film' OR cn.name CONTAINS 'Warner')
AND ct.kind = 'production companies'
AND k.keyword = 'sequel'
AND lt.link CONTAINS 'follow'
AND mc.note IS NULL
AND t.production_year >= 1950
AND t.production_year <= 2000
RETURN
MIN(cn.name) AS from_company,
MIN(lt.link) AS movie_link_type,
MIN(t.title) AS non_polish_sequel_movie;
null
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.