版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/someby/article/details/83789967
问题描述
在Spark-shell中运行官方文档提供的例子时,出现error: not found: value StructType/StructField/StringType的错误
解决方案
将相关的类导入即可
import org.apache.spark.sql.types.{StructType, StructField, StringType, IntegerType};
或者
org.apache.spark.sql.types._