Skip to content

SQL: "keys" method behaves differently than "values" method #2964

@gramian

Description

@gramian

ArcadeDB Server v25.11.1 (build 522241f606696c3cf24711298c58cc9c1483fb1d/1765311329530/UNKNOWN)

Running on Linux 6.14.0-37-generic - OpenJDK 64-Bit Server VM 21.0.8

The .keys() method handles lists of maps by collection the element's keys in a list (ie item by item), whereas the .values() method returns null for lists:

SELECT [{"x":1,"y":2}].keys() AS keys, [{"x":1,"y":2}].values() as values

returns:

[
  { "keys": ["x","y"],
    "values": null }
]

This is due to the keys method handling collections separately: https://github.com/ArcadeData/arcadedb/blob/main/engine/src/main/java/com/arcadedb/query/sql/method/collection/SQLMethodKeys.java#L55
and the values method not: https://github.com/ArcadeData/arcadedb/blob/main/engine/src/main/java/com/arcadedb/query/sql/method/collection/SQLMethodValues.java#L44

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions