-
Notifications
You must be signed in to change notification settings - Fork 752
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): support timezone #4878
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/databend/databend/2SUHukz1A4kVtMP3ekGi4SPvEBnA |
@vercel[bot] is not allowed to run commands |
Thanks for the contribution! Please review the labels and make any necessary changes. |
73a041c
to
05ffd05
Compare
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Signed-off-by: Veeupup <code@tanweime.com>
Signed-off-by: Veeupup <code@tanweime.com>
Signed-off-by: Veeupup <code@tanweime.com>
05ffd05
to
47c25eb
Compare
Signed-off-by: Veeupup <code@tanweime.com>
Signed-off-by: Veeupup <code@tanweime.com>
Signed-off-by: Veeupup <code@tanweime.com>
Signed-off-by: Veeupup <code@tanweime.com>
Signed-off-by: Veeupup <code@tanweime.com>
@@ -66,23 +69,27 @@ pub fn cast_column_field( | |||
column_with_field: &ColumnWithField, | |||
from_type: &DataTypeImpl, | |||
target_type: &DataTypeImpl, | |||
func_ctx: &FunctionContext, |
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.
How about putting func_ctx
as the first argument?
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.
We can do this little refactor in another PR
Signed-off-by: Veeupup <code@tanweime.com>
Signed-off-by: Veeupup <code@tanweime.com>
We need more stateless-test to test corner cases of differents timezone in the future |
Signed-off-by: Veeupup <code@tanweime.com>
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'd like to know if we support DST(Daylight Saving Time) or not? As soon as timezone is introduced, the implementation of datetime functions(e.g. |
@leiysky I did not add stateless-test about DST now. We use |
I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/
Summary
this is part of #4651 , make databend work with timezone.
And now, we only store UTC timestamp in microseconds in databend, and then we will display with timezone.
and all functions with timestamp will be the corresponding logic with timezone.
such as in
UTC
, timestamp is2022-04-30 22:00:00
and then inAsia/Shanghai
, it should be2022-05-01 06:00:00
. and when we calltostartofmonth
, the first will output2022-04-01
and the latter will be2022-05-01
. Others will be the same logic.Changelog
Related Issues
Fixes #4651