xtdb.arrow.FixedSizeBinaryVector.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xtdb-core Show documentation
Show all versions of xtdb-core Show documentation
An open source document database with bitemporal graph queries
package xtdb.arrow
import org.apache.arrow.memory.BufferAllocator
import org.apache.arrow.vector.types.pojo.ArrowType
import xtdb.api.query.IKeyFn
import java.nio.ByteBuffer
class FixedSizeBinaryVector(
al: BufferAllocator,
override val name: String,
override var nullable: Boolean,
byteWidth: Int
) : FixedWidthVector(al, byteWidth) {
override val arrowType = ArrowType.FixedSizeBinary(byteWidth)
override fun getBytes(idx: Int): ByteBuffer = getBytes0(idx)
override fun getObject0(idx: Int, keyFn: IKeyFn<*>) = getByteArray(idx)
override fun writeObject0(value: Any) = when (value) {
is ByteBuffer -> writeBytes(value)
is ByteArray -> writeBytes(ByteBuffer.wrap(value))
else -> TODO("unknown type: ${value::class.simpleName}")
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy