apache / apache/age

ORDER BY alias does not work with RETURN AS alias

Open
#801 3 comments 1 reaction 0 assignees View on GitHub
bug override-stale
Dominant language
C
Stars
4.8k
Forks
523
Avg merge
1d 2h
Merged PRs (30d)
9

Description

**Describe the bug**
ORDER BY alias does not work with RETURN AS alias

**How are you accessing AGE (Command line, driver, etc.)?**
- Command Line

**What data setup do we need to do?**
```pgsql
SELECT * FROM cypher('graph', $$
CREATE (:opt_match_v {name: 'someone'})-[:opt_match_e]->(:opt_match_v {name: 'somebody'}),
(:opt_match_v {name: 'anybody'})-[:opt_match_e]->(:opt_match_v {name: 'nobody'})
$$) AS (u agtype);
```

**What is the command that caused the error?**
```pgsql
SELECT * FROM cypher('graph', $$
MATCH p=(n)-[]->(m)
RETURN n.name as u
ORDER BY u
$$) AS (u agtype);
```
```
ERROR: could not find rte for u
LINE 2: MATCH p=(n)-[]->(m) RETURN n.name as u ORDER BY u
^
```

**Expected behavior**
Expected order by to work

**Environment (please complete the following information):**
- latest

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.