The Variant type allows a single column to hold values of different data types, enabling flexible handling of semi-structured data without defining a rigid schema upfront. StreamNative Ursa supports the Variant type for both Apache Iceberg (V3) and Delta Lake tables.Documentation Index
Fetch the complete documentation index at: https://docs.streamnative.io/llms.txt
Use this file to discover all available pages before exploring further.
Important: Variant type support is disabled by default. Contact the StreamNative Support Team to enable the feature flag before using Variant types.
Enabling Variant Support
Variant support is gated by a small set of broker properties. The required combination depends on the target table format.| Property | Default | Description |
|---|---|---|
variantTypeEnabled | false | Master switch for Variant support. Required for both Iceberg and Delta. |
tableEvolveSchemaEnabled | true | Schema evolution must remain enabled so Variant fields can be added/removed during writes. Required for both Iceberg and Delta. |
allowIcebergV3 | false | Enables Iceberg V3 features (including Variant). Required for Iceberg, ignored for Delta. |
Iceberg
Set the following properties on the compaction servicecustom config:
Downstream query engine compatibility: When allowIcebergV3 is enabled, the downstream query engine reading the table must also support Iceberg V3. Older Spark / Trino / Athena versions that only support Iceberg V2 will fail to read tables that use Variant or other V3-only features. Verify your engine’s Iceberg support level before enabling.
Delta Lake
Delta Lake’s Variant type is not gated by an Iceberg version flag. Only the master switch and schema evolution are required:Supported Data Types
- Primitives:
string,int,long,float,double,boolean,bytes - Complex types:
map,list / array,set - Nested POJOs and entire POJOs
Configure Variant in Pulsar
Avro Schema
Use the@AvroSchema annotation with logicalType: "variant":
JSON Schema
Use@JsonPropertyDescription with the Variant annotation:
ProtobufNative Schema
Define a custom field option namedlogical_type:
Configure Variant in Ursa (Kafka Protocol)
Avro Schema — POJO Annotation
Same@AvroSchema annotations as Pulsar. Produce data using ReflectionAvroSerializer (do not use KafkaAvroSerializer).
Avro Schema — Inline Definition
DefinelogicalType: "variant" directly in the Avro schema:
JSON Schema
Same@JsonPropertyDescription("logicalType: variant") annotations as Pulsar.
Protobuf Schema
Protobuf is supported via the samelogical_type custom field option as Pulsar’s ProtobufNative schema. Define the option once in your .proto file and tag each Variant field:
Performance Optimization
Usevariant-metadata-fields to specify fields that should be extracted as top-level columns. This accelerates query performance by enabling predicate pushdown on those fields:
Schema Evolution Rules for Variant
| Operation | Supported |
|---|---|
| Adding new Variant fields | Yes |
| Removing existing Variant fields | Yes |
| Converting non-Variant field to Variant | No (messages sent to Dead Letter Table) |
| Converting Variant field to another type | No (messages sent to Dead Letter Table) |