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

GroovyTranslator doesn't handle empty maps

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.3.2
    • 3.4.0, 3.3.4, 3.2.10
    • server
    • None

    Description

      Bytecode queries that contain an empty map and lambdas fail because GroovyTranslator doesn't account for empty maps when removing the last trailing comma.

      To reproduce:

      gremlin> identity = new OneArgLambda('it.get()', 'gremlin-groovy')
      ==>lambda[it.get()]
      gremlin> bytecode = __.inject([:]).map(identity).asAdmin().getBytecode()
      ==>[[], [inject({}), map(lambda[it.get()])]]
      gremlin> client.submit(bytecode).all().get()
      org.apache.tinkerpop.gremlin.driver.exception.ResponseException: org.codehaus.groovy.control.MultipleCompilationErrorsException: 
      Script9.groovy: 1: expecting ')', found ']' @ line 1, column 31.
      gremlinscriptengine__g.inject(]).map({it.get()})
      ^
      
      1 error
      

       

      Attachments

        Issue Links

          Activity

            People

              spmallette Stephen Mallette
              Solovyov Dimitry Solovyov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: