PHILO-HE commented on issue #10387: URL: https://github.com/apache/incubator-gluten/issues/10387#issuecomment-3173452352
@FelixYBW, Gluten currently supports `try_add`, `try_subtract`, `try_multiply`, and `try_divide`. These functions are offloaded to Velox's `checked_xxx` functions (e.g., `checked_add`), which are implemented separately. Spark's implementation differs, as some code paths are shared with regular functions (not try functions, e.g., the add function). For `try_xxx` functions, they can follow the code path with ANSI enabled. If exceptions occur, they are caught, and a NULL result is returned. This behavior is slightly different from ANSI mode, which directly throws exceptions. For new `try_xxx` functions to be added, their implementations in Velox could also be influenced by the ANSI flag if we aim to reuse existing regular functions instead of implementing separate functions like `checked_add`. For all other regular functions instantiated in Spark with ANSI flag determined by config, branching logic should be added in Velox to respect this Velox's ANSI config. This approach can help reduce code duplication. Maybe, for some simple functions, we can add separate implementations without sharing code. Then, mapping to which function is decided by Gluten according to the ANSI config. -- 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]
