问题描述
在Spark-shell中运行官方文档提供的例子时,出现error: not found: value StructType/StructField/StringType的错误
解决方案
将相关的类导入即可
import org.apache.spark.sql.types.{StructType, StructField, StringType, IntegerType};
或者
org.apache.spark.sql.types._
在Spark-shell中运行官方文档提供的例子时,出现error: not found: value StructType/StructField/StringType的错误
将相关的类导入即可
import org.apache.spark.sql.types.{StructType, StructField, StringType, IntegerType};
或者
org.apache.spark.sql.types._