Class Rule
java.lang.Object
io.confluent.kafka.schemaregistry.type.logical.Rule
A validation rule attached to a
Schema or Schema.Field,
authored as a SQL-flavored CHECK (...) clause and translated to a
CEL expression for runtime evaluation.
Mirrors the Meta.Rule doc in confluent/meta.proto so
the wire form is uniform across Avro/JSON (as a confluent:rules
array property) and Protobuf (as a repeated Rule rules field on
Meta).
Field semantics:
getName()— optional machine identifier fromCONSTRAINT name CHECK (...); null if the user didn't supply one. Used in error reporting.getDoc()— optional human-readable error text fromMESSAGE 'text'; null if absent. Surfaced when the rule fails at runtime.getExpr()— the translated CEL expression that the runtime evaluator executes. Always non-null.getSql()— the original SQL CHECK expression text. Used by the DDL emitter to round-trip back to readable SQL. Always non-null. Namedsqlto match the existing convention inMeta.Rulethat distinguishes "sql-form source" from the "expression form" stored inexpr.
The expr field is the source of truth for runtime evaluation;
sql is the source of truth for DDL re-emission.
-
Constructor Summary
Constructors -
Method Summary