[ 
https://issues.apache.org/jira/browse/TINKERPOP-2907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17701126#comment-17701126
 ] 

Stephen Mallette commented on TINKERPOP-2907:
---------------------------------------------

That's valid syntax for the antlr grammar, so it should work in that context, 
but you are using Groovy. For Groovy you would want to use 
{{Double.POSITIVE_INFINITY}} or perhaps do 

{code}
gremlin> Infinity
No such property: Infinity for class: groovysh_evaluate
Type ':help' or ':h' for help.
Display stack trace? [yN]n
gremlin> NEGATIVE_INFINITY
==>-Infinity
gremlin> POSITIVE_INFINITY
==>Infinity
gremlin> Infinity = POSITIVE_INFINITY
==>Infinity
{code}

I think the grammar supports signed infinity as well but I don't think Groovy 
can handle that as an alias as shown above (at least not without some sort of 
meta-programming which seems like overkill in my opinion). Of all the language 
variants we strive to make gremlin-groovy as close to the antlr grammar as 
possible but there are times where it deviates. If you are building something 
for the future you might consider conforming your Gremlin to the antlr grammar 
as I sense the Groovy style will become more of just a Gremlin variant like 
python or .NET rather than the archetypal representation of the language.

> Throw ExecutionException for property
> -------------------------------------
>
>                 Key: TINKERPOP-2907
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2907
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: driver, server
>    Affects Versions: 3.6.2
>         Environment: - TinkerGraph Version: 3.6.2
> - Operating system: macOS 13.2.1
> - API/Driver: Java
>            Reporter: Zeyang Zhuang
>            Priority: Major
>
> I first randomly create a graph. Then when I run the following query: 
> `g.V().has('vp4', 
> between(0.10558513485092047,0.27458978042693427).and(between(0.4688484640878603,Infinity))).and(__.order().by(desc)).hasNot('vp1')`
>  is thrown with an exception. I think this query is syntactically correct, 
> but I keep triggering this kind of problem. Can TinkerGraph supports Infinity 
> comparison?
> *Expected behavior:*
> No exception should be expected to throw. Or futher messages or prompts 
> should be thrown.
> *Actual behavior:*
> A `java.util.concurrent.ExecutionException` is thrown. And I'm not really 
> sure whether this problem should happen so I report this. I think it should 
> support the Infinity rules.
> ```
> TinkerGraph exception :
> java.util.concurrent.ExecutionException: 
> org.apache.tinkerpop.gremlin.driver.exception.ResponseException: No such 
> property: Infinity for class: Script126
> ```



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to