software.amazon.awscdk.services.glue.alpha.TableBaseProps Maven / Gradle / Ivy
Show all versions of glue-alpha Show documentation
package software.amazon.awscdk.services.glue.alpha;
/**
* Example:
*
*
* // The code below shows an example of how to instantiate this type.
* // The values are placeholders you should change.
* import software.amazon.awscdk.services.glue.alpha.*;
* Database database;
* DataFormat dataFormat;
* StorageParameter storageParameter;
* TableBaseProps tableBaseProps = TableBaseProps.builder()
* .columns(List.of(Column.builder()
* .name("name")
* .type(Type.builder()
* .inputString("inputString")
* .isPrimitive(false)
* .build())
* // the properties below are optional
* .comment("comment")
* .build()))
* .database(database)
* .dataFormat(dataFormat)
* // the properties below are optional
* .compressed(false)
* .description("description")
* .enablePartitionFiltering(false)
* .parameters(Map.of(
* "parametersKey", "parameters"))
* .partitionIndexes(List.of(PartitionIndex.builder()
* .keyNames(List.of("keyNames"))
* // the properties below are optional
* .indexName("indexName")
* .build()))
* .partitionKeys(List.of(Column.builder()
* .name("name")
* .type(Type.builder()
* .inputString("inputString")
* .isPrimitive(false)
* .build())
* // the properties below are optional
* .comment("comment")
* .build()))
* .storageParameters(List.of(storageParameter))
* .storedAsSubDirectories(false)
* .tableName("tableName")
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.99.0 (build 8f757e4)", date = "2024-06-13T18:49:27.714Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.glue.alpha.$Module.class, fqn = "@aws-cdk/aws-glue-alpha.TableBaseProps")
@software.amazon.jsii.Jsii.Proxy(TableBaseProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface TableBaseProps extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) Columns of the table.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.util.List getColumns();
/**
* (experimental) Database in which to store the table.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.glue.alpha.IDatabase getDatabase();
/**
* (experimental) Storage type of the table's data.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.glue.alpha.DataFormat getDataFormat();
/**
* (experimental) Indicates whether the table's data is compressed or not.
*
* Default: false
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getCompressed() {
return null;
}
/**
* (experimental) Description of the table.
*
* Default: generated
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getDescription() {
return null;
}
/**
* (experimental) Enables partition filtering.
*
* Default: - The parameter is not defined
*
* @see https://docs.aws.amazon.com/athena/latest/ug/glue-best-practices.html#glue-best-practices-partition-index
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getEnablePartitionFiltering() {
return null;
}
/**
* (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
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-table-tableinput.html#cfn-glue-table-tableinput-parameters
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.Map getParameters() {
return null;
}
/**
* (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
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getPartitionIndexes() {
return null;
}
/**
* (experimental) Partition columns of the table.
*
* Default: table is not partitioned
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getPartitionKeys() {
return null;
}
/**
* (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();
*
*
* @see https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_EXTERNAL_TABLE.html#r_CREATE_EXTERNAL_TABLE-parameters - under _"TABLE PROPERTIES"_
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getStorageParameters() {
return null;
}
/**
* (experimental) Indicates whether the table data is stored in subdirectories.
*
* Default: false
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getStoredAsSubDirectories() {
return null;
}
/**
* (experimental) Name of the table.
*
* Default: - generated by CDK.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getTableName() {
return null;
}
/**
* @return a {@link Builder} of {@link TableBaseProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link TableBaseProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.util.List columns;
software.amazon.awscdk.services.glue.alpha.IDatabase database;
software.amazon.awscdk.services.glue.alpha.DataFormat dataFormat;
java.lang.Boolean compressed;
java.lang.String description;
java.lang.Boolean enablePartitionFiltering;
java.util.Map parameters;
java.util.List partitionIndexes;
java.util.List partitionKeys;
java.util.List storageParameters;
java.lang.Boolean storedAsSubDirectories;
java.lang.String tableName;
/**
* Sets the value of {@link TableBaseProps#getColumns}
* @param columns Columns of the table. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder columns(java.util.List extends software.amazon.awscdk.services.glue.alpha.Column> columns) {
this.columns = (java.util.List)columns;
return this;
}
/**
* Sets the value of {@link TableBaseProps#getDatabase}
* @param database Database in which to store the table. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder database(software.amazon.awscdk.services.glue.alpha.IDatabase database) {
this.database = database;
return this;
}
/**
* Sets the value of {@link TableBaseProps#getDataFormat}
* @param dataFormat Storage type of the table's data. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder dataFormat(software.amazon.awscdk.services.glue.alpha.DataFormat dataFormat) {
this.dataFormat = dataFormat;
return this;
}
/**
* Sets the value of {@link TableBaseProps#getCompressed}
* @param compressed Indicates whether the table's data is compressed or not.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder compressed(java.lang.Boolean compressed) {
this.compressed = compressed;
return this;
}
/**
* Sets the value of {@link TableBaseProps#getDescription}
* @param description Description of the table.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder description(java.lang.String description) {
this.description = description;
return this;
}
/**
* Sets the value of {@link TableBaseProps#getEnablePartitionFiltering}
* @param enablePartitionFiltering Enables partition filtering.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder enablePartitionFiltering(java.lang.Boolean enablePartitionFiltering) {
this.enablePartitionFiltering = enablePartitionFiltering;
return this;
}
/**
* Sets the value of {@link TableBaseProps#getParameters}
* @param parameters 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.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder parameters(java.util.Map parameters) {
this.parameters = parameters;
return this;
}
/**
* Sets the value of {@link TableBaseProps#getPartitionIndexes}
* @param partitionIndexes 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.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder partitionIndexes(java.util.List extends software.amazon.awscdk.services.glue.alpha.PartitionIndex> partitionIndexes) {
this.partitionIndexes = (java.util.List)partitionIndexes;
return this;
}
/**
* Sets the value of {@link TableBaseProps#getPartitionKeys}
* @param partitionKeys Partition columns of the table.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder partitionKeys(java.util.List extends software.amazon.awscdk.services.glue.alpha.Column> partitionKeys) {
this.partitionKeys = (java.util.List)partitionKeys;
return this;
}
/**
* Sets the value of {@link TableBaseProps#getStorageParameters}
* @param storageParameters 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.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder storageParameters(java.util.List extends software.amazon.awscdk.services.glue.alpha.StorageParameter> storageParameters) {
this.storageParameters = (java.util.List)storageParameters;
return this;
}
/**
* Sets the value of {@link TableBaseProps#getStoredAsSubDirectories}
* @param storedAsSubDirectories Indicates whether the table data is stored in subdirectories.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder storedAsSubDirectories(java.lang.Boolean storedAsSubDirectories) {
this.storedAsSubDirectories = storedAsSubDirectories;
return this;
}
/**
* Sets the value of {@link TableBaseProps#getTableName}
* @param tableName Name of the table.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder tableName(java.lang.String tableName) {
this.tableName = tableName;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link TableBaseProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public TableBaseProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link TableBaseProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements TableBaseProps {
private final java.util.List columns;
private final software.amazon.awscdk.services.glue.alpha.IDatabase database;
private final software.amazon.awscdk.services.glue.alpha.DataFormat dataFormat;
private final java.lang.Boolean compressed;
private final java.lang.String description;
private final java.lang.Boolean enablePartitionFiltering;
private final java.util.Map parameters;
private final java.util.List partitionIndexes;
private final java.util.List partitionKeys;
private final java.util.List storageParameters;
private final java.lang.Boolean storedAsSubDirectories;
private final java.lang.String tableName;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.columns = software.amazon.jsii.Kernel.get(this, "columns", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.glue.alpha.Column.class)));
this.database = software.amazon.jsii.Kernel.get(this, "database", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.glue.alpha.IDatabase.class));
this.dataFormat = software.amazon.jsii.Kernel.get(this, "dataFormat", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.glue.alpha.DataFormat.class));
this.compressed = software.amazon.jsii.Kernel.get(this, "compressed", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.description = software.amazon.jsii.Kernel.get(this, "description", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.enablePartitionFiltering = software.amazon.jsii.Kernel.get(this, "enablePartitionFiltering", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.parameters = software.amazon.jsii.Kernel.get(this, "parameters", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.partitionIndexes = software.amazon.jsii.Kernel.get(this, "partitionIndexes", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.glue.alpha.PartitionIndex.class)));
this.partitionKeys = software.amazon.jsii.Kernel.get(this, "partitionKeys", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.glue.alpha.Column.class)));
this.storageParameters = software.amazon.jsii.Kernel.get(this, "storageParameters", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.glue.alpha.StorageParameter.class)));
this.storedAsSubDirectories = software.amazon.jsii.Kernel.get(this, "storedAsSubDirectories", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.tableName = software.amazon.jsii.Kernel.get(this, "tableName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.columns = (java.util.List)java.util.Objects.requireNonNull(builder.columns, "columns is required");
this.database = java.util.Objects.requireNonNull(builder.database, "database is required");
this.dataFormat = java.util.Objects.requireNonNull(builder.dataFormat, "dataFormat is required");
this.compressed = builder.compressed;
this.description = builder.description;
this.enablePartitionFiltering = builder.enablePartitionFiltering;
this.parameters = builder.parameters;
this.partitionIndexes = (java.util.List)builder.partitionIndexes;
this.partitionKeys = (java.util.List)builder.partitionKeys;
this.storageParameters = (java.util.List)builder.storageParameters;
this.storedAsSubDirectories = builder.storedAsSubDirectories;
this.tableName = builder.tableName;
}
@Override
public final java.util.List getColumns() {
return this.columns;
}
@Override
public final software.amazon.awscdk.services.glue.alpha.IDatabase getDatabase() {
return this.database;
}
@Override
public final software.amazon.awscdk.services.glue.alpha.DataFormat getDataFormat() {
return this.dataFormat;
}
@Override
public final java.lang.Boolean getCompressed() {
return this.compressed;
}
@Override
public final java.lang.String getDescription() {
return this.description;
}
@Override
public final java.lang.Boolean getEnablePartitionFiltering() {
return this.enablePartitionFiltering;
}
@Override
public final java.util.Map getParameters() {
return this.parameters;
}
@Override
public final java.util.List getPartitionIndexes() {
return this.partitionIndexes;
}
@Override
public final java.util.List getPartitionKeys() {
return this.partitionKeys;
}
@Override
public final java.util.List getStorageParameters() {
return this.storageParameters;
}
@Override
public final java.lang.Boolean getStoredAsSubDirectories() {
return this.storedAsSubDirectories;
}
@Override
public final java.lang.String getTableName() {
return this.tableName;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
data.set("columns", om.valueToTree(this.getColumns()));
data.set("database", om.valueToTree(this.getDatabase()));
data.set("dataFormat", om.valueToTree(this.getDataFormat()));
if (this.getCompressed() != null) {
data.set("compressed", om.valueToTree(this.getCompressed()));
}
if (this.getDescription() != null) {
data.set("description", om.valueToTree(this.getDescription()));
}
if (this.getEnablePartitionFiltering() != null) {
data.set("enablePartitionFiltering", om.valueToTree(this.getEnablePartitionFiltering()));
}
if (this.getParameters() != null) {
data.set("parameters", om.valueToTree(this.getParameters()));
}
if (this.getPartitionIndexes() != null) {
data.set("partitionIndexes", om.valueToTree(this.getPartitionIndexes()));
}
if (this.getPartitionKeys() != null) {
data.set("partitionKeys", om.valueToTree(this.getPartitionKeys()));
}
if (this.getStorageParameters() != null) {
data.set("storageParameters", om.valueToTree(this.getStorageParameters()));
}
if (this.getStoredAsSubDirectories() != null) {
data.set("storedAsSubDirectories", om.valueToTree(this.getStoredAsSubDirectories()));
}
if (this.getTableName() != null) {
data.set("tableName", om.valueToTree(this.getTableName()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-glue-alpha.TableBaseProps"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TableBaseProps.Jsii$Proxy that = (TableBaseProps.Jsii$Proxy) o;
if (!columns.equals(that.columns)) return false;
if (!database.equals(that.database)) return false;
if (!dataFormat.equals(that.dataFormat)) return false;
if (this.compressed != null ? !this.compressed.equals(that.compressed) : that.compressed != null) return false;
if (this.description != null ? !this.description.equals(that.description) : that.description != null) return false;
if (this.enablePartitionFiltering != null ? !this.enablePartitionFiltering.equals(that.enablePartitionFiltering) : that.enablePartitionFiltering != null) return false;
if (this.parameters != null ? !this.parameters.equals(that.parameters) : that.parameters != null) return false;
if (this.partitionIndexes != null ? !this.partitionIndexes.equals(that.partitionIndexes) : that.partitionIndexes != null) return false;
if (this.partitionKeys != null ? !this.partitionKeys.equals(that.partitionKeys) : that.partitionKeys != null) return false;
if (this.storageParameters != null ? !this.storageParameters.equals(that.storageParameters) : that.storageParameters != null) return false;
if (this.storedAsSubDirectories != null ? !this.storedAsSubDirectories.equals(that.storedAsSubDirectories) : that.storedAsSubDirectories != null) return false;
return this.tableName != null ? this.tableName.equals(that.tableName) : that.tableName == null;
}
@Override
public final int hashCode() {
int result = this.columns.hashCode();
result = 31 * result + (this.database.hashCode());
result = 31 * result + (this.dataFormat.hashCode());
result = 31 * result + (this.compressed != null ? this.compressed.hashCode() : 0);
result = 31 * result + (this.description != null ? this.description.hashCode() : 0);
result = 31 * result + (this.enablePartitionFiltering != null ? this.enablePartitionFiltering.hashCode() : 0);
result = 31 * result + (this.parameters != null ? this.parameters.hashCode() : 0);
result = 31 * result + (this.partitionIndexes != null ? this.partitionIndexes.hashCode() : 0);
result = 31 * result + (this.partitionKeys != null ? this.partitionKeys.hashCode() : 0);
result = 31 * result + (this.storageParameters != null ? this.storageParameters.hashCode() : 0);
result = 31 * result + (this.storedAsSubDirectories != null ? this.storedAsSubDirectories.hashCode() : 0);
result = 31 * result + (this.tableName != null ? this.tableName.hashCode() : 0);
return result;
}
}
}