Skip to content

Commit 48fa890

Browse files
committed
fmt
1 parent 369d372 commit 48fa890

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

datafusion/datasource-parquet/src/row_filter.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ impl DatafusionArrowPredicate {
120120
time: metrics::Time,
121121
) -> Result<Self> {
122122
let projected_schema = Arc::clone(&candidate.filter_schema);
123-
let physical_expr = transform_physical_expr_with_schema(candidate.expr, &projected_schema)?;
123+
let physical_expr =
124+
transform_physical_expr_with_schema(candidate.expr, &projected_schema)?;
124125

125126
Ok(Self {
126127
physical_expr,

datafusion/physical-expr-common/src/physical_expr.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,7 @@ pub trait PhysicalExpr: Send + Sync + Display + Debug + DynEq + DynHash {
337337
/// Adapt this [`PhysicalExpr`] to a new schema.
338338
/// For example, `Column("b", 1)` can be adapted to `Column("b", 0)`
339339
/// given the schema `Schema::new(vec![("b", DataType::Int32)])`.
340-
fn with_schema(
341-
&self,
342-
_schema: &Schema,
343-
) -> Result<Option<Arc<dyn PhysicalExpr>>> {
340+
fn with_schema(&self, _schema: &Schema) -> Result<Option<Arc<dyn PhysicalExpr>>> {
344341
// By default, we return the same expression.
345342
// This is a safe default behavior.
346343
Ok(None)
@@ -551,4 +548,4 @@ pub fn transform_physical_expr_with_schema(
551548
}
552549
})
553550
.data()
554-
}
551+
}

datafusion/physical-expr/src/expressions/column.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,7 @@ impl PhysicalExpr for Column {
142142
write!(f, "{}", self.name)
143143
}
144144

145-
fn with_schema(
146-
&self,
147-
schema: &Schema,
148-
) -> Result<Option<Arc<dyn PhysicalExpr>>> {
145+
fn with_schema(&self, schema: &Schema) -> Result<Option<Arc<dyn PhysicalExpr>>> {
149146
// Find our index in the new schema
150147
let new_index = schema.index_of(&self.name)?;
151148
// If the index is the same return None to indicate no change

datafusion/physical-expr/src/expressions/dynamic_filters.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,13 @@ mod test {
334334
// Each ParquetExec calls `with_new_children` on the DynamicFilterPhysicalExpr
335335
// and remaps the children to the file schema.
336336
let filter = Arc::clone(&dynamic_filter);
337-
let dynamic_filter_1 = transform_physical_expr_with_schema(filter, &filter_schema_1).unwrap();
337+
let dynamic_filter_1 =
338+
transform_physical_expr_with_schema(filter, &filter_schema_1).unwrap();
338339
let snap = dynamic_filter_1.snapshot().unwrap().unwrap();
339340
insta::assert_snapshot!(format!("{snap:?}"), @r#"BinaryExpr { left: Column { name: "a", index: 0 }, op: Eq, right: Literal { value: Int32(42) }, fail_on_overflow: false }"#);
340341
let filter = Arc::clone(&dynamic_filter);
341-
let dynamic_filter_2 = transform_physical_expr_with_schema(filter, &filter_schema_2).unwrap();
342+
let dynamic_filter_2 =
343+
transform_physical_expr_with_schema(filter, &filter_schema_2).unwrap();
342344
let snap = dynamic_filter_2.snapshot().unwrap().unwrap();
343345
insta::assert_snapshot!(format!("{snap:?}"), @r#"BinaryExpr { left: Column { name: "a", index: 1 }, op: Eq, right: Literal { value: Int32(42) }, fail_on_overflow: false }"#);
344346
// Both filters allow evaluating the same expression

0 commit comments

Comments
 (0)