Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to stack TRAVERSE $depth constraints after $depth has been selected once #8395

Closed
CyprienGottstein opened this issue Jul 12, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@CyprienGottstein
Copy link

OrientDB Version: v3.0.3

Java Version: 1.8.0_161

OS: Ubuntu 16.04

Hi OrientDB Team,

Expected behavior

Possibility to "reset" $depth constraint by changing its name with a projection

Actual behavior

Requests returns no result.

Steps to reproduce

Import minimalist database :
delete_from_match.gz

Run following query :

TRAVERSE outE("knows") FROM ( SELECT *, $depth as some_depth FROM ( TRAVERSE out("knows") FROM ( SELECT * FROM my_class where name = "Alice" ) WHILE $depth <= 2 ) SKIP 0 LIMIT 3 )

If you run the same query without selecting the $depth, it will work :

TRAVERSE outE("knows") FROM ( SELECT * FROM ( TRAVERSE out("knows") FROM ( SELECT * FROM my_class where name = "Alice" ) WHILE $depth <= 2 ) SKIP 0 LIMIT 3 )

About the general idea behind this, i'm interested in the $depth of the first traverse because this is about a constructed query where a client declared how much depth level he allows to traverse the data and once the query is over, our system will always retrieve the outgoing edges of the processed set of vertices.

I guess i could make it work by storing the intermediate set into memory and then doing a second step (request) to retrieve the outgoing edges but this is exactly what i want to avoid, i should not have to store the intermediate set in order to retrieve what i want.

I tried to tweak the query by using a batch script like so :

LET $a = (
SELECT *, $depth as d FROM (
TRAVERSE out("knows") FROM ( SELECT * FROM my_class where name = "Alice" ) WHILE $depth <= 2
) SKIP 0 LIMIT 3 ) ;
SELECT *, $depth from ( TRAVERSE outE("knows") FROM (select expand($a)));

But it didn't worked either, any ideas ?

Best Regards,

Cyprien.

@luigidellaquila luigidellaquila self-assigned this Jul 12, 2018
luigidellaquila added a commit that referenced this issue Jul 13, 2018
@luigidellaquila
Copy link
Member

Hi @CyprienGottstein

Thank you for reporting, it was a bug indeed.
I just fixed it and pushed the fix to 3.0.x branch, it will be in the snapshot in a few hours

Thanks

Luigi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants