-
Notifications
You must be signed in to change notification settings - Fork 750
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
refactor: use jiff crate replace chrono in date/timestamp func #16787
Open
TCeason
wants to merge
5
commits into
databendlabs:main
Choose a base branch
from
TCeason:jiff
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+987
−845
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
pr-refactor
this PR changes the code base without new features or bugfix
label
Nov 7, 2024
TCeason
force-pushed
the
jiff
branch
10 times, most recently
from
November 8, 2024 14:16
884c9d1
to
f284827
Compare
TCeason
commented
Nov 11, 2024
TCeason
force-pushed
the
jiff
branch
2 times, most recently
from
November 11, 2024 04:12
7f2eb80
to
e8fb09e
Compare
Done: register_diff_functions(registry); register_to_number_functions(registry); register_add_functions(registry); register_sub_functions(registry); register_timestamp_to_date register_date_to_timestamp register_to_string register_string_to_date register_string_to_timestamp TODO: register_real_time_functions(registry); register_rounder_functions(registry);
TCeason
changed the title
refactor: use jiff crate replace chrono
refactor: use jiff crate replace chrono in date/timestamp func
Nov 13, 2024
TCeason
force-pushed
the
jiff
branch
3 times, most recently
from
November 13, 2024 08:28
77462e1
to
f94743a
Compare
andylokandy
reviewed
Nov 13, 2024
@@ -98,7 +98,8 @@ pub enum FunctionEval { | |||
#[derive(Clone)] | |||
pub struct FunctionContext { | |||
pub tz: TzLUT, |
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.
Can we remove it? Or convert from jiff_tz?
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.
Cannot. Date_format need this. Jeff not support format string with no ascii format
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
In jiff https://docs.rs/jiff/latest/jiff/index.html#time-zone-features, we enable
tzdb-bundle-always
(When enabled, Jiff will forcefully depend on the jiff-tzdb crate). It's not a good idea when use jiff crate.But if not enable it, jiff will read tzinfo from file /usr/share/zoneinfo. This file relate
tzdata
in system env. And we init timezone in function ctx, if system not install tzdata will cause panic. So we enable featuretzdb-bundle-always
as default.Done:
register_diff_functions(registry)
register_to_number_functions(registry)
register_add_functions(registry)
register_sub_functions(registry)
register_timestamp_to_date
register_date_to_timestamp
register_to_string
register_string_to_date
register_string_to_timestamp
register_real_time_functions
register_rounder_functions
Tests
Type of change
This change is