Skip to main content
Committed ⭐️⭐️⭐️
June 2, 2022
Solved

Is it possible to run Cognite Spark Data Source locally?

  • June 2, 2022
  • 12 replies
  • 350 views

I am doing some ETL jobs in Azure Databricks and have successfully managed to use Cognite’s Spark Data Source to read and write time-series, datapoints etc from and to CDF. I know that databricks itself is a cloud platform. However, it is interesting for me to be able to run some or all of the jobs locally during development phase. I wonder if it is still possible to somehow test-run Spark jobs locally? The configuration does not seem to be trivial. 

 I played a little bit with PySpark, and I was able to run it on my Mac but I could not create a connection to “cognite.spark.v1” to read or write data. 

Do you know if it is possible to perform such operation? If not, what would you suggest? 


 

Best answer by Reza Parseh

Ok, it seemed like I needed to start PySpark with this package

pyspark --packages com.cognite.spark.datasource:cdf-spark-datasource-fat_2.12:2.0.10

My system Scala installation is 2.13 but apache-spark has its own installed using HomeBrew (well, that’s what Brew does I guess). After this everything else works and I can download datapoints :) Thanks again @Håkon Trømborg  

12 replies

Reza ParsehAuthorAnswer
Committed ⭐️⭐️⭐️
June 3, 2022

Ok, it seemed like I needed to start PySpark with this package

pyspark --packages com.cognite.spark.datasource:cdf-spark-datasource-fat_2.12:2.0.10

My system Scala installation is 2.13 but apache-spark has its own installed using HomeBrew (well, that’s what Brew does I guess). After this everything else works and I can download datapoints :) Thanks again @Håkon Trømborg  

Håkon Trømborg
Practitioner ⭐️⭐️⭐️
Tech Lead
June 3, 2022

Great! Thanks for asking the question also, helped discover some problems in our docs :) Have fun Sparking!