Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

container must be an array or object #1043

Closed
MuhammadTahaNaveed opened this issue Jul 17, 2023 · 4 comments · Fixed by #1046
Closed

container must be an array or object #1043

MuhammadTahaNaveed opened this issue Jul 17, 2023 · 4 comments · Fixed by #1046
Labels
bug Something isn't working

Comments

@MuhammadTahaNaveed
Copy link
Member

MuhammadTahaNaveed commented Jul 17, 2023

Describe the bug
Errors out saying container must be an array or object.

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

  • terminal

What data setup do we need to do?

SELECT * FROM cypher('hello',
    $$CREATE (n)-[:KNOWS {n:'hello'}]->({n:'hello'})
$$) as (a agtype);

What is the command that caused the error?

SELECT * FROM cypher('hello',
    $$MATCH (x)<-[y *]-(),({n:y[0].n}) RETURN x
$$) as (a agtype);
ERROR:  container must be an array or object

Expected behavior
expected vertex x to be returned

{"id": 281474976710658, "label": "", "properties": {"n": "hello"}}::vertex

Environment (please complete the following information):

  • latest (PG13 master)

Additional Context
This works

SELECT * FROM cypher('hello',$$
    MATCH (x)<-[y *]-()
    MATCH ({n:y[0].n})
    RETURN x
$$) as (a agtype);
                                     a                                      
----------------------------------------------------------------------------
 {"id": 281474976710658, "label": "", "properties": {"n": "hello"}}::vertex
(1 row)
@MuhammadTahaNaveed MuhammadTahaNaveed added the bug Something isn't working label Jul 17, 2023
@jrgemignani
Copy link
Contributor

jrgemignani commented Jul 17, 2023

@MuhammadTahaNaveed Looks like I overlooked binary arrays and objects. I will look into this.

Correction: It is because the VLE passes a special vpc container (vpc = VLE Path Container) around for its results. In this case, the container is getting passed instead of the actualized contents of that container. I will see about putting the decode into agtype_access_operator. However, this may not be the appropriate place for it.

@jrgemignani
Copy link
Contributor

@MuhammadTahaNaveed I have fixed it and verified the results with Neo4j. Working on the PR now.

@MuhammadTahaNaveed
Copy link
Member Author

@MuhammadTahaNaveed Looks like I overlooked binary arrays and objects. I will look into this.

Correction: It is because the VLE passes a special vpc container (vpc = VLE Path Container) around for its results. In this case, the container is getting passed instead of the actualized contents of that container. I will see about putting the decode into agtype_access_operator. However, this may not be the appropriate place for it.

@jrgemignani I think the reason you mentioned may also be valid for #1044.

@jrgemignani
Copy link
Contributor

jrgemignani commented Jul 17, 2023

See PR #1046 which addresses this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants