Skip to content

[FLINK-39915][table] Reject mixing positional and named function arguments#28399

Open
gustavodemorais wants to merge 2 commits into
apache:masterfrom
confluentinc:FLINK-39915
Open

[FLINK-39915][table] Reject mixing positional and named function arguments#28399
gustavodemorais wants to merge 2 commits into
apache:masterfrom
confluentinc:FLINK-39915

Conversation

@gustavodemorais

Copy link
Copy Markdown
Contributor

What is the purpose of the change

Calling a function with a mix of positional and named arguments (e.g. f(TABLE t, op => DESCRIPTOR(x))) previously failed validation with an internal assertion calcite error. This surfaces a clear ValidationException instead, telling the user to use either all positional or all named arguments.

Brief change log

  • Detect mixed positional and named arguments in FlinkCalciteSqlValidator and throw a ValidationException before operand permutation runs.

Verifying this change

  • FlinkCalciteSqlValidatorTest
  • ProcessTableFunctionTest

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)

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

2.1.117 (Claude Code) and Opus 4.8

@flinkbot

flinkbot commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

CI report:

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

@raminqaf raminqaf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Thanks for the fix!

@fhueske fhueske left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The change looks good, but I'd add two more assertions to the test.

Cheers, Fabian


@Test
void testMixedPositionalAndNamedArguments() {
assertThatThrownBy(() -> plannerMocks.getParser().parse("SELECT myFunc(1, b => 2) FROM t1"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

add assertions that all positional and all named do not throw?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, done. Take a look 4a4d514

@github-actions github-actions Bot added the community-reviewed PR has been reviewed by the community. label Jun 12, 2026

@fhueske fhueske left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the fix.

+1 to merge 👍

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

Labels

community-reviewed PR has been reviewed by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants