databendlabs / databend

๐——๐—ฎ๐˜๐—ฎ, ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜๐—ถ๐—ฐ๐˜€ & ๐—”๐—œ. Modern alternative to Snowflake. Cost-effective and simple for massive-scale analytics. https://databend.com
https://docs.databend.com
Other
7.88k stars 753 forks source link

refactor: use jiff crate replace chrono in date/timestamp func #16787

Closed TCeason closed 5 days ago

TCeason commented 2 weeks ago

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

Type of change


This change isโ€‚Reviewable

TCeason commented 1 week ago

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

TCeason commented 5 days ago

Please review this pr @sundy-li