-
Notifications
You must be signed in to change notification settings - Fork 216
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
test: clickhouse integration tests #2815
Conversation
Oh, I see. The order of the Clickhouse results seems to be random. I have observed that the order of the results changes each time I run the following query. WITH table_0 AS (
SELECT
13 AS x_int,
13.0 AS x_float,
5 AS k_int,
5.0 AS k_float
UNION
ALL
SELECT
-13 AS x_int,
-13.0 AS x_float,
5 AS k_int,
5.0 AS k_float
UNION
ALL
SELECT
13 AS x_int,
13.0 AS x_float,
-5 AS k_int,
-5.0 AS k_float
UNION
ALL
SELECT
-13 AS x_int,
-13.0 AS x_float,
-5 AS k_int,
-5.0 AS k_float
)
SELECT
(x_int / k_int)
FROM
table_0 @max-sixty @aljazerzen Do you think we can add a |
Yes I think that's OK — it doesn't limit any SQL functionality. Feel free to merge this with most queries excluded and then follow-up with changed queries unexcluded. I also think we could have the Unsupported dialects look for e.g. (Though maybe that's harder than just adding |
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.
Great!
@@ -81,11 +81,12 @@ impl Dialect { | |||
| Dialect::SQLite | |||
| Dialect::Postgres | |||
| Dialect::MySql | |||
| Dialect::MsSql => SupportLevel::Supported, | |||
| Dialect::MsSql | |||
| Dialect::ClickHouse => SupportLevel::Supported, |
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.
Depending on how many exclusions we need, we could move this down a rung. (Probably we should do that for MsSql too)
Note: ClickHouse doesn't have |
fe4ad02
to
4beff3d
Compare
The problem that we are currently experiencing is that the results of the following query. prql/prql-compiler/tests/integration/queries/switch.prql Lines 1 to 8 in f35c7e5
This is not a connection problem, as the following SQL via MySQL CLI reproduces it. WITH table_0 AS (
SELECT
CASE
WHEN composer IS NOT NULL THEN composer
WHEN genre_id < 17 THEN 'no composer'
ELSE 'unknown composer'
END AS display,
milliseconds
FROM
tracks
ORDER BY
milliseconds
LIMIT
10
)
SELECT
display
FROM
table_0
ORDER BY
milliseconds
|
I expected it to be a case when issue, but the following example works....... from [
{x = '3'},
{x = '1'},
]
select x = case {
x == '3' => 'fiz',
true => x,
}
|
Oh, I understand. Perhaps this is being read as an empty character rather than WITH table_0 AS (
SELECT
CASE
WHEN composer != '' THEN composer
WHEN genre_id < 17 THEN 'no composer'
ELSE 'unknown composer'
END AS display,
milliseconds
FROM
tracks
ORDER BY
milliseconds
LIMIT
10
)
SELECT
display
FROM
table_0
ORDER BY
milliseconds
|
It seems to be correctly recognized as NULL when reading csv. Perhaps a problem with the table type definition? > SELECT composer FROM file('/var/lib/clickhouse/user_files/chinook/tracks.csv') limit 5;
+------------------------------------------------------------------------+
| composer |
+------------------------------------------------------------------------+
| Angus Young, Malcolm Young, Brian Johnson |
| NULL |
| F. Baltes, S. Kaufman, U. Dirkscneider & W. Hoffman |
| F. Baltes, R.A. Smith-Diesel, S. Kaufman, U. Dirkscneider & W. Hoffman |
| Deaffy & R.A. Smith-Diesel |
+------------------------------------------------------------------------+
5 rows in set (0.010 sec) |
Ok, > WITH table_0 AS (
-> SELECT
-> CASE
-> WHEN composer IS NOT NULL THEN composer
-> WHEN genre_id < 17 THEN 'no composer'
-> ELSE 'unknown composer'
-> END AS display,
-> milliseconds
-> FROM
-> tracks
-> ORDER BY
-> milliseconds
-> LIMIT
-> 10
-> )
-> SELECT
-> display
-> FROM
-> table_0
-> ORDER BY
-> milliseconds;
+------------------+
| display |
+------------------+
| Samuel Rosa |
| no composer |
| no composer |
| no composer |
| L. Muggerud |
| no composer |
| L. Muggerud |
| unknown composer |
| Gilberto Gil |
| Chico Science |
+------------------+
10 rows in set (0.011 sec) |
It seems working now 🎉 |
Great work!! |
Close #2813, based on #2814
Same as #2811