Skip to content

Commit

Permalink
fix: remove to_timezone function (#4439)
Browse files Browse the repository at this point in the history
fix: remove to_timezone, it doesn't make sense
  • Loading branch information
killme2008 authored Jul 26, 2024
1 parent db3a078 commit 0710e6f
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 373 deletions.
3 changes: 0 additions & 3 deletions src/common/function/src/scalars/timestamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@

use std::sync::Arc;
mod greatest;
mod to_timezone;
mod to_unixtime;

use greatest::GreatestFunction;
use to_timezone::ToTimezoneFunction;
use to_unixtime::ToUnixtimeFunction;

use crate::function_registry::FunctionRegistry;
Expand All @@ -27,7 +25,6 @@ pub(crate) struct TimestampFunction;

impl TimestampFunction {
pub fn register(registry: &FunctionRegistry) {
registry.register(Arc::new(ToTimezoneFunction));
registry.register(Arc::new(ToUnixtimeFunction));
registry.register(Arc::new(GreatestFunction));
}
Expand Down
313 changes: 0 additions & 313 deletions src/common/function/src/scalars/timestamp/to_timezone.rs

This file was deleted.

48 changes: 0 additions & 48 deletions tests/cases/standalone/common/function/time.result
Original file line number Diff line number Diff line change
Expand Up @@ -20,51 +20,3 @@ select GREATEST('2000-02-11'::Date, '2020-12-30'::Date);
| 2020-12-30 |
+-------------------------------------------------+

select to_timezone('2022-09-20T14:16:43.012345+08:00', 'Europe/Berlin');

+-----------------------------------------------------------------------------+
| to_timezone(Utf8("2022-09-20T14:16:43.012345+08:00"),Utf8("Europe/Berlin")) |
+-----------------------------------------------------------------------------+
| 2022-09-20 08:16:43.012345 |
+-----------------------------------------------------------------------------+

select to_timezone('2022-09-20T14:16:43.012345+08:00'::Timestamp, 'Europe/Berlin');

+------------------------------------------------------------------------------------------------------------------------------+
| to_timezone(arrow_cast(Utf8("2022-09-20T14:16:43.012345+08:00"),Utf8("Timestamp(Millisecond, None)")),Utf8("Europe/Berlin")) |
+------------------------------------------------------------------------------------------------------------------------------+
| 2022-09-20 08:16:43.012 |
+------------------------------------------------------------------------------------------------------------------------------+

select to_timezone('2024-03-29T14:16:43.012345Z', 'Asia/Shanghai');

+------------------------------------------------------------------------+
| to_timezone(Utf8("2024-03-29T14:16:43.012345Z"),Utf8("Asia/Shanghai")) |
+------------------------------------------------------------------------+
| 2024-03-29 22:16:43.012345 |
+------------------------------------------------------------------------+

select to_timezone('2024-03-29T14:16:43.012345Z'::Timestamp, 'Asia/Shanghai');

+-------------------------------------------------------------------------------------------------------------------------+
| to_timezone(arrow_cast(Utf8("2024-03-29T14:16:43.012345Z"),Utf8("Timestamp(Millisecond, None)")),Utf8("Asia/Shanghai")) |
+-------------------------------------------------------------------------------------------------------------------------+
| 2024-03-29 22:16:43.012 |
+-------------------------------------------------------------------------------------------------------------------------+

select to_timezone(1709992225, 'Asia/Shanghai');

+------------------------------------------------------+
| to_timezone(Int64(1709992225),Utf8("Asia/Shanghai")) |
+------------------------------------------------------+
| 1970-01-21 02:59:52.225 |
+------------------------------------------------------+

select to_timezone(1711508510000::INT64, 'Asia/Shanghai');

+-----------------------------------------------------------------------------------+
| to_timezone(arrow_cast(Int64(1711508510000),Utf8("Int64")),Utf8("Asia/Shanghai")) |
+-----------------------------------------------------------------------------------+
| 2024-03-27 11:01:50 |
+-----------------------------------------------------------------------------------+

Loading

0 comments on commit 0710e6f

Please sign in to comment.