alan910127 commented on code in PR #15482:
URL: https://github.com/apache/datafusion/pull/15482#discussion_r2029961032


##########
datafusion/optimizer/src/analyzer/type_coercion.rs:
##########
@@ -290,12 +290,31 @@ impl<'a> TypeCoercionRewriter<'a> {
         right: Expr,
         right_schema: &DFSchema,
     ) -> Result<(Expr, Expr)> {
-        let (left_type, right_type) = BinaryTypeCoercer::new(
-            &left.get_type(left_schema)?,
-            &op,
-            &right.get_type(right_schema)?,
-        )
-        .get_input_types()?;
+        let left_type = left.get_type(left_schema)?;
+        let right_type = right.get_type(right_schema)?;
+
+        match (&left, &right) {

Review Comment:
   I think both are valid -- duckdb supports something like `select int_col = 
'12'||'3'`, while postgres returns an error since it only treats string 
literals as `unknown` type (thus the filter was `int = text` => error). 
However, I think supporting expressions makes more sense semantically (I 
believe we don't have a concept like the `unknown` type?).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to