Class Schema
java.lang.Object
io.confluent.kafka.schemaregistry.type.logical.Schema
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic enumstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic Schemacreate(Schema.Type type) static SchemacreateArray(Schema elementType) static SchemacreateBinary(int length) static SchemaCreates an unbounded bytes type (alias for VARBINARY(MAX_LENGTH)).static SchemacreateChar(int length) static SchemacreateDecimal(int precision, int scale) static SchemacreateEnum(List<Schema.EnumValue> values) static Schemastatic SchemacreateMultiset(Schema elementType) static SchemacreateNamedTypeRef(String qualifiedName) static SchemaCreates an unbounded string type (alias for VARCHAR(MAX_LENGTH)).static SchemacreateStruct(List<Schema.Field> fields) static SchemacreateTime(int precision) static SchemacreateTimestamp(int precision) static SchemacreateTimestampLtz(int precision) static SchemacreateUnion(List<Schema.UnionBranch> branches) static SchemacreateVarbinary(int length) static SchemacreateVarchar(int length) booleangetDoc()intintgetRules()Validation rules attached to this schema.intgetScale()getTags()getType()inthashCode()static booleanisCelReservedName(String name) True ifnamematches a CEL reserved word (case-insensitive).booleanstatic StringQuotenameas a DDL identifier if it would otherwise fail to tokenize as one — i.e.setNullable(boolean nullable) abstract StringtoDdl()toString()protected StringwithNullableSuffix(String ddl)
-
Field Details
-
NO_PARAM
public static final int NO_PARAM- See Also:
-
MAX_LENGTH
public static final int MAX_LENGTH- See Also:
-
DEFAULT_LENGTH
public static final int DEFAULT_LENGTH- See Also:
-
DEFAULT_DECIMAL_PRECISION
public static final int DEFAULT_DECIMAL_PRECISION- See Also:
-
DEFAULT_DECIMAL_SCALE
public static final int DEFAULT_DECIMAL_SCALE- See Also:
-
DEFAULT_TIME_PRECISION
public static final int DEFAULT_TIME_PRECISION- See Also:
-
DEFAULT_TIMESTAMP_PRECISION
public static final int DEFAULT_TIMESTAMP_PRECISION- See Also:
-
-
Method Details
-
getType
-
isNullable
public boolean isNullable() -
setNullable
-
getDoc
-
setDoc
-
getTags
-
setTags
-
getParams
-
setParams
-
getRules
Validation rules attached to this schema. For struct types this carries table-level CHECK constraints (constraints that may reference any field). Empty for non-struct schemas in the typical case. -
setRules
-
getFields
-
getField
-
getEnumValues
-
getBranches
-
getElementType
-
getKeyType
-
getValueType
-
getPrecision
public int getPrecision() -
getScale
public int getScale() -
getLength
public int getLength() -
getQualifiedName
-
toDdl
-
withNullableSuffix
-
create
-
createDecimal
-
createString
Creates an unbounded string type (alias for VARCHAR(MAX_LENGTH)). -
createVarchar
-
createChar
-
createBytes
Creates an unbounded bytes type (alias for VARBINARY(MAX_LENGTH)). -
createBinary
-
createVarbinary
-
createTime
-
createTimestamp
-
createTimestampLtz
-
createStruct
-
createEnum
-
createUnion
-
createArray
-
createMultiset
-
createMap
-
createNamedTypeRef
-
equals
-
hashCode
public int hashCode() -
toString
-
isCelReservedName
True ifnamematches a CEL reserved word (case-insensitive). The translator uses this to switch between dot-syntax and index-syntax column-ref emit so reserved-name fields still produce valid CEL. -
quoteIdentifierIfNeeded
Quotenameas a DDL identifier if it would otherwise fail to tokenize as one — i.e. it's empty, contains non-identifier characters, matches a SQL keyword that the grammar doesn't accept as an identifier, or matches a CEL reserved word (so CHECK references emit cleanly). Quoted form: backtick-wrap and double internal backticks.Used by both
toDdl()and the LT-to-DDL converter so identifier emission is consistent across paths.
-