Saves the data from RDD to a Cassandra table in batches of given size.
Saves the data from RDD to a Cassandra table in batches of given size. Use this overload only if you find automatically tuned batch size doesn't result in optimal performance.
Larger batches raise memory use by temporary buffers and may incur larger GC pressure on the server. Small batches would result in more roundtrips and worse throughput. Typically sending a few kilobytes of data per every batch is enough to achieve good performance.
By default, writes are performed at ConsistencyLevel.ONE in order to leverage data-locality and minimize network traffic. This write consistency level is controlled by the following property:
Saves the data from RDD to a Cassandra table.
Saves the data from RDD to a Cassandra table.
The RDD object properties must match Cassandra table column names.
Non-selected property/column names are left unchanged in Cassandra.
All primary key columns must be selected.
Example:
CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1 };
CREATE TABLE test.words(word VARCHAR PRIMARY KEY, count INT, other VARCHAR);case class WordCount(word: String, count: Int, other: String) val rdd = sc.parallelize(Seq(WordCount("foo", 5, "bar"))) rdd.saveToCassandra("test", "words", Seq("word", "count")) // will not save the "other" column
By default, writes are performed at ConsistencyLevel.ONE in order to leverage data-locality and minimize network traffic. This write consistency level is controlled by the following property:
Saves the data from RDD to a Cassandra table.
Saves the data from RDD to a Cassandra table.
Saves all properties that have corresponding Cassandra columns.
The underlying RDD class must provide data for all columns.
Example:
CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1 };
CREATE TABLE test.words(word VARCHAR PRIMARY KEY, count INT, other VARCHAR);case class WordCount(word: String, count: Int, other: String) val rdd = sc.parallelize(Seq(WordCount("foo", 5, "bar"))) rdd.saveToCassandra("test", "words")
By default, writes are performed at ConsistencyLevel.ONE in order to leverage data-locality and minimize network traffic. This write consistency level is controlled by the following property:
Provides Cassandra-specific methods on
RDD