You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "Omega359 (via GitHub)" <gi...@apache.org> on 2025/03/20 20:39:13 UTC

[I] type coercion for arthmetic/binary ops fails for some unsigned/signed mappings [datafusion]

Omega359 opened a new issue, #15340:
URL: https://github.com/apache/datafusion/issues/15340

   ### Describe the bug
   
   The type coercion in the [mathematics_numerical_coercion](https://github.com/apache/datafusion/blob/main/datafusion/expr-common/src/type_coercion/binary.rs#L1014) function are too simple and do not properly handle mappings. However, the [binary_numeric_coercion](https://github.com/apache/datafusion/blob/main/datafusion/expr-common/src/type_coercion/binary.rs#L826) function does have the correct coercion rules for numeric values.
   
   
   
   ### To Reproduce
   
   You can see this with the tests:
   
   ``Rust
   test_coercion_binary_rule!(
               DataType::Int32,
               DataType::UInt32,
               Operator::Plus,
               DataType::Int32
           );
   ```
   That is incorrect. Proper expansion of i32 and u32 is i64, not i32. 
   
   ### Expected behavior
   
   Proper numeric type conversion happens when unsigned numeric types are involved.
   
   ### Additional context
   
   _No response_


-- 
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-unsubscribe@datafusion.apache.org.apache.org

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


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


Re: [I] type coercion for arthmetic/binary ops fails for some unsigned/signed mappings [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #15340: type coercion for arthmetic/binary ops fails for some unsigned/signed mappings
URL: https://github.com/apache/datafusion/issues/15340


-- 
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-unsubscribe@datafusion.apache.org

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


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


Re: [I] type coercion for arthmetic/binary ops fails for some unsigned/signed mappings [datafusion]

Posted by "Omega359 (via GitHub)" <gi...@apache.org>.
Omega359 commented on issue #15340:
URL: https://github.com/apache/datafusion/issues/15340#issuecomment-2741609413

   take


-- 
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-unsubscribe@datafusion.apache.org

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


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