From 557c79ff2c443c089e09d3ad60d382eb7fdba7bf Mon Sep 17 00:00:00 2001 From: Phillip LeBlanc Date: Sat, 21 Dec 2024 14:18:42 +0900 Subject: [PATCH] Handle converting Utf8View & BinaryView to Iceberg schema --- crates/iceberg/src/arrow/schema.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/iceberg/src/arrow/schema.rs b/crates/iceberg/src/arrow/schema.rs index 91dfe85e9..3aad6b0c9 100644 --- a/crates/iceberg/src/arrow/schema.rs +++ b/crates/iceberg/src/arrow/schema.rs @@ -119,8 +119,10 @@ fn visit_type(r#type: &DataType, visitor: &mut V) -> Resu DataType::Boolean | DataType::Utf8 | DataType::LargeUtf8 + | DataType::Utf8View | DataType::Binary | DataType::LargeBinary + | DataType::BinaryView | DataType::FixedSizeBinary(_) ) => { @@ -402,7 +404,9 @@ impl ArrowSchemaVisitor for ArrowSchemaConverter { { Ok(Type::Primitive(PrimitiveType::TimestamptzNs)) } - DataType::Binary | DataType::LargeBinary => Ok(Type::Primitive(PrimitiveType::Binary)), + DataType::Binary | DataType::LargeBinary | DataType::BinaryView => { + Ok(Type::Primitive(PrimitiveType::Binary)) + } DataType::FixedSizeBinary(width) => { Ok(Type::Primitive(PrimitiveType::Fixed(*width as u64))) }