westonpace commented on PR #15180:
URL: https://github.com/apache/arrow/pull/15180#issuecomment-1414566400

   > It would be good to run the macrobenchmarks on this. I would expect some 
speedup
   
   I will but I'm not certain we will get any speedup.
   
   > mainly in the python queries (assuming we have any that would trigger this)
   
   We don't.  The python queries are extremely basic.
   
   > I ran into some issues with decimal types 
   
   Yes.  In fact, for some of the simpler TPC-H queries, that conversion from 
decimal to double is a majority of the execution time.  Unfortunately, this PR 
does not fix that particular case because we don't support decimal arithmetic 
so a cast is inevitable.
   
   The implementation is a bit subtle.  All of our non-decimal implicit casts 
go from "narrow type" to "wider type" (e.g. it is a safe cast).  For example, 
if we have `add<int8, int16>` it will become `add<int16, int16>`.  So by 
shrinking the literal as much as possible we ensure it is the one that will be 
cast (or avoid the cast).
   
   With decimal implicit casts we actually go in the opposite direction.  We go 
from decimal (a wide type) to float64 (a more narrow type).  Since we don't 
shrink a float64 literal into a decimal literal we still end up casting the 
array and not the literal.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to