0
在Zeppelin中,我使用另一段中創建的數據框。我顯示我的df變量的類型並獲得:無法訪問Spark數據框方法
res35: String = DataFrame
暗示它是數據框。但是,當我嘗試在DF變量使用select我得到一個錯誤:
<console>:62: error: value select is not a member of Object
我必須對象轉換爲數據幀或東西嗎?有人能告訴我我錯過了什麼嗎? TIA!
我的代碼是:
val df = z.get("wds")
df.getClass.getSimpleName
df.select(explode($"filtered").as("value")).groupBy("value").count.show
這使folowwing(編輯)的輸出:
df: Object = [racist: boolean, contributors:
string, coordinates: string, ...n: Int = 20
res35: String = DataFrame
<console>:62: error: value select is not a member of Object
df.select(explode($"filtered").as("value")).groupBy("value").count.show