-
Notifications
You must be signed in to change notification settings - Fork 82
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
Add test that runs DuckDB its test_all_types function #577
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
\x on | ||
SET bytea_output = 'escape'; | ||
SELECT * FROM duckdb.query($$ | ||
FROM test_all_types() | ||
SELECT * exclude( | ||
tinyint, -- PG14 outputs this differently currently | ||
varint, | ||
TIME, | ||
time_tz, | ||
bit, | ||
small_enum, | ||
medium_enum, | ||
large_enum, | ||
timestamptz_array, | ||
struct, | ||
struct_of_arrays, | ||
array_of_structs, | ||
map, | ||
"union", | ||
fixed_int_array, | ||
fixed_varchar_array, | ||
fixed_nested_int_array, | ||
fixed_nested_varchar_array, | ||
fixed_struct_array, | ||
struct_of_fixed_array, | ||
fixed_array_of_int_list, | ||
list_of_fixed_int_array, | ||
nested_int_array, -- The nested array has different lengths, which is not possible in PG | ||
) | ||
$$) | ||
-[ RECORD 1 ]---+------------------------------------------------------------------------------------------------------------------------------------- | ||
bool | f | ||
smallint | -32768 | ||
int | -2147483648 | ||
bigint | -9223372036854775808 | ||
hugeint | 0 | ||
uhugeint | 0 | ||
utinyint | 0 | ||
usmallint | 0 | ||
uint | 0 | ||
ubigint | 0 | ||
date | 07-14-5881580 | ||
timestamp | Sun Jan 10 08:01:49.551616 294247 | ||
timestamp_s | Sun Jan 10 08:01:49.551616 294247 | ||
timestamp_ms | Sun Jan 10 08:01:49.551616 294247 | ||
timestamp_ns | Wed Sep 22 00:00:00 1677 | ||
timestamp_tz | Sun Jan 10 00:01:49.551616 294247 PST | ||
Comment on lines
+42
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All of these underflow currently. I think we should either truncate or throw an error in this case. |
||
float | -3.4028235e+38 | ||
double | -1.7976931348623157e+308 | ||
dec_4_1 | -999.9 | ||
dec_9_4 | -99999.9999 | ||
dec_18_6 | -999999999999.999999 | ||
dec38_10 | -9999999999999999999999999999.9999999999 | ||
uuid | 00000000-0000-0000-0000-000000000000 | ||
interval | @ 0 | ||
varchar | 🦆🦆🦆🦆🦆🦆 | ||
blob | thisisalongblob\000withnullbytes | ||
int_array | {} | ||
double_array | {} | ||
date_array | {} | ||
timestamp_array | {} | ||
varchar_array | {} | ||
-[ RECORD 2 ]---+------------------------------------------------------------------------------------------------------------------------------------- | ||
bool | t | ||
smallint | 32767 | ||
int | 2147483647 | ||
bigint | 9223372036854775807 | ||
hugeint | 170141183460469231731687303715884105727 | ||
uhugeint | 340282366920938463463374607431768211455 | ||
utinyint | 255 | ||
usmallint | 65535 | ||
uint | 4294967295 | ||
ubigint | 18446744073709551615 | ||
date | 07-10-5881580 | ||
timestamp | Sun Jan 10 04:00:54.775806 294247 | ||
timestamp_s | Sun Jan 10 04:00:54 294247 | ||
timestamp_ms | Sun Jan 10 04:00:54.775 294247 | ||
timestamp_ns | Fri Apr 11 23:47:16.854775 2262 | ||
timestamp_tz | Sat Jan 09 20:00:54.775806 294247 PST | ||
float | 3.4028235e+38 | ||
double | 1.7976931348623157e+308 | ||
dec_4_1 | 999.9 | ||
dec_9_4 | 99999.9999 | ||
dec_18_6 | 999999999999.999999 | ||
dec38_10 | 9999999999999999999999999999.9999999999 | ||
uuid | ffffffff-ffff-ffff-ffff-ffffffffffff | ||
interval | @ 83 years 3 mons 999 days 16 mins 39.999999 secs | ||
varchar | goo | ||
blob | \000\000\000a | ||
int_array | {42,999,NULL,NULL,-42} | ||
double_array | {42,NaN,Infinity,-Infinity,NULL,-42} | ||
date_array | {01-01-1970,07-11-5881580,07-13-5881580,NULL,05-12-2022} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the two dates in the middle are displayed by duckdb as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Turns out |
||
timestamp_array | {"Thu Jan 01 00:00:00 1970","Sun Jan 10 04:00:54.775807 294247","Sun Jan 10 04:00:54.775809 294247",NULL,"Thu May 12 16:23:45 2022"} | ||
varchar_array | {🦆🦆🦆🦆🦆🦆,goose,NULL,""} | ||
-[ RECORD 3 ]---+------------------------------------------------------------------------------------------------------------------------------------- | ||
bool | | ||
smallint | | ||
int | | ||
bigint | | ||
hugeint | | ||
uhugeint | | ||
utinyint | | ||
usmallint | | ||
uint | | ||
ubigint | | ||
date | | ||
timestamp | | ||
timestamp_s | | ||
timestamp_ms | | ||
timestamp_ns | | ||
timestamp_tz | | ||
float | | ||
double | | ||
dec_4_1 | | ||
dec_9_4 | | ||
dec_18_6 | | ||
dec38_10 | | ||
uuid | | ||
interval | | ||
varchar | | ||
blob | | ||
int_array | | ||
double_array | | ||
date_array | | ||
timestamp_array | | ||
varchar_array | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
\x on | ||
SET bytea_output = 'escape'; | ||
SELECT * FROM duckdb.query($$ | ||
FROM test_all_types() | ||
SELECT * exclude( | ||
tinyint, -- PG14 outputs this differently currently | ||
varint, | ||
TIME, | ||
time_tz, | ||
bit, | ||
small_enum, | ||
medium_enum, | ||
large_enum, | ||
timestamptz_array, | ||
struct, | ||
struct_of_arrays, | ||
array_of_structs, | ||
map, | ||
"union", | ||
fixed_int_array, | ||
fixed_varchar_array, | ||
fixed_nested_int_array, | ||
fixed_nested_varchar_array, | ||
fixed_struct_array, | ||
struct_of_fixed_array, | ||
fixed_array_of_int_list, | ||
list_of_fixed_int_array, | ||
nested_int_array, -- The nested array has different lengths, which is not possible in PG | ||
) | ||
$$) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bug! We should be returning: