Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-1957

Static Groovy script compilation requires long literals in predicates

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.3.2
    • None
    • groovy
    • None
    • GremlinGroovyScriptEngine with GroovyCompilerGremlinPlugin and COMPILE_STATIC

    Description

      When using the GremlinGroovyScriptEngine together with GroovyCompilerGremlinPlugin and compilation option COMPILE_STATIC it is required to use long literals instead of integer literals in predicates. For example the following query fails during compilation:

      g.V().where(outE().count().is(lt(50)))

      This gives the following error message:

      Script1.groovy: 1: [Static type checking] - Cannot call org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal <org.apache.tinkerpop.gremlin.structure.Vertex, java.lang.Long>#is(org.apache.tinkerpop.gremlin.process.traversal.P <java.lang.Long>) with arguments [org.apache.tinkerpop.gremlin.process.traversal.P <java.lang.Integer>]
       @ line 1, column 13.
         g.V().where(outE().count().is(lt(50)))
                     ^
      
      Script1.groovy: 1: [Static type checking] - Cannot find matching method org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal#where(java.lang.Object). Please check if the declared type is correct and if the method exists.
       @ line 1, column 1.
         g.V().where(outE().count().is(lt(50)))

      Changing the query to use long literals makes the query work:

      g.V().where(outE().count().is(lt(50L)))

      The original query works with version 3.2.8 or if COMPILE_STATIC is NOT used.

      Attachments

        Activity

          People

            Unassigned Unassigned
            komueller Konstantin Müller
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: