Skip to content

[SPARK-52866][SQL] Add support for try_to_date #51555

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
wants to merge 12 commits into from

Conversation

mihailom-db
Copy link
Contributor

What changes were proposed in this pull request?

This PR adds alias for calling try_to_date, this function behaves the same as to_date, but returns NULL on errors.

Why are the changes needed?

As part of #49227 we have changed the error message for ToTimestamp when we call the function to_date to return try_to_date suggestion. This suggestion is not available and this PR fixes the issue.

Does this PR introduce any user-facing change?

Yes, we are adding new function call.

How was this patch tested?

Tests added in docs.

Was this patch authored or co-authored using generative AI tooling?

No.

@mihailom-db mihailom-db changed the title [WIP][SQL] Add support for try_to_date [SPARK-52866][SQL] Add support for try_to_date Jul 18, 2025
@@ -2125,7 +2125,7 @@ case class ParseToDate(
this(left, None)
}

override def prettyName: String = "to_date"
override def nodeName: String = "to_date"
Copy link
Member

Choose a reason for hiding this comment

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

What's the reason for the replacement?

Copy link
Member

Choose a reason for hiding this comment

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

nvm, I got it.

@MaxGekk
Copy link
Member

MaxGekk commented Jul 22, 2025

+1, LGTM. Merging to master.
Thank you, @mihailom-db and @cloud-fan for review.

@MaxGekk MaxGekk closed this in 75721ad Jul 22, 2025
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