【发布时间】:2016-10-16 00:01:19
【问题描述】:
当我尝试运行为 IBM Bluemix 上的 Apache Spark 服务提供的示例之一时,我收到以下错误:
NameErrorTraceback (most recent call last)
<ipython-input-5-7de9805c358e> in <module>()
----> 1 set_hadoop_config(credentials_1)
<ipython-input-2-e790e4773aec> in set_hadoop_config(credentials)
1 def set_hadoop_config(credentials):
2 prefix = "fs.swift.service." + credentials['name']
----> 3 hconf = sc._jsc.hadoopConfiguration()
4 hconf.set(prefix + ".auth.url", credentials['auth_url']+'/v3/auth/tokens')
5 hconf.set(prefix + ".auth.endpoint.prefix", "endpoints")
NameError: global name 'sc' is not defined
我正在使用数据源面板上的插入到代码选项加载一个简单的 CSV 文件。但是,生成的凭据中没有“名称”属性。
credentials['name'] 不在我单击插入代码后生成的键值对中。
我想知道是否有任何其他方式来加载数据或这个问题是 IBM Bluemix 问题。
【问题讨论】: