Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

reading a csv file from azure blob storage with PySpark

I'm trying to do a machine learning project using a PySpark HDInsight cluster on Microsoft Azure. To operate on my cluster a use a Jupyter notebook. Also, I have my data (a csv file), stored on the Azure Blob storage.

According to the documentation the syntax of the path to my file is:

path = 'wasb[s]://[email protected]/movies_plus_genre_info_2.csv'

However, when i try to read the csv file with the following command:

csvFile = spark.read.csv(path, header=True, inferSchema=True)

I get the following error:

'java.net.URISyntaxException: Illegal character in scheme name at index 4: wasb[s]://[email protected]/movies_plus_genre_info_2.csv'

Here is a screenshot of the the error looks like in the notebook: error screenshot

Any ideas on how to fix this?

like image 789
Mathias Saver Avatar asked Oct 18 '22 01:10

Mathias Saver


1 Answers

It is either (unencrypted):

wasb://...

or (encrypted):

wasbs://...

not

wasb[s]://...
like image 169
Alper t. Turker Avatar answered Nov 03 '22 07:11

Alper t. Turker