Reproduction
LOAD 'age';
SET search_path = ag_catalog, public;
SELECT ag_catalog.create_graph('age_issue_case19');
SELECT *
FROM ag_catalog.cypher('age_issue_case19', $$
RETURN avg(toFloat(1)) AS value
UNION ALL
RETURN null AS value
$$) AS (value agtype);
Expected
The query returns two rows: 1.0 and null. The equivalent query is
accepted by Neo4j, and AGE can return the aggregate by itself.
Actual
ERROR: UNION types double precision and agtype cannot be matched
Controls
These queries succeed on the same fresh graph:
RETURN avg(toFloat(1)) AS value
RETURN toFloat(1) AS value
UNION ALL
RETURN null AS value
The failure is specific to combining the numeric aggregate result with a
UNION branch. It does not require a graph pattern, writes, an entity, or a
probe projection. Current-log Case 3197 and its full fixture reproduce this
error on AGE 1.8.0.
This is separate from #2525: #2525 requires a numeric aggregate to be used in
a CASE WHEN ... IS NULL THEN ... ELSE ... END expression and reports a
boolean conversion error. This reduction contains no CASE and fails during
UNION type resolution.
Environment
Apache AGE 1.8.0 on PostgreSQL 18.6, Docker image
apache/age:release_PG18_1.8.0.
Reproduction
Expected
The query returns two rows:
1.0andnull. The equivalent query isaccepted by Neo4j, and AGE can return the aggregate by itself.
Actual
Controls
These queries succeed on the same fresh graph:
The failure is specific to combining the numeric aggregate result with a
UNIONbranch. It does not require a graph pattern, writes, an entity, or aprobe projection. Current-log Case 3197 and its full fixture reproduce this
error on AGE 1.8.0.
This is separate from #2525: #2525 requires a numeric aggregate to be used in
a
CASE WHEN ... IS NULL THEN ... ELSE ... ENDexpression and reports aboolean conversion error. This reduction contains no
CASEand fails duringUNIONtype resolution.Environment
Apache AGE
1.8.0on PostgreSQL18.6, Docker imageapache/age:release_PG18_1.8.0.