New to Kestra?
Use blueprints to kickstart your first workflows.
Orchestrate an Apache Druid to Pandas pipeline with Kestra. Run SQL on Druid, store results as CSV, and process them in Python, all in declarative YAML.
id: druid-to-pandas
namespace: company.team
tasks:
- id: query_druid
type: io.kestra.plugin.jdbc.druid.Query
url: jdbc:avatica:remote:url=http://localhost:8888/druid/v2/sql/avatica/;transparent_reconnection=true
sql: |
SELECT __time as edit_time, channel, page, user, delta, added, deleted
FROM wikipedia
fetchType: STORE
- id: write_to_csv
type: io.kestra.plugin.serdes.csv.IonToCsv
from: "{{ outputs.query_druid.uri }}"
- id: process_using_pandas
type: io.kestra.plugin.scripts.python.Script
dependencies:
- pandas
script: |
import pandas as pd
df = pd.read_csv("{{ outputs.write_to_csv.uri }}")
df.head()
Move analytical data out of Apache Druid and into a Python workflow without glue scripts. This blueprint runs a SQL query against Druid over its Avatica JDBC endpoint, serializes the result set to CSV, and hands the file to a Pandas script for downstream analysis. It solves the common gap between a real-time analytics database and the Python tooling that data scientists and analysts actually use for transformation, feature engineering, and reporting.
query_druid task (io.kestra.plugin.jdbc.druid.Query) connects to Druid through the Avatica JDBC URL and runs a SQL SELECT over the wikipedia datasource. With fetchType: STORE, the full result set is written to Kestra internal storage as an Ion file and exposed as a URI.write_to_csv task (io.kestra.plugin.serdes.csv.IonToCsv) reads that Ion output and converts it to a CSV file, producing a clean tabular artifact.process_using_pandas task (io.kestra.plugin.scripts.python.Script) declares pandas as a dependency, reads the CSV with pd.read_csv, and runs your analysis logic.Druid is excellent at serving sub-second analytical queries, but it has no native scheduler to extract data, convert formats, and trigger downstream Python on a cadence or in response to an event. Kestra fills that gap: event and schedule triggers kick off the pipeline, per-task retries handle transient JDBC failures, execution outputs give you lineage from query to CSV to script, and the whole flow is declarative YAML you can version and review.
This blueprint connects to a local Druid endpoint and references no secret() values. When pointing at a secured Druid deployment, move credentials into Kestra secrets and inject them into the JDBC url, username, and password properties rather than hardcoding them.
url property to your Druid Avatica endpoint.df.head() with real transformations, aggregations, or feature engineering.