from_json不是对象org.apache.spark.sql.functions的成员

时间:2018-05-18 12:38:45

标签: scala apache-spark dataframe apache-spark-sql spark-streaming

我有以下代码: -

import org.apache.spark.sql.functions.from_json
val ds = df.select(from_json($"value" cast "string", schema)).as[event]

但是它会出错

value from_json is not a member of object org.apache.spark.sql.functions 

使用此依赖关系: -

<dependency>
        <groupId>org.apache.spark</groupId>
        <artifactId>spark-sql_2.11</artifactId>
        <version>2.0.0</version>
</dependency>

0 个答案:

没有答案