我尝试通过选择小时+分钟/ 60以及数据帧中的其他列来创建新数据帧,如下所示:
val logon11 = logon1.select("User","PC","Year","Month","Day","Hour","Minute",$"Hour"+$"Minute"/60)
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
<console>:38: error: overloaded method value select with alternatives:
(col: String,cols: String*)org.apache.spark.sql.DataFrame <and>
(cols: org.apache.spark.sql.Column*)org.apache.spark.sql.DataFrame
cannot be applied to (String, String, String, String, String, String, String,org.apache.spark.sql.Colum)
...
Run Code Online (Sandbox Code Playgroud)
也许我知道原因是我无法同时使用"select"获取这些类型的DataFrame.那我怎么能得到这样的数据帧呢?