0
我有一个分区表卡桑德拉:我如何保存星火据帧到一个分区表卡桑德拉
sess.execute(s"""CREATE TABLE IF NOT EXISTS test.details(
| userId text,
| name text,
| age text,
| date date,
| PRIMARY KEY (date))
| WITH CLUSTERING ORDER BY (time DESC)""".stripMargin)
我使用Scala的2.11.8和Spark 2.0和卡桑德拉。这里的表格由'date'col分区。所以在这种情况下,我怎样才能将数据框保存到这个表中?是否有我需要使用的API的Scala代码示例?如果没有分区和集群我使用:
myDF.distinct().write
.cassandraFormat(keyspace = "test", table = "details", cluster="cluster")
.mode(SaveMode.Append)
.save()
这应该每个微批流应用被保存,在选购注重性能的API