age: Property access from edge/vertex in array gives unexpected error
Describe the bug Property access from edge/vertex in array gives unexpected error.
How are you accessing AGE (Command line, driver, etc.)?
- terminal
What data setup do we need to do?
SELECT * FROM cypher('graph',$$
CREATE (n)-[:KNOWS {n:'hello'}]->({n:'hello'})
$$) as (a agtype);
What is the command that caused the error?
SELECT * FROM cypher('graph',$$
MATCH ()<-[x *]-()
RETURN x[0].n
$$) as (a agtype);
ERROR: container must be an array or object
Expected behavior
should have executed successfully and returned hello
Environment (please complete the following information):
- 1.3.0 PG12
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 17 (16 by maintainers)
@MuhammadTahaNaveed Yeah, we kind of both came up with a solution and PR at the same time. We need to coordinate better, lol.
@jrgemignani oh okay! Actually I tried a fix for it in pr #1034. Can you give a look ? Thanks.
The regular match uses
_agtype_build_edge
. The vle match usesagtype_value_build_edge
. Both convert their contents to agtype, but differently.I think it might be the difference between a serialized array of agtypes versus and array of agtype_values.
I’m looking at it in the debugger. Apparently, the regular match and vle match go through different routes - each creates the edge in a different way.
An array of edges.