xvrl commented on a change in pull request #11630:
URL: https://github.com/apache/druid/pull/11630#discussion_r720590563
##########
File path: docs/ingestion/data-formats.md
##########
@@ -151,6 +151,57 @@ Be sure to change the `delimiter` to the appropriate
delimiter for your data. Li
}
```
+### KAFKA
+
+The `inputFormat` to load complete kafka record including header, key and
value. An example is:
+
+```json
+"ioConfig": {
+ "inputFormat": {
+ "type": "kafka",
+ "headerLabelPrefix": "kafka.header.",
+ "timestampColumnName": "kafka.timestamp",
+ "keyColumnName": "kafka.key",
+ "headerFormat":
+ {
+ "type": "string"
+ },
+ "keyFormat":
+ {
+ "type": "json"
+ },
+ "valueFormat":
+ {
+ "type": "json"
+ }
+ },
+ ...
+}
+```
+
+The KAFKA `inputFormat` has the following components:
+
+| Field | Type | Description | Required |
+|-------|------|-------------|----------|
+| type | String | This should say `kafka`. | yes |
+| headerLabelPrefix | String | A custom label prefix for all the header
columns. | no (default = "kafka.header.") |
+| timestampColumnName | String | Specifies the name of the column for the
kafka record's timestamp.| no (default = "kafka.timestamp") |
+| keyColumnName | String | Specifies the name of the column for the kafka
record's key.| no (default = "kafka.key") |
+| headerFormat | Object | headerFormat specifies how to parse the kafka
headers. Current supported type is "string". | no |
+| keyFormat | [InputFormat](#input-format) | keyFormat can be any existing
inputFormat to parse the kafka key. The current behavior is to only process the
first entry of the input format. See [the below
section](../development/extensions-core/kafka-ingestion.md#specifying-data-format)
for details about specifying the input format. | no |
+| valueFormat | [InputFormat](#input-format) | valueFormat can be any existing
inputFormat to parse the kafka value payload. See [the below
section](../development/extensions-core/kafka-ingestion.md#specifying-data-format)
for details about specifying the input format. | yes |
+
+```
+> For any conflicts in dimension/metric names, this inputFormat will prefer
kafka value's column names.
+> This will enable seemless porting of existing kafka ingestion inputFormat to
this new format, with additional columns from kafka header and key.
+
+> Kafka input format fundamentally blends information from header, key and
value portions of a kafka record to create a druid row. It does this by
+> exploding individual records from the value and augmenting each of these
values with the selected key/header columns.
+
+> Kafka input format also by default exposes kafka timestamp
(timestampColumnName), which can be used as the primary timestamp column.
+> One can also choose timestamp column from either key or value payload, if
there is no timestamp available then the default kafka timestamp is our savior.
Review comment:
how does one choose the value or key timestamp? maybe an example would
help.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]