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

commonMain.aws.sdk.kotlin.services.glue.model.JdbcConnectorOptions.kt Maven / Gradle / Ivy

There is a newer version: 1.3.76
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.glue.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Additional connection options for the connector.
 */
public class JdbcConnectorOptions private constructor(builder: Builder) {
    /**
     * Custom data type mapping that builds a mapping from a JDBC data type to an Glue data type. For example, the option `"dataTypeMapping":{"FLOAT":"STRING"}` maps data fields of JDBC type `FLOAT` into the Java `String` type by calling the `ResultSet.getString()` method of the driver, and uses it to build the Glue record. The `ResultSet` object is implemented by each driver, so the behavior is specific to the driver you use. Refer to the documentation for your JDBC driver to understand how the driver performs the conversions.
     */
    public val dataTypeMapping: Map? = builder.dataTypeMapping
    /**
     * Extra condition clause to filter data from source. For example:
     *
     * `BillingCity='Mountain View'`
     *
     * When using a query instead of a table name, you should validate that the query works with the specified `filterPredicate`.
     */
    public val filterPredicate: kotlin.String? = builder.filterPredicate
    /**
     * The name of the job bookmark keys on which to sort.
     */
    public val jobBookmarkKeys: List? = builder.jobBookmarkKeys
    /**
     * Specifies an ascending or descending sort order.
     */
    public val jobBookmarkKeysSortOrder: kotlin.String? = builder.jobBookmarkKeysSortOrder
    /**
     * The minimum value of `partitionColumn` that is used to decide partition stride.
     */
    public val lowerBound: kotlin.Long? = builder.lowerBound
    /**
     * The number of partitions. This value, along with `lowerBound` (inclusive) and `upperBound` (exclusive), form partition strides for generated `WHERE` clause expressions that are used to split the `partitionColumn`.
     */
    public val numPartitions: kotlin.Long? = builder.numPartitions
    /**
     * The name of an integer column that is used for partitioning. This option works only when it's included with `lowerBound`, `upperBound`, and `numPartitions`. This option works the same way as in the Spark SQL JDBC reader.
     */
    public val partitionColumn: kotlin.String? = builder.partitionColumn
    /**
     * The maximum value of `partitionColumn` that is used to decide partition stride.
     */
    public val upperBound: kotlin.Long? = builder.upperBound

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.glue.model.JdbcConnectorOptions = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("JdbcConnectorOptions(")
        append("dataTypeMapping=$dataTypeMapping,")
        append("filterPredicate=$filterPredicate,")
        append("jobBookmarkKeys=$jobBookmarkKeys,")
        append("jobBookmarkKeysSortOrder=$jobBookmarkKeysSortOrder,")
        append("lowerBound=$lowerBound,")
        append("numPartitions=$numPartitions,")
        append("partitionColumn=$partitionColumn,")
        append("upperBound=$upperBound")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = dataTypeMapping?.hashCode() ?: 0
        result = 31 * result + (filterPredicate?.hashCode() ?: 0)
        result = 31 * result + (jobBookmarkKeys?.hashCode() ?: 0)
        result = 31 * result + (jobBookmarkKeysSortOrder?.hashCode() ?: 0)
        result = 31 * result + (lowerBound?.hashCode() ?: 0)
        result = 31 * result + (numPartitions?.hashCode() ?: 0)
        result = 31 * result + (partitionColumn?.hashCode() ?: 0)
        result = 31 * result + (upperBound?.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 JdbcConnectorOptions

        if (dataTypeMapping != other.dataTypeMapping) return false
        if (filterPredicate != other.filterPredicate) return false
        if (jobBookmarkKeys != other.jobBookmarkKeys) return false
        if (jobBookmarkKeysSortOrder != other.jobBookmarkKeysSortOrder) return false
        if (lowerBound != other.lowerBound) return false
        if (numPartitions != other.numPartitions) return false
        if (partitionColumn != other.partitionColumn) return false
        if (upperBound != other.upperBound) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.glue.model.JdbcConnectorOptions = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * Custom data type mapping that builds a mapping from a JDBC data type to an Glue data type. For example, the option `"dataTypeMapping":{"FLOAT":"STRING"}` maps data fields of JDBC type `FLOAT` into the Java `String` type by calling the `ResultSet.getString()` method of the driver, and uses it to build the Glue record. The `ResultSet` object is implemented by each driver, so the behavior is specific to the driver you use. Refer to the documentation for your JDBC driver to understand how the driver performs the conversions.
         */
        public var dataTypeMapping: Map? = null
        /**
         * Extra condition clause to filter data from source. For example:
         *
         * `BillingCity='Mountain View'`
         *
         * When using a query instead of a table name, you should validate that the query works with the specified `filterPredicate`.
         */
        public var filterPredicate: kotlin.String? = null
        /**
         * The name of the job bookmark keys on which to sort.
         */
        public var jobBookmarkKeys: List? = null
        /**
         * Specifies an ascending or descending sort order.
         */
        public var jobBookmarkKeysSortOrder: kotlin.String? = null
        /**
         * The minimum value of `partitionColumn` that is used to decide partition stride.
         */
        public var lowerBound: kotlin.Long? = null
        /**
         * The number of partitions. This value, along with `lowerBound` (inclusive) and `upperBound` (exclusive), form partition strides for generated `WHERE` clause expressions that are used to split the `partitionColumn`.
         */
        public var numPartitions: kotlin.Long? = null
        /**
         * The name of an integer column that is used for partitioning. This option works only when it's included with `lowerBound`, `upperBound`, and `numPartitions`. This option works the same way as in the Spark SQL JDBC reader.
         */
        public var partitionColumn: kotlin.String? = null
        /**
         * The maximum value of `partitionColumn` that is used to decide partition stride.
         */
        public var upperBound: kotlin.Long? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.JdbcConnectorOptions) : this() {
            this.dataTypeMapping = x.dataTypeMapping
            this.filterPredicate = x.filterPredicate
            this.jobBookmarkKeys = x.jobBookmarkKeys
            this.jobBookmarkKeysSortOrder = x.jobBookmarkKeysSortOrder
            this.lowerBound = x.lowerBound
            this.numPartitions = x.numPartitions
            this.partitionColumn = x.partitionColumn
            this.upperBound = x.upperBound
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.glue.model.JdbcConnectorOptions = JdbcConnectorOptions(this)

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy