Class
ai.startree.pinot.plugin.inputformat.pulsar.PulsarKeyValueAvroMessageDecoder
When to Use
Use this decoder when:- Your realtime table consumes from Apache Pulsar.
- The Pulsar topic schema is a KeyValue schema.
- Both the key and value schemas are Avro schemas.
- The consumed message payload contains the key and value bytes stitched together.
- You want Pinot rows to include fields from the Pulsar message key and fields from the Pulsar message value.
Payload Layout
The decoder expects the byte array passed to Pinot to contain both key and value data in this exact layout:
Conceptually:
Configuration Example
Configure the decoder in the tablestreamConfig. The exact Pulsar consumer properties depend on your environment, but the decoder properties are:
Example:
Example Schemas
Pulsar key Avro schema:Decoder Behavior
- Uses the Pulsar Admin API to fetch schema information for the configured topic.
- Decodes the Pulsar KeyValue schema into separate key and value Avro schemas.
- Extracts every field from the key schema.
- Extracts value fields that are requested by Pinot and are not key fields.
- Writes key fields and value fields into the same Pinot
GenericRow. - Throws an exception when the payload cannot be parsed as the expected key/value Avro byte layout.
Field Selection
The decoder always extracts all fields from the key schema. For value fields, it honors Pinot’s requested field set when Pinot provides one. If a field exists in both key and value schemas, the key field wins because value extraction removes fields that are already part of the key schema. Avoid duplicate names unless the key value is the intended Pinot column value.Authentication Notes
authenticationToken is used to create a Pulsar token authentication client for the Pulsar Admin API. Treat this token as a secret:
- Store it in your deployment secret manager.
- Inject it into the table config or runtime configuration through your approved secret flow.
- Do not commit production tokens in table config files.

