This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/master by this push:
     new 3abbffb5c Minor: comments about coercion in physical planner (#4745)
3abbffb5c is described below

commit 3abbffb5c83395e8e6e68e5529835e72e7769d0d
Author: Andrew Lamb <[email protected]>
AuthorDate: Wed Dec 28 16:03:21 2022 -0500

    Minor: comments about coercion in physical planner (#4745)
---
 datafusion/physical-expr/src/planner.rs | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/datafusion/physical-expr/src/planner.rs 
b/datafusion/physical-expr/src/planner.rs
index e6b1dedc4..98955c6ac 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)
                 }
             }

Reply via email to