datafusion-comet icon indicating copy to clipboard operation
datafusion-comet copied to clipboard

[EPIC] Support try_* functions which always return NULL instead of runtime errors

Open advancedxy opened this issue 1 year ago • 2 comments

Spark adds a lot of try_* functions in the recent two years, which always return NULL instead of runtime errors. The list is as follows:

  • [ ] try_add
  • [ ] try_divide
  • [ ] try_subtract
  • [ ] try_multiply
  • [ ] try_element_at
  • [ ] try_avg
  • [ ] try_sum
  • [ ] try_to_binary
  • [ ] try_to_timestamp
  • [ ] try_aes_decrypt
  • [x] ~~try_reflect~~ (cannot be supported in Comet?)
  • [ ] try_cast (part of https://github.com/apache/datafusion-comet/issues/286)

We should add support to these functions too. It could be implemented in Comet first then contributed back to upstream DataFusion.

Originally posted by @viirya in https://github.com/apache/arrow-datafusion-comet/pull/277#discussion_r1568139442

advancedxy avatar Apr 17 '24 03:04 advancedxy

I added try_cast to the list, with a link to the cast epic

andygrove avatar Apr 24 '24 14:04 andygrove