commonMain.aws.sdk.kotlin.services.glue.model.Table.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of glue-jvm Show documentation
Show all versions of glue-jvm Show documentation
The AWS SDK for Kotlin client for Glue
The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.glue.model
import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant
/**
* Represents a collection of related data organized in columns and rows.
*/
public class Table private constructor(builder: Builder) {
/**
* The ID of the Data Catalog in which the table resides.
*/
public val catalogId: kotlin.String? = builder.catalogId
/**
* The time when the table definition was created in the Data Catalog.
*/
public val createTime: aws.smithy.kotlin.runtime.time.Instant? = builder.createTime
/**
* The person or entity who created the table.
*/
public val createdBy: kotlin.String? = builder.createdBy
/**
* The name of the database where the table metadata resides. For Hive compatibility, this must be all lowercase.
*/
public val databaseName: kotlin.String? = builder.databaseName
/**
* A description of the table.
*/
public val description: kotlin.String? = builder.description
/**
* A `FederatedTable` structure that references an entity outside the Glue Data Catalog.
*/
public val federatedTable: aws.sdk.kotlin.services.glue.model.FederatedTable? = builder.federatedTable
/**
* Specifies whether the view supports the SQL dialects of one or more different query engines and can therefore be read by those engines.
*/
public val isMultiDialectView: kotlin.Boolean? = builder.isMultiDialectView
/**
* Indicates whether the table has been registered with Lake Formation.
*/
public val isRegisteredWithLakeFormation: kotlin.Boolean = builder.isRegisteredWithLakeFormation
/**
* The last time that the table was accessed. This is usually taken from HDFS, and might not be reliable.
*/
public val lastAccessTime: aws.smithy.kotlin.runtime.time.Instant? = builder.lastAccessTime
/**
* The last time that column statistics were computed for this table.
*/
public val lastAnalyzedTime: aws.smithy.kotlin.runtime.time.Instant? = builder.lastAnalyzedTime
/**
* The table name. For Hive compatibility, this must be entirely lowercase.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* The owner of the table.
*/
public val owner: kotlin.String? = builder.owner
/**
* These key-value pairs define properties associated with the table.
*/
public val parameters: Map? = builder.parameters
/**
* A list of columns by which the table is partitioned. Only primitive types are supported as partition keys.
*
* When you create a table used by Amazon Athena, and you do not specify any `partitionKeys`, you must at least set the value of `partitionKeys` to an empty list. For example:
*
* `"PartitionKeys": []`
*/
public val partitionKeys: List? = builder.partitionKeys
/**
* The retention time for this table.
*/
public val retention: kotlin.Int = builder.retention
/**
* A structure containing information about the state of an asynchronous change to a table.
*/
public val status: aws.sdk.kotlin.services.glue.model.TableStatus? = builder.status
/**
* A storage descriptor containing information about the physical storage of this table.
*/
public val storageDescriptor: aws.sdk.kotlin.services.glue.model.StorageDescriptor? = builder.storageDescriptor
/**
* The type of this table. Glue will create tables with the `EXTERNAL_TABLE` type. Other services, such as Athena, may create tables with additional table types.
*
* Glue related table types:
*
* ## EXTERNAL_TABLE
* Hive compatible attribute - indicates a non-Hive managed table.
*
* ## GOVERNED
* Used by Lake Formation. The Glue Data Catalog understands `GOVERNED`.
*/
public val tableType: kotlin.String? = builder.tableType
/**
* A `TableIdentifier` structure that describes a target table for resource linking.
*/
public val targetTable: aws.sdk.kotlin.services.glue.model.TableIdentifier? = builder.targetTable
/**
* The last time that the table was updated.
*/
public val updateTime: aws.smithy.kotlin.runtime.time.Instant? = builder.updateTime
/**
* The ID of the table version.
*/
public val versionId: kotlin.String? = builder.versionId
/**
* A structure that contains all the information that defines the view, including the dialect or dialects for the view, and the query.
*/
public val viewDefinition: aws.sdk.kotlin.services.glue.model.ViewDefinition? = builder.viewDefinition
/**
* Included for Apache Hive compatibility. Not used in the normal course of Glue operations.
*/
public val viewExpandedText: kotlin.String? = builder.viewExpandedText
/**
* Included for Apache Hive compatibility. Not used in the normal course of Glue operations. If the table is a `VIRTUAL_VIEW`, certain Athena configuration encoded in base64.
*/
public val viewOriginalText: kotlin.String? = builder.viewOriginalText
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.glue.model.Table = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Table(")
append("catalogId=$catalogId,")
append("createTime=$createTime,")
append("createdBy=$createdBy,")
append("databaseName=$databaseName,")
append("description=$description,")
append("federatedTable=$federatedTable,")
append("isMultiDialectView=$isMultiDialectView,")
append("isRegisteredWithLakeFormation=$isRegisteredWithLakeFormation,")
append("lastAccessTime=$lastAccessTime,")
append("lastAnalyzedTime=$lastAnalyzedTime,")
append("name=$name,")
append("owner=$owner,")
append("parameters=$parameters,")
append("partitionKeys=$partitionKeys,")
append("retention=$retention,")
append("status=$status,")
append("storageDescriptor=$storageDescriptor,")
append("tableType=$tableType,")
append("targetTable=$targetTable,")
append("updateTime=$updateTime,")
append("versionId=$versionId,")
append("viewDefinition=$viewDefinition,")
append("viewExpandedText=$viewExpandedText,")
append("viewOriginalText=$viewOriginalText")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = catalogId?.hashCode() ?: 0
result = 31 * result + (createTime?.hashCode() ?: 0)
result = 31 * result + (createdBy?.hashCode() ?: 0)
result = 31 * result + (databaseName?.hashCode() ?: 0)
result = 31 * result + (description?.hashCode() ?: 0)
result = 31 * result + (federatedTable?.hashCode() ?: 0)
result = 31 * result + (isMultiDialectView?.hashCode() ?: 0)
result = 31 * result + (isRegisteredWithLakeFormation.hashCode())
result = 31 * result + (lastAccessTime?.hashCode() ?: 0)
result = 31 * result + (lastAnalyzedTime?.hashCode() ?: 0)
result = 31 * result + (name.hashCode())
result = 31 * result + (owner?.hashCode() ?: 0)
result = 31 * result + (parameters?.hashCode() ?: 0)
result = 31 * result + (partitionKeys?.hashCode() ?: 0)
result = 31 * result + (retention)
result = 31 * result + (status?.hashCode() ?: 0)
result = 31 * result + (storageDescriptor?.hashCode() ?: 0)
result = 31 * result + (tableType?.hashCode() ?: 0)
result = 31 * result + (targetTable?.hashCode() ?: 0)
result = 31 * result + (updateTime?.hashCode() ?: 0)
result = 31 * result + (versionId?.hashCode() ?: 0)
result = 31 * result + (viewDefinition?.hashCode() ?: 0)
result = 31 * result + (viewExpandedText?.hashCode() ?: 0)
result = 31 * result + (viewOriginalText?.hashCode() ?: 0)
return result
}
override fun equals(other: kotlin.Any?): kotlin.Boolean {
if (this === other) return true
if (other == null || this::class != other::class) return false
other as Table
if (catalogId != other.catalogId) return false
if (createTime != other.createTime) return false
if (createdBy != other.createdBy) return false
if (databaseName != other.databaseName) return false
if (description != other.description) return false
if (federatedTable != other.federatedTable) return false
if (isMultiDialectView != other.isMultiDialectView) return false
if (isRegisteredWithLakeFormation != other.isRegisteredWithLakeFormation) return false
if (lastAccessTime != other.lastAccessTime) return false
if (lastAnalyzedTime != other.lastAnalyzedTime) return false
if (name != other.name) return false
if (owner != other.owner) return false
if (parameters != other.parameters) return false
if (partitionKeys != other.partitionKeys) return false
if (retention != other.retention) return false
if (status != other.status) return false
if (storageDescriptor != other.storageDescriptor) return false
if (tableType != other.tableType) return false
if (targetTable != other.targetTable) return false
if (updateTime != other.updateTime) return false
if (versionId != other.versionId) return false
if (viewDefinition != other.viewDefinition) return false
if (viewExpandedText != other.viewExpandedText) return false
if (viewOriginalText != other.viewOriginalText) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.glue.model.Table = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The ID of the Data Catalog in which the table resides.
*/
public var catalogId: kotlin.String? = null
/**
* The time when the table definition was created in the Data Catalog.
*/
public var createTime: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The person or entity who created the table.
*/
public var createdBy: kotlin.String? = null
/**
* The name of the database where the table metadata resides. For Hive compatibility, this must be all lowercase.
*/
public var databaseName: kotlin.String? = null
/**
* A description of the table.
*/
public var description: kotlin.String? = null
/**
* A `FederatedTable` structure that references an entity outside the Glue Data Catalog.
*/
public var federatedTable: aws.sdk.kotlin.services.glue.model.FederatedTable? = null
/**
* Specifies whether the view supports the SQL dialects of one or more different query engines and can therefore be read by those engines.
*/
public var isMultiDialectView: kotlin.Boolean? = null
/**
* Indicates whether the table has been registered with Lake Formation.
*/
public var isRegisteredWithLakeFormation: kotlin.Boolean = false
/**
* The last time that the table was accessed. This is usually taken from HDFS, and might not be reliable.
*/
public var lastAccessTime: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The last time that column statistics were computed for this table.
*/
public var lastAnalyzedTime: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The table name. For Hive compatibility, this must be entirely lowercase.
*/
public var name: kotlin.String? = null
/**
* The owner of the table.
*/
public var owner: kotlin.String? = null
/**
* These key-value pairs define properties associated with the table.
*/
public var parameters: Map? = null
/**
* A list of columns by which the table is partitioned. Only primitive types are supported as partition keys.
*
* When you create a table used by Amazon Athena, and you do not specify any `partitionKeys`, you must at least set the value of `partitionKeys` to an empty list. For example:
*
* `"PartitionKeys": []`
*/
public var partitionKeys: List? = null
/**
* The retention time for this table.
*/
public var retention: kotlin.Int = 0
/**
* A structure containing information about the state of an asynchronous change to a table.
*/
public var status: aws.sdk.kotlin.services.glue.model.TableStatus? = null
/**
* A storage descriptor containing information about the physical storage of this table.
*/
public var storageDescriptor: aws.sdk.kotlin.services.glue.model.StorageDescriptor? = null
/**
* The type of this table. Glue will create tables with the `EXTERNAL_TABLE` type. Other services, such as Athena, may create tables with additional table types.
*
* Glue related table types:
*
* ## EXTERNAL_TABLE
* Hive compatible attribute - indicates a non-Hive managed table.
*
* ## GOVERNED
* Used by Lake Formation. The Glue Data Catalog understands `GOVERNED`.
*/
public var tableType: kotlin.String? = null
/**
* A `TableIdentifier` structure that describes a target table for resource linking.
*/
public var targetTable: aws.sdk.kotlin.services.glue.model.TableIdentifier? = null
/**
* The last time that the table was updated.
*/
public var updateTime: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The ID of the table version.
*/
public var versionId: kotlin.String? = null
/**
* A structure that contains all the information that defines the view, including the dialect or dialects for the view, and the query.
*/
public var viewDefinition: aws.sdk.kotlin.services.glue.model.ViewDefinition? = null
/**
* Included for Apache Hive compatibility. Not used in the normal course of Glue operations.
*/
public var viewExpandedText: kotlin.String? = null
/**
* Included for Apache Hive compatibility. Not used in the normal course of Glue operations. If the table is a `VIRTUAL_VIEW`, certain Athena configuration encoded in base64.
*/
public var viewOriginalText: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.glue.model.Table) : this() {
this.catalogId = x.catalogId
this.createTime = x.createTime
this.createdBy = x.createdBy
this.databaseName = x.databaseName
this.description = x.description
this.federatedTable = x.federatedTable
this.isMultiDialectView = x.isMultiDialectView
this.isRegisteredWithLakeFormation = x.isRegisteredWithLakeFormation
this.lastAccessTime = x.lastAccessTime
this.lastAnalyzedTime = x.lastAnalyzedTime
this.name = x.name
this.owner = x.owner
this.parameters = x.parameters
this.partitionKeys = x.partitionKeys
this.retention = x.retention
this.status = x.status
this.storageDescriptor = x.storageDescriptor
this.tableType = x.tableType
this.targetTable = x.targetTable
this.updateTime = x.updateTime
this.versionId = x.versionId
this.viewDefinition = x.viewDefinition
this.viewExpandedText = x.viewExpandedText
this.viewOriginalText = x.viewOriginalText
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.glue.model.Table = Table(this)
/**
* construct an [aws.sdk.kotlin.services.glue.model.FederatedTable] inside the given [block]
*/
public fun federatedTable(block: aws.sdk.kotlin.services.glue.model.FederatedTable.Builder.() -> kotlin.Unit) {
this.federatedTable = aws.sdk.kotlin.services.glue.model.FederatedTable.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.glue.model.TableStatus] inside the given [block]
*/
public fun status(block: aws.sdk.kotlin.services.glue.model.TableStatus.Builder.() -> kotlin.Unit) {
this.status = aws.sdk.kotlin.services.glue.model.TableStatus.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.glue.model.StorageDescriptor] inside the given [block]
*/
public fun storageDescriptor(block: aws.sdk.kotlin.services.glue.model.StorageDescriptor.Builder.() -> kotlin.Unit) {
this.storageDescriptor = aws.sdk.kotlin.services.glue.model.StorageDescriptor.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.glue.model.TableIdentifier] inside the given [block]
*/
public fun targetTable(block: aws.sdk.kotlin.services.glue.model.TableIdentifier.Builder.() -> kotlin.Unit) {
this.targetTable = aws.sdk.kotlin.services.glue.model.TableIdentifier.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.glue.model.ViewDefinition] inside the given [block]
*/
public fun viewDefinition(block: aws.sdk.kotlin.services.glue.model.ViewDefinition.Builder.() -> kotlin.Unit) {
this.viewDefinition = aws.sdk.kotlin.services.glue.model.ViewDefinition.invoke(block)
}
internal fun correctErrors(): Builder {
if (name == null) name = ""
return this
}
}
}