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

Enable ANSI mode for CAST string to timestamp #1555

Merged
merged 3 commits into from
Jan 25, 2021

Conversation

andygrove
Copy link
Contributor

@andygrove andygrove commented Jan 20, 2021

This PR adds a check to the CAST from string to timestamp to detect if any non-null values were not converted successfully. This check only happens in ANSI mode and will throw a DateTimeException if there were values that could not be converted. This matches Spark's behavior.

Partially addresses #1517 - we have different code paths for CAST and other methods of converting string to timestamp (such as to_date, to_timestamp, unix_timestamp, and to_unix_timestamp). I filed #1556 for adding tests for these functions.

@andygrove andygrove added this to the Jan 18 - Jan 29 milestone Jan 20, 2021
@andygrove andygrove self-assigned this Jan 20, 2021
Signed-off-by: Andy Grove <andygrove@nvidia.com>
@andygrove
Copy link
Contributor Author

build

Signed-off-by: Andy Grove <andygrove@nvidia.com>
Signed-off-by: Andy Grove <andygrove@nvidia.com>
@revans2
Copy link
Collaborator

revans2 commented Jan 21, 2021

build

Copy link
Collaborator

@gerashegalov gerashegalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@revans2 revans2 merged commit 4229d85 into NVIDIA:branch-0.4 Jan 25, 2021
nartal1 pushed a commit to nartal1/spark-rapids that referenced this pull request Jun 9, 2021
Signed-off-by: Andy Grove <andygrove@nvidia.com>
nartal1 pushed a commit to nartal1/spark-rapids that referenced this pull request Jun 9, 2021
Signed-off-by: Andy Grove <andygrove@nvidia.com>
@andygrove andygrove deleted the ansicast-string-to-timestamp branch June 23, 2021 16:52
tgravescs pushed a commit to tgravescs/spark-rapids that referenced this pull request Nov 30, 2023
Signed-off-by: Peixin Li <pxli@nyu.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants