Log icon
Download icon
Script icon
Docker icon
If icon
Fail icon
Upload icon
Set icon
SlackIncomingWebhook icon

Polars and DuckDB High-Performance Parquet Lakehouse Pipeline

Vectorized CSV ETL using Polars, in-memory contract auditing with DuckDB, and automated ZSTD Parquet publication to AWS S3 with Slack alerts.

Categories
CloudData

How it works

  1. HTTP Ingestion: Streams raw CSV data from external HTTP/HTTPS endpoints into Kestra internal storage.
  2. Vectorized Polars Processing: Spawns an isolated Docker container with polars to execute multithreaded filtering, type casting, schema validation, and ZSTD-compressed Parquet export.
  3. DuckDB In-Memory Contract Audit: Loads the Parquet artifact in memory using duckdb to audit column contracts, verify record count thresholds, and detect negative or null anomalies.
  4. Quality Gate Evaluation: Evaluates audit outputs with io.kestra.plugin.core.flow.If, aborting downstream writes if any schema violations are discovered.
  5. AWS S3 Lakehouse Upload: Archives the verified Parquet artifact into the partitioned S3 lakehouse bucket.
  6. KV Cataloging & Notification: Updates the Kestra KV Store with the latest dataset URI and notifies data engineering channels via Slack.

What you get

  • 10x-50x faster data processing combining Polars and DuckDB over traditional Pandas scripts.
  • Automated contract enforcement preventing silent schema corruption in lakehouse storage.
  • Zero external infrastructure overhead: runs entirely inside ephemeral Docker runners.
  • Full disaster and audit lineage stored in Kestra KV store.

Who it's for

  • Analytics Engineers and Data Platform teams building modern lakehouse architectures.
  • Data Engineers seeking blazingly fast local-first ETL before publishing to S3 or Athena.

Why orchestrate this with Kestra

  • Seamlessly sequences containerized Python scripts (io.kestra.plugin.scripts.runner.docker.Docker) with cloud storage plugins (io.kestra.plugin.aws.s3.Upload).
  • Provides native conditional logic, secret protection, retry handling, and centralized execution observability.

Prerequisites

  • AWS S3 bucket with write permissions.
  • Slack webhook URL for notifications.

Secrets

  • AWS_ACCESS_KEY_ID: AWS IAM access key with S3 PutObject permission.
  • AWS_SECRET_ACCESS_KEY: AWS IAM secret key.
  • SLACK_WEBHOOK_URL: Webhook URL for alerting.

Quick start

  1. Import this blueprint into your Kestra instance.
  2. Set AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and SLACK_WEBHOOK_URL in your namespace secrets.
  3. Trigger manually or configure a schedule to process incoming datasets periodically.

How to extend

  • Add an automated query step that triggers AWS Athena or DuckDB over S3 to generate analytics summaries.
  • Expand schema checks to support Great Expectations or custom SQL assertions.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.