#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct Column {
pub name: String,
pub type_text: String,
pub type_json: String,
pub position: Option<i32>,
pub type_name: ColumnTypeName,
pub comment: Option<String>,
pub nullable: Option<bool>,
pub partition_index: Option<i32>,
}
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[repr(i32)]
pub enum ColumnTypeName {
#[default]
Unspecified = 0,
Boolean = 1,
Byte = 2,
Short = 3,
Int = 4,
Long = 5,
Float = 6,
Double = 7,
Date = 8,
Timestamp = 9,
String = 10,
Binary = 11,
Decimal = 12,
Interval = 13,
Array = 14,
Struct = 15,
Map = 16,
Char = 17,
Null = 18,
UserDefinedType = 19,
TimestampNtz = 20,
Variant = 21,
TableType = 22,
}
impl From<i32> for ColumnTypeName {
fn from(v: i32) -> Self {
match v {
1 => Self::Boolean,
2 => Self::Byte,
3 => Self::Short,
4 => Self::Int,
5 => Self::Long,
6 => Self::Float,
7 => Self::Double,
8 => Self::Date,
9 => Self::Timestamp,
10 => Self::String,
11 => Self::Binary,
12 => Self::Decimal,
13 => Self::Interval,
14 => Self::Array,
15 => Self::Struct,
16 => Self::Map,
17 => Self::Char,
18 => Self::Null,
19 => Self::UserDefinedType,
20 => Self::TimestampNtz,
21 => Self::Variant,
22 => Self::TableType,
_ => Self::Unspecified,
}
}
}