greptimedb icon indicating copy to clipboard operation
greptimedb copied to clipboard

`PrimitiveVector` should as a logical data type

Open v0y4g3r opened this issue 2 years ago • 2 comments

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.

v0y4g3r avatar Aug 25 '22 07:08 v0y4g3r

We may also need to move the serialization of Vector to DataType, so we could serialize the elements based on vector's logical type.

evenyag avatar Sep 08 '22 07:09 evenyag

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.

waynexia avatar Nov 21 '22 07:11 waynexia

pub struct PrimitiveVector<T: LogicalPrimitiveType> {
    array: PrimitiveArray<T::ArrowPrimitive>,
}

This is implemented now? @v0y4g3r @waynexia

tisonkun avatar Mar 25 '24 15:03 tisonkun

This is related to the arrow2 crate, I guess we can close this issue now.

evenyag avatar Mar 26 '24 03:03 evenyag

No longer relevant.

tisonkun avatar Mar 26 '24 03:03 tisonkun