Skip to content

feat: deprecate AggregateUDF: :is_nullable - #18934

Closed
codetyri0n wants to merge 2 commits into
apache:mainfrom
codetyri0n:deprecate_is_nullable
Closed

feat: deprecate AggregateUDF: :is_nullable #18934
codetyri0n wants to merge 2 commits into
apache:mainfrom
codetyri0n:deprecate_is_nullable

Conversation

@codetyri0n

@codetyri0ncodetyri0n commented Nov 25, 2025

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

  • deprecating is_nullable in favour of return_field as it is already encoded within return_field

Are these changes tested?

  • yes

Are there any user-facing changes?

  • Deprecated method

@github-actionsgithub-actionsBot added logical-expr Logical plan and expressions physical-expr Changes to the physical-expr crates labels Nov 25, 2025
Jefffrey
Jefffrey previously approved these changes Nov 26, 2025

@JefffreyJefffrey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Surprisingly fewer changes than I expected

Comment threaddatafusion/expr/src/udaf.rs
Comment threaddatafusion/expr/src/udaf.rs Outdated
Comment threaddatafusion/expr/src/udaf.rs Outdated
Comment threaddatafusion/expr/src/udaf.rs Outdated

@martin-gmartin-g left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@@ -209,6 +209,7 @@ impl AggregateUDF {
}

pub fn is_nullable(&self) -> bool {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this method be deprecated too ?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

yep thanks!

@codetyri0n

Copy link
Copy Markdown
ContributorAuthor

thanks for catching the mod.rs miss @martin-g , i had left the count.rs file untouched as i dont see the signature or the implementation getting altered much in the near future

@github-actionsgithub-actionsBot added the ffi Changes to the ffi crate label Nov 26, 2025
@codetyri0n

Copy link
Copy Markdown
ContributorAuthor

can we merge this?

@Jefffrey

Copy link
Copy Markdown
Contributor

Sorry I haven't gotten around to re-reviewing this after the latest changes

@JefffreyJefffrey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the changes look good in achieving what we want for the issue.

Some notes:

  • We should look at UDAFs that implement is_nullable and ensure they implement return_field in line with the deprecation; I think this only occurs for Count
    • Unfortunately it seems Rust can't flag this for us (implementations of deprecated methods)
  • I think this PR doesn't introduce behaviour changes so long as any downstream UDAFs that implement is_nullable either don't implement return_field (in which case the default behaviour still uses is_nullable), or if they do implement return_field hopefully it is consistent with is_nullable otherwise behaviour may change
    • That latter case seems like a bug in the downstream anyway, though not sure how to communicate this 🤔

One more thing is I wonder how we should handle this for FFI; for example we have is_nullable as part of the FFI API I believe:

/// FFI equivalent to the `is_nullable` of a [`AggregateUDF`]
pubis_nullable:bool,

Maybe @timsaucer can weigh in regarding FFI?

Apart from that, it would be good if could get some other opinions on if we want to proceed with this deprecation; I know for the UDF is_nullable deprecation there was some concern, see discussions on #14094 and #17074. cc @alamb if you have time

  • Maybe we should include a note in the upgrade guide to make this more visible since Rust can't flag the implementation of a deprecated trait method 🤔

@timsaucer

Copy link
Copy Markdown
Member

Two things:

  • The FFI portion looks correct. When we remove the API we can just remove these pieces of code.
  • I think we need a note in the upgrade guide.

@Jefffrey
Jefffrey marked this pull request as draft December 30, 2025 04:44
@github-actions

Copy link
Copy Markdown

Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days.

@github-actionsgithub-actionsBot added the Stale PR has not had any activity for some time label Mar 1, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ffiChanges to the ffi cratelogical-exprLogical plan and expressionsphysical-exprChanges to the physical-expr cratesStalePR has not had any activity for some time

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate AggregateUDFImpl::is_nullable in favour of return_field

4 participants

@codetyri0n@Jefffrey@timsaucer@martin-g