Class AvroResultWriter
java.lang.Object
io.confluent.kafka.schemaregistry.rules.cel.avro.AvroResultWriter
Converts a CEL evaluation result (typically a Map literal or scalar) back into
the Avro representation matching a target
Schema. Constructs
GenericRecords field-by-field via
GenericRecordBuilder so we never roundtrip through JSON — that
roundtrip lossily encodes bytes as base64, requires {"branchName":...}
tagging for unions, and can't narrow CEL's widened int64 back to an
int field.
Used only by the Avro path of CelExecutor#transform; JSON Schema
and Protobuf targets keep their existing conversion paths.
-
Method Summary
-
Method Details
-
convert
ConvertcelValueinto the Avro shape required byschema. Recursively walks records, unions, arrays, and maps. For logical types, delegates to Avro's ownConversioninfrastructure by passing the value through unchanged — the caller'sGenericRecordBuilder(or the downstream serializer'sGenericData) handlesInstant↔Long,BigDecimal↔ bytes+scale, etc.
-