apache / apache/age

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

Open
#2,525 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
4.8k
Forks
523
Avg merge
1d 2h
Merged PRs (30d)
9

Description

Docker image `apache/age:release_PG18_1.8.0

**Reproduction**

```sql
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**

```text
CASE/ELSE could not convert type double precision to boolean
```

Contributor guide

Open the contributing guide

Research direction

Start by running the supplied SQL reproduction against the apache/age:release_PG18_1.8.0 Docker image and confirm the CASE/ELSE type error. Trace the CASE expression and numeric aggregate handling from the failing path; done means the query returns one row containing both numeric aggregate values without the boolean conversion error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, postgresql, sql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.