Class TableCreateOptions.Builder
java.lang.Object
io.github.flink.gcp.connector.bigquery.sink.TableCreateOptions.Builder
- Enclosing class:
TableCreateOptions
Builder for
TableCreateOptions.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the options.clusteredFields(List<String> fields) Clusters the table on the given columns, in precedence order (at most four).description(String description) Sets the description of a created table.kmsKeyName(String kmsKeyName) Sets the Cloud KMS key that encrypts a created table, as the key's resource nameprojects/<project>/locations/<location>/keyRings/<ring>/cryptoKeys/<key>.Sets the labels of a created table, replacing any set before.Partitions the table on ingestion time with the given granularity.Partitions the table on the givenTIMESTAMP,DATEorDATETIMEcolumn with the given granularity — the three column types BigQuery partitions on.timePartitioningExpiration(Duration expiration) Sets the partition expiration; partitions older than this are deleted by BigQuery.
-
Method Details
-
timePartitioning
Partitions the table on ingestion time with the given granularity.- Parameters:
type- the partitioning granularity- Returns:
- this builder
-
timePartitioning
public TableCreateOptions.Builder timePartitioning(TableCreateOptions.TimePartitioningType type, String field) Partitions the table on the givenTIMESTAMP,DATEorDATETIMEcolumn with the given granularity — the three column types BigQuery partitions on.- Parameters:
type- the partitioning granularityfield- the column to partition on- Returns:
- this builder
-
timePartitioningExpiration
Sets the partition expiration; partitions older than this are deleted by BigQuery. Requires time partitioning to be configured.- Parameters:
expiration- the partition expiration, at least 1 ms- Returns:
- this builder
-
clusteredFields
Clusters the table on the given columns, in precedence order (at most four).- Parameters:
fields- the clustering columns- Returns:
- this builder
-
description
Sets the description of a created table.- Parameters:
description- the table description, not blank- Returns:
- this builder
-
labels
Sets the labels of a created table, replacing any set before.Keys must not be blank and values must not be
null; an empty value is a label with no value. Whether a key or value is one BigQuery accepts is BigQuery's answer, given when the table is created. The keyflink_gcp_cdcis rejected: the sink's CDC table provisioning owns it.- Parameters:
labels- the table labels- Returns:
- this builder
-
kmsKeyName
Sets the Cloud KMS key that encrypts a created table, as the key's resource nameprojects/<project>/locations/<location>/keyRings/<ring>/cryptoKeys/<key>.The key encrypts a table the sink creates, and
FILE_LOADSstates it on the jobs that fill the temporary tables it stages that table's data in. It is never applied to a table that already exists. The key must be in the dataset's location, and BigQuery's encryption service account needs theroles/cloudkms.cryptoKeyEncrypterDecrypterrole on it; both are BigQuery's answer, given when the table is created.- Parameters:
kmsKeyName- the key's resource name, not blank- Returns:
- this builder
-
build
Builds the options.- Returns:
- the options
-