Unable to read AstraDB data in a Databricks Pyspark dataframe. Getting errors while establishing the connection.
In the Pyspark code I have the following:
import os from pyspark import SparkContext,SparkFiles,SQLContext,SparkFiles from pyspark.sql import SQLContext, SparkSession from pyspark.sql.functions import col spark =SparkSession.builder.appName('SparkCassandraApp')\ .config('spark.cassandra.connection.config.cloud.path','dbfs:/FileStore/tables/secure_connect_kafka.zip')\ .config('spark.cassandra.auth.username', '')\ .config('spark.cassandra.auth.password','')\ .config('spark.dse.continuousPagingEnabled',False)\ .getOrCreate() df = spark.read.format("org.apache.spark.sql.cassandra")\ .options(table="emp", keyspace="kafka").load() display(df)
I am getting error reading the df.. spark.read.format('')... Here is the error..
java.io.IOException: Failed to open native connection to Cassandra at Cloud File Based Config at dbfs:/FileStore/tables/secure_connect_kafka.zip :: Could not initialize class com.datastax.oss.driver.internal.core.config.typesafe.TypesafeDriverConfig
The secure_connect.zip has been uploaded into the dbfs
Any help here please.. Thanks, Narayana