[ 
https://issues.apache.org/jira/browse/TINKERPOP-2607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stephen Mallette closed TINKERPOP-2607.
---------------------------------------
    Resolution: Not A Bug

Gremlin Console (groovysh) assumes {{BigDecimal}} if you are not explicit with 
the type of number it is. 

{code}
gremlin> 0.12345.class
==>class java.math.BigDecimal
{code}

Neo4j must not coerce BigDecimal to double/float and therefore returns an 
error. TinkerPop does not do that coercion - it is up to Neo4j to do that sort 
of thing. In the Gremlin Console, or when using Groovy, I think you just need 
to be explicit about your types. A similar issue was raised about this with 
TinkerGraph where a similar answer was supplied: TINKERPOP-2603

> Neo4j-Gremlin could not directly write and query double or float values.
> ------------------------------------------------------------------------
>
>                 Key: TINKERPOP-2607
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2607
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: neo4j
>    Affects Versions: 3.4.10
>         Environment: TinkerPop Version : 3.4.10
> Neo4j Version : 3.5.27
> OS : CentOS8
> Storage Backend: in-memory
>            Reporter: Liwei Liu
>            Priority: Major
>
> h2. Neo4j-Gremlin could not directly write and query double or float values.
> h4. Environment
> TinkerPop Version : 3.4.10
> Neo4j Version : 3.5.27 
> OS : CentOS8
> Storage Backend: in-memory 
> Data size: 100 vertices, 200 edges
> h4. Bug description
>  Neo4j-Gremlin could not directly write and query double or float values. We 
> need to specify the detailed type of the property value. However, we can do 
> this in TinkerGraph or from Java API.
> h4. Current behavior
> {code:java}
> java.util.concurrent.ExecutionException: 
> org.apache.tinkerpop.gremlin.driver.exception.ResponseException: 
> [349203472:java.math.BigDecimal] is not a supported property 
> valuejava.util.concurrent.ExecutionException: 
> org.apache.tinkerpop.gremlin.driver.exception.ResponseException: 
> [349203472:java.math.BigDecimal] is not a supported property value at 
> java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357) 
> at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1908)
> {code}
> h3. Expected behavior
>  When enter the same code in TinkerGraph.
> {code:java}
> gremlin> g.addV().property('vp2', 3.49203472E8)
> ==>v[3192]{code}
>  When try to do it through Java API from Neo4j, it is legal.
> {code:java}
> Vertex v1 = g.addV().property("author",3.49203472E8).next();
> {code}
> When detailed type declared, it is legal.
> {code:java}
> gremlin> g.addV().property('vp2', 3.49203472E8d)
> ==>v[19946]
> {code}
> h3. Reproduce
> {code:java}
> gremlin> g.addV().property('vp2', 3.49203472E8)
> [349203472:java.math.BigDecimal] is not a supported property value
> {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to