On this page
Kafka stream (kafka)¶
YAML location: an entry in a flowgroup’s actions list.
Source selector: source.type: kafka.
Streams from Apache Kafka (or Kafka-protocol-compatible endpoints) into a
temporary view. Fields live under source:.
Minimal example¶
Add this entry to the actions list in your flowgroup.
- name: load_events
type: load
source:
type: kafka
bootstrap_servers: "broker1:9092,broker2:9092"
subscribe: orders
target: v_events
Source fields¶
Field |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
Yes |
— |
Must be |
|
string |
Yes |
— |
Maps to |
|
string |
One of |
— |
Topic(s). Provide exactly one of |
|
string |
One of |
— |
Topic regex. One of the three subscription methods. |
|
string (JSON) |
One of |
— |
Partition assignment. One of the three subscription methods. |
|
mapping |
No |
— |
Extra |
readMode must be stream (batch is rejected). Kafka returns binary
key/value columns — deserialize them in a downstream transform.
Read mode placement¶
Prefer action-level readMode alongside source and target.
The generator also accepts source.readMode as a fallback. An action-level
value takes precedence when both are supplied.
Action-level fields¶
These fields apply to every load sub-type. name, type, source and target are required.
Field |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
Yes |
— |
Unique action name within the flowgroup. |
|
string |
Yes |
— |
Always |
|
mapping |
Yes |
— |
Source configuration. |
|
string |
Yes |
— |
Name of the temporary view this action creates. |
|
string |
No |
sub-type |
|
|
string |
No |
auto |
Docstring for the generated view function. |
|
bool or list[string] |
No |
— |
Explicit column names to add; action-level |
|
list[string] |
No |
— |
Extra upstream table or view references added to the dependency graph. See Dependency analysis reference. |
See the worked guide or choose another load source.
For the upstream option definitions, see the Spark Kafka integration reference.