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

Fix validation in list comprehension and pattern comprehension #2902

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

nafraf
Copy link
Contributor

@nafraf nafraf commented Feb 22, 2023

Hi, this PR is to solve #2267. The proposed changes are:

  1. A new function AR_EXP_ContainsAgg() was created to check if AR_ExpNode tree contains an aggregating function.
    If an aggregating function is found, then the function sets the error message and returns true, otherwise, returns false

  2. The function FilterTree_Valid() was modified to receive a second parameter cypher_astnode_type_t type. In case of pattern comprehension or list comprehension type, there is a new validation to check that the predicate is not using aggregation functions.

  3. To validate list comprehension, the function ``_AR_ExpNodeFromComprehensionFunction()``` was modified:

    1. Validate predicate filters using CYPHER_AST_LIST_COMPREHENSION type
    2. Validate that aggregation function is not being used in evaluation node
  4. To validate pattern comprehension, the function buildPatternComprehensionOps() was modified:

    1. Validate that aggregation function is not being used in evaluation node
    2. Validate filters using CYPHER_AST_PATTERN_COMPREHENSION type

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.

None yet

1 participant