Skip to content
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

Merged
merged 9 commits into from
Nov 20, 2024

Conversation

TCeason
Copy link
Collaborator

@TCeason TCeason commented Nov 7, 2024

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 feature tzdb-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

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@TCeason TCeason marked this pull request as draft November 7, 2024 10:59
@github-actions github-actions bot added the pr-refactor this PR changes the code base without new features or bugfix label Nov 7, 2024
@TCeason TCeason force-pushed the jiff branch 10 times, most recently from 884c9d1 to f284827 Compare November 8, 2024 14:16
@TCeason TCeason force-pushed the jiff branch 3 times, most recently from e8fb09e to b1f4fce Compare November 12, 2024 05:35
@TCeason TCeason marked this pull request as ready for review November 13, 2024 05:28
@TCeason TCeason changed the title refactor: use jiff crate replace chrono refactor: use jiff crate replace chrono in date/timestamp func Nov 13, 2024
@TCeason TCeason marked this pull request as draft November 13, 2024 05:42
@TCeason TCeason force-pushed the jiff branch 4 times, most recently from f94743a to dea7044 Compare November 13, 2024 08:56
@TCeason TCeason marked this pull request as ready for review November 13, 2024 09:51
@TCeason TCeason force-pushed the jiff branch 3 times, most recently from a9432e8 to ae413f0 Compare November 14, 2024 10:07
@TCeason
Copy link
Collaborator Author

TCeason commented Nov 15, 2024

Please review this pr. Cc @b41sh @andylokandy @sundy-li

@TCeason TCeason force-pushed the jiff branch 2 times, most recently from 009d576 to 14c6d62 Compare November 15, 2024 05:43
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
Copy link
Collaborator Author

TCeason commented Nov 20, 2024

Please review this pr @sundy-li

@BohuTANG BohuTANG merged commit 170b4b2 into databendlabs:main Nov 20, 2024
74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-refactor this PR changes the code base without new features or bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants