Queries icon
IonToExcel icon

Extract and transform a Parquet file using DuckDB and export it in Excel

Read a remote Parquet file with DuckDB, run SQL in process, and export the result set to a native Excel workbook with Kestra orchestration.

Categories
Data
id: parquet-duckdb-to-excel
namespace: company.team

tasks:
  - id: parquet_duckdb
    type: io.kestra.plugin.jdbc.duckdb.Queries
    sql: |
      INSTALL parquet;
      LOAD parquet;
      INSTALL httpfs;
      LOAD httpfs;
      SELECT * 
      FROM
      read_parquet('https://huggingface.co/datasets/kestra/datasets/resolve/main/jaffle-large/raw_items.parquet?download=true')
      LIMIT 1000000;
    fetchType: STORE

  - id: duckdb_to_excel
    type: io.kestra.plugin.serdes.excel.IonToExcel
    from: "{{ outputs.parquet_duckdb.outputs[0].uri }}"

Turn a large remote Parquet dataset into a ready to share Excel file without spinning up a database or writing glue code. This blueprint reads a Parquet file directly over HTTP with DuckDB, runs SQL in process, and serializes the result set to a native .xlsx workbook. It solves a common last mile reporting problem: analytics live in columnar Parquet on object storage or a data lake, but business users still want a spreadsheet they can open, filter, and pivot in Excel.

How it works

  1. The parquet_duckdb task (io.kestra.plugin.jdbc.duckdb.Queries) installs and loads the parquet and httpfs DuckDB extensions, then runs read_parquet() against a remote Hugging Face URL. The query selects up to one million rows from a sample e-commerce items dataset and uses fetchType: STORE so the full result set is written to Kestra internal storage as an Ion file rather than held in memory.
  2. The duckdb_to_excel task (io.kestra.plugin.serdes.excel.IonToExcel) reads that stored Ion file via {{ outputs.parquet_duckdb.outputs[0].uri }} and converts it into an Excel workbook you can download from the execution outputs.

What you get

  • A single .xlsx file generated from columnar Parquet data.
  • In process SQL transformation with zero external database to provision.
  • Direct reads from remote storage over HTTP via the DuckDB httpfs extension.
  • A row cap that keeps the export within Excel's roughly one million row limit.

Who it's for

  • Data analysts and analytics engineers who publish spreadsheets to business stakeholders.
  • Data engineers building lightweight extract and convert pipelines without a warehouse.
  • Operations and finance teams that consume reports in Excel.

Why orchestrate this with Kestra

DuckDB is an embedded engine with no scheduler, no retries, and no run history of its own. Kestra wraps the query in a declarative YAML flow you can put on event triggers or schedules, retry on transient HTTP or extension load failures, and track end to end with execution logs and data lineage across the two tasks. The intermediate Ion file is passed between tasks through Kestra internal storage, so each step stays isolated and reproducible.

Prerequisites

  • A running Kestra instance.
  • Outbound network access so DuckDB can fetch the remote Parquet file.

Secrets

This blueprint reads a public dataset over HTTP and uses no secrets. If you point it at a private bucket, add the relevant credentials as Kestra secrets and reference them in the DuckDB connection or httpfs configuration.

Quick start

  1. Copy this flow into your Kestra instance.
  2. Run it as is to generate an Excel file from the sample dataset.
  3. Open the execution and download the .xlsx output from duckdb_to_excel.

How to extend

  • Swap the read_parquet() URL for your own Parquet file on S3, GCS, or Azure and configure httpfs credentials.
  • Replace SELECT * with aggregations, joins, or filters to shape the report.
  • Add a schedule or flow trigger to refresh the spreadsheet automatically.
  • Chain a notification or upload task to deliver the workbook to email, Slack, or object storage.

Links

Orchestrate with Kestra
Orchestrate DuckDB with Kestra
Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.