Class Schema
A schema represents the schema part of a CREATE TABLE (schema) WITH (options) DDL
statement in SQL. It defines columns of different kind, constraints, time attributes, and
watermark strategies. It is possible to reference objects (such as functions or types) across
different catalogs.
This class is used in the API and catalogs to define an unresolved schema that will be
translated to ResolvedSchema. Some methods of this class perform basic validation,
however, the main validation happens during the resolution. Thus, an unresolved schema can be
incomplete and might be enriched or merged with a different schema at a later stage.
Since an instance of this class is unresolved, it should not be directly persisted. The toString() shows only a summary of the contained objects.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder for constructing an immutable but still unresolvedSchema.static classSuper class for all kinds of columns in an unresolved schema.static final classDeclaration of a computed column that will be resolved toColumn.ComputedColumnduring schema resolution.static classSuper class for all kinds of constraints in an unresolved schema.static final classDeclaration of a metadata column that will be resolved toColumn.MetadataColumnduring schema resolution.static final classDeclaration of a physical column that will be resolved toColumn.PhysicalColumnduring schema resolution.static final classDeclaration of a primary key that will be resolved toUniqueConstraintduring schema resolution.static final classDeclaration of a watermark strategy that will be resolved toWatermarkSpecduring schema resolution. -
Method Summary
Modifier and TypeMethodDescriptionstatic Schemaderived()Convenience method for stating explicitly that a schema is empty and should be fully derived by the framework.booleaninthashCode()static Schema.BuilderBuilder for configuring and creating instances ofSchema.resolve(SchemaResolver resolver) Resolves the givenSchemato a validatedResolvedSchema.toString()
-
Method Details
-
newBuilder
Builder for configuring and creating instances ofSchema. -
derived
Convenience method for stating explicitly that a schema is empty and should be fully derived by the framework.The semantics are equivalent to calling
Schema.newBuilder().build().Note that derivation depends on the context. Usually, the method that accepts a
Schemainstance will mention whether schema derivation is supported or not. -
getColumns
-
getWatermarkSpecs
-
getPrimaryKey
-
resolve
Resolves the givenSchemato a validatedResolvedSchema. -
toString
-
equals
-
hashCode
public int hashCode()
-