Visitar URL original
pinot/contrib/jupyter-jupysql at master · apache/pinot · GitHub
Skip to content

Latest commit

 

History

History

jupyter-jupysql

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Query Pinot from Jupyter with JupySQL

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

Prerequisites

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.

Option A — local binary (this checkout)

From the Pinot repo root, after ./mvnw clean install -DskipTests -Pbin-dist:

./build/bin/quick-start-batch.sh

Option B — Docker

docker run --name pinot-quickstart \
  -p 2123:2123 -p 9000:9000 -p 8000:8000 \
  -d apachepinot/pinot:latest QuickStart -type batch

Wait until the controller UI at http://localhost:9000 is up.

Run the notebook

cd contrib/jupyter-jupysql
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
jupyter notebook pinot_jupysql_eda.ipynb

Connection 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