Skip to content

Commit

Permalink
c
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion committed Sep 17, 2024
1 parent de1aa24 commit c895a2e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions crates/polars-stream/src/nodes/parquet_source/metadata_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,14 @@ pub(super) fn ensure_metadata_has_projected_fields(
let schema = polars_parquet::arrow::read::infer_schema(metadata)?;

for field in projected_fields.iter_values() {
let Some(field) = schema.get(&field.name) else {
polars_bail!(SchemaMismatch: "did not find column: {}", field.name)
};

// Note: We convert to Polars-native dtypes for timezone normalization.
let dtype = DataType::from_arrow(&field.dtype, true);
let expected_dtype = DataType::from_arrow(&field.dtype, true);
let dtype = {
let Some(field) = schema.get(&field.name) else {
polars_bail!(SchemaMismatch: "did not find column: {}", field.name)
};
DataType::from_arrow(&field.dtype, true)
};

if dtype != expected_dtype {
polars_bail!(SchemaMismatch: "data type mismatch for column {}: found: {}, expected: {}",
Expand Down

0 comments on commit c895a2e

Please sign in to comment.