Skip to content

[FLINK-39392][table] Support conditional traits for PTFs#27886

Draft
gustavodemorais wants to merge 4 commits intoapache:masterfrom
gustavodemorais:FLINK-39392
Draft

[FLINK-39392][table] Support conditional traits for PTFs#27886
gustavodemorais wants to merge 4 commits intoapache:masterfrom
gustavodemorais:FLINK-39392

Conversation

@gustavodemorais
Copy link
Copy Markdown
Contributor

What is the purpose of the change

We'd like to make PTF traits configurable so we can have multiple versions depending on how they are configured by the user.

The first suggestion: introduce a declarative addTraitWhen API on StaticArgument that allows table argument traits to vary based on the SQL call context (e.g., whether PARTITION BY is provided or scalar argument values). This replaces the static  

  • As the first use case, TO_CHANGELOG now supports optional PARTITION BY:                    
  • With PARTITION BY: set semantics (co-located parallel execution)  

Brief change log

  • Add conditional traits with TraitContext
  • Evaluate them where necessary
  • Use if for the first use case TO_CHANGELOG with or without partition by
  • Adjust docs and comments

Verifying this change

  • Add semantic test

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

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

Documentation

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

@flinkbot
Copy link
Copy Markdown
Collaborator

flinkbot commented Apr 2, 2026

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