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

The Merge onMatch map validation is during execution instead of construction

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 3.6.3
    • 3.7.0, 3.6.5
    • process
    • None

    Description

      A small thing I noticed related to TINKERPOP-2931.

      With an empty graph, the traversal

      g.mergeV([:]).option(onMatch, ['~label', 'vertex']) 

      will create a new vertex, and since onMatch failed it doesn't apply anything inside regardless if it's a valid map or not, and will return

      v[0]

      This won't have any impact function-wise, since the onMatch map will be validated when the vertex is found, but just wondering if we should validate this on construction instead of execution?

      A more visual example on 3.6.3-SNAPSHOT console.

      gremlin> g.mergeV([:]).option(Merge.onMatch, ['~label':'vertex'])
      ==>v[0]
      gremlin> g.mergeV([:]).option(Merge.onMatch, ['~label':'vertex'])
      Property key can not be a hidden key: ~label
      Type ':help' or ':h' for help.
      Display stack trace? [yN]n
      gremlin> 

      Attachments

        Activity

          People

            valentyn Valentyn Kahamlyk
            xiazcy Yang Xia
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: