错误:Exception in thread "main" org.apache.spark.sql.AnalysisException: Since Spark 2.3, the queries from raw JSON/CSV files are disallowed when the
referenced columns only include the internal corrupt record column
(named _corrupt_record by default).
意思就是json文件时按行读取,只能允许一样一样读取,以下的格式时会出现错误
{
"username": "zhangsan",
"age": 25
}
解决:
将数据格式改成紧凑即可
{ "username": "zhangsan", "age": 25}