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-33255] [table] Validate argument count during type inference #23520

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

bvarghese1
Copy link
Contributor

  • Previously, TypeInferenceOperandInference was not validating argument counts which led to bugs like FLINK-33248
  • This commit adds a check to validate argument count and throws an exception if the argument count doesn't match the expected number of arguments

What is the purpose of the change

Validate argument count during type inference to avoid bugs like [FLINK-33248]

Brief change log

  • Adds a check to validate argument count and throws an exception if the argument count doesn't match the expected number of arguments
  • Also leads to better error messages

Verifying this change

This change added tests and can be verified as follows:

  • Added test to verify a ValidationException message is seen when functions are invoked without arguments
  • Updated existing function tests with improved error message

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? (no)
  • If yes, how is the feature documented? (not applicable)

@flinkbot
Copy link
Collaborator

flinkbot commented Oct 13, 2023

CI report:

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

@bvarghese1 bvarghese1 force-pushed the fix_FLINK-33255 branch 2 times, most recently from ea145d1 to 3be47e1 Compare October 13, 2023 23:43
Copy link
Contributor

@dawidwys dawidwys left a comment

Choose a reason for hiding this comment

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

some last suggestions from my side.

For the future. Could we create separate commits if we fix multiple issues? I could see this split into two separate commits:

  1. Improve exception message for signature mismatch
  2. Validate argument count in TypeInferenceOperandInference

- Previously, TypeInferenceOperandInference was not validating argument counts
  which led to bugs like FLINK-33248
- This commit adds a check to validate argument count and throws an exception
  if the argument count doesn't match the expected number of arguments
Copy link
Contributor

@dawidwys dawidwys left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you for this really nice improvement @bvarghese1 ! I think caring about exception messages is often underappreciated.

@dawidwys dawidwys merged commit b1bbafd into apache:master Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants