如何在 spark 2.0 中从 Cassandra Datastax 读取数据?
这就是我尝试过的 -
val df = spark.read.format("org.apache.spark.sql.cassandra").options(Map("keyspace" -> "my_keyspace",
"table" -> "my_table",
"spark.cassandra.connection.config.cloud.path" -> "file:///home/training/secure-connect-My_path.zip",
"spark.cassandra.auth.password" -> "password",
"spark.cassandra.auth.username" -> "Username"
))
.load()
我收到此错误:
Exception in thread "main" java.lang.ClassNotFoundException: Failed to find data source: org.apache.spark.sql.cassandra. Please find packages at http://spark.apache.org/third-party-projects.html
当我使用 datastax zip 时,为什么需要安装 Cassandra 或执行任何其他步骤?
使用相同的 zip 文件,我可以读取 java 程序中的数据。为什么我无法读入 Spark?