dask-sql icon indicating copy to clipboard operation
dask-sql copied to clipboard

[DF] Add handling for overloaded UDFs

Open charlesbluca opened this issue 3 years ago • 0 comments

This PR changes the implementation of DaskFunctions to support overloaded UDF definitions:

  • the return_type attribute has been replaced with return_types, a HashMap<Vec<PyDataType>, PyDataType>, mapping the potential input types of a UDF to its return type
  • this mapping is updated whenever an overloaded UDF definition is introduced
  • the mapping is used as part of the ScalarUDF's ReturnTypeFunction to assert which return type should be used for the given UDF call

Additional things that need to be done:

  • [ ] clean up the implementation to cut down on unnecessary clones
  • [ ] add handling to drop DaskFunctions when replace=True for register_function

charlesbluca avatar Aug 11 '22 21:08 charlesbluca