Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

narayana.jayanthi_191238 avatar image
narayana.jayanthi_191238 asked Erick Ramirez answered

Unable to read Astra DB table data from Databricks notebook

I am trying to read datastax astra db table from databricks pyspark notebook.. However, I am getting the below error:

java.io.IOException: Failed to open native connection to Cassandra at Cloud File Based Config at dbfs:/FileStore/tables/secure_connect_kafka.zip :: null

Caused by: com.datastax.oss.driver.api.core.DriverExecutionException
 at com.datastax.oss.driver.internal.core.util.concurrent.CompletableFutures.getUninterruptibly(CompletableFutures.java:152)
 at com.datastax.oss.driver.api.core.session.SessionBuilder.build(SessionBuilder.java:703)
 at com.datastax.spark.connector.cql.DefaultConnectionFactory$.createSession(CassandraConnectionFactory.scala:143)
 at com.datastax.spark.connector.cql.CassandraConnector$.createSession(CassandraConnector.scala:167)
 ... 26 more 
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
 at sun.security.ssl.Alert.createSSLException(Alert.java:131)
 at sun.security.ssl.Alert.createSSLException(Alert.java:117)
 at sun.security.ssl.TransportContext.fatal(TransportContext.java:335)
 at sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:293)

installed the following in the libraries:

com.datastax.spark:spark-cassandra-connector-assembly_2.12:3.0.1

Here is the code:

secure_bundle_file=os.getcwd()+'\\secure_connect_kafka.zip'
spark =SparkSession.builder.appName('SparkCassandraApp')\
.config('spark.cassandra.connection.config.cloud.path',secure_bundle_file )\
.config('spark.cassandra.auth.username', 'Secret ID')\
.config('spark.cassandra.auth.password','Secret Key')\
.config('spark.dse.continuousPagingEnabled',False)\
.getOrCreate()
df = spark.read.format("org.apache.spark.sql.cassandra")\
.options(table="emp", keyspace="kafka").load()

Any help.. please let me know.

Thanks

Narayana

astra dbdatabricks
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered

[Closed as duplicate of question #13906]

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.