datafusion icon indicating copy to clipboard operation
datafusion copied to clipboard

Move `arrow_cast` to `datafusion-functions` crate

Open alamb opened this issue 1 year ago • 1 comments

Is your feature request related to a problem or challenge?

Part of https://github.com/apache/arrow-datafusion/issues/9285 and https://github.com/apache/arrow-datafusion/issues/8045

The goal is to extract function definitions out of the datafusion core.

This ticket also has the nice benefit of being able to show off the newly added API in https://github.com/apache/arrow-datafusion/pull/8985

Describe the solution you'd like

Move the arrow_cast function to datafusion-functions

Describe alternatives you've considered

Note arrow_cast is somewhat different than most functions as it is implemented as part of sql parsing rather than as a normal BuiltinFunction. This means that the rest of datafusion sees it as an Expr::Cast which has special case handling.

We may need to add some way to for ScalarUDFs to simplify themselves (in this case for ArrowCast to "unwrap" itself).

Additional context

No response

alamb avatar Feb 20 '24 07:02 alamb

I think https://github.com/apache/arrow-datafusion/issues/9289 would allow us to preserve the same cast semantics

alamb avatar Feb 20 '24 08:02 alamb