Class ConfluentTableDescriptor.Builder
- Enclosing class:
- ConfluentTableDescriptor
ConfluentTableDescriptor.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuilder()protectedBuilder(ConfluentTableDescriptor descriptor) -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates an instance ofConfluentTableDescriptor.Define the comment for this table.distributedBy(int numberOfBuckets, String... bucketKeys) Defines that the table should be distributed into the given number of buckets by the given columns.distributedBy(String... bucketKeys) Defines that the table should be distributed into buckets over the given columns.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.distributedByHash(String... bucketKeys) Defines that the table should be distributed into buckets using a hash algorithm over the given columns.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.distributedByRange(String... bucketKeys) Defines that the table should be distributed into buckets using a range algorithm over the given columns.distributedInto(int numberOfBuckets) Defines that the table should be distributed into the given number of buckets.Defines theformatto be used for this table.format(ConfigOption<String> formatOption, FormatDescriptor formatDescriptor) Defines the format to be used for this table.format(FormatDescriptor formatDescriptor) Defines the format to be used for this table.keyFormat(FormatDescriptor formatDescriptor) Defines the key format for Kafka-based tables.Sets the given option on the table.option(ConfigOption<T> configOption, T value) Sets the given option on the table.partitionedBy(String... partitionKeys) Define which columns this table is partitioned by.Define the schema of theTableDescriptor.valueFormat(FormatDescriptor formatDescriptor) Defines the value format for Kafka-based tables.
-
Constructor Details
-
Builder
protected Builder() -
Builder
-
-
Method Details
-
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).- Overrides:
schemain classTableDescriptor.Builder
-
option
Sets the given option on the table.- Overrides:
optionin classTableDescriptor.Builder
-
option
Sets the given option on the table.Option keys must be fully specified. When defining options for a
format, useTableDescriptor.Builder.format(FormatDescriptor)instead.Example:
TableDescriptor.forConnector("kafka") .option("scan.startup.mode", "latest-offset") .build();- Overrides:
optionin classTableDescriptor.Builder
-
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
TableDescriptor.Builder.format(ConfigOption, FormatDescriptor)instead to specify for which option the format should be configured.- Overrides:
formatin classTableDescriptor.Builder
-
format
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 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'- Overrides:
formatin classTableDescriptor.Builder
-
format
public ConfluentTableDescriptor.Builder format(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 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'- Overrides:
formatin classTableDescriptor.Builder
-
distributedByHash
Defines that the table should be distributed into buckets using a hash algorithm over the given columns. The number of buckets is connector-defined.- Overrides:
distributedByHashin classTableDescriptor.Builder
-
distributedByHash
public ConfluentTableDescriptor.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.- Overrides:
distributedByHashin classTableDescriptor.Builder
-
distributedByRange
Defines that the table should be distributed into buckets using a range algorithm over the given columns. The number of buckets is connector-defined.- Overrides:
distributedByRangein classTableDescriptor.Builder
-
distributedByRange
public ConfluentTableDescriptor.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.- Overrides:
distributedByRangein classTableDescriptor.Builder
-
distributedBy
Defines that the table should be distributed into buckets over the given columns. The number of buckets and used algorithm are connector-defined.- Overrides:
distributedByin classTableDescriptor.Builder
-
distributedBy
Defines that the table should be distributed into the given number of buckets by the given columns. The used algorithm is connector-defined.- Overrides:
distributedByin classTableDescriptor.Builder
-
distributedInto
Defines that the table should be distributed into the given number of buckets. The algorithm is connector-defined.- Overrides:
distributedIntoin classTableDescriptor.Builder
-
partitionedBy
Define which columns this table is partitioned by.- Overrides:
partitionedByin classTableDescriptor.Builder
-
comment
Define the comment for this table.- Overrides:
commentin classTableDescriptor.Builder
-
keyFormat
Defines the key format for Kafka-based tables.Options of the provided are automatically prefixed. For example,
descriptorBuilder.keyFormat( FormatDescriptor.forFormat("json") .option("validate-writes", "true") .build() )will result in the options
'key.format' = 'json' 'key.json.validate-writes' = 'true'Options that affect which columns belong to the format, can be set with
option(String, String), for example.option("key.fields-prefix", "k_"). -
valueFormat
Defines the value format for Kafka-based tables.Options of the provided are automatically prefixed. For example,
descriptorBuilder.valueFormat( FormatDescriptor.forFormat("json") .option("validate-writes", "true") .build() )will result in the options
'value.format' = 'json' 'value.json.validate-writes' = 'true'Options that affect which columns belong to the format, can be set with
option(String, String), for example.option("value.fields-include", "all"). -
build
Creates an instance ofConfluentTableDescriptor.- Overrides:
buildin classTableDescriptor.Builder
-