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-27638][SQL]: Cast string to date/timestamp in binary comparisons with dates/timestamps #24567
Closed
Closed
[SPARK-27638][SQL]: Cast string to date/timestamp in binary comparisons with dates/timestamps #24567
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e24514e
SPARK-27638: date format yyyy-M-dd string comparison not handled prop…
41a03dd
change relative comments
19ec071
Merge branch 'master' of https://github.com/apache/spark into SPARK-2…
ac82eb2
cast to timestamp when comparting string and timestamp & enrich test…
34b00e9
add SQLConf legacy option to fallback to the old string vs date/times…
e63367c
Merge branch 'master' of https://github.com/apache/spark into SPARK-2…
c3e80f7
Modify migration guide & rename SQLConf option
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1760,6 +1760,13 @@ object SQLConf { | |
.internal() | ||
.intConf | ||
.createWithDefault(Int.MaxValue) | ||
|
||
val LEGACY_CAST_DATE_TIMESTAMP_TO_STRING = | ||
buildConf("spark.sql.legacy.binaryComparison.castDateTimestampToString") | ||
.doc("If it is set to true, date/timestamp will cast to string in binary comparisons " + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we also add a migration guide for this behavior change and mention this config? |
||
"with String") | ||
.booleanConf | ||
.createWithDefault(false) | ||
} | ||
|
||
/** | ||
|
@@ -2211,6 +2218,8 @@ class SQLConf extends Serializable with Logging { | |
def setCommandRejectsSparkCoreConfs: Boolean = | ||
getConf(SQLConf.SET_COMMAND_REJECTS_SPARK_CORE_CONFS) | ||
|
||
def castDateTimestampToString: Boolean = getConf(SQLConf.LEGACY_CAST_DATE_TIMESTAMP_TO_STRING) | ||
|
||
/** ********************** SQLConf functionality methods ************ */ | ||
|
||
/** Set Spark SQL configuration properties. */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spark.sql.legacy.typeCoercion.datetimeToString