Skip to content

Kafka exporter

Kafka exporter

The Kafka exporter: a separate SQLLoad mode that runs continuously and streams Kafka topics into Snowflake, Databricks (beta) or BigQuery (beta) tables.

The Kafka exporter is a separate mode of SQLLoad. It runs continuously, reading Kafka topics and writing each topic into a Snowflake, Databricks (beta) or BigQuery (beta) table, through a streaming route or staged files.

Load project Kafka exporter
sqlload.toml [connections], [targets] and [sources] [source] with kind = "kafka", [destination] and [staging], plus the optional sections in Configuration
Runs Once per sqlload load Continuously: sqlload run exports until stopped, or for --max-duration
Destinations Every target Snowflake, Databricks (beta), BigQuery (beta); see How rows reach the warehouse
Commands debug, plan, apply, load, copy, contract, logged-state debug, tables, plan, apply, run, status

load, copy, contract and logged-state refuse an exporter configuration. A minimal one, streaming into Snowflake, follows; the repository’s sqlload.example.toml is a complete one.

[source]
kind = "kafka"
brokers = "${ENV:KAFKA_BROKERS}"
include = ["shop.*"]
[destination]
kind = "snowflake"
account = "myorg-myaccount"
user = "SQLLOAD"
auth = { method = "pat", token = "${ENV:SNOWFLAKE_TOKEN}" }
database = "RAW"
schema = "KAFKA"
[staging]
kind = "none"

For Databricks, change only [destination]:

[destination]
kind = "databricks"
host = "dbc-1234.cloud.databricks.com"
client_id = "${ENV:DATABRICKS_CLIENT_ID}"
client_secret = "${ENV:DATABRICKS_CLIENT_SECRET}"
warehouse_id = "${ENV:DATABRICKS_WAREHOUSE_ID}"
catalog = "main"
schema = "kafka"
zerobus_endpoint = "https://123456.zerobus.us-west-2.cloud.databricks.com"

And for BigQuery:

[destination]
kind = "bigquery"
project = "my-project"
dataset = "kafka"
location = "EU"
service_account_key = "${ENV:BIGQUERY_KEY}"
Page Covers
Run it The commands in order, how rows reach each destination, and running several instances.
Configuration Every section and key of the exporter’s sqlload.toml, with defaults.
Topic naming How topics map to tables, stages, pipes and consumer groups.