fix: Make cast string to timestamp compatible with Spark#3884
Open
parthchandra wants to merge 2 commits intoapache:mainfrom
Open
fix: Make cast string to timestamp compatible with Spark#3884parthchandra wants to merge 2 commits intoapache:mainfrom
parthchandra wants to merge 2 commits intoapache:mainfrom
Conversation
Add addtional formats and handle edge cases. Update compatibility guide Spark version specific behaviour for cast string to timestamp
41de47d to
65d92c8
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add addtional formats and handle edge cases.
Update compatibility guide
Which issue does this PR close?
Addressed #3775
Rationale for this change
Makes string to timestamp cast compatible with Spark by adding support for all remaining formats.
What changes are included in this PR?
Adds additional regexes, and parsing for timestamp formats that are supported by Spark. Marks the cast as compatible so unit tests do not fallback to Spark any more.
Important change: A big change in this implementation is that a new parameter has been introduced in Cast to indicate if the calling Spark version is 4.0-plus. This is because there are differences between how Spark parses timestamp strings between versions earlier than Spark 4, and versions after Spark 4. This flag is used in only some specific cases but is required to allow full compatibility
How are these changes tested?
Unit tests. Spark tests