我有一个数据框,其中包含一个Unix时间戳列(例如1435655706000),我希望将其转换为格式为“yyyy-MM-DD”的日期。我尝试了nscala-time,但它不起作用。
val time_col = sqlc.sql("select ts from mr").map(_(0).toString.toDateTime)
time_col.collect().foreach(println)
我遇到了错误:
java.lang.IllegalArgumentException: 无效格式:"1435655706000" 在 "6000" 处格式不正确