Reimplement list comprehension#2190
Merged
jrgemignani merged 4 commits intoapache:PG14from Jun 17, 2025
Merged
Conversation
- Fixed issue when MATCH clause variable is referenced inside list comprehension in WHERE clause or in property constraint. - Added regression tests.
Adds extra step in CI workflow to install missing necessary dependencies.
The build now needs to use https:, instead of git:
The labeler now requires a new step before running.
Modified the following files -
.github/workflows/installcheck.yaml
.github/workflows/labeler.yml
* Revert "Fix issue 1955 - List comprehension in WHERE clause (apache#2094)" This reverts commit 0f0d9be. * Revert "Fix error using list comprehension with WITH * (apache#1838)" This reverts commit 5e08a2f. * Revert "Fix shift/reduce conflict in grammar (apache#1719)" This reverts commit fab3119. * Revert "Implement list comprehension (apache#1610)" This reverts commit 3b2b394. * Reimplement list comprehension - Reimplement list comprehension to use ARRAY sublinks. - Some test results were not correct. All the test results that are modified are correct and are verified with neo4j. - Also resolves the issue of using list comprehension in MERGE clause (1611) and issue 1850 * Add expression tree walkers for cypher nodes - Added cypher_raw_expr_tree_walker and cypher_expr_tree_walker, based on Postgres's raw_expression_tree_walker and expression_tree_walker. These follow the same walker API as Postgres and add support for Cypher-specific nodes. - Also added the agtype[] to agtype func and typecast to 1.5.0-y.y.y.sql - Simplifies logic for cypher_subquery handling in where clause. - Fixes a crash when list comprehension in the WHERE clause references a variable from the preceding MATCH clause.
0b32310 to
9772a70
Compare
jrgemignani
approved these changes
Jun 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reimplement list comprehension to use ARRAY sublinks.
Some test results were not correct. All the test results that are
modified are correct and are verified with neo4j.
Also resolves the issue of using list comprehension in MERGE clause (List comprehension as property constraint of MERGE clause errors out #1611)
and issue Server crashes when executing SELECT * FROM cypher('list_comprehension' ...) #1850
Note: Please use Rebase and Merge option for merging this PR as it includes some patches that weren't applied to PG14