Skip to content
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

[FLINK-35403] Allow Skipping Invocation of Function Calls While Constant-folding #24814

Merged
merged 2 commits into from
May 27, 2024

Conversation

AlanConfluent
Copy link
Contributor

What is the purpose of the change

This PR adds a new method to FunctionDefinition, supportsConstantFolding which indicates of a function call should have constant expression reduction done during planning time. For example, AddOne(10) could be reduced to 11 by invoking AddOne during planning time. This is the default and current Flink functionality.

This addition allows overriding the default behavior and returning false, which would keep the expression intact, to be invoked at runtime instead.

This functionality and motivation is covered in more detail in FLIP 452.

Verifying this change

  • Added new test cases to ExpressionReductionRulesTest.
    • These test that existing plans are unchanged
    • New tests show that disabling constant folding also keeps plans without reducing away the invocation

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): (yes)
  • The serializers: (no)
  • The runtime per-record code paths (performance sensitive): (no)
    • It shouldn't affect default behavior, which is to constant fold
  • 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)

@flinkbot
Copy link
Collaborator

flinkbot commented May 20, 2024

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.

Nice and clean PR with good documentation. Nothing to add here.

@twalthr twalthr merged commit efcd146 into apache:master May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants