Skip to content

Apache DataFusion SQL Query Engine

Minor: comments about coercion in physical planner (#4745)

Andrew Lamb3abbffb5c833
diff --git a/datafusion/physical-expr/src/planner.rs b/datafusion/physical-expr/src/planner.rs
index e6b1dedc40..98955c6ac3 100644
--- a/datafusion/physical-expr/src/planner.rs
+++ b/datafusion/physical-expr/src/planner.rs
@@ -198,8 +198,13 @@ pub fn create_physical_expr(
input_schema,
)?)),
_ => {
- // we have coerced both sides into a common type in the logical phase,
- // and then perform a binary operation
+ // Note that the logical planner is responsible
+ // for type coercion on the arguments (e.g. if one
+ // argument was originally Int32 and one was
+ // Int64 they will both be coerced to Int64).
+ //
+ // There should be no coercion during physical
+ // planning.
binary(lhs, *op, rhs, input_schema)
}
}