software.amazon.awscdk.services.glue.alpha.Table Maven / Gradle / Ivy
Show all versions of glue-alpha Show documentation
package software.amazon.awscdk.services.glue.alpha;
/**
* (deprecated) A Glue table.
*
* Example:
*
*
* IDatabase glueDatabase;
* Table table = Table.Builder.create(this, "Table")
* .storageParameters(List.of(StorageParameter.skipHeaderLineCount(1), StorageParameter.compressionType(CompressionType.GZIP), StorageParameter.custom("foo", "bar"), StorageParameter.custom("separatorChar", ","), StorageParameter.custom(StorageParameters.WRITE_PARALLEL, "off")))
* // ...
* .database(glueDatabase)
* .columns(List.of(Column.builder()
* .name("col1")
* .type(Schema.STRING)
* .build()))
* .dataFormat(DataFormat.CSV)
* .build();
*
*
* @deprecated Use {@link S3Table } instead.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.104.0 (build e79254c)", date = "2024-11-15T10:25:09.362Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.glue.alpha.$Module.class, fqn = "@aws-cdk/aws-glue-alpha.Table")
public class Table extends software.amazon.awscdk.services.glue.alpha.S3Table {
protected Table(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected Table(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
* @param props This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Table(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.glue.alpha.S3TableProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* (experimental) A fluent builder for {@link software.amazon.awscdk.services.glue.alpha.Table}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.constructs.Construct scope;
private final java.lang.String id;
private final software.amazon.awscdk.services.glue.alpha.S3TableProps.Builder props;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
this.props = new software.amazon.awscdk.services.glue.alpha.S3TableProps.Builder();
}
/**
* (experimental) Columns of the table.
*
* @return {@code this}
* @param columns Columns of the table. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder columns(final java.util.List extends software.amazon.awscdk.services.glue.alpha.Column> columns) {
this.props.columns(columns);
return this;
}
/**
* (experimental) Database in which to store the table.
*
* @return {@code this}
* @param database Database in which to store the table. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder database(final software.amazon.awscdk.services.glue.alpha.IDatabase database) {
this.props.database(database);
return this;
}
/**
* (experimental) Storage type of the table's data.
*
* @return {@code this}
* @param dataFormat Storage type of the table's data. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder dataFormat(final software.amazon.awscdk.services.glue.alpha.DataFormat dataFormat) {
this.props.dataFormat(dataFormat);
return this;
}
/**
* (experimental) Indicates whether the table's data is compressed or not.
*
* Default: false
*
* @return {@code this}
* @param compressed Indicates whether the table's data is compressed or not. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder compressed(final java.lang.Boolean compressed) {
this.props.compressed(compressed);
return this;
}
/**
* (experimental) Description of the table.
*
* Default: generated
*
* @return {@code this}
* @param description Description of the table. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder description(final java.lang.String description) {
this.props.description(description);
return this;
}
/**
* (experimental) Enables partition filtering.
*
* Default: - The parameter is not defined
*
* @return {@code this}
* @see https://docs.aws.amazon.com/athena/latest/ug/glue-best-practices.html#glue-best-practices-partition-index
* @param enablePartitionFiltering Enables partition filtering. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder enablePartitionFiltering(final java.lang.Boolean enablePartitionFiltering) {
this.props.enablePartitionFiltering(enablePartitionFiltering);
return this;
}
/**
* (experimental) The key/value pairs define properties associated with the table.
*
* The key/value pairs that are allowed to be submitted are not limited, however their functionality is not guaranteed.
*
* Default: - The parameter is not defined
*
* @return {@code this}
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-table-tableinput.html#cfn-glue-table-tableinput-parameters
* @param parameters The key/value pairs define properties associated with the table. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder parameters(final java.util.Map parameters) {
this.props.parameters(parameters);
return this;
}
/**
* (experimental) Partition indexes on the table.
*
* A maximum of 3 indexes
* are allowed on a table. Keys in the index must be part
* of the table's partition keys.
*
* Default: table has no partition indexes
*
* @return {@code this}
* @param partitionIndexes Partition indexes on the table. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder partitionIndexes(final java.util.List extends software.amazon.awscdk.services.glue.alpha.PartitionIndex> partitionIndexes) {
this.props.partitionIndexes(partitionIndexes);
return this;
}
/**
* (experimental) Partition columns of the table.
*
* Default: table is not partitioned
*
* @return {@code this}
* @param partitionKeys Partition columns of the table. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder partitionKeys(final java.util.List extends software.amazon.awscdk.services.glue.alpha.Column> partitionKeys) {
this.props.partitionKeys(partitionKeys);
return this;
}
/**
* (experimental) The user-supplied properties for the description of the physical storage of this table.
*
* These properties help describe the format of the data that is stored within the crawled data sources.
*
* The key/value pairs that are allowed to be submitted are not limited, however their functionality is not guaranteed.
*
* Some keys will be auto-populated by glue crawlers, however, you can override them by specifying the key and value in this property.
*
* Default: - The parameter is not defined
*
* Example:
*
*
* IDatabase glueDatabase;
* Table table = Table.Builder.create(this, "Table")
* .storageParameters(List.of(StorageParameter.skipHeaderLineCount(1), StorageParameter.compressionType(CompressionType.GZIP), StorageParameter.custom("foo", "bar"), StorageParameter.custom("separatorChar", ","), StorageParameter.custom(StorageParameters.WRITE_PARALLEL, "off")))
* // ...
* .database(glueDatabase)
* .columns(List.of(Column.builder()
* .name("col1")
* .type(Schema.STRING)
* .build()))
* .dataFormat(DataFormat.CSV)
* .build();
*
*
* @return {@code this}
* @see https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_EXTERNAL_TABLE.html#r_CREATE_EXTERNAL_TABLE-parameters - under _"TABLE PROPERTIES"_
* @param storageParameters The user-supplied properties for the description of the physical storage of this table. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder storageParameters(final java.util.List extends software.amazon.awscdk.services.glue.alpha.StorageParameter> storageParameters) {
this.props.storageParameters(storageParameters);
return this;
}
/**
* (experimental) Indicates whether the table data is stored in subdirectories.
*
* Default: false
*
* @return {@code this}
* @param storedAsSubDirectories Indicates whether the table data is stored in subdirectories. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder storedAsSubDirectories(final java.lang.Boolean storedAsSubDirectories) {
this.props.storedAsSubDirectories(storedAsSubDirectories);
return this;
}
/**
* (experimental) Name of the table.
*
* Default: - generated by CDK.
*
* @return {@code this}
* @param tableName Name of the table. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder tableName(final java.lang.String tableName) {
this.props.tableName(tableName);
return this;
}
/**
* (experimental) S3 bucket in which to store data.
*
* Default: one is created for you
*
* @return {@code this}
* @param bucket S3 bucket in which to store data. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder bucket(final software.amazon.awscdk.services.s3.IBucket bucket) {
this.props.bucket(bucket);
return this;
}
/**
* (experimental) The kind of encryption to secure the data with.
*
* You can only provide this option if you are not explicitly passing in a bucket.
*
* If you choose SSE-KMS
, you can provide an un-managed KMS key with encryptionKey
.
* If you choose CSE-KMS
, you must provide an un-managed KMS key with encryptionKey
.
*
* Default: BucketEncryption.S3_MANAGED
*
* @return {@code this}
* @param encryption The kind of encryption to secure the data with. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder encryption(final software.amazon.awscdk.services.glue.alpha.TableEncryption encryption) {
this.props.encryption(encryption);
return this;
}
/**
* (experimental) External KMS key to use for bucket encryption.
*
* The encryption
property must be SSE-KMS
or CSE-KMS
.
*
* Default: key is managed by KMS.
*
* @return {@code this}
* @param encryptionKey External KMS key to use for bucket encryption. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder encryptionKey(final software.amazon.awscdk.services.kms.IKey encryptionKey) {
this.props.encryptionKey(encryptionKey);
return this;
}
/**
* (experimental) S3 prefix under which table objects are stored.
*
* Default: - No prefix. The data will be stored under the root of the bucket.
*
* @return {@code this}
* @param s3Prefix S3 prefix under which table objects are stored. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder s3Prefix(final java.lang.String s3Prefix) {
this.props.s3Prefix(s3Prefix);
return this;
}
/**
* @return a newly built instance of {@link software.amazon.awscdk.services.glue.alpha.Table}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public software.amazon.awscdk.services.glue.alpha.Table build() {
return new software.amazon.awscdk.services.glue.alpha.Table(
this.scope,
this.id,
this.props.build()
);
}
}
}