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

GroovyTranslator doesn't handle empty maps

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3.2
    • Fix Version/s: 3.4.0, 3.3.4, 3.2.10
    • Component/s: server
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: