@PublicEvolving public static final class Schema.Builder extends Object
Schema.| 构造器和说明 |
|---|
Builder() |
| 限定符和类型 | 方法和说明 |
|---|---|
Schema |
build()
Returns an instance of a
Schema. |
Schema.Builder |
column(Column column) |
Schema.Builder |
comment(String comment)
Declares table comment.
|
Schema.Builder |
fromRowDataType(DataType type)
Adopts all fields of the given row as physical columns of the schema.
|
Schema.Builder |
metadataColumn(String columnName,
DataType type)
Declares a metadata column that is appended to this schema.
|
Schema.Builder |
metadataColumn(String columnName,
DataType type,
String metadataKey)
Declares a metadata column that is appended to this schema.
|
Schema.Builder |
metadataColumn(String columnName,
DataType type,
String metadataKey,
String comment)
Declares a metadata column that is appended to this schema.
|
Schema.Builder |
option(String key,
String value)
Declares an option.
|
Schema.Builder |
options(Map<String,String> options)
Declares options.
|
Schema.Builder |
partitionKey(List<String> columnNames)
Declares a partition key constraint for a set of given columns.
|
Schema.Builder |
partitionKey(String... columnNames)
Declares a partition key constraint for a set of given columns.
|
Schema.Builder |
physicalColumn(String columnName,
DataType type)
Declares a physical column that is appended to this schema.
|
Schema.Builder |
physicalColumn(String columnName,
DataType type,
String comment)
Declares a physical column that is appended to this schema.
|
Schema.Builder |
physicalColumn(String columnName,
DataType type,
String comment,
String defaultValue)
Declares a physical column that is appended to this schema.
|
Schema.Builder |
primaryKey(List<String> columnNames)
Declares a primary key constraint for a set of given columns.
|
Schema.Builder |
primaryKey(String... columnNames)
Declares a primary key constraint for a set of given columns.
|
Schema.Builder |
setColumns(List<Column> columns)
Set new columns.
|
public Schema.Builder partitionKey(String... columnNames)
columnNames - columns that form a unique primary keypublic Schema.Builder partitionKey(List<String> columnNames)
columnNames - columns that form a unique primary keypublic Schema.Builder fromRowDataType(DataType type)
public Schema.Builder physicalColumn(String columnName, DataType type)
columnName - column nametype - data type of the columnpublic Schema.Builder physicalColumn(String columnName, DataType type, String comment)
columnName - column nametype - data type of the columncomment - description of the columnpublic Schema.Builder physicalColumn(String columnName, DataType type, String comment, String defaultValue)
columnName - column nametype - data type of the columncomment - description of the columndefaultValue - default value of the columnpublic Schema.Builder metadataColumn(String columnName, DataType type)
columnName - column nametype - data type of the columnpublic Schema.Builder metadataColumn(String columnName, DataType type, String metadataKey)
columnName - column nametype - data type of the columnmetadataKey - the key of metadatapublic Schema.Builder metadataColumn(String columnName, DataType type, String metadataKey, String comment)
columnName - column nametype - data type of the columnmetadataKey - the key of metadatacomment - description of the columnpublic Schema.Builder column(Column column)
public Schema.Builder primaryKey(String... columnNames)
columnNames - columns that form a unique primary keypublic Schema.Builder primaryKey(List<String> columnNames)
columnNames - columns that form a unique primary keypublic Schema.Builder options(Map<String,String> options)
public Schema.Builder option(String key, String value)
public Schema.Builder comment(String comment)
public Schema.Builder setColumns(List<Column> columns)
Copyright © 2025 The Apache Software Foundation. All rights reserved.