Using Spark connector for pyspark inside Apache Zeppellin

Hello everyone!

I want to use the aerospark connector for some advanced data science tasks in Apache Zeppelin notebooks with the pyspark interpreter. It seems like finally everything is working, at least i can import the aerospike client in scala enviroment of spark without any exceptions. But i cannot find any examples of quering Aerospike from pyspark, do you have some? How can i create a proper SQLContext with pyspark using the driver?

Thanks

1 Like

I have found out, how to connect to AS:

%spark.pyspark
conn = sqlc.read.format("com.aerospike.spark.sql").\
    option('aerospike.seedhost', AS_HOST).\
    option('aerospike.port', AS_PORT).\
    option('aerospike.namespace', NAMESPACE).\
    option('aerospike.set', SET_NAME).load()

how to query AS now? :slight_smile:

2 Likes

yes, sorry for a dummy question)