例如下面是我的代码:
spark = SparkSession.builder.appName('SparkCassandraApp')\
.config('spark.cassandra.connection.host', 'xx.xx.xx.xx') \
.config('spark.cassandra.connection.port', '9042') \
.config("spark.cassandra.auth.username","username")\
.config("spark.cassandra.auth.password","password")\
.getOrCreate()
df = spark.read.format("org.apache.spark.sql.cassandra").option("table","local").option( "keyspace","system").load().select('host_id')
df.show()
出现以下错误:
错误executor.Executor:阶段0.0(TID 0)中任务0.0中的异常java.io.IOException:准备SELECT“host_id”FROM“system”期间出现异常。“local”WHERE token(“key”)<?允许过滤:org/apache/spark/sql/catalyst/package$ScalaReflectionLock$ at com.datastax.spark.connector.rdd.CassandraTableScanRDD.createStatement(CassandraTableScanRDD.scala:323)
我在用着
火花版本:2.4.6
斯卡拉版本:2.11.12
spark -cassandra-connector spark-cassandra-connector_2.11-2.0.5-yb-2.jar