java - How to get range of rows using spark in Cassandra -
i have table in cassandra structure
create table dmp.table ( pid text primary key, day_count map<text, int>, first_seen map<text, timestamp>, last_seen map<text, timestamp>, usage_count map<text, int> }
now i'm trying query using spark-cassandra driver , there can chunks of data. in if have 100 rows , should able 0-10 rows 10 -20 , on.
cassandrajavardd<cassandrarow> cassandrardd = cassandrajavautil.javafunctions(javasparkcontext).cassandratable(keyspacename, tablename);
i'm asking there no column in table can query using in clause range of rows.
you can add auto-incrementing id coloumn -- see dataframe-ified zip index solution. can query newly-created id
column:
select ... id >= 0 , id < 10;
etc.
Comments
Post a Comment