greptimedb
greptimedb copied to clipboard
`PrimitiveVector` should as a logical data type
PrimitiveVector
contains a primitive array, but the logical data type of vector may differ from it's internal array, for example, DateVector
is represented by a Int32Vector
, but the logical type is Date
.
In fact, arrow's PrimitveArray::new
accepts a parameter to specify it's logical data type, so PrimitiveVector
should also have a logical data type.
We may also need to move the serialization of Vector
to DataType
, so we could serialize the elements based on vector's logical type.
I suggest changing the parameter Primitive
of PrimitiveVector
to LogicalType
(or another naming). With a type parameter PhysicalType
. Just like this in arrow - ArrowPrimitiveType
and type parameter Native
.
pub struct PrimitiveVector<T: LogicalPrimitiveType> {
array: PrimitiveArray<T::ArrowPrimitive>,
}
This is implemented now? @v0y4g3r @waynexia
This is related to the arrow2 crate, I guess we can close this issue now.
No longer relevant.