Skip to content

Commit

Permalink
Don't check schema metadata in Table::try_new
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron committed Apr 3, 2024
1 parent 1327bae commit a408bd0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/table/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,16 @@ pub struct Table {
impl Table {
pub fn try_new(schema: SchemaRef, batches: Vec<RecordBatch>) -> Result<Self> {
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()
)));
}
}
Expand Down

0 comments on commit a408bd0

Please sign in to comment.