Skip to content

Commit

Permalink
feat(planner): map parquet error to datafusion error
Browse files Browse the repository at this point in the history
  • Loading branch information
devanbenz committed Sep 14, 2024
1 parent c62fb61 commit a3ea55a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion datafusion/sql/src/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use crate::utils::normalize_ident;

use arrow_schema::{DataType, Fields};
use datafusion_common::parsers::CompressionTypeVariant;
use datafusion_common::DataFusionError::ParquetError;
use datafusion_common::{
exec_err, not_impl_err, plan_datafusion_err, plan_err, schema_err,
unqualified_field_not_found, Column, Constraints, DFSchema, DFSchemaRef,
Expand Down Expand Up @@ -1034,7 +1035,8 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
"PARQUET" => {
if Path::exists((&location).as_ref()) {
let file = File::open(&location)?;
let parquet_file = ParquetRecordBatchReaderBuilder::try_new(file)?;
let parquet_file = ParquetRecordBatchReaderBuilder::try_new(file)
.map_err(|err| plan_datafusion_err!("{err}"))?;
let schema = parquet_file.schema();
schema.to_owned().to_dfschema_ref()?
} else {
Expand Down

0 comments on commit a3ea55a

Please sign in to comment.