Repository navigation
fix(#12397): toString() renders a point and the concatenation of a string with a map is refused - #12404
Conversation
…on of a string with a map is refused
A point is a map at runtime, so toString() refused it with 'cannot convert LinkedHashMap' and the concatenation of a string with a point or a map answered the Java Map.toString() form, which prints the internal keys of the point (srid included) in a shape no point constructor or toString() accepts.
toString() now renders a point as the point literal, the way Neo4j renders it: point({x: 1.0, y: 2.0, crs: 'cartesian'}), with the z coordinate when the point has one. A map that is not a point is still refused.
The concatenation of a string with a map is refused with the type error Neo4j raises; a list is still concatenated and appended as before.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
This pull request is merged. |
|
Triage: Thanks for the PR. The change is small, focused and matches Neo4j behavior. I found no security concerns and nothing that has to change before merge. I could only read the diff and the base branch, so I didn't run any tests. What I checked
Minor, non-blocking
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 4 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
…nger names the map The map is handled before that list now: a point is rendered and any other map is refused with its own message.
|
Triage: ReviewI found no blocking problems, and no security concerns. I could not run anything, so the checks below come from reading the diff and the base branch. What the PR does
Observations (non-blocking)
The change is small and focused, and it reuses existing helpers. It also respects the CLAUDE.md conventions on imports, |
fix(#12397): toString() renders a point and the concatenation of a string with a map is refused
A point is a map at runtime in ArcadeDB (there is no dedicated geometry type yet, issue #4870), so
toString()refused it withtoString() cannot convert LinkedHashMapand the concatenation of a string with a point or a map answered the JavaMap.toString()form, which prints the internal keys of the point (sridincluded) in a shape no point constructor ortoString()accepts.Behavior change
toString()of a point now answers the point literal, the way Neo4j answers it:toString(point({x:1,y:2}))point({x: 1.0, y: 2.0, crs: 'cartesian'})point({x: 1.0, y: 2.0, crs: 'cartesian'})toString(point({longitude:1,latitude:2}))point({x: 1.0, y: 2.0, crs: 'wgs-84'})point({x: 1.0, y: 2.0, crs: 'wgs-84'})toString(point({x:1,y:2,z:3}))point({x: 1.0, y: 2.0, z: 3.0, crs: 'cartesian-3d'})point({x: 1.0, y: 2.0, z: 3.0, crs: 'cartesian-3d'})The concatenation of a string with a map, or with a point, is now refused with the type error Neo4j raises:
'a' + point({x:1,y:2})a{x=1.0, y=2.0, crs=cartesian, srid=7203}'a' + {k:1}a{k=1}{k:1} + 'a'{k=1}aWhat did not change:
toString()of a map that is not a point is still refused, as it is in Neo4j.Notes
sridis not part of the rendering: Neo4j prints the name of the coordinate reference system, and the srid is its numeric name.Tests
engine/src/test/java/com/arcadedb/function/geo/PointToStringIssue12397Test.java, a new regression test that pins every answer of the tables above, plus the controls.