xvrl commented on a change in pull request #11630:
URL: https://github.com/apache/druid/pull/11630#discussion_r718729851
##########
File path: docs/ingestion/data-formats.md
##########
@@ -151,6 +151,51 @@ 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 | Object | keyFormat can be any existing inputFormat to parse the
kafka key. See [the below
section](../development/extensions-core/kafka-ingestion.md#specifying-data-format)
for details about specifying the input format. | no |
+| valueFormat | Object | 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.
+```
+
Review comment:
can we explain how the input format works, and how it explodes
individual records from the value and adds the corresponding key / header
columns. I think that's important to understand.
We also need to explain the timestamp behavior and how one can use either
the Kafka timestamp or the value timestamp for when they want to migrate from
the existing. We should also explain whether it is possible or not possible to
use a field from the key payload as timestamp or not.
--
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]