From a408bd086a8b5247729a65a03eba2dfa815079a3 Mon Sep 17 00:00:00 2001 From: Kyle Barron Date: Wed, 3 Apr 2024 16:00:45 -0400 Subject: [PATCH] Don't check schema metadata in Table::try_new --- src/table/mod.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/table/mod.rs b/src/table/mod.rs index 167ae933..bfcdcf42 100644 --- a/src/table/mod.rs +++ b/src/table/mod.rs @@ -42,11 +42,16 @@ pub struct Table { impl Table { pub fn try_new(schema: SchemaRef, batches: Vec) -> Result { for batch in batches.iter() { - if batch.schema() != schema { + // Don't check schema metadata in comparisons. + // TODO: I have some issues in the Parquet reader where the batches are missing the + // schema metadata. + if batch.schema().fields() != schema.fields() { return Err(GeoArrowError::General(format!( - "Schema is not consistent across batches. Expected {}, got {}", + "Schema is not consistent across batches. Expected {}, got {}. With expected metadata: {:?}, got {:?}", schema, - batch.schema() + batch.schema(), + schema.metadata(), + batch.schema().metadata() ))); } }