kazantsev-maksim opened a new pull request, #344: URL: https://github.com/apache/datafusion-spark/pull/344
## Which issue does this PR close? - Closes #266. ## Rationale for this change Spark SQL provides `log1p`, which computes the natural logarithm of `1 + x` accurately for values near zero. Adding this function to DataFusion Spark lets users run queries that use `log1p` with Spark-compatible behavior. ## What changes are included in this PR? - Add and register the `log1p` scalar function. - Return `NULL` for inputs less than or equal to `-1.0`, including negative infinity. - Preserve `NULL` inputs and handle `NaN`, positive infinity, and values near zero. - Add function documentation and SQL logic tests for ordinary values, boundary cases, special values, small inputs, and supported input types. ## Are these changes tested? SQL logic tests have been added in `math/log1p.slt`. They have not yet been run, and the expected results have not been independently verified against Spark. ## Are there any user-facing changes? Yes. This PR adds the new `log1p(expr)` SQL function. It returns a `DOUBLE` and returns `NULL` for inputs less than or equal to `-1.0`. No existing functions are changed. -- 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]
