0
有谁知道是什么原因导致了这个错误?看起来很基本。Spark set_hadoop_config错误
在:
def set_hadoop_config(credentials):
prefix = "fs.swift.service." + credentials['name']
hconf = sc._jsc.hadoopConfiguration()
hconf.set(prefix + ".auth.url", credentials['auth_url']+'/v2.0/tokens')
hconf.set(prefix + ".auth.endpoint.prefix", "endpoints")
hconf.set(prefix + ".tenant", credentials['project_id'])
hconf.set(prefix + ".username", credentials['user_id'])
hconf.set(prefix + ".password", credentials['password'])
hconf.setInt(prefix + ".http.port", 8080)
hconf.set(prefix + ".region", credentials['region'])
日期:
Name: Compile Error Message: :1: error: ':' expected but ')' found. def set_hadoop_config(credentials): ^StackTrace:
谢谢!
听起来像一个语法错误。在代码中的某处,如果您应该放置冒号,则应放置圆括号 –
这是一个新的笔记本,不幸的是第一行代码。 Thx – Tak
当我执行问题中显示的代码时,第二行中会出现关于缺少缩进的错误。当我缩进除第一行以外的所有内容时,它会执行而不会出现问题。我在一个新创建的笔记本上尝试过。 也许你在实际的代码中忽略了一些空白或其他特殊字符? –