Skip to content

Commit 8c38433

Browse files
committed
fix test case
1 parent c71db45 commit 8c38433

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

datafusion/core/src/physical_plan/planner.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,7 +1666,7 @@ mod tests {
16661666
use crate::execution::runtime_env::RuntimeEnv;
16671667
use crate::logical_plan::plan::Extension;
16681668
use crate::physical_plan::{
1669-
expressions, DisplayFormatType, Partitioning, Statistics,
1669+
expressions, DisplayFormatType, Partitioning, PhysicalPlanner, Statistics,
16701670
};
16711671
use crate::prelude::{SessionConfig, SessionContext};
16721672
use crate::scalar::ScalarValue;
@@ -1696,7 +1696,7 @@ mod tests {
16961696
session_state.config.target_partitions = 4;
16971697
let planner = DefaultPhysicalPlanner::default();
16981698
// in the test, we should optimize the logical plan first
1699-
session_state.optimize(logical_plan)?;
1699+
let logical_plan = session_state.optimize(logical_plan)?;
17001700
planner
17011701
.create_physical_plan(&logical_plan, &session_state)
17021702
.await
@@ -1717,8 +1717,9 @@ mod tests {
17171717
let plan = plan(&logical_plan).await?;
17181718

17191719
// verify that the plan correctly casts u8 to i64
1720+
// the cast from u8 to i64 for literal will be simplified, and get lit(int64(5))
17201721
// the cast here is implicit so has CastOptions with safe=true
1721-
let expected = "BinaryExpr { left: Column { name: \"c7\", index: 2 }, op: Lt, right: CastExpr { expr: Literal { value: UInt8(5) }, cast_type: Int64";
1722+
let expected = "BinaryExpr { left: Column { name: \"c7\", index: 2 }, op: Lt, right: Literal { value: Int64(5) } }";
17221723
assert!(format!("{:?}", plan).contains(expected));
17231724
Ok(())
17241725
}

datafusion/optimizer/src/type_coercion.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ impl ExprRewriter for TypeCoercionRewriter<'_> {
124124
right.clone().cast_to(&coerced_type, &self.schema)?,
125125
),
126126
};
127-
128127
expr.rewrite(&mut self.const_evaluator)
129128
}
130129
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ mod tests {
12991299
Operator::BitwiseXor,
13001300
Int64Array,
13011301
DataType::Int64,
1302-
vec![9i64, 4i64, 6i64]
1302+
vec![9i64, 4i64, 6i64],
13031303
);
13041304
Ok(())
13051305
}

0 commit comments

Comments
 (0)