neo4j-contrib / neo4j-apoc-procedures

Awesome Procedures On Cypher for Neo4j - codenamed "apoc"                     If you like it, please ★ above ⇧            
https://neo4j.com/labs/apoc
Apache License 2.0
1.7k stars 495 forks source link

Float type not respected in export #1629

Closed folterj closed 3 years ago

folterj commented 4 years ago

Float type not respected in export

Numerical values of float type without decimals appear to be automatically converter to integer during export. Apart of the undesired type change, this will additionally cause failure when trying to import large values.

Reproducible

CREATE (x:Test {x:1000000000000000000000000.0})

MATCH (x:Test) RETURN x.x
> 1e+24.0
MATCH (x:Test) RETURN apoc.meta.type(x.x)
> "FLOAT"

CALL apoc.export.cypher.all("test.cypher")

Expected Behavior (Mandatory)

UNWIND [{_id:0, properties:{x:1000000000000000000000000.0}}] AS row
CREATE (n:`UNIQUE IMPORT LABEL`{`UNIQUE IMPORT ID`: row._id}) SET n += row.properties SET n:Test;

(Expected .0)

Actual Behavior (Mandatory)

UNWIND [{_id:0, properties:{x:1000000000000000000000000}}] AS row
CREATE (n:`UNIQUE IMPORT LABEL`{`UNIQUE IMPORT ID`: row._id}) SET n += row.properties SET n:Test;

(Missing .0)

Versions

Test 1

Test 2

conker84 commented 3 years ago

this should be fixed with #1675