0
CASSANDRA_TABLE has (some_other_column, itemid) as primary key.
val cassandraRdd: CassandraTableScanRDD[CassandraRow] = sparkSession.sparkContext
.cassandraTable(cassandraKeyspace, cassandraTable)
cassandraRdd.take(10).foreach(println)
這cassandraRdd已經從我的卡珊德拉表星火CassandraTableScanRDD KeyBy不持有的所有列
val temp1: CassandraTableScanRDD[((String), CassandraRow)] = cassandraRdd
.select("itemid", "column2", "column3")
.keyBy[(String)]("itemid")
val temp2: CassandraTableScanRDD[((String), CassandraRow)] = cassandraRdd
.keyBy[(String)]("itemid")
temp1.take(10).foreach(println)
temp2.take(10).foreach(println)
兩個temp1中和TEMP2不保留所有列是keyBy操作
((988230014),CassandraRow{itemid: 988230014})
後讀取的所有列我如何在特定列上鍵入並讓CassandraRow保留所有列?