coderfender commented on PR #2073: URL: https://github.com/apache/datafusion-comet/pull/2073#issuecomment-3166295484
@andygrove , Here is the summary of changes : 1. Spark's Try eval mode returns NULL in case there is a computation failure. Note that this is only supported / useful when the operands are integer (Int / Long) type since overflow on Float , Double and Decimal are non deterministic and/or return Nan/ Inf. 2. Since neither data fusion nor Arrow kernels have native implementation of Spark's `Try` eval mode , I went ahead and implemented custom UDFs (with custom Arrow kernels) which perform checked_add, checked_sub, checked_mul , checked_div which return None when overflow occurs. 3. I also verified that `div` and `integer_div` do work with the Try mode and added tests to check all possible edge cases. 4. `fail_on_overflow` param is added to `create_physical_expr` function to fork code to call UDF based on the Eval Option selected. 5. Once this PR gets approved / merged, I will go ahead and continue to use this framework to implement the EVAL mode for other ops such as cast while also refactoring `abs` , `modulo` operations -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org