Skip to content

Fix validation in list comprehension and pattern comprehension#2902

Draft
nafraf wants to merge 13 commits intoRedisGraph:masterfrom
nafraf:bug#2267
Draft

Fix validation in list comprehension and pattern comprehension#2902
nafraf wants to merge 13 commits intoRedisGraph:masterfrom
nafraf:bug#2267

Conversation

@nafraf
Copy link
Copy Markdown
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.

1 participant