Skip to content

Minor: Add Accumulator::return_type and StateFieldsArgs::return_type to help with upgrade to 48 #16112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alamb
Copy link
Contributor

@alamb alamb commented May 20, 2025

Which issue does this PR close?

Rationale for this change

#15911 from @timsaucer added Accumulator::return_field to make it more general, but that requires changing all call sites to refer to return_field.data_type()

In DataFusion 47:

args.return_type,

on main:

args.return_field.data_type(),

To help with the migration, I added a return_type() method to AccumulatorArgs

After this PR (the code looks much closer to DataFusion 47):

args.return_type(),

I will add similar functions to the WindowUDFFieldArgs and ScalarFunctionArgs

What changes are included in this PR?

  1. I added a return_type() method to AccumulatorArgs
  2. Update callsites to use it

Are these changes tested?

By exsiting CI tests

Are there any user-facing changes?

@github-actions github-actions bot added sqllogictest SQL Logic Tests (.slt) functions Changes to functions implementation labels May 20, 2025
@alamb alamb changed the title Minor: Add Accumulator::return_type to help with transition Minor: Add Accumulator::return_type and StateFieldsArgs::return_type to help with upgrade to 48 May 20, 2025
Copy link
Contributor

@timsaucer timsaucer left a comment

Choose a reason for hiding this comment

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

This seems like a very good idea.

@alamb alamb force-pushed the avg_duration_ga branch from eb2ab94 to 1ec4d73 Compare May 21, 2025 18:35
@alamb alamb marked this pull request as ready for review May 21, 2025 18:35
@github-actions github-actions bot removed the sqllogictest SQL Logic Tests (.slt) label May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
functions Changes to functions implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants