Skip to content

Apache DataFusion SQL Query Engine

code clean (#4354)

Jie Hanba73c8180ebd
diff --git a/datafusion/core/src/datasource/listing/table.rs b/datafusion/core/src/datasource/listing/table.rs
index e3ee5f3840..11b295a48f 100644
--- a/datafusion/core/src/datasource/listing/table.rs
+++ b/datafusion/core/src/datasource/listing/table.rs
@@ -543,16 +543,15 @@ impl TableProvider for ListingTable {
.table_partition_cols
.iter()
.map(|col| {
- (
+ Ok((
col.0.to_owned(),
self.table_schema
- .field_with_name(&col.0)
- .unwrap()
+ .field_with_name(&col.0)?
.data_type()
.clone(),
- )
+ ))
})
- .collect();
+ .collect::<Result<Vec<_>>>()?;
// create the execution plan
self.options