[FLINK-40420][python] Add set operations to DataFrame API - #29166
Open
beetle0915 wants to merge 1 commit into
Open
[FLINK-40420][python] Add set operations to DataFrame API#29166beetle0915 wants to merge 1 commit into
beetle0915 wants to merge 1 commit into
Conversation
Generated-by: OpenAI Codex (codex-cli 0.154.0-alpha.6.2)
beetle0915
marked this pull request as ready for review
September 13, 2026 01:57
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
Implement FLINK-40420 by exposing set operations on the PyFlink DataFrame API.
Brief change log
union,union_all,intersect,intersect_all,minus, andminus_allasPublicEvolvingmethods that delegate to the corresponding Table API operations and return new DataFrames.union_all.Verifying this change
Local verification uses Python 3.12.11, Java 17, and an existing Flink 2.4-SNAPSHOT Java distribution. Python sources are from this branch.
python -m pytest -q pyflink/dataframe/tests: 351 passed, including 12 new test methods and batch/streaming MiniCluster execution tests. Eight existing deprecation warnings remain.python -m flake8 --config=tox.ini pyflink/dataframe: passed.python -m mypy --config-file tox.ini: passed (83 source files).-W --keep-going: passed.git diff --check: passed.This PR is a draft: full-repository
./mvnw clean verify, end-to-end tests, and the multi-version CI matrix have not been run locally. Java artifacts were reused rather than rebuilt for this Python-only patch.Existing Table API mixed-type limitation
During execution testing,
intersect,intersect_all,minus, andminus_allfailed for mixed INT/BIGINT inputs even though the resolved result schema was BIGINT. This also reproduces by calling the original Table API directly from a clean Python checkout of the base commit,e01bbcacd962189c726d8324a35d66cc162712e7, without importing DataFrame.unionandunion_allsucceed; explicitly casting the inputs to matching BIGINT types makes all six operations succeed.The clean-checkout comparison had 14 passing cases and four failing mixed-type cases across the six operations and three input scenarios. This PR does not change the planner or add implicit casts in the DataFrame wrappers. The four affected method docstrings advise explicit casts. Should the underlying Table API problem be tracked in a separate issue?
Minimal direct Table API reproduction (no DataFrame usage)
Expected: one row containing
2. Observed: a type mismatch while applyingReplaceIntersectWithSemiJoinRule.minusfails inReplaceMinusWithAntiJoinRule; the two ALL variants fail with aUnionTransformationinput type mismatch.Does this pull request potentially affect one of the following parts:
@Public(Evolving): yes, adds sixPublicEvolvingDataFrame methodsDocumentation
versionadded:: 2.4.0.Was generative AI tooling used to co-author this PR?
Generated-by: OpenAI Codex (codex-cli 0.154.0-alpha.6.2)