Skip to content

Conversation

Blizzara
Copy link
Contributor

@Blizzara Blizzara commented Mar 10, 2025

use return_type_from_args instead

Which issue does this PR close?

Rationale for this change

Implementing return_type_from_exprs is almost harmful, since it's not used by DataFusion for anything. Implementing it instead of return_type or return_type_from_args leads to code that compiles but fails at runtime.

Filing this to start the discussion of if we want to take it in.

Somewhat related to #15123

What changes are included in this PR?

Removes return_type_from_exprs completely. This leads to compile failures for anyone who's mistakenly still using it.

Also removes create_physical_expr function which was using this return_type_from_exprs. Given it's also marked as deprecated I didn't check if it could be rewritten to use return_type_from_args instead, but if that's possible, we can do it as well to reduce the impact.

Are these changes tested?

Existing tests

Are there any user-facing changes?

Yes, BREAKING CHANGE: ScalarUDFImpl::return_type_from_exprs is removed, also create_physical_expr is removed.

use `return_type_from_args` instead
@github-actions github-actions bot added logical-expr Logical plan and expressions physical-expr Changes to the physical-expr crates core Core DataFusion crate functions Changes to functions implementation labels Mar 10, 2025
Copy link
Contributor

@jayzhan211 jayzhan211 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@jayzhan211 jayzhan211 merged commit bb16115 into apache:main Mar 12, 2025
25 checks passed
irenjj pushed a commit to irenjj/datafusion that referenced this pull request Mar 12, 2025
* chore: remove ScalarUDFImpl::return_type_from_exprs

use `return_type_from_args` instead

* clippy
@alamb alamb mentioned this pull request Mar 12, 2025
39 tasks
@Blizzara Blizzara deleted the avo/remove-return-type-from-exprs branch March 20, 2025 07:52
@alamb alamb mentioned this pull request Apr 14, 2025
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate functions Changes to functions implementation logical-expr Logical plan and expressions physical-expr Changes to the physical-expr crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Breaking change in "return_type_from_exprs"

2 participants