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

xtdb.arrow.KeywordVector.kt Maven / Gradle / Ivy

The newest version!
package xtdb.arrow

import clojure.lang.Keyword
import org.apache.arrow.vector.types.pojo.Field
import org.apache.arrow.vector.types.pojo.FieldType
import xtdb.api.query.IKeyFn
import xtdb.vector.extensions.KeywordType

class KeywordVector(override val inner: Utf8Vector): ExtensionVector() {
    override val field: Field = Field(name, FieldType(nullable, KeywordType, null), emptyList())

    override fun getObject0(idx: Int, keyFn: IKeyFn<*>) = Keyword.intern(inner.getObject0(idx, keyFn))

    override fun writeObject0(value: Any) = when(value) {
        is Keyword -> inner.writeObject(value.sym.toString())
        else -> TODO("promotion")
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy