Delete data from Cassandra table, using data from the RDD as primary keys.
Delete data from Cassandra table, using data from the RDD as primary keys. Uses the specified column names.
the name of the Keyspace to use
the name of the Table to use
The list of column names to delete, empty ColumnSelector means full row.
Primary key columns selector, Optional. All RDD primary columns columns will be checked by default
additional configuration object allowing to set consistency level, batch size, etc.
Uses the data from RDD to join with a Cassandra table without retrieving the entire table.
Uses the data from RDD to join with a Cassandra table without retrieving the entire table. Any RDD which can be used to saveToCassandra can be used to joinWithCassandra as well as any RDD which only specifies the partition Key of a Cassandra Table. This method executes single partition requests against the Cassandra Table and accepts the functional modifiers that a normal com.datastax.spark.connector.rdd.CassandraTableScanRDD takes.
By default this method only uses the Partition Key for joining but any combination of columns which are acceptable to C* can be used in the join. Specify columns using joinColumns as a parameter or the on() method.
Example With Prior Repartitioning:
val source = sc.parallelize(keys).map(x => new KVRow(x)) val repart = source.repartitionByCassandraReplica(keyspace, tableName, 10) val someCass = repart.joinWithCassandraTable(keyspace, tableName)
Example Joining on Clustering Columns:
val source = sc.parallelize(keys).map(x => (x, x * 100)) val someCass = source.joinWithCassandraTable(keyspace, wideTable).on(SomeColumns("key", "group"))
Key every row in the RDD by with the IP Adresses of all of the Cassandra nodes which a contain a replica of the data specified by that row.
Key every row in the RDD by with the IP Adresses of all of the Cassandra nodes which a contain a replica of the data specified by that row. The calling RDD must have rows that can be converted into the partition key of the given Cassandra Table.
Uses the data from RDD to left join with a Cassandra table without retrieving the entire table.
Uses the data from RDD to left join with a Cassandra table without retrieving the entire table. Any RDD which can be used to saveToCassandra can be used to leftJoinWithCassandra as well as any RDD which only specifies the partition Key of a Cassandra Table. This method executes single partition requests against the Cassandra Table and accepts the functional modifiers that a normal com.datastax.spark.connector.rdd.CassandraTableScanRDD takes.
By default this method only uses the Partition Key for joining but any combination of columns which are acceptable to C* can be used in the join. Specify columns using joinColumns as a parameter or the on() method.
Example With Prior Repartitioning:
val source = sc.parallelize(keys).map(x => new KVRow(x)) val repart = source.repartitionByCassandraReplica(keyspace, tableName, 10) val someCass = repart.leftJoinWithCassandraTable(keyspace, tableName)
Example Joining on Clustering Columns:
val source = sc.parallelize(keys).map(x => (x, x * 100)) val someCass = source.leftJoinWithCassandraTable(keyspace, wideTable).on(SomeColumns("key", "group"))
Repartitions the data (via a shuffle) based upon the replication of the given keyspaceName
and tableName
.
Repartitions the data (via a shuffle) based upon the replication of the given keyspaceName
and tableName
.
Calling this method before using joinWithCassandraTable will ensure that requests will be coordinator
local. partitionsPerHost
Controls the number of Spark Partitions that will be created in this repartitioning
event.
The calling RDD must have rows that can be converted into the partition key of the given Cassandra Table.
Saves the data from RDD to a new table with definition taken from the
ColumnMapper
for this class.
Saves the data from RDD to a new table with definition taken from the
ColumnMapper
for this class.
keyspace where to create a new table
name of the table to create; the table must not exist
Selects the columns to save data to. Uses only the unique column names, and you must select at least all primary key columns. All other fields are discarded. Non-selected property/column names are left unchanged. This parameter does not affect table creation.
additional configuration object allowing to set consistency level, batch size, etc.
optional, implicit connector to Cassandra
factory for obtaining the row writer to be used to extract column values from items of the RDD
a column mapper determining the definition of the table
Saves the data from RDD to a new table defined by the given TableDef
.
Saves the data from RDD to a new table defined by the given TableDef
.
First it creates a new table with all columns from the TableDef
and then it saves RDD content in the same way as saveToCassandra.
The table must not exist prior to this call.
table definition used to create a new table
Selects the columns to save data to. Uses only the unique column names, and you must select at least all primary key columns. All other fields are discarded. Non-selected property/column names are left unchanged. This parameter does not affect table creation.
additional configuration object allowing to set consistency level, batch size, etc.
optional, implicit connector to Cassandra
factory for obtaining the row writer to be used to extract column values from items of the RDD
Saves the data from RDD to a Cassandra table.
Saves the data from RDD to a Cassandra table. Uses the specified column names.
the name of the Keyspace to use
the name of the Table to use
additional configuration object allowing to set consistency level, batch size, etc.
Applies a function to each item, and groups consecutive items having the same value together.
Applies a function to each item, and groups consecutive items having the same value together.
Contrary to groupBy
, items from the same group must be already next to each other in the
original collection. Works locally on each partition, so items from different
partitions will never be placed in the same group.
Provides Cassandra-specific methods on RDD