File size: 3,744 Bytes
b98ffbb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
use arrow::array::{PrimitiveArray, StringArray};
use crate::IntoArrow;
impl IntoArrow for bool {
type A = arrow::array::BooleanArray;
fn into_arrow(self) -> Self::A {
std::iter::once(Some(self)).collect()
}
}
impl IntoArrow for u8 {
type A = PrimitiveArray<arrow::datatypes::UInt8Type>;
fn into_arrow(self) -> Self::A {
std::iter::once(self).collect()
}
}
impl IntoArrow for u16 {
type A = PrimitiveArray<arrow::datatypes::UInt16Type>;
fn into_arrow(self) -> Self::A {
std::iter::once(self).collect()
}
}
impl IntoArrow for u32 {
type A = PrimitiveArray<arrow::datatypes::UInt32Type>;
fn into_arrow(self) -> Self::A {
std::iter::once(self).collect()
}
}
impl IntoArrow for u64 {
type A = PrimitiveArray<arrow::datatypes::UInt64Type>;
fn into_arrow(self) -> Self::A {
std::iter::once(self).collect()
}
}
impl IntoArrow for i8 {
type A = PrimitiveArray<arrow::datatypes::Int8Type>;
fn into_arrow(self) -> Self::A {
std::iter::once(self).collect()
}
}
impl IntoArrow for i16 {
type A = PrimitiveArray<arrow::datatypes::Int16Type>;
fn into_arrow(self) -> Self::A {
std::iter::once(self).collect()
}
}
impl IntoArrow for i32 {
type A = PrimitiveArray<arrow::datatypes::Int32Type>;
fn into_arrow(self) -> Self::A {
std::iter::once(self).collect()
}
}
impl IntoArrow for i64 {
type A = PrimitiveArray<arrow::datatypes::Int64Type>;
fn into_arrow(self) -> Self::A {
std::iter::once(self).collect()
}
}
impl IntoArrow for f32 {
type A = PrimitiveArray<arrow::datatypes::Float32Type>;
fn into_arrow(self) -> Self::A {
std::iter::once(self).collect()
}
}
impl IntoArrow for f64 {
type A = PrimitiveArray<arrow::datatypes::Float64Type>;
fn into_arrow(self) -> Self::A {
std::iter::once(self).collect()
}
}
impl IntoArrow for &str {
type A = StringArray;
fn into_arrow(self) -> Self::A {
std::iter::once(Some(self)).collect()
}
}
impl IntoArrow for Vec<u8> {
type A = PrimitiveArray<arrow::datatypes::UInt8Type>;
fn into_arrow(self) -> Self::A {
self.into()
}
}
impl IntoArrow for Vec<u16> {
type A = PrimitiveArray<arrow::datatypes::UInt16Type>;
fn into_arrow(self) -> Self::A {
self.into()
}
}
impl IntoArrow for Vec<u32> {
type A = PrimitiveArray<arrow::datatypes::UInt32Type>;
fn into_arrow(self) -> Self::A {
self.into()
}
}
impl IntoArrow for Vec<u64> {
type A = PrimitiveArray<arrow::datatypes::UInt64Type>;
fn into_arrow(self) -> Self::A {
self.into()
}
}
impl IntoArrow for Vec<i8> {
type A = PrimitiveArray<arrow::datatypes::Int8Type>;
fn into_arrow(self) -> Self::A {
self.into()
}
}
impl IntoArrow for Vec<i16> {
type A = PrimitiveArray<arrow::datatypes::Int16Type>;
fn into_arrow(self) -> Self::A {
self.into()
}
}
impl IntoArrow for Vec<i32> {
type A = PrimitiveArray<arrow::datatypes::Int32Type>;
fn into_arrow(self) -> Self::A {
self.into()
}
}
impl IntoArrow for Vec<i64> {
type A = PrimitiveArray<arrow::datatypes::Int64Type>;
fn into_arrow(self) -> Self::A {
self.into()
}
}
impl IntoArrow for Vec<f32> {
type A = PrimitiveArray<arrow::datatypes::Float32Type>;
fn into_arrow(self) -> Self::A {
self.into()
}
}
impl IntoArrow for Vec<f64> {
type A = PrimitiveArray<arrow::datatypes::Float64Type>;
fn into_arrow(self) -> Self::A {
self.into()
}
}
impl IntoArrow for () {
type A = arrow::array::NullArray;
fn into_arrow(self) -> Self::A {
arrow::array::NullArray::new(0)
}
}
|