You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@age.apache.org by "1fanwang (via GitHub)" <gi...@apache.org> on 2026/08/29 06:25:26 UTC

[PR] fix: allow reduce and list comprehensions in LIMIT and SKIP [age]

1fanwang opened a new pull request, #2557:
URL: https://github.com/apache/age/pull/2557

   `LIMIT` and `SKIP` reject `reduce()` and list comprehensions with `ERROR: 0A000: unsupported SubLink`. These expressions do not contain a user-written subquery, but AGE represents their iteration internally as a sublink.
   
   The parser now permits sublinks while transforming `LIMIT` and `OFFSET` expressions, matching PostgreSQL's handling of those contexts. On current master, all four cases from the issue fail. On this branch, each returns `1`.
   
   Closes https://github.com/apache/age/issues/2518.
   
   ## Testing
   
   <details>
   <summary>Regression tests</summary>
   
   ```console
   $ git restore --source=0e30566226f017d53b7f52025803b38af3ad2b3f -- src/backend/parser/cypher_expr.c
   $ docker build --target build -t age-2518 -f docker/Dockerfile .
   $ docker run --rm age-2518 bash -lc 'chown -R postgres:postgres /age && su postgres -c "make -C /age PG_CONFIG=/usr/lib/postgresql/18/bin/pg_config installcheck REGRESS=\"list_comprehension age_reduce\""'
   not ok 1     - list_comprehension
   not ok 2     - age_reduce
   # 2 of 2 tests failed.
   
   $ git restore --source=HEAD -- src/backend/parser/cypher_expr.c
   $ docker build --target build -t age-2518 -f docker/Dockerfile .
   $ docker run --rm age-2518 bash -lc 'chown -R postgres:postgres /age && su postgres -c "make -C /age PG_CONFIG=/usr/lib/postgresql/18/bin/pg_config installcheck REGRESS=\"list_comprehension age_reduce cypher_match cypher_subquery\""'
   ok 1         - list_comprehension
   ok 2         - age_reduce
   ok 3         - cypher_match
   ok 4         - cypher_subquery
   1..4
   # All 4 tests passed.
   ```
   
   </details>
   
   <details>
   <summary>PostgreSQL 18.6 query results</summary>
   
   ```console
   # Current master, one error from each LIMIT/SKIP and reduce/list-comprehension case
   ERROR:  0A000: unsupported SubLink
   ERROR:  0A000: unsupported SubLink
   ERROR:  0A000: unsupported SubLink
   ERROR:  0A000: unsupported SubLink
   
   # This branch, running the same four statements
    result
   --------
    1
   (1 row)
   
    result
   --------
    1
   (1 row)
   
    result
   --------
    1
   (1 row)
   
    result
   --------
    1
   (1 row)
   ```
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: allow reduce and list comprehensions in LIMIT and SKIP [age]

Posted by "1fanwang (via GitHub) via commits" <co...@age.apache.org>.
1fanwang commented on PR #2557:
URL: https://github.com/apache/age/pull/2557#issuecomment-6768590563

   Ready for review when you have time.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org