Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spark Legacy Configuration #12

Open
satyasyamnn opened this issue Jul 1, 2021 · 0 comments
Open

Spark Legacy Configuration #12

satyasyamnn opened this issue Jul 1, 2021 · 0 comments

Comments

@satyasyamnn
Copy link

When this code is run using Spark version 3.1.2 I got an error

Caused by: org.apache.spark.SparkUpgradeException: You may get a different result due to the upgrading of Spark 3.0: Fail to parse '2065-10-6' in the new parser. You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0, or set to CORRECTED and treat it as an invalid datetime string.
at org.apache.spark.sql.catalyst.util.DateTimeFormatterHelper$$anonfun$checkParsedDiff$1.applyOrElse(DateTimeFormatterHelper.scala:150)

The fix for this issue is to add the following lines of code

    SparkConf conf = new SparkConf().setAppName("Spark In Action").setMaster("local[*]");
    conf.set("spark.sql.legacy.timeParserPolicy", "LEGACY");

To make it work in Spark 3 what kind of formatting is required?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant