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
當我執行問題中顯示的代碼時,第二行中會出現關於缺少縮進的錯誤。當我縮進除第一行以外的所有內容時,它會執行而不會出現問題。我在一個新創建的筆記本上嘗試過。 也許你在實際的代碼中忽略了一些空白或其他特殊字符? –