gregfelice commented on PR #2359:
URL: https://github.com/apache/age/pull/2359#issuecomment-4129860245

   Addressed all 4 Copilot suggestions:
   
   1. **NULL semantics** — Rewrote from EXISTS_SUBLINK to EXPR_SUBLINK with 
aggregate-based CASE expressions (`bool_or(pred IS TRUE/FALSE)` + `bool_or(pred 
IS NULL)`) to preserve three-valued Cypher NULL semantics. `any(x IN [NULL] 
WHERE x > 0)` now correctly returns NULL instead of false.
   
   2. **Unqualified iterator check** — Added `list_length(cref->fields) != 1` 
validation in `extract_iter_variable_name()`. Qualified names like `x.y` now 
error with "qualified name not allowed as iterator variable".
   
   3. **NULL regression tests** — Added 13 new test cases covering: NULL list 
input for all four functions, null elements in lists, literal null predicates, 
and mixed null/non-null elements.
   
   4. **single() performance** — Applied `IS TRUE` filtering so NULL predicates 
aren't counted. The LIMIT 2 optimization breaks correlated variable references 
in graph property contexts (e.g., `MATCH (u) WHERE single(x IN u.vals WHERE 
...)`), documented with TODO for future optimization pass.
   
   **Bonus**: Added copy/read support for `cypher_predicate_function` 
ExtensibleNode to prevent "unexpected copyObject()" crashes when PostgreSQL's 
query rewriter copies expression trees.
   
   All 32 regression tests pass (`predicate_functions`: ok).


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to