Select first N rows of Cassandra table

OiRc picture OiRc · Jun 16, 2015 · Viewed 25.6k times · Source

As stated in this doc to select a range of rows i have to write this:

select first 100 col1..colN from table;

but when I launch this on cql shell I get this error:

<ErrorMessage code=2000 [Syntax error in CQL query] message="line 1:13 no viable alternative at input '100' (select [first] 100...)">

What's wrong?

Answer

Thorarins picture Thorarins · Jun 16, 2015

According to the Docs, key word first is to limit the number of Columnns, not rows

to limit the number of rows , you must just keyword limit.

select col1..colN from table  limit 100;

the default limit is 10000