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

xtdb.vector.extensions.UuidVector.kt Maven / Gradle / Ivy

The newest version!
package xtdb.vector.extensions

import org.apache.arrow.memory.BufferAllocator
import org.apache.arrow.vector.FixedSizeBinaryVector
import org.apache.arrow.vector.types.pojo.FieldType
import java.nio.ByteBuffer
import java.util.*

class UuidVector(name: String, allocator: BufferAllocator, fieldType: FieldType) :
    XtExtensionVector(name, allocator, fieldType, FixedSizeBinaryVector(name, allocator, 16)) {

    override fun getObject0(index: Int): UUID {
        val bb = ByteBuffer.wrap(underlyingVector.getObject(index))
        return UUID(bb.getLong(), bb.getLong())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy