This example shows how to query Apache Pinot from a Jupyter notebook using JupySQL and the pinotdb Python client. It is meant for local EDA: SQL magics, pandas DataFrames, and simple plots.
Related issue: #10160
A running batch quickstart (loads the baseballStats table). The broker SQL
endpoint is port 8000 (not 8099, which appears in some older client snippets).
The controller UI is port 9000.
From the Pinot repo root, after ./mvnw clean install -DskipTests -Pbin-dist:
./build/bin/quick-start-batch.shdocker run --name pinot-quickstart \
-p 2123:2123 -p 9000:9000 -p 8000:8000 \
-d apachepinot/pinot:latest QuickStart -type batchWait until the controller UI at http://localhost:9000 is up.
cd contrib/jupyter-jupysql
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
jupyter notebook pinot_jupysql_eda.ipynbConnection string used in the notebook (broker 8000, controller 9000).
The engine is created with use_multistage_engine=true so JupySQL %sqlplot
CTEs are accepted:
pinot://localhost:8000/query/sql?controller=http://localhost:9000/
To execute all cells headlessly (quickstart must already be running):
jupyter nbconvert --to notebook --execute pinot_jupysql_eda.ipynb --output pinot_jupysql_eda.executed.ipynb