cloud-fan commented on PR #36615:
URL: https://github.com/apache/spark/pull/36615#issuecomment-1132481952

   Good catch!
   
   This is a long-standing issue. The type coercion for decimal types is really 
messy as it's not bound to `Expression.resolved`. Changing the rule order does 
fix this simple query, but I'm afraid it's still fragile as rule order is quite 
unreliable.
   
   I'd like to have a more aggresive refactor: let's don't require operands of 
these math operations to be the same decimal type, and we can define the return 
decimal type for each math operation individually. Then the only thing need to 
be done in the type coercion is to cast non-decimal operands to decimal types.


-- 
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: reviews-unsubscr...@spark.apache.org

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


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

Reply via email to