学习记录-报错-2

阅读 47

2022-03-22

Exception in thread "main" org.apache.spark.SparkUpgradeException: You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'YYYY-MM-dd' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2)

将SparkSession 定义成下面的样子即可

val spark = SparkSession
.builder()
.appName("top-three")
.master("local[2]")
.config("spark.sql.legacy.timeParserPolicy", "LEGACY")
.getOrCreate()

精彩评论(0)

0 0 举报