Skip to content Skip to sidebar Skip to footer

Cloudant Database Not Connecting Using Spark Python

I am using Spark version 2.0.1 and trying to connect cloudant database using Python code but same time I am getting an error. Error is throwing at 'load(cloudant_credentials['db_na

Solution 1:

Try using cloudant package in spark-submit: https://spark-packages.org/package/cloudant-labs/spark-cloudant

Include this package in your Spark Applications using: spark-shell, pyspark, or spark-submit

$SPARK_HOME/bin/spark-shell --packages cloudant-labs:spark-cloudant:2.0.0-s_2.11

Note: you can use also the following format from: https://github.com/cloudant-labs/spark-cloudant

see example here: https://github.com/cloudant-labs/spark-cloudant/blob/master/examples/python/CloudantDF.py

Solution 2:

In Spark 2.0 we are using SparkSession instead of SparkContext andSQLContext. You can see an example here: https://github.com/cloudant-labs/spark-cloudant/blob/master/examples/python/CloudantDF.py#L23-L30

Post a Comment for "Cloudant Database Not Connecting Using Spark Python"