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

IN keyword issue in Orient 3.0.8 #8619

Closed
milankyada opened this issue Oct 22, 2018 · 4 comments
Closed

IN keyword issue in Orient 3.0.8 #8619

milankyada opened this issue Oct 22, 2018 · 4 comments
Assignees
Labels

Comments

@milankyada
Copy link

milankyada commented Oct 22, 2018

OrientDB Version: 3.0.8

Java Version: 1.8.0_171

OS: Ubuntu 14.04.5 LTS

Expected behavior

Query should return same result as returning in OrientDB 2.2.35 but it is returning empty resultset

Actual behavior

select from Company where outE('is_a')[type="Tenant"].inV()['@Rid'] in [#28:9,#28:8,#28:7] limit 5
This query is working fine with OrientDB 2.2.35 but the same query is not returning same result with OrientDB 3.0.8

Steps to reproduce

CREATE CLASS Company EXTENDS V
CREATE PROPERTY Company.name string
Insert into Company(name) values("webix pvt. ltd."),("diversity pvt. ltd.")

CREATE CLASS Tenant EXTENDS V
CREATE PROPERTY Tenant.name string
Insert into Tenant(name) values("DotNet"),("pdev")

CREATE CLASS is_a EXTENDS E
CREATE EDGE is_a FROM #18:0 TO #22:0
CREATE EDGE is_a FROM #18:0 TO #23:0
CREATE EDGE is_a FROM #19:0 TO #22:0
CREATE EDGE is_a FROM #19:0 TO #23:0

select from Company where outE('is_a')[type="Tenant"].inV()["@rid"] in [#22:0,#23:0] 
@luigidellaquila
Copy link
Member

Hi @milankyada

Thank you for reporting, I'd say it's a bug, I'll check it asap and let you know

Thanks

Luigi

@luigidellaquila
Copy link
Member

Hi @milankyada

You have a few problems here, some can be considered bugs, others are conceptual:

  • graph operators (out(), outE(), in() and so on) return collections, so does outE('is_a')[type="Tenant"].inV()["@rid"], so you cannot use IN operator; you have to use CONTAINSANY instead:
select from Company where outE('is_a')[type="Tenant"].inV()["@rid"] CONTAINSANY [#22:0,#23:0] 
  • outE('is_a')[type="Tenant"] returns nothing, just because you don't have a type attribute on your edges. Perhaps you want to extract only Tenant vertices? In this case you have to do as follows:
    outE('is_a').inV()[@class = "Tenant"] or, more easily out('is_a')[@class = "Tenant"]

  • the following still returns nothing:

select from Company where out('is_a')["@rid"] CONTAINSANY [#22:0,#23:0] 

and the problem here seems to be a bug concerning "@Rid" used in square brackets. The following works fine instead:

select from Company where out('is_a').@rid CONTAINSANY [#22:0,#23:0] 

I'm checking this last bug now

Thanks

Luigi

luigidellaquila added a commit that referenced this issue Oct 23, 2018
@luigidellaquila
Copy link
Member

Hi @milankyada

I just pushed a fix for the problem with square bracket selection

Thanks

Luigi

@milankyada
Copy link
Author

Thank you @luigidellaquila
I'll be waiting for next release.

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