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

Unable to translate gremlin query to java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.5.1
    • 3.6.0, 3.5.2
    • translator
    • None

    Description

      updated description

       

      In the user interface for Db2 Graph users enter Gremlin queries which get submitted as scripts. One feature that we are working on is helping users take their queries and use them in their own applications directly, instead of using our user interface to run queries. To achieve that we have a `translate query` button that shows them their query in the different language formats the translator supports. For the most part the Groovy translation just works in Java code, however, some data types are problematic.

       

      One unique aspect about Db2 Graph is that all your data is stored in Db2. Our implementation takes your Gremlin query and figures out the most optimized SQL statements to get the result set. We then execute the SQL statements and return the results. On occasion we may need to help Db2 understand how to translate a query, for example using java.sql.Timestamp.valueOf('2015-01-01 12:05:00') as a filter

       

      When this filter gets translated to Groovy it uses new Timestamp(1420113900000) which is invalid Java. We need to use new Timestamp(1420113900000L)

       

      I'm not sure if there would be other areas where the translated Groovy syntax does not work in Java, this is the only example I've found that is problematic

       

      Attachments

        Activity

          People

            spmallette Stephen Mallette
            tkolanko Tom Kolanko
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: