TIBCOSoftware / snappydata

Project SnappyData - memory optimized analytics database, based on Apache Spark™ and Apache Geode™. Stream, Transact, Analyze, Predict in one cluster
http://www.snappydata.io
Other
1.04k stars 200 forks source link

how to use offset in sql #1369

Open gangly opened 5 years ago

gangly commented 5 years ago

I want to query data from snappydata using sql, like this: select from tableA limit 10, 20; or select from tableA limit 20 offset 10;

and find error.

Does snappydata not support offset ?

kneeraj commented 5 years ago

Hi Gary - OFFSET is not supported yet. We plan to bring it in at some point soon though we can't give you an exact date now.

TeslaCN commented 5 years ago

“select from (select row_number() over (order by id desc) rn, from table) where rn between 1 and 10” it works 李刚大佬好🌚

jramnara commented 5 years ago

this is likely quite expensive if the table is large. A better approach is to use monotonically_increasing_id() function to inject a id column into your table at load time. And, later use this to select the required range.


Jags SnappyData acquired by TIBCO http://snappydata.io Download binary, source https://www.snappydata.io/download

On Wed, Aug 28, 2019 at 12:28 AM 吴伟杰 notifications@github.com wrote:

“select from (select row_number() over (order by id desc) rn, from table) where rn between 1 and 10” it works 李刚大佬好🌚

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/SnappyDataInc/snappydata/issues/1369?email_source=notifications&email_token=AAOYUBXVOJDLCFWI3DEG3ODQGYSIFA5CNFSM4IGCQNI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5KFDRQ#issuecomment-525619654, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOYUBVDUI7ZJ3JWYSP5EELQGYSIFANCNFSM4IGCQNIQ .