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

select expand(out().out()) get two same vertex? #7620

Closed
lightjiao opened this issue Aug 7, 2017 · 3 comments
Closed

select expand(out().out()) get two same vertex? #7620

lightjiao opened this issue Aug 7, 2017 · 3 comments
Assignees
Labels

Comments

@lightjiao
Copy link

I have a test graph below

a_1 ---[e_a_b]---> b_1
a_1 ---[e_a_b]---> b_2
b_1 ---[e_b_c]---> c_1
b_2 ---[e_b_c]---> c_1
execute sql

select expand(out("e_a_b").out("e_b_c")) from v_a

return two same vertex(two c_1), it's a BUG? or I used in a wrong way?
How can I get one single c_1 after select expand(out("e_a_b").out("e_b_c")) from v_aon my test data?
My purpose is to count friends of friends and sort by the result
How can I get this.
I know traverse out("e_a_b", "e_b_c") from (select from v_a where name = "a_1") ,but this only get one of the v_a(the a_1), I need a page of v_a and the count of relation's relation

My English is not very well, thanks reading.

data scripts

create class v_a extends v clusters 1;
create vertex v_a content {"name": "a_1"};
create class v_b extends v clusters 1;
create vertex v_b content {"name": "b_1"};
create vertex v_b content {"name": "b_2"};
create class v_c extends v clusters 1;
create vertex v_c content {"name": "c_1"};
create class e_a_b extends e clusters 1;
create edge e_a_b from (select from v_a) to (select from v_b);
create class e_b_c extends e clusters 1;
create edge e_b_c from (select from v_b) to (select from v_c);

OrientDB Version: 2.2.24

Java Version: 1.8.0_102

OS: centos 6.8

Expected behavior

select out().out() from v_areturn one vertex

Actual behavior

return two same vertex

@lightjiao
Copy link
Author

select name, set(out("e_a_b").out("e_b_c")).size() from v_a

I… find the answer?

The problem is always solved after the problem is raised - -b

any better way?

the stackoverflow
https://stackoverflow.com/questions/45550381/orientdb-select-out-out-return-two-same-vertex/45550641#45550641

@luigidellaquila
Copy link
Member

Hi @lightjiao

Yes, it's expected, you can also use .asSet(), but there is no particular advantage compared to your solution

Thanks

Luigi

@lightjiao
Copy link
Author

@luigidellaquila Thank you ^_^

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