【发布时间】:2018-12-19 15:22:37
【问题描述】:
我正在尝试在我的数据框上应用如下所示的数据透视
val pivot_company_model_vals_df = company_model_vals_df.groupBy("company_id","id","date")
.pivot("code")
.agg( when( col("data_item_value_numeric").isNotNull,
first("numeric")).otherwise(first("value")) )
错误
org.apache.spark.sql.AnalysisException: expression '`data_item_value_numeric`' is neither present in the group by, nor is it an aggregate function.
你能帮我看看我做错了什么吗? 谢谢
【问题讨论】:
标签: scala apache-spark apache-spark-sql databricks