jayzhan211 commented on issue #15035:
URL: https://github.com/apache/datafusion/issues/15035#issuecomment-2726167036

   month_id is integer and "2024" is utf8.
   
   
   In `type_coercion`, we cast month_id to utf8 based on the coercion rule.
   `CAST(foo.month_id AS Utf8) = Utf8("2024")`
   
   Instead of unwrapping the cast after cast. How about we fix the type 
coercion to avoid the cast at the first place. Given the rhs is literal, we can 
try to parse the string to i32 and check if it is valid. I expect we end up 
`foo.month_id = 2024` in `type_coercion`. Although this only works for literal 
case, if both are columns, then we can only convert it to string since we don't 
know the value at this point.


-- 
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