Skip to content

CASE WHEN <numeric aggregate> IS NULL THEN null ELSE <numeric aggregate> END` fails with a boolean type error #2525

Description

@YGY-001

Docker image `apache/age:release_PG18_1.8.0

Reproduction

LOAD 'age';
SET search_path = ag_catalog, public;
SELECT ag_catalog.create_graph('age_issue_case1');

SELECT *
FROM ag_catalog.cypher('age_issue_case1', $$
UNWIND ['GU'] AS alias0
WITH max(toFloat(1)) AS alias2, avg(toFloat(1)) AS alias3
WITH CASE WHEN alias2 IS NULL THEN null ELSE alias2 END AS alias2,
     CASE WHEN alias3 IS NULL THEN null ELSE alias3 END AS alias3
RETURN {alias2: alias2, alias3: alias3} AS result
$$) AS (result agtype);

Expected

One row containing the two numeric aggregate values.

Actual

CASE/ELSE could not convert type double precision to boolean

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions