You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TUR-302: Storage: implement a point property type - #1333
Goal. Add Neo4j's point as a stored property type, so CREATE (:City {at: point({longitude: 2.3522, latitude: 48.8566})}) stores a point and RETURN n.at reads back point({x: 2.3522, y: 48.8566, crs: 'wgs-84'}).
Approach.ValueType::Point and CellTag::Point are appended before their sentinels. db::Point is 32 trivially copyable bytes: x, y, z as doubles, a one-byte PointCRS (cartesian, cartesian-3d, wgs-84, wgs-84-3d) and zeroed padding. The constructor makes equal points equal in every byte, so dumps, EncodedList comparisons and DISTINCT keys compare raw bytes. point(map) follows Neo4j's PointValue.fromInputFields. The type is threaded through storage, dump/load, the v3 dialects (!storage.point, db.to_point), the binary protocol (POINT = 22), Python and npm.
Where to look.
storage/metadata/Point.h:36Point: the layout and its invariants
Checked by hand against a server: BinaryClient returns Point(srid=7203, x=1.0, y=2.0, z=None), and the npm client returns {"srid":4979,"x":3,"y":4,"z":5}.
Merge Danger
Door: one-way
ValueType::Point = 11, CellTag::Point = 14, the PointCRS ordinals and the 32-byte layout go into every datapart written from now on, and POINT = 22 into the wire protocol.
Blast Radius: storage
Every switch over ValueType and CellTag gains a case. Clients older than this one cannot decode a POINT column.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement a point property type.