在spark-shell中解决error: not found: value StructType/StructField/StringType问题

问题描述:

在Spark-shell中运行官方文档提供的例子时,出现error: not found: value StructType/StructField/StringType的错误

在spark-shell中解决error: not found: value StructType/StructField/StringType问题

解决方法

stackoverflow上 给出的解决方法是导入相应的类型

 import org.apache.spark.sql.types._

导入后问题就解决了