Skip to content

Commit 46e97ae

Browse files
authored
Merge pull request #4036 from ClickHouse/update_supported_types
[kafka] Added supported types. Added annotation about JSON conversion
2 parents f54955c + b6829d9 commit 46e97ae

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/integrations/data-ingestion/kafka/kafka-clickhouse-connect-sink.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ Sink, use [Kafka Connect Transformations](https://docs.confluent.io/platform/cur
136136
| Kafka Connect Type | ClickHouse Type | Supported | Primitive |
137137
| --------------------------------------- |-----------------------| --------- | --------- |
138138
| STRING | String || Yes |
139+
| STRING | JSON. See below (1) || Yes |
139140
| INT8 | Int8 || Yes |
140141
| INT16 | Int16 || Yes |
141142
| INT32 | Int32 || Yes |
@@ -148,11 +149,16 @@ Sink, use [Kafka Connect Transformations](https://docs.confluent.io/platform/cur
148149
| STRUCT | Variant(T1, T2, ...) || No |
149150
| STRUCT | Tuple(a T1, b T2, ...) || No |
150151
| STRUCT | Nested(a T1, b T2, ...) || No |
152+
| STRUCT | JSON. See below (1), (2) || No |
151153
| BYTES | String || No |
152154
| org.apache.kafka.connect.data.Time | Int64 / DateTime64 || No |
153155
| org.apache.kafka.connect.data.Timestamp | Int32 / Date32 || No |
154156
| org.apache.kafka.connect.data.Decimal | Decimal || No |
155157

158+
- (1) - JSON is supported only when ClickHouse settings has `input_format_binary_read_json_as_string=1`. This works only for RowBinary format family and the setting affects all columns in the insert request so they all should be a string. Connector will convert STRUCT to a JSON string in this case.
159+
160+
- (2) - When struct has unions like `oneof` then converter should be configured to NOT add prefix/suffix to a field names. There is `generate.index.for.unions=false` [setting for `ProtobufConverter`](https://docs.confluent.io/platform/current/schema-registry/connect.html#protobuf).
161+
156162
**Without a schema declared:**
157163

158164
A record is converted into JSON and sent to ClickHouse as a value in [JSONEachRow](../../../sql-reference/formats.mdx#jsoneachrow) format.

0 commit comments

Comments
 (0)