Skip to content

Issue with collect in cypher #860

Closed
Closed
@M-Taan

Description

@M-Taan

ArcadeDB Version: 23.1.2

JDK Version: openjdk 11.0.18

OS: Arch, running 6.1.9-arch1-1

Expected behavior

When running a query that results in a single node match, collect should result in a list of hashmaps of length 1.

Actual behavior

When running a query that results in a single node match, collect returns a hashmap.

Steps to reproduce

As an example, I wrote this query in the open beer database, so it can be easily reproduced.
This brewery produces only one beer. As stated above, the collection should be a list of hashmaps of length 1, instead it returns beer-products as a single hashmap.

MATCH (b:Beer)-[:HasBrewery]->(brw:Brewery {id: 519})
return brw.name as `brewery-name`, collect(b) as `beer-products`

Activity

self-assigned this
on Feb 14, 2023
added
bugSomething isn't working
on Feb 14, 2023
added this to the 23.2.1 milestone on Feb 14, 2023
added a commit that references this issue on Feb 15, 2023
lvca

lvca commented on Feb 15, 2023

@lvca
Contributor

Reproduced. The result set from cypher is transformed. There is a specific case where it makes flat all the list of maps with only one item. Removed and seems to work without breaking things. Please let me know if the latest main branch solves your use case.

added a commit that references this issue on Feb 15, 2023

fix: recent change to fix #860 created a regression

3d7e8e5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfixed

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @lvca@M-Taan

      Issue actions

        Issue with collect in cypher · Issue #860 · ArcadeData/arcadedb