Skip to content

Commit 2e404ec

Browse files
update duckdb sql generated from prql to prql v0.9.1 compiler output
1 parent 22f2ade commit 2e404ec

File tree

4 files changed

+34
-19
lines changed

4 files changed

+34
-19
lines changed

data/chinook/duckdb/employees-by-age.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ SELECT
33
first_name,
44
last_name,
55
birth_date,
6-
(DATE '2023-02-12' - birth_date) / 365 AS age
6+
((DATE '2023-10-14' - birth_date) / 365) AS age
77
FROM
88
employees
99

10-
-- Generated by PRQL compiler version:0.5.0 target:sql.duckdb (https://prql-lang.org)
10+
-- Generated by PRQL compiler version:0.9.1 target:sql.duckdb (https://prql-lang.org)

data/chinook/duckdb/employees-by-birth-date.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ FROM
88
ORDER BY
99
birth_date
1010

11-
-- Generated by PRQL compiler version:0.5.0 target:sql.duckdb (https://prql-lang.org)
11+
-- Generated by PRQL compiler version:0.9.1 target:sql.duckdb (https://prql-lang.org)
Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
1-
WITH table_1 AS (
2-
SELECT
3-
*,
4-
ROW_NUMBER() OVER (
5-
PARTITION BY title
6-
ORDER BY
7-
hire_date
8-
) AS _expr_0
9-
FROM
10-
employees
11-
)
121
SELECT
13-
* EXCLUDE (_expr_0)
2+
DISTINCT ON (title) *
143
FROM
15-
table_1
16-
WHERE
17-
_expr_0 <= 1
4+
employees
5+
ORDER BY
6+
title,
7+
hire_date
188

19-
-- Generated by PRQL compiler version:0.5.0 target:sql.duckdb (https://prql-lang.org)
9+
-- Generated by PRQL compiler version:0.9.1 target:sql.duckdb (https://prql-lang.org)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
WITH table_0 AS (
2+
SELECT
3+
*
4+
from
5+
read_parquet(
6+
"s3://gbif-open-data-us-east-1/occurrence/2023-03-01/occurrence.parquet/000000"
7+
)
8+
)
9+
SELECT
10+
genus,
11+
species,
12+
COUNT(*) AS total
13+
FROM
14+
table_0
15+
WHERE
16+
genus = 'Anas'
17+
GROUP BY
18+
genus,
19+
species
20+
ORDER BY
21+
total DESC
22+
LIMIT
23+
10
24+
25+
-- Generated by PRQL compiler version:0.9.1 target:sql.duckdb (https://prql-lang.org)

0 commit comments

Comments
 (0)