-
Notifications
You must be signed in to change notification settings - Fork 3
to_timestamp_*
scalar functions family
#1259
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
e2c1a0e
ntz
ravlio 11c9a51
timezone
ravlio a99b4e5
visitor
ravlio a40348c
register
ravlio 16ba2d3
register
ravlio f74bd21
fix
ravlio 5ba3cd3
work
ravlio 5a1855f
clippy
ravlio 86d019f
wip
ravlio d25004c
debug
ravlio a2d4740
try
ravlio 9e3f4e2
Wip
ravlio 9787028
rm debug
ravlio 12fd761
fmt
ravlio a94b71e
work
ravlio ff86835
rm test
ravlio 05aace1
rm obsolete
ravlio 50e6936
clippy
ravlio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
13 changes: 13 additions & 0 deletions
13
crates/core-executor/src/tests/snapshots/query_timestamp_date.snap
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
source: crates/core-executor/src/tests/query.rs | ||
description: "\"SELECT TO_TIMESTAMP('2022-01-01 11:30:00'::date)\"" | ||
--- | ||
Ok( | ||
[ | ||
"+-------------------------------------------+", | ||
"| to_timestamp(Utf8(\"2022-01-01 11:30:00\")) |", | ||
"+-------------------------------------------+", | ||
"| 2022-01-01T00:00:00 |", | ||
"+-------------------------------------------+", | ||
], | ||
) |
13 changes: 13 additions & 0 deletions
13
crates/core-executor/src/tests/snapshots/query_timestamp_scale.snap
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
source: crates/core-executor/src/tests/query.rs | ||
description: "r#\"SELECT\n TO_TIMESTAMP(1000000000, 0) AS \"Scale in seconds\",\n TO_TIMESTAMP(1000000000, 3) AS \"Scale in milliseconds\",\n TO_TIMESTAMP(1000000000, 6) AS \"Scale in microseconds\",\n TO_TIMESTAMP(1000000000, 9) AS \"Scale in nanoseconds\";\"#" | ||
--- | ||
Ok( | ||
[ | ||
"+---------------------+-----------------------+-----------------------+----------------------+", | ||
"| Scale in seconds | Scale in milliseconds | Scale in microseconds | Scale in nanoseconds |", | ||
"+---------------------+-----------------------+-----------------------+----------------------+", | ||
"| 2001-09-09T01:46:40 | 1970-01-12T13:46:40 | 1970-01-01T00:16:40 | 1970-01-01T00:00:01 |", | ||
"+---------------------+-----------------------+-----------------------+----------------------+", | ||
], | ||
) |
13 changes: 13 additions & 0 deletions
13
crates/core-executor/src/tests/snapshots/query_timestamp_scale_decimal.snap
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
source: crates/core-executor/src/tests/query.rs | ||
description: "r#\"SELECT\n TO_TIMESTAMP(1000000000::DECIMAL, 0) AS \"Scale in seconds\",\n TO_TIMESTAMP(1000000000::DECIMAL, 3) AS \"Scale in milliseconds\",\n TO_TIMESTAMP(1000000000::DECIMAL, 6) AS \"Scale in microseconds\",\n TO_TIMESTAMP(1000000000::DECIMAL, 9) AS \"Scale in nanoseconds\";\"#" | ||
--- | ||
Ok( | ||
[ | ||
"+---------------------+-----------------------+-----------------------+----------------------+", | ||
"| Scale in seconds | Scale in milliseconds | Scale in microseconds | Scale in nanoseconds |", | ||
"+---------------------+-----------------------+-----------------------+----------------------+", | ||
"| 2001-09-09T01:46:40 | 1970-01-12T13:46:40 | 1970-01-01T00:16:40 | 1970-01-01T00:00:01 |", | ||
"+---------------------+-----------------------+-----------------------+----------------------+", | ||
], | ||
) |
13 changes: 13 additions & 0 deletions
13
crates/core-executor/src/tests/snapshots/query_timestamp_scale_decimal_scaled.snap
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
source: crates/core-executor/src/tests/query.rs | ||
description: "r#\"SELECT\n TO_TIMESTAMP(1000000000::DECIMAL, 0) AS \"Scale in seconds\",\n TO_TIMESTAMP(1000000000000::DECIMAL, 3) AS \"Scale in milliseconds\",\n TO_TIMESTAMP(1000000000000000::DECIMAL, 6) AS \"Scale in microseconds\",\n TO_TIMESTAMP(1000000000000000000::DECIMAL, 9) AS \"Scale in nanoseconds\";\"#" | ||
--- | ||
Ok( | ||
[ | ||
"+---------------------+-----------------------+-----------------------+----------------------+", | ||
"| Scale in seconds | Scale in milliseconds | Scale in microseconds | Scale in nanoseconds |", | ||
"+---------------------+-----------------------+-----------------------+----------------------+", | ||
"| 2001-09-09T01:46:40 | 2001-09-09T01:46:40 | 2001-09-09T01:46:40 | 2001-09-09T01:46:40 |", | ||
"+---------------------+-----------------------+-----------------------+----------------------+", | ||
], | ||
) |
13 changes: 13 additions & 0 deletions
13
crates/core-executor/src/tests/snapshots/query_timestamp_scale_int_str.snap
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
source: crates/core-executor/src/tests/query.rs | ||
description: "r#\"SELECT\n TO_TIMESTAMP('1000000000') AS \"Scale in seconds\",\n TO_TIMESTAMP('1000000000000') AS \"Scale in milliseconds\",\n TO_TIMESTAMP('1000000000000000') AS \"Scale in microseconds\",\n TO_TIMESTAMP('1000000000000000000') AS \"Scale in nanoseconds\";\"#" | ||
--- | ||
Ok( | ||
[ | ||
"+---------------------+-----------------------+-----------------------+----------------------+", | ||
"| Scale in seconds | Scale in milliseconds | Scale in microseconds | Scale in nanoseconds |", | ||
"+---------------------+-----------------------+-----------------------+----------------------+", | ||
"| 2001-09-09T01:46:40 | 2001-09-09T01:46:40 | 2001-09-09T01:46:40 | 2001-09-09T01:46:40 |", | ||
"+---------------------+-----------------------+-----------------------+----------------------+", | ||
], | ||
) |
13 changes: 13 additions & 0 deletions
13
crates/core-executor/src/tests/snapshots/query_timestamp_scaled.snap
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
source: crates/core-executor/src/tests/query.rs | ||
description: "r#\"SELECT\n TO_TIMESTAMP(1000000000) AS \"Scale in seconds\",\n TO_TIMESTAMP(1000000000000, 3) AS \"Scale in milliseconds\",\n TO_TIMESTAMP(1000000000000000, 6) AS \"Scale in microseconds\",\n TO_TIMESTAMP(1000000000000000000, 9) AS \"Scale in nanoseconds\";\"#" | ||
--- | ||
Ok( | ||
[ | ||
"+---------------------+-----------------------+-----------------------+----------------------+", | ||
"| Scale in seconds | Scale in milliseconds | Scale in microseconds | Scale in nanoseconds |", | ||
"+---------------------+-----------------------+-----------------------+----------------------+", | ||
"| 2001-09-09T01:46:40 | 2001-09-09T01:46:40 | 2001-09-09T01:46:40 | 2001-09-09T01:46:40 |", | ||
"+---------------------+-----------------------+-----------------------+----------------------+", | ||
], | ||
) |
14 changes: 14 additions & 0 deletions
14
crates/core-executor/src/tests/snapshots/query_timestamp_str_format.snap
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
source: crates/core-executor/src/tests/query.rs | ||
description: "\"SELECT\n TO_TIMESTAMP('04/05/2024 01:02:03', 'mm/dd/yyyy hh24:mi:ss') as a,\n TO_TIMESTAMP('04/05/2024 01:02:03') as b\"" | ||
info: "Setup queries: SET timestamp_input_format = 'mm/dd/yyyy hh24:mi:ss'" | ||
--- | ||
Ok( | ||
[ | ||
"+---------------------+---------------------+", | ||
"| a | b |", | ||
"+---------------------+---------------------+", | ||
"| 2024-04-05T01:02:03 | 2024-04-05T01:02:03 |", | ||
"+---------------------+---------------------+", | ||
], | ||
) |
13 changes: 13 additions & 0 deletions
13
crates/core-executor/src/tests/snapshots/query_timestamp_timestamp.snap
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
source: crates/core-executor/src/tests/query.rs | ||
description: "\"SELECT TO_TIMESTAMP(1000000000::TIMESTAMP)\"" | ||
--- | ||
Ok( | ||
[ | ||
"+-----------------------------------------------+", | ||
"| to_timestamp(to_timestamp(Int64(1000000000))) |", | ||
"+-----------------------------------------------+", | ||
"| 2001-09-09T01:46:40 |", | ||
"+-----------------------------------------------+", | ||
], | ||
) |
14 changes: 14 additions & 0 deletions
14
crates/core-executor/src/tests/snapshots/query_timestamp_timezone.snap
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
source: crates/core-executor/src/tests/query.rs | ||
description: "\"SELECT TO_TIMESTAMP(1000000000)\"" | ||
info: "Setup queries: ALTER SESSION SET timestamp_input_mapping = 'timestamp_tz'" | ||
--- | ||
Ok( | ||
[ | ||
"+---------------------------------+", | ||
"| to_timestamp(Int64(1000000000)) |", | ||
"+---------------------------------+", | ||
"| 2001-09-08T18:46:40-07:00 |", | ||
"+---------------------------------+", | ||
], | ||
) |
This file contains hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.