You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cache the arguments type to avoid recomputing for ScalarUDF::return_type_from_exprs #9518
I test it locally that after avoiding the re-computation, at least this query gets super fast as the main branch does.
Describe the solution you'd like
We can cache the result for the same arguments and schema pair, but we need to check the matching every time too.
We can add another argument args_types: &[DataType] for return_type_from_exprs. If the args_types is empty, we calculate the types, otherwise we skip it.
We can compute the return type along with udf creation 🤔
We have schema for ScalarFunction::new_udf, it is possible
It looks like 3 is better if the schema is usually fixed, otherwise 2. 1 if we need to re-compute args_types in many place, but it doesn't seem to be true for now.
Describe alternatives you've considered
Other better design
Additional context
To reproduce, you can play around on commit 970dd7d
Activity