n24q02m opened a new pull request, #561:
URL: https://github.com/apache/hugegraph-doc/pull/561

   ## Purpose of the PR
   
   - close #556
   
   In Gremlin-Groovy, an unsuffixed decimal literal like `1.0` is parsed as 
`java.math.BigDecimal`. When querying a `DOUBLE` or `FLOAT` property with 
collection predicates such as `P.within(1.0, 1.5)`, `P.within` checks set 
membership without numeric type coercion (`BigDecimal(1.0)` vs `Double(1.0)`), 
so the traversal returns `0`:
   
   ```groovy
   schema.propertyKey('weight').asDouble().ifNotExist().create()
   // has('weight', P.within(1.0, 1.5)) -> 0 (BigDecimal vs Double)
   // has('weight', P.within(1.0d, 1.5d)) -> 1
   ```
   
   This PR updates both the EN and CN documentation 
(`content/{en,cn}/docs/language/hugegraph-gremlin.md` and 
`content/{en,cn}/docs/clients/restful-api/propertykey.md`) to explain the `d` / 
`f` literal suffix requirement when querying `DOUBLE` / `FLOAT` properties.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to