beamrock opened a new issue, #945:
URL: https://github.com/apache/age/issues/945
**Describe the bug**
If an alias is not specified, the count result is incorrect.
**How are you accessing AGE (Command line, driver, etc.)?**
- anywhere. I did in Command line.
**What data setup do we need to do?**
SELECT * from cypher('movie_graph', $$
CREATE (a:Part {part_num: '123'}),
(b:Part {part_num: '345'}),
(c:Part {part_num: '456'}),
(d:Part {part_num: '789'})
$$) as (a agtype);
CREATE (a:Part {part_num: '123'}),
(b:Part {part_num: '345'}),
(c:Part {part_num: '456'}),
(d:Part {part_num: '789'}) ;
moviedb=# SELECT * from cypher('movie_graph', $$ match (a:Part) return a $$)
as (result agtype);
result
--------------------------------------------------------------------------------------
{"id": 1125899906842625, "label": "Part", "properties": {"part_num":
"123"}}::vertex
{"id": 1125899906842626, "label": "Part", "properties": {"part_num":
"345"}}::vertex
{"id": 1125899906842627, "label": "Part", "properties": {"part_num":
"456"}}::vertex
{"id": 1125899906842628, "label": "Part", "properties": {"part_num":
"789"}}::vertex
(4 rows)
// When an alias is not specified
moviedb=# SELECT * from cypher('movie_graph', $$ match (:Part) return
count(*) $$) as (result agtype);
result
--------
1 <-------- incorrect count result
(1 row)
// When an alias and a label is specified
moviedb=# SELECT * from cypher('movie_graph', $$ match (a:Part) return
count(*) $$) as (result agtype);
result
--------
4
(1 row)
// When an alias is only specified
moviedb=# SELECT * from cypher('movie_graph', $$ match (a) return count(*)
$$) as (result agtype);
result
--------
4
(1 row)
Just so you know, agensgraph and neo4j give accurate results.
**Expected behavior**
A clear and concise description of what you expected to happen.
neo4j@ldbcgraph> match (:Part) return count(*) ;
+----------+
| count(*) |
+----------+
| 4 |
+----------+
sampledb=# match (:Part) return count(*) ;
count
-------
4
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]