All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awscdk.services.glue.alpha.ExternalTableProps Maven / Gradle / Ivy

There is a newer version: 2.167.1-alpha.0
Show newest version
package software.amazon.awscdk.services.glue.alpha;

/**
 * Example:
 * 

*

 * Connection myConnection;
 * Database myDatabase;
 * ExternalTable.Builder.create(this, "MyTable")
 *         .connection(myConnection)
 *         .externalDataLocation("default_db_public_example") // A table in Redshift
 *         // ...
 *         .database(myDatabase)
 *         .columns(List.of(Column.builder()
 *                 .name("col1")
 *                 .type(Schema.STRING)
 *                 .build()))
 *         .dataFormat(DataFormat.JSON)
 *         .build();
 * 
*/ @javax.annotation.Generated(value = "jsii-pacmak/1.99.0 (build 8f757e4)", date = "2024-06-13T18:49:27.670Z") @software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.glue.alpha.$Module.class, fqn = "@aws-cdk/aws-glue-alpha.ExternalTableProps") @software.amazon.jsii.Jsii.Proxy(ExternalTableProps.Jsii$Proxy.class) @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public interface ExternalTableProps extends software.amazon.jsii.JsiiSerializable, software.amazon.awscdk.services.glue.alpha.TableBaseProps { /** * (experimental) The connection the table will use when performing reads and writes. *

* Default: - No connection */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.glue.alpha.IConnection getConnection(); /** * (experimental) The data source location of the glue table, (e.g. default_db_public_example for Redshift). *

* If this property is set, it will override both bucket and s3Prefix. *

* Default: - No outsourced data source location */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @org.jetbrains.annotations.NotNull java.lang.String getExternalDataLocation(); /** * @return a {@link Builder} of {@link ExternalTableProps} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) static Builder builder() { return new Builder(); } /** * A builder for {@link ExternalTableProps} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static final class Builder implements software.amazon.jsii.Builder { software.amazon.awscdk.services.glue.alpha.IConnection connection; java.lang.String externalDataLocation; 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 ExternalTableProps#getConnection} * @param connection The connection the table will use when performing reads and writes. This parameter is required. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder connection(software.amazon.awscdk.services.glue.alpha.IConnection connection) { this.connection = connection; return this; } /** * Sets the value of {@link ExternalTableProps#getExternalDataLocation} * @param externalDataLocation The data source location of the glue table, (e.g. default_db_public_example for Redshift). This parameter is required. * If this property is set, it will override both bucket and s3Prefix. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder externalDataLocation(java.lang.String externalDataLocation) { this.externalDataLocation = externalDataLocation; return this; } /** * Sets the value of {@link ExternalTableProps#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 columns) { this.columns = (java.util.List)columns; return this; } /** * Sets the value of {@link ExternalTableProps#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 ExternalTableProps#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 ExternalTableProps#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 ExternalTableProps#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 ExternalTableProps#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 ExternalTableProps#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 ExternalTableProps#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 partitionIndexes) { this.partitionIndexes = (java.util.List)partitionIndexes; return this; } /** * Sets the value of {@link ExternalTableProps#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 partitionKeys) { this.partitionKeys = (java.util.List)partitionKeys; return this; } /** * Sets the value of {@link ExternalTableProps#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 storageParameters) { this.storageParameters = (java.util.List)storageParameters; return this; } /** * Sets the value of {@link ExternalTableProps#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 ExternalTableProps#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 ExternalTableProps} * @throws NullPointerException if any required attribute was not provided */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @Override public ExternalTableProps build() { return new Jsii$Proxy(this); } } /** * An implementation for {@link ExternalTableProps} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @software.amazon.jsii.Internal final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements ExternalTableProps { private final software.amazon.awscdk.services.glue.alpha.IConnection connection; private final java.lang.String externalDataLocation; 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.connection = software.amazon.jsii.Kernel.get(this, "connection", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.glue.alpha.IConnection.class)); this.externalDataLocation = software.amazon.jsii.Kernel.get(this, "externalDataLocation", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); 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.connection = java.util.Objects.requireNonNull(builder.connection, "connection is required"); this.externalDataLocation = java.util.Objects.requireNonNull(builder.externalDataLocation, "externalDataLocation is required"); 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 software.amazon.awscdk.services.glue.alpha.IConnection getConnection() { return this.connection; } @Override public final java.lang.String getExternalDataLocation() { return this.externalDataLocation; } @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("connection", om.valueToTree(this.getConnection())); data.set("externalDataLocation", om.valueToTree(this.getExternalDataLocation())); 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.ExternalTableProps")); 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; ExternalTableProps.Jsii$Proxy that = (ExternalTableProps.Jsii$Proxy) o; if (!connection.equals(that.connection)) return false; if (!externalDataLocation.equals(that.externalDataLocation)) return false; 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.connection.hashCode(); result = 31 * result + (this.externalDataLocation.hashCode()); result = 31 * 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; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy