xtdb.arrow.KeywordVector.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
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