Skip to content

[FLINK-36139][core] Do not use result type hints for aggregate accumulators - #29261

Draft
Sunnypain wants to merge 1 commit into
apache:masterfrom
Sunnypain:fix/FLINK-36139-aggregate-accumulator-type
Draft

Sunnypain wants to merge 1 commit into
apache:masterfrom
Sunnypain:fix/FLINK-36139-aggregate-accumulator-type

Conversation

@Sunnypain

Copy link
Copy Markdown

What is the purpose of the change

Fix FLINK-36139. For an AggregateFunction<String, Long, Row> implementing ResultTypeQueryable<Row>, accumulator type extraction currently returns the declared Row result type instead of Long. This selects an incompatible serializer for the accumulator.

This is a draft while Jira assignment and maintainer agreement are pending.

Brief change log

  • Ignore ResultTypeQueryable only when extracting the AggregateFunction accumulator type; retain the existing generic extraction and input inference.
  • Add five regression tests covering concrete and inferred accumulator types, explicit result types, and both missing-type handling modes.

Verifying this change

  • Before the fix, the five new tests produced four failures and one pass.
  • After the fix, all 80 tests in TypeExtractorTest passed.
  • ./mvnw -B -ntp -pl flink-core -am -Dflink.forkCountUnitTest=1 clean verify passed on Temurin 17.0.20.1 with Maven Wrapper 3.9.16. The local run used a separate Maven settings file prioritizing Maven Central. Across the selected modules, JUnit XML reports contain 8,321 tests, zero failures/errors, and 1,777 skipped cases.

The original Kubernetes resubmission/checkpoint scenario and the full Flink repository test suite were not run locally.

Does this pull request potentially affect one of the following parts:

  • Dependencies: no.
  • Public API: fixes behavior of an existing @PublicEvolving type-extraction method; no signatures or annotations change.
  • Serializers: corrects accumulator serializer selection through type information; no serializer implementation or format changes.
  • Runtime per-record code paths: no.
  • Deployment or recovery: prevents the reported accumulator type mismatch; checkpoint/recovery protocols are unchanged.
  • S3 file system connector: no.

Documentation

  • Does this pull request introduce a new feature? No.
  • Feature documentation: not applicable.
Was generative AI tooling used to co-author this PR?
  • Yes.

Generated-by: OpenAI Codex (GPT-6)

…lators

ResultTypeQueryable describes an aggregate function's output, not its
accumulator. Use the existing generic extraction path for the accumulator
while preserving explicit output type hints and missing-type handling.

Generated-by: OpenAI Codex (GPT-6)
@flinkbot

flinkbot commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants