Skip to content

Commit 83d9fdf

Browse files
authored
fix: use int2 for arrow 8-bit int (#311)
1 parent fbca72d commit 83d9fdf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arrow-pg/src/datatypes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub fn into_pg_type(arrow_type: &DataType) -> PgWireResult<Type> {
2424
let datatype = match arrow_type {
2525
DataType::Null => Type::UNKNOWN,
2626
DataType::Boolean => Type::BOOL,
27-
DataType::Int8 => Type::CHAR,
27+
DataType::Int8 => Type::INT2,
2828
DataType::Int16 | DataType::UInt8 => Type::INT2,
2929
DataType::Int32 | DataType::UInt16 => Type::INT4,
3030
DataType::Int64 | DataType::UInt32 => Type::INT8,
@@ -53,7 +53,7 @@ pub fn into_pg_type(arrow_type: &DataType) -> PgWireResult<Type> {
5353
| DataType::ListView(field)
5454
| DataType::LargeListView(field) => match field.data_type() {
5555
DataType::Boolean => Type::BOOL_ARRAY,
56-
DataType::Int8 => Type::CHAR_ARRAY,
56+
DataType::Int8 => Type::INT2_ARRAY,
5757
DataType::Int16 | DataType::UInt8 => Type::INT2_ARRAY,
5858
DataType::Int32 | DataType::UInt16 => Type::INT4_ARRAY,
5959
DataType::Int64 | DataType::UInt32 => Type::INT8_ARRAY,

0 commit comments

Comments
 (0)