simple query ist mysterious

23 views
Skip to first unread message

hartmut bischoff

unread,
Sep 19, 2016, 2:20:41 AM9/19/16
to OrientDB
Hi,

I was very surprised, that a simple query " select from something where a = b " could be a subject.

but
2.3.1 :001 > DB.execute{ "select from contract where strike = 30" }
 => [] 
2.3.1 :002 > DB.execute{ "select from contract where strike between 30 and 30" }
 => [#<IB::Option:0x000000031fa268 @metadata={"type"=>"d", "class"=>"option", "version"=>1, "fieldTypes"=>"expiry=t,strike=c", "cluster"=>25, "record"=>25},  @attributes={ (...) "strike"=>30.0, (...) ] 
2.3.1 :003 > 

 
(rest-api)

A verification in studio was successful. 

The property "strike" is defined as decimal. 

Why is the simple "where strike =  30" or "where strike = 30.0" returning an empty result,
whereas "where strike between 30 and 30" returns the correct record?



hartmut






Oleksandr Gubchenko

unread,
Sep 19, 2016, 2:35:01 AM9/19/16
to OrientDB
Hi,

which version are you using?

Oleksandr Gubchenko

unread,
Sep 19, 2016, 2:42:38 AM9/19/16
to OrientDB
I've tried it on the latest 2.2.10 and both studio and rest (using postman) give me the right result:

{"result":[{"@type":"d","@rid":"#21:0","@version":1,"@class":"contract","strike":30,"@fieldTypes":"strike=c"}]}

Alex.

hartmut bischoff

unread,
Sep 19, 2016, 3:26:30 AM9/19/16
to OrientDB
I'm using 2.2.7

Oleksandr Gubchenko

unread,
Sep 19, 2016, 3:36:02 AM9/19/16
to orient-...@googlegroups.com
On 2.2.10 I get this:



Your contract class is a superclass of option?

Oleksandr Gubchenko

unread,
Sep 19, 2016, 3:44:30 AM9/19/16
to orient-...@googlegroups.com
I've also tried it on 2.2.7 with option being sub-class of contract.

All works properly.

hartmut bischoff

unread,
Sep 19, 2016, 4:35:39 AM9/19/16
to OrientDB
Thanks for checking.

still mysterious.

I attatched my test-database.
can you do a test with it, too?
ttws.gz

Oleksandr Gubchenko

unread,
Sep 19, 2016, 4:59:11 AM9/19/16
to OrientDB
I've done some tests and you are right, with you db there is some strange behaviour.
But this query seems to work fine:

select * from option where 30 = strike


or:
select * from contract where 30 = strike





Hope it helps.
Reply all
Reply to author
Forward
0 new messages