Skip to content

[Variant] Support more Arrow Datatypes from Variant primitive types #8805

@klion26

Description

@klion26

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

We have implemented the variant primitive to arrow types for all variant primitive types now(1-1 mapping), but maybe the user will pass a different type which is not a valid arrow primitive type, this issue wants to discuss which arrow types we will support transformed from variant primitive with cast, or we don't need to support these types.

Describe the solution you'd like

Here is data types I collected for now

Arrow DataType Variant primitive Type Cast logic
Date64 Date32 Date32 * (24 * 60 * 60 * 1000)`
Timestamp_[ntz](Second) Timestamp_[ntz](Micros/Nanos) - use micros as an example
- let the timestamp be t
- there are two options for unhappy path
1. return None if t % 1000000 != 0
2 return floor[t / 1000000]
TImestamp_[ntz](Millisecond) Timestamp_[ntz](Micros/Nanos) Same as above
Time32(Second/Millisecond) Time same as above
Time64(Nanosecond) Time(Macors) same as above

Describe alternatives you've considered

If there is any types we want to support, we can ref to the logic of variant_to_arrow.rs#make_variant_to_arrow_row_builder for more info

Additional context

Metadata

Metadata

Assignees

Labels

enhancementAny new improvement worthy of a entry in the changelog

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions