[FLINK-40431][python] Support per-UDF concurrency and batch size in PyFlink DataFrame API - #29048
Draft
auroflow wants to merge 10 commits into
Draft
Conversation
Add expression-oriented general, async, and pandas scalar UDF support using the release-11 implementation structure adapted for community PyFlink. Generated-by: OpenAI Codex (GPT-5)
Introduce a resolved source descriptor that centralizes callable classification, construction, invocation, lifecycle, async detection, and annotation inspection. Generated-by: OpenAI Codex (GPT-5)
Defer zero-argument callable, ScalarFunction, and AsyncScalarFunction class construction while keeping configured instances client-created. Resolve class annotations statically and clean up partial lifecycle initialization. Generated-by: OpenAI Codex (GPT-5)
Keep scalar-function test fixtures compatible with the variadic Table API eval contract while preserving unary behavior and type-hint inference. Generated-by: OpenAI Codex (GPT-5)
Generated-by: OpenAI Codex (GPT-5)
Generated-by: OpenAI Codex (GPT-5)
Generated-by: OpenAI Codex (GPT-5)
Generated-by: OpenAI Codex (GPT-5)
Resolve callable annotations independently so unrelated unresolved hints do not hide pandas annotations. Reuse recursive type-hint conversion for explicit TypedDict return types. Generated-by: OpenAI Codex (GPT-5)
Propagate execution options through Python UDF metadata, split incompatible planner operators, and apply the minimum fused Arrow batch size. Generated-by: Codex (GPT-5)
Collaborator
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
This pull request adds per-UDF concurrency and batch-size settings to the PyFlink
DataFrame API.
Users can configure these settings when declaring a UDF:
The planner applies an explicitly configured concurrency as the Python operator
parallelism. UDFs with incompatible explicit concurrency values are placed in
separate operators.
When compatible pandas UDFs are fused into one operator, the smallest explicitly
configured batch size is used. If no UDF specifies a batch size, the existing
global Arrow batch-size configuration remains effective.
This change builds on the PyFlink DataFrame UDF support currently under review
and is intended to be rebased onto
masterafter that change is merged.Brief change log
concurrencyandbatch_sizearguments to DataFrame and Tablescalar UDF declarations.
batch_sizetopandas UDFs.
backward-compatible Java constructors and defaults.
explicit concurrency values, including nested UDF calls.
and asynchronous Python operators.
retaining the global configuration when no per-UDF value is set.
being merged.
Verifying this change
This change added and extended tests that can be verified as follows:
backward compatibility, and execution.
map-merge compatibility.
parallelism, fused minimum batch size, global batch-size fallback, and
asynchronous UDF concurrency without starting a MiniCluster.
pyflink.dataframe.tests.test_udf: 15 tests passed.tests passed.
Does this pull request potentially affect one of the following parts:
@Public(Evolving): yes,the public PyFlink DataFrame and Table UDF creation APIs gain optional arguments
Checkpointing, Kubernetes/Yarn, ZooKeeper: no
Documentation
Was generative AI tooling used to co-author this PR?
Generated-by: Codex (GPT-5)