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

Add implicit bool checking in expr predication. #4855

Merged
merged 2 commits into from
Nov 11, 2022

Conversation

Shylock-Hg
Copy link
Contributor

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number:

Close https://github.com/vesoft-inc/nebula-ent/issues/1624

Description:

How do you solve it?

Special notes for your reviewer, ex. impact of this fix, design document, etc:

Checklist:

Tests:

  • Unit test(positive and negative cases)
  • Function test
  • Performance test
  • N/A

Affects:

  • Documentation affected (Please add the label if documentation needs to be modified.)
  • Incompatibility (If it breaks the compatibility, please describe it and add the label.)
  • If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).)
  • Performance impacted: Consumes more CPU/Memory

Release notes:

Please confirm whether to be reflected in release notes and how to describe:

ex. Fixed the bug .....

@Shylock-Hg
Copy link
Contributor Author

"""
MATCH (person:Person)-[:KNOWS*2]-(friend)-[:IS_LOCATED_IN]->(city:Place)
WHERE id(person) == "p-6597069812321" AND id(friend) != "p-6597069812321" AND NOT (friend)-[:KNOWS]-(person)
WITH person, city, friend, date(friend.Person.birthday) as birthday
WHERE  (birthday.month==10 AND birthday.day>=21) OR
        (birthday.month==(10%12)+1 AND birthday.day<22)
WITH DISTINCT friend, city, person
OPTIONAL MATCH (friend)<-[:POST_HAS_CREATOR]-(post:Post)
WITH friend, city, collect(post) AS posts, person
WITH friend,
     city,
     size(posts) AS postCount,
     size([p IN posts WHERE (p)-[:HAS_TAG]->()<-[:HAS_INTEREST]-(person)]) AS commonPostCount
RETURN toInteger(substr(id(friend), 2)) AS personId,
       friend.Person.firstName AS personFirstName,
       friend.Person.lastName AS personLastName,
       commonPostCount - (postCount - commonPostCount) AS commonInterestScore,
       friend.Person.gender AS personGender,
       city.Place.name AS personCityName
ORDER BY commonInterestScore DESC, personId ASC
LIMIT 10
"""

@Shylock-Hg Shylock-Hg added ready-for-testing PR: ready for the CI test type/bug Type: something is unexpected labels Nov 10, 2022
@Sophie-Xie Sophie-Xie merged commit 6d65a85 into vesoft-inc:master Nov 11, 2022
@Shylock-Hg Shylock-Hg deleted the fix/implicit-bool-checking branch November 11, 2022 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing PR: ready for the CI test type/bug Type: something is unexpected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants