I'm trying to filter on a small part of a huge Cassandra table by using:
val snapshotsFiltered = sc.parallelize(startDate to endDate).map(TableKey(_2)).joinWithCassandraTable("listener","snapshots_test_b")
I want to map the rows in the cassandra table on 'created' column that is part of the partition key.
My table key (the partition key of the table) defined as:
case class TableKey(imei: String, created: Long, when: Long)
The result is an error:
[error] /home/ubuntu/scala/test/test.scala:61: not enough arguments for method apply: (imei: String, created: Long)test.TableKey in object TableKey. [error] Unspecified value parameter created. [error] val snapshotsFiltered = sc.parallelize(startDate to endDate).map(TableKey(_2)).joinWithCassandraTable("listener","snapshots_test_b") [error] ^ [error] one error found [error] (compile:compile) Compilation failed
It worked with only one object in the partition key as in the Documentation.
Why there is a problem with multiple partition key?- answered.
EDIT: I tried to use the joinWithCassandraTable in the right form:
val snapshotsFiltered = sc.parallelize(startDate to endDate).map(TableKey("*",_,startDate)).joinWithCassandraTable("listener","snapshots_test_c")
When I trying to run it on Spark there is no errors but it stuck on "[stage 0:> (0+2)/2]" forever...
What goes wrong?