@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 |
distributedBy(int numberOfBuckets,
String... bucketKeys)
Defines that the table should be distributed into the given number of buckets by the
given columns.
|
TableDescriptor.Builder |
distributedBy(String... bucketKeys)
Defines that the table should be distributed into buckets over the given columns.
|
TableDescriptor.Builder |
distributedByHash(int numberOfBuckets,
String... bucketKeys)
Defines that the table should be distributed into the given number of buckets using a
hash algorithm over the given columns.
|
TableDescriptor.Builder |
distributedByHash(String... bucketKeys)
Defines that the table should be distributed into buckets using a hash algorithm over the
given columns.
|
TableDescriptor.Builder |
distributedByRange(int numberOfBuckets,
String... bucketKeys)
Defines that the table should be distributed into the given number of buckets using a
range algorithm over the given columns.
|
TableDescriptor.Builder |
distributedByRange(String... bucketKeys)
Defines that the table should be distributed into buckets using a range algorithm over
the given columns.
|
TableDescriptor.Builder |
distributedInto(int numberOfBuckets)
Defines that the table should be distributed into the given number of buckets.
|
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 distributedByHash(String... bucketKeys)
public TableDescriptor.Builder distributedByHash(int numberOfBuckets, String... bucketKeys)
public TableDescriptor.Builder distributedByRange(String... bucketKeys)
public TableDescriptor.Builder distributedByRange(int numberOfBuckets, String... bucketKeys)
public TableDescriptor.Builder distributedBy(String... bucketKeys)
public TableDescriptor.Builder distributedBy(int numberOfBuckets, String... bucketKeys)
public TableDescriptor.Builder distributedInto(int numberOfBuckets)
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.