-
Notifications
You must be signed in to change notification settings - Fork 760
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
feat(query): add func date_format and str_to_date and str_to_timestamp #11442
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
This comment was marked as outdated.
This comment was marked as outdated.
These functions requires additional documentation. Thanks! cc @soyeric128 We already have an powerful date format function in place. cc @wubx |
output.push_null(); | ||
} else { | ||
match (std::str::from_utf8(date), std::str::from_utf8(format)) { | ||
(Ok(date), Ok(format)) => { |
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.
why not throw the error?
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.
Refer to MySQL behavior here. Return null directly if there is any invalid
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.
I think we should not follow MySQL's behavior, we should throw if any error happens.
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.
I think we should not follow MySQL's behavior, we should throw if any error happens.
Modify in this pr: #11455
I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/
Summary
support function:
date_format(Timestamp, String) :: String NULL
date_format(Timestamp NULL, String NULL) :: String NULL
str_to_date(String, String) :: Date NULL
str_to_date(String NULL, String NULL) :: Date NULL
str_to_timestamp(String, String) :: Timestamp NULL
str_to_timestamp(String NULL, String NULL) :: Timestamp NULL
Note
Closes #11125