SELECT WHERE @rid < produces NumberFormatException for Long.MAX_VALUE and Integer.MAX_VALUE

35 views
Skip to first unread message

Bryan

unread,
Aug 31, 2015, 2:53:21 PM8/31/15
to orient-...@googlegroups.com
OrientDB version 2.1.0

Hi,

I have a SELECT query that gives consumers of my API an option to page through some data (sort of like seeking in a file). 
I provide constants like BEGINNING_POS = -1, and END_POS = Long.MAX_VALUE

like: getMyData(long position)
internally I do a SQL command like the following...

If I do this for a command...
SELECT * FROM foo WHERE @rid < ?
and then
command.execute(Long.MAX_VALUE) 
it throws NumberFormatException.

I noticed that the position parameter (rid) is trying to parse using "Integer.parseInt(...)". -> See OInputParameter.java:76
Why is this?

According to limits page of the documentation, I can have 9,223,372,036,854,780,000 (2^63-1) records per cluster, which is more than the java Long.MAX_VALUE (9223372036854775807). So how do I query for a max RID value like this? 
Even if I use Integer.MAX_VALUE it still does not work using a long type: (2147483648 is too big)
Maybe I'm misunderstanding...

Thank you for your time!

Bryan

unread,
Sep 1, 2015, 4:56:13 PM9/1/15
to OrientDB
So does anyone know why the limit for records per cluster is 2^63-1 but when specifying an @rid range on a query I can't use anything larger than an int?
Reply all
Reply to author
Forward
0 new messages