comphead commented on code in PR #7674:
URL: https://github.com/apache/datafusion-comet/pull/7674#discussion_r4621378791


##########
native/spark-expr/src/utils.rs:
##########
@@ -322,6 +324,33 @@ fn pre_timestamp_cast(array: ArrayRef, timezone: String) 
-> Result<ArrayRef, Arr
     }
 }
 
+/// The values that `Decimal128Type::is_valid_decimal_precision` accepts for 
one precision, looked
+/// up once so that a per-row check is two inline comparisons. Arrow does not 
mark that method
+/// `#[inline]`, and release builds call it out of line on every row.

Review Comment:
   Filed apache/arrow-rs#12326 and linked it from the comment in b0b77cbc13. 
The comment keeps both reasons, as you suggested.
   
   Before filing, I checked the claims:
   - On arrow-rs `main` (`eb62e557`), none of the four 
`is_valid_decimal_precision` impls is `#[inline]`, while the arrow-data 
functions they wrap are.
   - arrow-cast calls the method per value in `cast/decimal.rs`.
   - In the 1.2.0 snapshot jar (`52ea712`, with the same three files as this 
PR's base), both `linux/aarch64/libcomet.so` and `linux/amd64/libcomet.so` call 
it from the places you listed. That is `update_single` once, AVG `update_batch` 
twice, each `merge_batch` once, and SUM `evaluate` twice. On amd64 it goes 
through GOT slot `0x6d5e9a0`.
   



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to