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

commonMain.aws.sdk.kotlin.services.firehose.serde.OrcSerDeDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.firehose.serde

import aws.sdk.kotlin.services.firehose.model.OrcCompression
import aws.sdk.kotlin.services.firehose.model.OrcFormatVersion
import aws.sdk.kotlin.services.firehose.model.OrcSerDe
import aws.smithy.kotlin.runtime.serde.Deserializer
import aws.smithy.kotlin.runtime.serde.SdkFieldDescriptor
import aws.smithy.kotlin.runtime.serde.SdkObjectDescriptor
import aws.smithy.kotlin.runtime.serde.SerialKind
import aws.smithy.kotlin.runtime.serde.asSdkSerializable
import aws.smithy.kotlin.runtime.serde.deserializeList
import aws.smithy.kotlin.runtime.serde.deserializeMap
import aws.smithy.kotlin.runtime.serde.deserializeStruct
import aws.smithy.kotlin.runtime.serde.field
import aws.smithy.kotlin.runtime.serde.json.JsonDeserializer
import aws.smithy.kotlin.runtime.serde.json.JsonSerialName
import aws.smithy.kotlin.runtime.serde.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct
import kotlin.collections.mutableListOf

internal fun deserializeOrcSerDeDocument(deserializer: Deserializer): OrcSerDe {
    val builder = OrcSerDe.Builder()
    val BLOCKSIZEBYTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("BlockSizeBytes"))
    val BLOOMFILTERCOLUMNS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("BloomFilterColumns"))
    val BLOOMFILTERFALSEPOSITIVEPROBABILITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("BloomFilterFalsePositiveProbability"))
    val COMPRESSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Compression"))
    val DICTIONARYKEYTHRESHOLD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("DictionaryKeyThreshold"))
    val ENABLEPADDING_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("EnablePadding"))
    val FORMATVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("FormatVersion"))
    val PADDINGTOLERANCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("PaddingTolerance"))
    val ROWINDEXSTRIDE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("RowIndexStride"))
    val STRIPESIZEBYTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("StripeSizeBytes"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(BLOCKSIZEBYTES_DESCRIPTOR)
        field(BLOOMFILTERCOLUMNS_DESCRIPTOR)
        field(BLOOMFILTERFALSEPOSITIVEPROBABILITY_DESCRIPTOR)
        field(COMPRESSION_DESCRIPTOR)
        field(DICTIONARYKEYTHRESHOLD_DESCRIPTOR)
        field(ENABLEPADDING_DESCRIPTOR)
        field(FORMATVERSION_DESCRIPTOR)
        field(PADDINGTOLERANCE_DESCRIPTOR)
        field(ROWINDEXSTRIDE_DESCRIPTOR)
        field(STRIPESIZEBYTES_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                BLOCKSIZEBYTES_DESCRIPTOR.index -> builder.blockSizeBytes = deserializeInt()
                BLOOMFILTERCOLUMNS_DESCRIPTOR.index -> builder.bloomFilterColumns =
                    deserializer.deserializeList(BLOOMFILTERCOLUMNS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                BLOOMFILTERFALSEPOSITIVEPROBABILITY_DESCRIPTOR.index -> builder.bloomFilterFalsePositiveProbability = deserializeDouble()
                COMPRESSION_DESCRIPTOR.index -> builder.compression = deserializeString().let { OrcCompression.fromValue(it) }
                DICTIONARYKEYTHRESHOLD_DESCRIPTOR.index -> builder.dictionaryKeyThreshold = deserializeDouble()
                ENABLEPADDING_DESCRIPTOR.index -> builder.enablePadding = deserializeBoolean()
                FORMATVERSION_DESCRIPTOR.index -> builder.formatVersion = deserializeString().let { OrcFormatVersion.fromValue(it) }
                PADDINGTOLERANCE_DESCRIPTOR.index -> builder.paddingTolerance = deserializeDouble()
                ROWINDEXSTRIDE_DESCRIPTOR.index -> builder.rowIndexStride = deserializeInt()
                STRIPESIZEBYTES_DESCRIPTOR.index -> builder.stripeSizeBytes = deserializeInt()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy