java - FetchPlan orientDB incorrect results -
i using orient 2.1-rc4, executed following commands: motive fetch outgoing vertices path.
1. correct result simple graph
create class depends extends e create vertex set name="persians" create vertex set name="vikings" create vertex set name="teutons" create vertex set name="mayans" create vertex set name="aztecs" select * v \# |@rid|@class|name 0 |#9:0|v |persians 1 |#9:1|v |vikings 2 |#9:2|v |teutons 3 |#9:3|v |mayans 4 |#9:4|v |aztecs create edge depends #9:0 #9:2 create edge depends #9:1 #9:2 create edge depends #9:2 #9:3 create edge depends #9:2 #9:4 select @this.tojson('fetchplan:in_*:-2 *:-1') #9:2 {"out_depends":[{"out":"#9:2","in":{"name":"mayans","in_depends":["#11:2"]}},{"out":"#9:2","in":{"name":"aztecs","in_depends":["#11:3"]}}],"name":"teutons"} only outgoing nodes fetched expected.
2. incorrect result
adding 2 more vertices:
create vertex set name="britons" create vertex set name="mongols" create edge depends #9:5 #9:0 create edge depends #9:6 #9:4 select * e ----+-----+-------+----+---- \# |@rid |@class |out |in ----+-----+-------+----+---- 0 |#11:0|depends|#9:0|#9:2 1 |#11:1|depends|#9:1|#9:2 2 |#11:2|depends|#9:2|#9:3 3 |#11:3|depends|#9:2|#9:4 4 |#11:4|depends|#9:5|#9:0 5 |#11:5|depends|#9:6|#9:4 ----+-----+-------+----+---- trying fetch out vertices per http://orientdb.com/docs/last/fetching-strategies.html
select @this.tojson('fetchplan:in_*:-2') #9:2 {"out_depends":["#11:2","#11:3"],"name":"teutons"} not out vertices fetched
select @this.tojson('fetchplan:in_*:-2 *:-1') #9:2 {"out_depends":[{"out":"#9:2","in":{"name":"mayans","in_depends":["#11:2"]}},{"out":"#9:2","in":{"in_depends":["#11:3",{"out":{"name":"mongols","out_depends":["#11:5"]},"in":"#9:4"}],"name":"aztecs"}}],"name":"teutons"} extra vertex mongols fetched, means rule has not being applied @ other levels. (out_depends excluded 0th level)
adding [*] apply exclusion rule on levels per documentation
select @this.tojson('fetchplan:[*]in_*:-2 *:-1') #9:2 {"out_depends":[{"out":"#9:2","in":{"name":"mayans","in_depends":["#11:2"]}},{"out":"#9:2","in":{"in_depends":["#11:3",{"out":{"name":"mongols","out_depends":["#11:5"]},"in":"#9:4"}],"name":"aztecs"}}],"in_depends":[{"out":{"name":"persians","out_depends":["#11:0"],"in_depends":[{"out":{"name":"britons","out_depends":["#11:4"]},"in":"#9:0"}]},"in":"#9:2"},{"out":{"name":"vikings","out_depends":["#11:1"]},"in":"#9:2"}],"name":"teutons"} this fetches entire tree. can give suggestion?

Comments
Post a Comment