Skip to content

[FLINK-37969] Allow Transformation subgraphs to be merged during translation #26699

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

Merged
merged 1 commit into from
Jun 18, 2025

Conversation

AHeise
Copy link
Contributor

@AHeise AHeise commented Jun 18, 2025

What is the purpose of the change

Transformations are immutable by design and thus planner or DataStream API need to generate a subgraph in one pass. However, there are some use cases where we would attach some small subgraph to a larger subgraph before translation into a StreamGraph. For example, system views in SQL may actually refer to specific parts of the query where we would like to add a subgraph to a side-output.

This commit adds StubTransformation that is later connected to an existing Transformation by defining a predicate to find the upstream transformations to which to connect the downstream transformations.

Brief change log

  • Adds TransformationTranslator.Context#getTransformations
  • Adds StubTransformation(Translation)

Verifying this change

Added unit tests in StreamGraphGeneratorTest.

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

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@flinkbot
Copy link
Collaborator

flinkbot commented Jun 18, 2025

CI report:

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

Copy link
Contributor

@twalthr twalthr left a comment

Choose a reason for hiding this comment

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

Found one minor thing. Feel free to merge afterwards.

TypeInformation<T> typeInformation,
Predicate<Transformation<?>> upstreamFinder,
Function<Transformation<?>, Transformation<?>> inputAdjuster) {
checkNotNull(upstreamFinder, "connectionId must not be null");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
checkNotNull(upstreamFinder, "connectionId must not be null");
checkNotNull(upstreamFinder, "upstreamFinder must not be null");

…slation

Transformations are immutable by design and thus planner or DataStream API need to generate a subgraph in one pass. However, there are some use cases where we would attach some small subgraph to a larger subgraph before translation into a StreamGraph. For example, system views in SQL may actually refer to specific parts of the query where we would like to add a subgraph to a side-output.

This commit adds StubTransformation that is later connected to an existing Transformation by defining a predicate to find the upstream transformations to which to connect the downstream transformations.
@AHeise AHeise force-pushed the flink-37969-stub-transformation branch from d5491d6 to 7e7847b Compare June 18, 2025 14:32
@AHeise AHeise merged commit 4f424c7 into apache:master Jun 18, 2025
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.

3 participants