Skip to content

[OpenCypher] size() returns null for unsupported argument types instead of raising a type error #5477

Description

@shulei5831sl

Environment

  • Host OS: Linux x86_64
  • Deployment: Docker
  • Query interface: HTTP command API
  • Query language: opencypher and cypher (both affected)
  • ArcadeDB version: 26.8.1-SNAPSHOT
  • Build: efa5747/1784810487393/main
  • Docker image: arcadedata/arcadedb:latest
  • RepoDigest: arcadedata/arcadedb@sha256:1cb78c08e2e40e765f18cd1b06be83d878d7e13c01471db6bddb112a53d0de74
  • API endpoint: POST http://localhost:2494/api/v1/command/test

Minimal reproducer

curl -u root:<password> \
  -H "Content-Type: application/json" \
  -X POST \
  http://localhost:2494/api/v1/command/test \
  -d '{"language":"opencypher","command":"RETURN size(42) AS r"}'

Response:

{"user":"root","result":[{"r":null}]}

Matched valid-input controls

String control:

curl -u root:<password> \
  -H "Content-Type: application/json" \
  -X POST \
  http://localhost:2494/api/v1/command/test \
  -d '{"language":"opencypher","command":"RETURN size(\"abc\") AS r"}'

Response: {"user":"root","result":[{"r":3}]}

List control:

curl -u root:<password> \
  -H "Content-Type: application/json" \
  -X POST \
  http://localhost:2494/api/v1/command/test \
  -d '{"language":"opencypher","command":"RETURN size([1,2,3]) AS r"}'

Response: {"user":"root","result":[{"r":3}]}

Null-propagation control

size(null) correctly returns null per Cypher null-propagation rules.
This is the expected behavior and not a bug. The issue is that invalid
scalar arguments (INTEGER, FLOAT, BOOLEAN, MAP) also silently return
null, conflating a type error with legitimate null propagation.

curl -u root:<password> \
  -H "Content-Type: application/json" \
  -X POST \
  http://localhost:2494/api/v1/command/test \
  -d '{"language":"opencypher","command":"RETURN size(null) AS r"}'

Response: {"user":"root","result":[{"r":null}]} (correct)

Type matrix

Input Query Result Notes
INTEGER RETURN size(42) AS r null Should be type error
FLOAT RETURN size(3.14) AS r null Should be type error
BOOLEAN RETURN size(true) AS r null Should be type error
MAP RETURN size({a:1}) AS r null Should be type error
NULL RETURN size(null) AS r null Correct — null propagation
STRING RETURN size('abc') AS r 3 Valid control
LIST RETURN size([1,2,3]) AS r 3 Valid control

size() is documented as accepting STRING | LIST<ANY>. INTEGER, FLOAT,
BOOLEAN, and MAP are not valid input types. Returning null for these
inputs conflates a legitimate type error with legal null propagation.

Expected behavior

size() is documented as operating on a list or string. An argument
outside those input domains should be rejected with a client-facing
argument or type error rather than being accepted as a successful
query returning null.

Actual behavior

ArcadeDB accepts INTEGER, FLOAT, BOOLEAN, and MAP arguments to size()
and silently returns null. No client-facing type or argument error is
produced.

Language mode Invalid-input result
opencypher null
cypher null

The same result is obtained in both opencypher and cypher language modes.

Cross-engine comparison for size(42)

Engine Result
Neo4j 2026.06 Client-facing type error
Memgraph 3.12 Client-facing type error
ArcadeDB 26.8.1-SNAPSHOT Returns null silently

MAP behavior differs across engines (Memgraph documents MAP as a supported
input type for size()) and is not claimed as a cross-engine consistency
check. The table above is scoped to the minimal size(42) reproducer.

Stability

30 consecutive executions returned null in each language mode.

Additional context

This behavior was identified during a generated type-state campaign.
Across the complete RC-E18-B family, 17 generated witnesses were minimized
to two canonical behaviors involving head() and size(). This report
covers the size() behavior only. The generated witnesses are not treated
as separate bugs.

This is related in symptom to #5476, but affects a different
function with a different accepted input domain. It is reported separately
because it is not yet known whether the two behaviors share an
implementation root cause.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions