Does it work if you use static inline WHERE clause (i.e. you write the where clause in for the specific case). I know this is not what you want, I’m just trying to isolate the problem.
Another clue is, when trying a different starting company, I’m also getting varying results, but this time it’s either returning one hop worth of data, or two hops. Which means the problem is not “sometimes tg returns no data” but tg returns different results with the same query.
I think it is because you are setting object.@visited = true in the ACCUM clause, though I can 't decide what topologies might have that characteristic given that we can only have one edge between any two specific vertices. I can imagine two-hop variation (if there is a diamond pattern), but not one-hop.
Can you set it in POST-ACCUM? Let us know the result?
Thanks Rik, I tried moving @visited = true to the POST-ACCUM as well as getting rid of object.@visited == false condition all together, with results being the same every time. In the changelog we found this for 2.6 version:
Fix for 2.5.2 bug - Inconsistent query results when running non-distributed query on a cluster
“Inconsistent query results when running non-distributed query on a cluster” is exactly the problem we are seeing here I believe, although the changelog seems to suggest that the bug was introduced in 2.5.2 whereas we are on a 2.2.3 version. We are now looking to upgrade to 2.6.3 as the next step to see if that fixes the issue.