Skip to content

[FLINK-37586][udf] Add support for options in user-defined functions and update related documentation#4252

Open
Hisoka-X wants to merge 2 commits intoapache:masterfrom
Hisoka-X:FLINK-37586-yaml
Open

[FLINK-37586][udf] Add support for options in user-defined functions and update related documentation#4252
Hisoka-X wants to merge 2 commits intoapache:masterfrom
Hisoka-X:FLINK-37586-yaml

Conversation

@Hisoka-X
Copy link
Member

This close https://issues.apache.org/jira/browse/FLINK-37586

This pull request adds support for passing configuration options to user-defined functions (UDFs) in pipeline definitions. It updates both the YAML schema and the internal Java representations to allow specifying an options block for each UDF, making these options available at runtime. The documentation is updated to explain how to use this feature, and new tests are added to ensure correct parsing and handling.

@github-actions github-actions bot added docs Improvements or additions to documentation composer cli labels Jan 31, 2026
@Hisoka-X
Copy link
Member Author

Hisoka-X commented Feb 3, 2026

cc @yuxiqian

user-defined-function:
- name: query_redis
classpath: com.example.flink.cdc.udf.RedisQueryFunction
options:
Copy link
Member

@yuxiqian yuxiqian Feb 4, 2026

Choose a reason for hiding this comment

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

nit: Would you prefer putting extra options at the same level as name and classpath? Just like source and pipeline.model:

source:
  name: MySQL Source
  type: mysql
  username: ... # other options

pipeline:
  model:
    - model-name: CHAT
      class-name: OpenAIChatModel
      openai.model: ... # other options

Copy link
Member Author

Choose a reason for hiding this comment

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

No, this way hard to identifier which option come from flink-cdc, which come from user function.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli composer docs Improvements or additions to documentation e2e-tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants