Reading files

We have a couple of functions named read_*, which ask the DB to read files, designed for DuckDB:

PRQL

from (read_parquet 'artists.parquet')
join (read_csv 'albums.csv') [==track_id]

SQL

WITH table_0 AS (
  SELECT
    *
  FROM
    read_parquet('artists.parquet')
),
table_1 AS (
  SELECT
    *
  FROM
    read_csv_auto('albums.csv')
)
SELECT
  table_2.*,
  table_3.*
FROM
  table_0 AS table_2
  JOIN table_1 AS table_3 ON table_2.track_id = table_3.track_id

Note

These don’t currently have all the DuckDB options. If those would be helpful, please log an issue and it’s a fairly easy addition.

Info

We may be able to reduce the boilerplate WITH table_x AS SELECT * FROM... in future versions.