Mark1626 commented on PR #18999: URL: https://github.com/apache/datafusion/pull/18999#issuecomment-3619858901
Ok, instead of converting to float I'll keep it as integers and perform and integer log. Just one thing though the `log` function in DuckDB and Clickhouse return `float64/double` so the behaviour might different (but I personally think that's fine, as the user will not have an implicit type conversion from decimal to float). And if we are returning as decimal then the following is expected right? across Decimal32, Decimal64, Decimal128, Decimal256 | Query | Res | |----------------------------------|-------| | select log(12345::decimal(38,0)) | 4.0 | | select log(12345::decimal(38,2)) | 4.09 | I went through the Intel and IBM solution to understand potential edge cases which could affect precision. I won't be porting anything from them unless it's truly needed, point noted -- 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]
