我有以下代码: -
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>