Inspection functions in the Tributary DuckDB extension
Function category
Inspection
2 functionsInspect cluster shape and the loaded extension build — broker / topic / partition discovery via `tributary_metadata`, and the version stamp via `tributary_version`.
Signature
tributary_metadata(... := VARCHAR, bootstrap.servers := VARCHAR) → TABLE
Arguments (Named)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
bootstrap.servers
|
Type
VARCHAR
|
Mode Named |
Description
Comma-separated host:port list of brokers to bootstrap from.
|
Argument
...
|
Type
VARCHAR
|
Mode Named |
Description
Varargs
Any other librdkafka configuration name — same surface as tributary_scan_topic.
|
Returns
A table with the following columns:
| Column | Type | Description |
|---|---|---|
Column
brokers
|
Type
STRUCT[]
|
Description Array of broker descriptors — id, host, port. |
Column
topics
|
Type
STRUCT[]
|
Description Array of topic descriptors — name, error, partitions[]. Each partition includes its leader, replicas, and ISR set. |
Description
Inspect a Kafka cluster without consuming from a specific topic. Returns one row containing two arrays: brokers and topics. Useful for discovering what a cluster exposes, sizing partition-parallel scans, or scripting topic-list audits.
1
List every topic on a cluster
SELECT unnest(topics).name AS topic_name
FROM tributary_metadata("bootstrap.servers" := 'kafka:9092');
2
Count partitions per topic
SELECT
t.name AS topic,
array_length(t.partitions) AS partitions
FROM (
SELECT unnest(topics) AS t
FROM tributary_metadata("bootstrap.servers" := 'kafka:9092')
)
ORDER BY partitions DESC;
Related functions
Signature
tributary_version() → VARCHAR
Description
Returns the loaded Tributary extension version as a date-stamped build string (e.g. '20250612.01'). Use to confirm what's loaded when matching against bug reports or release notes.
1
Print the loaded version
SELECT tributary_version();