Skip to content

Commit

Permalink
Support compute return types from argument values (not just their Dat…
Browse files Browse the repository at this point in the history
…aTypes) (apache#8985)

* ScalarValue return types from argument values

* change file name

* try using ?Sized

* use Ok

* move method default impl outside trait

* Use type trait for ExprSchemable

* fix nit

* Proposed Return Type from Expr suggestions (#1)

* Improve return_type_from_args

* Rework example

* Update datafusion/core/tests/user_defined/user_defined_scalar_functions.rs

---------

Co-authored-by: Junhao Liu <[email protected]>

* Apply suggestions from code review

Co-authored-by: Alex Huang <[email protected]>

* Fix tests + clippy

* rework types to use dyn trait

* fmt

* docs

* Apply suggestions from code review

Co-authored-by: Jeffrey Vo <[email protected]>

* Add docs explaining what happens when both `return_type` and `return_type_from_exprs` are called

* clippy

* fix doc -- comedy of errors

---------

Co-authored-by: Andrew Lamb <[email protected]>
Co-authored-by: Alex Huang <[email protected]>
Co-authored-by: Jeffrey Vo <[email protected]>
  • Loading branch information
4 people authored Feb 15, 2024
1 parent 85be1bc commit 92d9274
Show file tree
Hide file tree
Showing 6 changed files with 245 additions and 53 deletions.
142 changes: 139 additions & 3 deletions datafusion/core/tests/user_defined/user_defined_scalar_functions.rs
40 changes: 22 additions & 18 deletions datafusion/expr/src/expr_schema.rs
69 changes: 61 additions & 8 deletions datafusion/expr/src/udf.rs
16 changes: 8 additions & 8 deletions datafusion/optimizer/src/analyzer/type_coercion.rs
14 changes: 9 additions & 5 deletions datafusion/physical-expr/src/planner.rs
17 changes: 6 additions & 11 deletions datafusion/physical-expr/src/udf.rs

0 comments on commit 92d9274

Please sign in to comment.