Hi all, I've opened a PR fixing issue #2383, where UNWIND [null] AS x RETURN count(x) returns 1 instead of the Neo4j/openCypher-correct 0. - Issue: https://github.com/apache/age/issues/2383 - PR: https://github.com/apache/age/pull/2411 Root cause: age_unnest() materialized top-level AGTV_NULL elements as non-NULL datums wrapping an agtype-null, so count()'s strict null check never skipped the row. The reference paths (RETURN count(null),WITH null AS x RETURN count(x)) already returned 0. Approach: Patching age_unnest() directly broke predicate_functions tests, because AGE's construct_age_function_name() rewrites bare unnest → age_unnest, so list comprehensions and all/any/none/single sharethe same SRF and deliberately rely on agtype-null flowing through. Instead, I added a dedicated age_unwind() SRF with UNWIND-specific null semantics (top-level AGTV_NULL → SQL NULL, nested nulls preserved)and pointed only transform_cypher_unwind() at it. age_unnest() is unchanged, so list comprehension and predicate function behavior is preserved. Tests: make installcheck on PostgreSQL 18 / Ubuntu 24.04: 32/33 pass. The only failure (age_upgrade) reproduces identically on pristine master (pre-existing, unrelated — same age_prepare_pg_upgrade alreadyexists error). Added 7 regression tests in regress/sql/cypher_unwind.sql covering count(x), IS NULL, WHERE x IS NOT NULL, count(*) cardinality, nested-null preservation, and direct row-value inspection. Happy to iterate on review feedback. This is my first contribution to AGE, so please let me know if I've missed anything expected for the PR shape, commit message style, or release-notes/upgrade-scriptconventions. Thanks, Prashant Chinnam GitHub: @crprashant
