Created
October 9, 2017 21:43
-
-
Save gadamc/6284fe9b0cb42d8af0c0943f02b2c1cd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ibmos2spark | |
credentials = { | |
'auth_url': 'https://identity.open.softlayer.com', #your URL might be different | |
'project_id': '', | |
'region': '', | |
'user_id': '', | |
'username': '', | |
'password': '', | |
} | |
configuration_name = 'my_bluemix_os' #you can give any name you like | |
# 1. Create a connection | |
bmos = ibmos2spark.bluemix(sc, credentials, configuration_name) #sc is the SparkContext instance | |
# 2. Get path to data | |
path_to_data = bmos.url(container_name, object_name) | |
# Creat an Apache Spark RDD with path to data | |
data = sc.textFile(path_to_data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment