Class LogicalTypeToDdlConverter

java.lang.Object
io.confluent.kafka.schemaregistry.type.logical.LogicalTypeToDdlConverter

public final class LogicalTypeToDdlConverter extends Object
Emits a LogicalType as DDL text — the inverse of LogicalTypesSchemaVisitor. Output is canonical (one statement per line; struct bodies multi-line when more than two fields). Round-trips through the visitor produce an equivalent LogicalType.

Lossy points (intentional, matching visitor capability):

  • External references have no syntactic marker — they're inferred on read-back from usage. USING TYPE statements survive (carrying the wire-format URI binding) but bare externals (no URI) are implicit, identified by appearing in a type position without a matching local STRUCT/ENUM.
  • Path-keyed defaultValues aren't re-emitted; field-level defaults survive via Schema.Field.getDefaultValue().
  • The single-root sugar is detected and the trailing root-registration TYPE statement is elided when it would be redundant. The multi-root UNION sugar is detected similarly.