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

Text Predicates fail if they encounter non strings

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • 3.4.6
    • None
    • process
    • None
    • MacOS + TinkerPop 3.4.6 , Gremlin Console, TinkerGraph

    Description

      This issue comes from investigating the report on Stack Overflow here: https://stackoverflow.com/questions/62013568/how-to-do-gremlin-contain-search-for-both-number-and-string

      It was reported against Neptune but I see the same behavior with TinkerGraph. As best I can tell the poster has overloaded a property key so that it is sometimes a float and sometimes a string. There is no error if the number matches exactly but if it does not and the TextP part of the or step triggers then an exception is thrown as TextP.containing tries to work against a float value. I guess the question is, should the text predicates be smart enough to ignore non String property values? 

      Here is a simple reproducer

      {{}}

      gremlin> graph = TinkerGraph.open()
       ==>tinkergraph[vertices:0 edges:0]
       gremlin> g = graph.traversal()
       ==>graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
       gremlin> g.addV('test').property('x',12.5)
       ==>v[0]
       gremlin> g.addV('test').property('x','ABCDEF')
       ==>v[2]
       gremlin> g.V().hasLabel('test').or(has('x',12.3),has('x',TextP.containing('CDE')))
       java.math.BigDecimal cannot be cast to java.lang.String
       Type ':help' or ':h' for help.
       Display stack trace? [yN] 

      {{}}
       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            gfxman Kelvin R. Lawrence
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: