答えて

0

これをチェックしましたか?leftJoinWithCassandraTable

/** 
    * Uses the data from [[org.apache.spark.rdd.RDD 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")) 
    * }}} 
**/ 
+0

このコードは、spark-cassandra-connector 1.6.2では使用できません。それはspark-cassandra-connector 1.6.4以降で利用可能です。私は1.6.2上の1.6.4の機能がほしいと思っています。 –

+0

あなたは '分割された' CassandraRDDと考えることができ、 'leftOuterJoin'を使ってそれを行います。 https://github.com/datastax/spark-cassandra-connector/blob/v1.6.2/doc/16_partitioning.md#joining-to-cassandra-rdds-from-non-cassandra-rdds – semsorock

関連する問題