UNIONALL query was working, but now it won't.

213 views
Skip to first unread message

Simon L

unread,
Sep 5, 2014, 9:41:53 AM9/5/14
to
Hi everyone.

The following query was working fine for a while. Then, I did a major DB update where the schema and other things were changed. I also updated ODB. Now, it returns 0 objects for some reason:

SELECT expand($c) LET $a = ( SELECT @rid as @rid, @class as @class FROM (SELECT expand(out()) FROM #25:5632 )), $b = ( select * from #25:5632 ), $c = UNIONALL( $a, $b )

0 Item(s) found.

It used to return something like:
#34:12, SomeClassName
#34:13, SomeClassName
#25:5632, property1, property2, property3

It's possible I accidentally made a small change to the query, but I don't recall.

When I take each part of the query outside the UNIONALL/LET, then individually they work fine.

Simon L

unread,
Sep 5, 2014, 5:49:16 PM9/5/14
to orient-...@googlegroups.com
NOTE: This union statement isn't working either:
select expand( $c ) LET $a = (select from #32:2), $b = (select from #32:2), $c = UNIONALL($a,$b)
OrientDB version: Server v1.7.9-SNAPSHOT 

Simon L

unread,
Sep 5, 2014, 6:14:57 PM9/5/14
to orient-...@googlegroups.com
This might be an issue with v1.7.9? See below. You can test this on a blank DB.

USING VERSION 1.7.8 (STABLE):
orientdb {tempdel002}> select expand( $c ) LET $a = (select from #5:2), $b = (select from #5:2), $c = UNIONALL($a,$b)

----+----+------+-------------------------------------------------------------------------+------+-----
#   |@RID|name  |password                                                                 |status|roles
----+----+------+-------------------------------------------------------------------------+------+-----
0   |#5:2|writer|{SHA-256}B93006774CBDD4B299389A03AC3D88C3A76B460D538795BC12718011A909FBA5|ACTIVE|[1]  
1   |#5:2|writer|{SHA-256}B93006774CBDD4B299389A03AC3D88C3A76B460D538795BC12718011A909FBA5|ACTIVE|[1]  
----+----+------+-------------------------------------------------------------------------+------+-----

2 item(s) found. Query executed in 0.003 sec(s).


USING FRESH, BLANK DB ON VERSION 1.7.9-SNAPSHOT
orientdb {tempdel02}> select from OUser                                                                              

----+----+------+-------------------------------------------------------------------------+------+-----
#   |@RID|name  |password                                                                 |status|roles
----+----+------+-------------------------------------------------------------------------+------+-----
0   |#5:0|admin |{SHA-256}8C6976E5B5410415BDE908BD4DEE15DFB167A9C873FC4BB8A81F6F2AB448A918|ACTIVE|[1]  
1   |#5:1|reader|{SHA-256}3D0941964AA3EBDCB00CCEF58B1BB399F9F898465E9886D5AEC7F31090A0FB30|ACTIVE|[1]  
2   |#5:2|writer|{SHA-256}B93006774CBDD4B299389A03AC3D88C3A76B460D538795BC12718011A909FBA5|ACTIVE|[1]  
----+----+------+-------------------------------------------------------------------------+------+-----

3 item(s) found. Query executed in 0.006 sec(s).
orientdb {tempdel02}> select expand( $c ) LET $a = (select from #5:2), $b = (select from #5:2), $c = UNIONALL($a,$b)


0 item(s) found. Query executed in 0.001 sec(s).
orientdb {tempdel02}> 

Curtis Mosters

unread,
Sep 5, 2014, 6:26:35 PM9/5/14
to orient-...@googlegroups.com
1.7.9 is not officially released. For me on 1.7.8 and also on 1.7.9 it works. Maybe downgrade and open an issue in Github?

Tested with
select expand( $c ) LET $a = (select from #11:1), $b = (select from #11:0), $c = UNIONALL($a,$b)

and also (2 identical results)
select expand( $c ) LET $a = (select from #11:1), $b = (select from #11:1), $c = UNIONALL($a,$b)

worked for me of Version 1.7.8 and 1.7.9.

Simon L

unread,
Sep 5, 2014, 6:37:06 PM9/5/14
to orient-...@googlegroups.com
Unfortunately, I think I may need to use this version. I copied and pasted your query and replaced the RIDs with ones from the OUser table on a fresh DB. It still gave 0 results. Will see what I can do.


--

---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/mRRmmL-MgsM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Simon L

unread,
Sep 5, 2014, 6:42:42 PM9/5/14
to orient-...@googlegroups.com
Version info: OrientDB Server v1.7.9-SNAPSHOT (build UNKNOWN@r; 2014-08-25 12:25:31+0200)


On Friday, September 5, 2014 6:37:06 PM UTC-4, Simon L wrote:
Unfortunately, I think I may need to use this version. I copied and pasted your query and replaced the RIDs with ones from the OUser table on a fresh DB. It still gave 0 results. Will see what I can do.
To unsubscribe from this group and all its topics, send an email to orient-database+unsubscribe@googlegroups.com.

Curtis Mosters

unread,
Sep 5, 2014, 6:43:03 PM9/5/14
to orient-...@googlegroups.com
Yap, also just in case there is anything with the OUser. But also works on them.

select expand( $c ) LET $a = (select from #5:0), $b = (select from #5:1), $c = UNIONALL($a,$b)

2 results:
#5:01OUserACTIVE{SHA-256}8C6976E5B5410415BDE908BD4DEE15DFB167A9C873FC4BB8A81F6F2AB448A918admin
#5:11OUserACTIVE{SHA-256}3D0941964AA3EBDCB00CCEF58B1BB399F9F898465E9886D5AEC7F31090A0FB30reader
Yeah or just reinstall. Give some feedback what helped you =)
Reply all
Reply to author
Forward
0 new messages