@PublicEvolving public static class TableDescriptor.Builder extends Object
TableDescriptor
.Modifier | Constructor and Description |
---|---|
protected |
Builder() |
protected |
Builder(TableDescriptor descriptor) |
Modifier and Type | Method and Description |
---|---|
TableDescriptor |
build()
Returns an immutable instance of
TableDescriptor . |
TableDescriptor.Builder |
comment(String comment)
Define the comment for this table.
|
TableDescriptor.Builder |
format(ConfigOption<String> formatOption,
FormatDescriptor formatDescriptor)
Defines the format to be used for this table.
|
TableDescriptor.Builder |
format(FormatDescriptor formatDescriptor)
Defines the format to be used for this table.
|
TableDescriptor.Builder |
format(String format)
Defines the
format to be used for this table. |
<T> TableDescriptor.Builder |
option(ConfigOption<T> configOption,
T value)
Sets the given option on the table.
|
TableDescriptor.Builder |
option(String key,
String value)
Sets the given option on the table.
|
TableDescriptor.Builder |
partitionedBy(String... partitionKeys)
Define which columns this table is partitioned by.
|
TableDescriptor.Builder |
schema(Schema schema)
Define the schema of the
TableDescriptor . |
protected Builder()
protected Builder(TableDescriptor descriptor)
public TableDescriptor.Builder schema(@Nullable Schema schema)
TableDescriptor
.
The schema is typically required. It is optional only in cases where the schema can be
inferred, e.g. Table.insertInto(TableDescriptor)
.
public <T> TableDescriptor.Builder option(ConfigOption<T> configOption, T value)
public TableDescriptor.Builder option(String key, String value)
Option keys must be fully specified. When defining options for a format
, use format(FormatDescriptor)
instead.
Example:
TableDescriptor.forConnector("kafka")
.option("scan.startup.mode", "latest-offset")
.build();
public TableDescriptor.Builder format(String format)
format
to be used for this table.
Note that not every connector requires a format to be specified, while others may use
multiple formats. In the latter case, use format(ConfigOption, FormatDescriptor)
instead to specify for which option the format should be configured.
public TableDescriptor.Builder format(FormatDescriptor formatDescriptor)
Note that not every connector requires a format to be specified, while others may use multiple formats.
Options of the provided are automatically prefixed. For example,
descriptorBuilder.format(FormatDescriptor.forFormat("json")
.option(JsonOptions.IGNORE_PARSE_ERRORS, true)
.build()
will result in the options
'format' = 'json'
'json.ignore-parse-errors' = 'true'
public TableDescriptor.Builder format(ConfigOption<String> formatOption, FormatDescriptor formatDescriptor)
Note that not every connector requires a format to be specified, while others may use multiple formats.
Options of the provided are automatically prefixed. For example,
descriptorBuilder.format(KafkaOptions.KEY_FORMAT, FormatDescriptor.forFormat("json")
.option(JsonOptions.IGNORE_PARSE_ERRORS, true)
.build()
will result in the options
'key.format' = 'json'
'key.json.ignore-parse-errors' = 'true'
public TableDescriptor.Builder partitionedBy(String... partitionKeys)
public TableDescriptor.Builder comment(@Nullable String comment)
public TableDescriptor build()
TableDescriptor
.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.