You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Marko A. Rodriguez (JIRA)" <ji...@apache.org> on 2015/06/03 18:28:38 UTC

[jira] [Closed] (TINKERPOP3-619) select should not throw

     [ https://issues.apache.org/jira/browse/TINKERPOP3-619?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marko A. Rodriguez closed TINKERPOP3-619.
-----------------------------------------
       Resolution: Fixed
    Fix Version/s: 3.0.0.GA
         Assignee: Marko A. Rodriguez

Okay. This is what I did.

If {{select("a")}} doesn't get an object, move on to the next traverser to process.

If {{select("a","b")}} doesn't get ALL objects, move on to the next traverser to process. In other words, the returns {{Map<String,Object>}} is guaranteed to have all its variables bound.

I added [~mhfrantz]'s two test cases using {{until(...).repeat(..as('a')..).select('a'...)}} and things are working as desired.

Next, I think this notion of "all must bind or none" should be the general theme for these {{Scoping}} steps. E.g. {{WhereStep}}. I think {{where('a',eq('b'))}} should filter if either of those variables don't bind. Right now, it will throw an Exception saying it can't find the bindings.

This then begs the question -- what about {{has('aKeyThatDoesNotExist',eq(32))}} ? Should that just be a filter {{true}} or do as we do now -- throw an Exception "Property aKeyThatDoesNotExist does not exist for the element" ? [~dkuppitz] ?

If we make it "just filter" then we won't see queries like this: {{g.V.has('age').has('age',gt(32))}}. This is analgous to us not needing {{select('a','b').hasKeys('a','b').where('a',eq('b')}} as if it doesn't bind, it doesn't exist -- for map-steps, move to the next traverser, for filter-steps, return false.



> select should not throw
> -----------------------
>
>                 Key: TINKERPOP3-619
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-619
>             Project: TinkerPop 3
>          Issue Type: Improvement
>          Components: process
>            Reporter: Matt Frantz
>            Assignee: Marko A. Rodriguez
>             Fix For: 3.0.0.GA
>
>
> Rather than raise {{IllegalArgumentException}}, if {{select}} cannot find the label, it should return {{null}}.  This is preferable because of the difficulty of dealing with exceptions during traversal.  It is not always indicative of a static flaw in the traversal, since conditional logic in the traversal may bypass certain {{as}} steps.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)