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

Static Groovy script compilation requires long literals in predicates

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 3.3.2
    • Fix Version/s: None
    • Component/s: groovy
    • Labels:
      None
    • Environment:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: