-
Notifications
You must be signed in to change notification settings - Fork 762
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
Feature: function about convert_timezone #16177
Comments
Hey, |
Hello, |
Need test :) you can add it in datetime_tz.test in suite dir |
I think something is wrong with this new method "convert_timezone". |
You can read this doc first: https://docs.databend.com/guides/community/contributor/how-to-write-scalar-functions And then can ref function: "to_timestamp": https://github.com/datafuselabs/databend/blob/4b2e844c728f9f4875ce3f61458e7a7d1c6554f4/src/query/functions/src/scalars/datetime.rs#L146 Now ctx.func_ctx.tz.tz is a user setting timezone. In convert_timezone, we should :
After impl the function, add test in https://github.com/datafuselabs/databend/blob/4cd1de74fa42a31bb61d0d7d46b7c108a11471ac/tests/sqllogictests/suites/query/functions/02_0012_function_datetimes_tz.test#L658 |
convert_timezone with three args is hard to impl now. Because now databend only store timestamp in storage. |
* Feature: function about convert_timezone #16177 * Correction trait type * Formatting the function * Solving compiling issue * Correcting file format * adding tests * Correction unti test * Correction unit tests 2 * Correction unit tests 3 * Correction unit tests 4 * Correction unit tests 5 * Correction unit tests 6 * Correction unit tests 6 * Implementation of convert_timezone * Correction registry and error handling * Correction eval function * Correction eval function 2 * Correction eval function 3 * Correction eval function 4 * Correction eval function 5 * Correction eval function 6 * Correction eval function 7 * Correction eval function 8 * Correction eval function 9 * Correction eval function 11 * Correction eval function 12 * Correction eval function 13 + add of the 3 arguments function version * Code formatting * Correction third parameter convert_timezone() * Correction type * Correction 1 * Correction 2 * Adding unit test * Adding unit test 2 * Correciton unit test 4 * Correciton unit test 5 * Correciton unit test 6 * Correciton unit test 7 * Correction unit test 8 * Correction checked expr * Correction convert_timezone * Correction convert_timezone 2 * Correction convert_timezone 3 * Correction convert_timezone 4 * Correction convert_timezone 5 * Correction convert_timezone 6 * Correction convert_timezone 7 * Correction convert_timezone 8 * Correction convert_timezone 9 * Correction convert_timezone 10 * Correction convert_timezone 11 * Correction convert_timezone 12 * Correction convert_timezone 12 * Correction convert_timezone 13 * Unit test * Unit test 2 * Unit test 3 * Unit test 4 * Unit test 5 * Unit test 6 * Unit test 7 * feat: convert_timezone(target_timezone, ts) * add some check * if error output push default --------- Co-authored-by: TCeason <[email protected]>
Summary
Now Databend support to_timestamp can convert string to current timezone with setting
timezone
.And convert_timezone is support to convert given time to target timezone.
ref: https://docs.snowflake.com/en/sql-reference/functions/convert_timezone
The text was updated successfully, but these errors were encountered: