primaryKey
The primary key will be assigned a random name.
- Parameters:
columns- array of columns that form a unique primary key
TableSchema.add(TableColumn column) TableColumn to this builder.build()TableSchema instance.primaryKey(String... columns) primaryKey(String name,
String[] columns) watermark(String rowtimeAttribute,
String watermarkExpressionString,
DataType watermarkExprOutputType) watermark(WatermarkSpec watermarkSpec) WatermarkSpec to this builder.The call order of this method determines the order of fields in the schema.
The call order of this method determines the order of fields in the schema.
The returned expression should be a SQL-style expression whose identifiers should be all quoted and expanded.
It should be expanded because this expression may be persisted then deserialized from the catalog, an expanded identifier would avoid the ambiguity if there are same name UDF referenced from different paths. For example, if there is a UDF named "my_udf" from path "my_catalog.my_database", you could pass in an expression like "`my_catalog`.`my_database`.`my_udf`(`f0`) + 1";
It should be quoted because user could use a reserved keyword as the identifier, and we have no idea if it is quoted when deserialize from the catalog, so we force to use quoted identifier here. But framework will not check whether it is qualified and quoted or not.
name - Field namedataType - Field data typeexpression - Computed column expression.TableColumn to this builder.
The call order of this method determines the order of fields in the schema.
The call order of this method determines the order of fields in the schema.
field(String, DataType) instead which uses
the new type system based on DataTypes. Please make sure to use either the
old or the new type system consistently to avoid unintended behavior. See the website
documentation for more information.rowtimeAttribute - the field name as a rowtime attribute, can be a nested field
using dot separator.watermarkExpressionString - the string representation of watermark generation
expression, e.g. "ts - INTERVAL '5' SECOND". The string is a qualified SQL expression
string (UDFs are expanded) but will not be validated by TableSchema.watermarkExprOutputType - the data type of the computation result of watermark
generation expression. Whether the data type equals to the output type of expression
will also not be validated by TableSchema.WatermarkSpec to this builder.The primary key will be assigned a random name.
columns - array of columns that form a unique primary keycolumns - array of columns that form a unique primary keyname - name for the primary key, can be used to reference the constraintTableSchema instance.