Loads JupySQL extension with DuckDB setup (incl. GCS auth).
Use in a notebook as follows:
-
Install via pip if not yet installed:
pip install git+https://github.com/grobgl/duckdb-sql-ipython-ext
-
(optional) Prepare GCS credentials:
- Create HMAC keys and store them as
GCS_KEY_ID
andGCS_SECRET
environment variables. - If using a
.env
file, these may have to be loaded into a notebook usingpython-dotenv
:%load_ext dotenv %dotenv /home/serenitydev/.env
- Create HMAC keys and store them as
-
Load extension:
%load_ext duckdb_sql
See JupySQL.
%sql select * from 'gs://example-bucket/**/*-example.parquet' limit 10;
Multi line:
%%sql
select *
from 'gs://example-bucket/**/*-example.parquet'
limit 10
Store result to variable:
%%sql example_df <<
select * from 'gs://example-bucket/**/*-example.parquet' limit 10;