Class TableDescriptor.Builder
- java.lang.Object
-
- org.apache.flink.table.api.TableDescriptor.Builder
-
- Enclosing class:
- TableDescriptor
@PublicEvolving public static class TableDescriptor.Builder extends Object
Builder forTableDescriptor.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBuilder()protectedBuilder(TableDescriptor descriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TableDescriptorbuild()Returns an immutable instance ofTableDescriptor.TableDescriptor.Buildercomment(String comment)Define the comment for this table.TableDescriptor.BuilderdistributedBy(int numberOfBuckets, String... bucketKeys)Defines that the table should be distributed into the given number of buckets by the given columns.TableDescriptor.BuilderdistributedBy(String... bucketKeys)Defines that the table should be distributed into buckets over the given columns.TableDescriptor.BuilderdistributedByHash(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.BuilderdistributedByHash(String... bucketKeys)Defines that the table should be distributed into buckets using a hash algorithm over the given columns.TableDescriptor.BuilderdistributedByRange(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.BuilderdistributedByRange(String... bucketKeys)Defines that the table should be distributed into buckets using a range algorithm over the given columns.TableDescriptor.BuilderdistributedInto(int numberOfBuckets)Defines that the table should be distributed into the given number of buckets.TableDescriptor.Builderformat(String format)Defines theformatto be used for this table.TableDescriptor.Builderformat(org.apache.flink.configuration.ConfigOption<String> formatOption, FormatDescriptor formatDescriptor)Defines the format to be used for this table.TableDescriptor.Builderformat(FormatDescriptor formatDescriptor)Defines the format to be used for this table.TableDescriptor.Builderoption(String key, String value)Sets the given option on the table.<T> TableDescriptor.Builderoption(org.apache.flink.configuration.ConfigOption<T> configOption, T value)Sets the given option on the table.TableDescriptor.BuilderpartitionedBy(String... partitionKeys)Define which columns this table is partitioned by.TableDescriptor.Builderschema(org.apache.flink.table.api.Schema schema)Define the schema of theTableDescriptor.
-
-
-
Constructor Detail
-
Builder
protected Builder()
-
Builder
protected Builder(TableDescriptor descriptor)
-
-
Method Detail
-
schema
public TableDescriptor.Builder schema(@Nullable org.apache.flink.table.api.Schema schema)
Define the schema of theTableDescriptor.The schema is typically required. It is optional only in cases where the schema can be inferred, e.g.
Table.insertInto(TableDescriptor).
-
option
public <T> TableDescriptor.Builder option(org.apache.flink.configuration.ConfigOption<T> configOption, T value)
Sets the given option on the table.
-
option
public TableDescriptor.Builder option(String key, String value)
Sets the given option on the table.Option keys must be fully specified. When defining options for a
format, useformat(FormatDescriptor)instead.Example:
TableDescriptor.forConnector("kafka") .option("scan.startup.mode", "latest-offset") .build();
-
format
public TableDescriptor.Builder format(String format)
Defines theformatto 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.
-
format
public TableDescriptor.Builder format(FormatDescriptor formatDescriptor)
Defines the format to be used for this table.Note that not every connector requires a format to be specified, while others may use multiple formats.
Options of the provided {@param formatDescriptor} 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'
-
format
public TableDescriptor.Builder format(org.apache.flink.configuration.ConfigOption<String> formatOption, FormatDescriptor formatDescriptor)
Defines the format to be used for this table.Note that not every connector requires a format to be specified, while others may use multiple formats.
Options of the provided {@param formatDescriptor} 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'
-
distributedByHash
public TableDescriptor.Builder distributedByHash(String... bucketKeys)
Defines that the table should be distributed into buckets using a hash algorithm over the given columns. The number of buckets is connector-defined.
-
distributedByHash
public 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.
-
distributedByRange
public TableDescriptor.Builder distributedByRange(String... bucketKeys)
Defines that the table should be distributed into buckets using a range algorithm over the given columns. The number of buckets is connector-defined.
-
distributedByRange
public 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.
-
distributedBy
public TableDescriptor.Builder distributedBy(String... bucketKeys)
Defines that the table should be distributed into buckets over the given columns. The number of buckets and used algorithm are connector-defined.
-
distributedBy
public TableDescriptor.Builder distributedBy(int numberOfBuckets, String... bucketKeys)
Defines that the table should be distributed into the given number of buckets by the given columns. The used algorithm is connector-defined.
-
distributedInto
public TableDescriptor.Builder distributedInto(int numberOfBuckets)
Defines that the table should be distributed into the given number of buckets. The algorithm is connector-defined.
-
partitionedBy
public TableDescriptor.Builder partitionedBy(String... partitionKeys)
Define which columns this table is partitioned by.
-
comment
public TableDescriptor.Builder comment(@Nullable String comment)
Define the comment for this table.
-
build
public TableDescriptor build()
Returns an immutable instance ofTableDescriptor.
-
-