Orientdb: SQL subquery is not support in 3.0.x ?

Created on 12 Sep 2018  ·  3Comments  ·  Source: orientechnologies/orientdb

OrientDB Version: 3.0.5

Java Version: 1.8

OS: Centos 6.8

SQL

select * 
from v_test_1
where  id in ( select in('e_test').id from v_test_2 where name = 'jack' )

Expected behavior

return v_test_1 which related v_test_2's name = 'jack'

Actual behavior

return 0 records
BUT, the sql below work fine, and must use $refs[0].refs_id, and $refs.refs_id don't work

select * 
from v_test_1
let $refs = ( select in('e_test').id as refs_id from v_test_2 where name = 'jack' ) 
where where  id in  $refs[0].`refs_id`

this sql syntax is very important for us, and if we change to let, it would be a very big change
is a bug ? or is a deprecated feature ?

thanks reading

bug

All 3 comments

Hi @lightjiao

It's supposed to work, probably it just needs a little addition in a comparator.
I'll work on it asap and let you know

Thanks

Luigi

Hi @lightjiao

I tested it with v 3.0.7, the problem was already fixed for basic cases.
There was still an issue when the parent query used an index, I fixed it and pushed to 3.0.x. It will be released with v 3.0.8

Thanks

Luigi

I check this on the develop snapshot, it work fine.
Looking forward to the release of 3.0.8

Thanks very much. 👍

Was this page helpful?
0 / 5 - 0 ratings