Skip to content
Queria Docs
English
Esc
↑↓navigate↵open⌘Jpreview
On this page

Combine with your local data

JOIN your local CSV / Parquet files with Queria datasets

The Queria CLI and Python API are DuckDB under the hood, so functions like read_csv / read_parquet work as-is. You can JOIN your local files with Queria’s published datasets in a single SQL statement.

Example: add prefecture population to an office list

Say you have an office list offices.csv on hand:

pref,office
東京都,本社
大阪府,西日本支社
福岡県,九州支社

Join it with e-Stat total population using the prefecture name as the key. The dataset side is attached automatically just by referencing it — no setup required:

queria sql "
  SELECT o.office, e.area_name, e.value AS population
  FROM read_csv('offices.csv') o
  JOIN e_stat.ssds.a_pref_population e
    ON e.area_name = o.pref
  WHERE e.item_name = 'A1101_総人口' AND e.year = 2024
  ORDER BY population DESC
"

Use --out to keep the result as a file:

queria sql "..." --out result.parquet

Parquet and JSON work the same way

Any format DuckDB can read combines the same way:

queria sql "
  SELECT *
  FROM read_parquet('sales.parquet') s
  JOIN zipcode.main.mart_zipcode z ON z.zipcode = s.zipcode
"

From Python

The same works with the Python API. The result comes straight back as a pandas DataFrame:

import queria

con = queria.connect()
df = con.sql("""
  SELECT o.office, e.value AS population
  FROM read_csv('offices.csv') o
  JOIN e_stat.ssds.a_pref_population e ON e.area_name = o.pref
  WHERE e.item_name = 'A1101_総人口' AND e.year = 2024
""").df()

Was this page helpful?