-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-27638][SQL]: Cast string to date/timestamp in binary comparisons with dates/timestamps #24567
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
Closed
Closed
[SPARK-27638][SQL]: Cast string to date/timestamp in binary comparisons with dates/timestamps #24567
Changes from all 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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_DATETIME_TO_STRING = | ||
| buildConf("spark.sql.legacy.typeCoercion.datetimeToString") | ||
| .doc("If it is set to true, date/timestamp will cast to string in binary comparisons " + | ||
|
Contributor
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 castDatetimeToString: Boolean = getConf(SQLConf.LEGACY_CAST_DATETIME_TO_STRING) | ||
|
|
||
| /** ********************** SQLConf functionality methods ************ */ | ||
|
|
||
| /** Set Spark SQL configuration properties. */ | ||
|
|
||
This file contains hidden or 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->spark.sql.legacy.typeCoercion.datetimeToString.enabledThere 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.
cc @Ngone51
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.
#27065