set_swift_config: Fuction for setting configurations from swift

Description Usage Arguments Examples

Description

This function allows you to set your configuration in swift from sparklyr

Usage

1
set_swift_config(sc, creds)

Arguments

sc

active spark context

creds

your swift credentials, see README for further info

Examples

1
2
3
4
5
6
7
8
9
#this example runs in DSX
kernels <- sparklyr::list_spark_kernels()
sc <- sparklyr::spark_connect(config = kernels[1])
creds <-list(auth_url = "https://identity.open.softlayer.com",project = "object_storage_92c67982_------",project_id = "7babac2c------------------",region = "dallas",user_id = "18aa------------------",domain_id = "2c------------------",domain_name =  "------",username = "admin_774cd5e------------------------",password = "i------------",container = "notebooks", filename = "yourfile.csv")
set_swift_config(sc, creds)
#then you can read data in from ObjectStore into spark
spark_object_name = "dataFromSwift" #what you want the object called in spark
swift_data_object_path = "swift://sparklyrenvironment.keystone//flights3.csv"
sparklyr::spark_read_csv(sc, spark_object_name,swift_data_object_path)

IBMDataScience/objectStoreR documentation built on May 7, 2019, 5:04 a.m.