[FLINK-40260][python] Support the Python PTF definition API and the stateless runtime path - #28830
Open
hsrain3 wants to merge 2 commits into
Open
[FLINK-40260][python] Support the Python PTF definition API and the stateless runtime path#28830hsrain3 wants to merge 2 commits into
hsrain3 wants to merge 2 commits into
Conversation
hsrain3
marked this pull request as draft
July 28, 2026 10:12
hsrain3
marked this pull request as draft
July 28, 2026 10:12
Collaborator
hsrain3
force-pushed
the
codex/pyflink-ptf-pr1
branch
from
July 28, 2026 12:50
d5c6994 to
e46f95d
Compare
added 2 commits
July 30, 2026 12:34
Add Python PTF definitions and the Java planner placeholder with explicit type inference. Expose Table API entry points for registered Python and Java PTF calls. Generated-by: Codex (GPT-5)
Introduce the Fn Execution protocol and Beam runner needed to execute Python Process Table Functions in the SDK harness. Implement worker-side eval and on_timer dispatch, remote value state with TTL, timer commands, and zero-to-many result framing. Add the Java runtime operator for argument projection, output correlation, watermark propagation, checkpoint-safe state commits, and event-time timer registration. Generalize Python timer registration through a shared handler and add unit coverage for worker, runner, timer, checkpoint, and restore behavior. Planner translation and end-to-end coverage will be added in follow-up changes. Generated-by: Codex (GPT-5)
hsrain3
force-pushed
the
codex/pyflink-ptf-pr1
branch
from
July 30, 2026 05:57
e46f95d to
2081555
Compare
hsrain3
marked this pull request as ready for review
July 30, 2026 11:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
Java Process Table Functions are not currently accessible through the PyFlink Table API, and
PyFlink does not provide APIs or a Python runtime contract for defining Python Process Table
Functions.
This pull request introduces the PyFlink Process Table Function public APIs and the corresponding
Python and Java runtime foundations. The implementation reuses Flink's existing Java PTF type
inference, Beam Python function infrastructure, keyed state backend, and internal timer service.
This is a foundational subtask. Planner translation to the Python PTF operator and end-to-end
execution tests will be added in follow-up subtasks.
The first Python PTF version is designed for a single table argument, append-only input and output,
ROW value state with TTL, and event-time timers. Multi-input Python PTFs, updating inputs,
ORDER BY, inline invocation, and additional state types are outside the scope of this change.
Brief change log
ProcessTableFunction,udptf(),ProcessTableFunctionArgument,ProcessTableFunctionState, and the supported argument traits.types, table semantics, and timer usage.
Table.process(),Table.partition_by(),Table.as_argument(),PartitionedTable, andTableEnvironment.from_call().multi-input Java PTF calls through
from_call().PythonProcessTableFunctionplanner placeholder with explicit staticarguments, state type strategies, state TTL, and result type inference.
key, TTL, runtime context, metrics, and state-cache metadata.
automatic state write-back, explicit state clearing, and timer callbacks.
timer family.
event-time timers, timer deletion, clear-all operations, and checkpoint recovery.
Python timer command channel.
Verifying this change
This change added tests and can be verified as follows:
signatures, traits, result types, TTL, and unsupported first-version combinations.
process(),partition_by(),as_argument(), andmulti-input Java PTF calls through
from_call().clearing, exception handling, TTL forwarding, 0-N output, time conversions, and timer
callbacks.
clear-all operations, invalid commands, and checkpoint restore.
flink-python,flink-table-common, andflink-table-runtimemodule test suites.Does this pull request potentially affect one of the following parts:
@Public(Evolving): yes, newPyFlink public APIs are added; no existing public API is changed incompatibly
serializer is changed
execution path
participates in checkpoint and recovery; no JobManager or deployment mechanism is changed
Documentation
documentation and examples will be added with the planner integration subtask.
Was generative AI tooling used to co-author this PR?
Generated-by: Codex (GPT-5.6)