forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ClickHouse#61491 from ClickHouse/definitive-cast
A definitive guide to CAST
- Loading branch information
Showing
4 changed files
with
426 additions
and
3 deletions.
There are no files selected for viewing
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
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
77 changes: 77 additions & 0 deletions
77
tests/queries/0_stateless/03011_definitive_guide_to_cast.reference
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
123 | ||
2009-02-14 00:31:30 | ||
[1,2,3] | ||
123 Nullable(UInt8) | ||
\N Nullable(UInt8) | ||
1 | ||
255 | ||
['Hello','wo\'rld\\'] | ||
Hello wo\\\'rld\\\\ | ||
wo\'rld\\ wo\\\'rld\\\\ | ||
133 210 | ||
210 | ||
[123,456] | ||
1 -1 | ||
[] [] Array(Nothing) Array(Array(Array(Tuple(UInt64, String)))) | ||
1970-01-01 01:00:00 | ||
2009-02-14 00:31:30.123456 | ||
1970-01-01 00:59:59.888889 | ||
2009-02-14 00:31:30 | ||
1970-01-01 01:00:00 | ||
2299-12-31 23:59:59.000000 | ||
2009-02-14 | ||
2009-02-14 | ||
123\0\0 | ||
123 | ||
123 | ||
123 | ||
123 | ||
123 | ||
123 | ||
123 | ||
123 | ||
123 | ||
123 | ||
String 123 | ||
123 UInt8 | ||
200 UInt8 | ||
123 | ||
123 | ||
1.1 | ||
1.10000000000000016387 | ||
18446744073709551615 | ||
[1.1,2.3] | ||
[1.10000000000000016387,2.29999999999999967236] | ||
Row 1: | ||
────── | ||
CAST('1.1', 'Decimal(30, 20)'): 1.1 | ||
CAST('1.1', 'Decimal(30, 20)'): 1.1 | ||
CAST(plus(1, 1), 'UInt8'): 2 | ||
-1 | ||
\N | ||
0 | ||
255 | ||
123 | ||
Hello\0\0\0\0\0 | ||
Hello\0\0\0\0\0 | ||
123.45 | ||
2024-04-25 01:02:03 | ||
2024-04-25 01:02:03.000000 | ||
2024-04-25 01:02:03 | ||
2024-04-25 01:02:03.456789 | ||
2024-03-16 11:01:25 | ||
2024-03-16 19:01:25 | ||
2024-03-16 19:01:25 | ||
2024-03-16 11:01:25 | ||
123 \N \N \N | ||
123 0 0 0 | ||
Nullable(UInt8) UInt8 | ||
123 | ||
123 | ||
123 | ||
\N | ||
2024-04-25 2024-01-01 02:03:04 1 12 | ||
2024-04-25 2024-01-01 02:03:04.000000 2009-02-14 00:31:30 | ||
2024-04-25 2024-01-01 02:03:04.000000 2009-02-14 00:31:30 | ||
1986-04-25 13:00:00 | ||
14 |
Oops, something went wrong.