seokyun-ha-toss opened a new pull request, #15283:
URL: https://github.com/apache/iceberg/pull/15283
## Summary
Add support for converting arbitrary Java objects (e.g. `Map<String,
Object>`, lists, primitives) into Iceberg **Variant** type in the Kafka Connect
RecordConverter. Nested maps and lists are converted recursively so that
structures like `{"user": {"name": "alice", "address": {"city": "Seoul", "zip":
"12345"}}}` are correctly represented as a single Variant.
## Motivation
Kafka Connect payloads often come as schema-less or JSON-like maps. To write
them into Iceberg tables with a Variant column, the connector must convert
these Java objects into the Variant format (metadata + value) and support
nested maps/arrays without losing structure or key names.
## Behaviour
| Input | Result |
|-------|--------|
| **Primitives** (String, int, long, boolean, etc.) | Single metadata
(empty) + corresponding Variant primitive. |
| **Flat map** e.g. `{"a": 1, "b": "x"}` | One metadata with keys `["a",
"b"]`, one ShreddedObject with two fields. |
| **Nested map** e.g. `{"user": {"name": "alice", "address": {"city":
"Seoul", "zip": "12345"}}}` | One shared metadata for all keys; root and nested
objects as ShreddedObjects with consistent field IDs. |
| **Lists** | Converted to **VariantArray** with elements converted
recursively. |
| **Already Variant / ByteBuffer** | Pass-through or
`Variant.from(ByteBuffer)` where appropriate. |
## Relates
- https://github.com/apache/iceberg/issues/10392
Thanks, Good Day!
--
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]