Skip to content

Tributary

Read Apache Kafka topics from DuckDB SQL.

177,813
extension loads · last 90 days
On this page

Technical Overview

Kafka topics you can WHERE and JOIN

What this extension is for

  • Snapshot a topic: One CREATE TABLE AS materializes the current contents of a topic for offline analysis.
  • Join Kafka with local data: JOIN topic rows against a local DuckDB table — the typical pattern for enriching events with reference data on the fly.
  • Inspect a cluster: Cluster-metadata queries return broker and topic descriptors as a row — useful for scripted audits and partition-parallel scan planning.
  • Ad-hoc analytics: Count, group, window, or aggregate the messages currently on a topic — without building a Kafka Streams or Flink job for a one-off question.

How it works

  • Configuration is parameter-passthrough: No Tributary-specific auth or transport settings. Every name in librdkafka's CONFIGURATION reference is accepted as a named SQL parameter.
  • Multi-partition parallelism: Each partition is read concurrently, so cluster scans scale with topic partition count rather than serializing through one consumer.
  • Output shape: Each row is (topic, partition, offset, message). The message is a BLOB — decode it in SQL with DuckDB's JSON functions, Avro/Protobuf extensions, or decode(...).
  • No catalog, no secrets: There is no ATTACH ... (TYPE tributary) and no managed CREATE SECRET TYPE tributary. Every call passes its own credentials through named parameters — source them from getenv() and pass via SQL variables so they never appear inline in queries.

Production caveats

  • Reads, not writes: The verified function surface is consumer-side. There is no documented producer / write-back function — for cache-priming or topic-publishing workflows, keep a real Kafka producer.
  • Whole-topic scan by default: A scan reads the topic's current contents end-to-end. Scope with WHERE on partition/offset/timestamp, or set auto.offset.reset := 'latest'.
  • Credentials in named parameters: Pass SASL / SSL credentials via bind variables seeded from getenv() so they don't appear in cached SQL plans.
  • Experimental status: The function surface may change as more librdkafka paths get exposed. Pin a known-good extension version.

Common Use Cases

Deep Dive

Technical Details

Install

INSTALL tributary FROM community;
LOAD tributary;

Quick Start

Scan an entire Kafka topic

SELECT *
FROM tributary_scan_topic('test-topic',
                          "bootstrap.servers" := 'localhost:9092');

Reference

Extension Contents

Quick reference to all available functions and settings organized by category.

Name Description
Inspection
tributary_metadata() Inspect a Kafka cluster without consuming from a specific topic.
tributary_version() Returns the loaded Tributary extension version as a date-stamped build string (e.g.
Reading
tributary_scan_topic() Read messages from a Kafka topic as DuckDB rows.

API Reference

Function Documentation

Practical Examples

Cookbook

Real-world recipes and patterns for common use cases.

Platform Support

Compatibility

Extension availability may vary by platform and DuckDB version. Check below to ensure this extension supports your environment before installation.

Quick Facts

Release status Experimental
Software License MIT
Pricing Free
Written In C++
Source Available Yes
View on GitHub
Usage
177,813
loads · last 90 days

Platforms

Platform availability hasn't been recorded for this extension yet.

DuckDB & Haybarn

Release calendar
Not recorded for this extension.