在”load()”处出现cassandra-connector问题。

huangapple go评论74阅读模式
英文:

Problem with cassandra-connector at "load()"

问题

我成功下载了这个连接器:com.datastax.spark:spark-cassandra-connector_2.11:2.5.1

当我尝试使用以下代码加载信息时:

data = sparkSession.read.format("org.apache.spark.sql.cassandra").options(table="tbthesis", keyspace="test").load()

我遇到了以下错误:

Exception has occurred: Py4JJavaError
An error occurred while calling o48.load.
: 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

除了错误建议的“寻找另一个连接器”之外,还有其他想法吗?实际上,这正是许多专业人士建议我使用的连接器,因此我认为问题可能出在别的地方。

谢谢!

英文:

I downloaded succesfully this connector: com.datastax.spark:spark-cassandra-connector_2.11:2.5.1

And when I try to load the information with this line:

data = sparkSession.read.format("org.apache.spark.sql.cassandra").options(table="tbthesis", 
keyspace="test").load()

I get this error:

Exception has occurred: Py4JJavaError
An error occurred while calling o48.load.
: 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

Any ideas besides what the error suggests about "Look for another connector"? Indeed, this is the connector which several professionals have suggested me to use, hence it most be something else I think.

Thanks!

答案1

得分: 1

我的问题已经解决,我必须下载:

--packages com.datastax.spark:spark-cassandra-connector_2.12:2.5.1

这是适用于我的Scala版本(2.12.10)的正确连接器。

感谢大家的支持!

英文:

My problem is solved, I had to download:

--packages com.datastax.spark:spark-cassandra-connector_2.12:2.5.1

which is the right connector for my scala version: 2.12.10

Thank you all for your support!

huangapple
  • 本文由 发表于 2020年8月28日 22:31:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/63635808.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定