Skip to content

Commit

Permalink
Merge pull request #4 from splitgraph/feature/varchar-support
Browse files Browse the repository at this point in the history
Add VARCHAR support
  • Loading branch information
mildbyte authored Sep 18, 2024
2 parents 0eb89db + ecaaeb0 commit bd4653a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pg_arrow_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl ArrowBuilder {
scale: scale.into(),
}
}
Type::TEXT => StringBuilder(array::StringBuilder::new()),
Type::TEXT | Type::VARCHAR => StringBuilder(array::StringBuilder::new()),
Type::BYTEA => BinaryBuilder(array::BinaryBuilder::new()),
_ => panic!("Unsupported type: {}", type_info.pg_type),
}
Expand Down Expand Up @@ -181,7 +181,7 @@ fn pg_type_to_arrow_type(type_info: &PgTypeInfo) -> DataType {
numeric_typmod_precision(type_info.type_modifier).try_into().expect("Unsupported precision"),
numeric_typmod_scale(type_info.type_modifier).try_into().expect("Unsupported scale"),
),
Type::TEXT => DataType::Utf8,
Type::TEXT | Type::VARCHAR => DataType::Utf8,
Type::BYTEA => DataType::Binary,
_ => panic!("Unsupported type: {}. Explicitly cast the relevant columns to text in order to store them as strings.", type_info.pg_type),
}
Expand Down

0 comments on commit bd4653a

Please sign in to comment.