session.execute( "INSERT INTO simplex.songs (id, title, album, artist, tags) " + "VALUES (" + "756716f7-2e54-4715-9f00-91dcbea6cf50," + "'La Petite Tonkinoise'," + "'Bye Bye Blackbird'," + "'Joséphine Baker'," + "{'jazz', '2013'})" + ";");
Ok, that makes sense. But what's not clear to me is whether the datastax java driver is always using the binary protocol?
On Friday, August 16, 2013 6:29:45 PM UTC+2, Keith Freeman wrote:For the benefit of anyone visiting this thread in the future: the token() and LIMIT method is not sufficient when you have wide rows, it will miss data.
There's a thread recently started on the cassandra-user list, but the idea is that LIMIT will sometimes cut off results from a wide row, and the following SELECT will start from the next row so those lost results from the previous row will never be returned.
Correct paging is significantly more complicated, and is described here: http://www.datastax.com/dev/blog/cql3-table-support-in-hadoop-pig-and-hive
On Thursday, August 1, 2013 5:54:40 PM UTC-6, Michael Figuiere wrote:Cassandra 1.2.x doesn't support paging queries. You have to do it manually with the help of the LIMIT keyword and the appropriate where clause. An example of such a query is:1st query: SELECT * FROM user LIMIT 100;Nth query: SELECT * FROM user WHERE token(id) > token(last_received_id) LIMIT 100;Where 'user' is a table with a primary key column named 'id'.Starting from Cassandra 2.0 (to be released later this summer, but already available in beta), we'll support paging (see https://issues.apache.org/jira/browse/CASSANDRA-4415), so you'll be able to iterate on the resultset and rows will be fetched on the fly by the driver. You'll be able to control the amount of rows to fetch. See https://github.com/datastax/java-driver/tree/v2-wip for a first look at what we prepare. Note that as the name of the branch implies this is still work in progress, so consider it as experimental for now.
[Just posted a reply to this that got stuck in the list for moderation - never mind, because afterwards, Google turned up the answer:]
Great job! Thanks.Jan
MichaelOn Thu, Aug 1, 2013 at 4:37 PM, Keith Freeman <8fo...@gmail.com> wrote:
Hello,I don't see any support in the Java API for paging queries, am I missing it? I.e. I want to do "select * from table;" in a loop getting N rows at a time.Thanks.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.