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

fix: include valid alternative UDF signatures in error message (MINOR) #4403

Merged
merged 2 commits into from
Jan 29, 2020

Conversation

big-andy-coates
Copy link
Contributor

Description

When a UDF/UDAF/UDTF is called with incorrect parameters the user is informed by the error:

Function 'Foo' does not accept parameters of types:[STRING, STRING]

This is all well and good, but KSQL could be more helpful! The message is now:

Function 'Foo' does not accept parameters (STRING, STRING).
Valid alternatives are:
FOO(STRING)
FOO(STRING text, INT len)
FOO(STRING text, INT start, INT len)
For detailed information on a function run: DESCRIBE FUNCTION <Function-Name>;

Testing done

mvn test and manual

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

When a UDF/UDAF/UDTF is called with incorrect parameters the user is informed by the error:

```
Function 'Foo' does not accept parameters of types:[STRING, STRING]
```

This is all well and good, but KSQL could be more helpful!  The message is now:

```
Function 'Foo' does not accept parameters (STRING, STRING).
Valid alternatives are:
FOO(STRING)
FOO(STRING text, INT len)
FOO(STRING text, INT start, INT len)
For detailed information on a function run: DESCRIBE FUNCTION <Function-Name>;
```
@big-andy-coates big-andy-coates requested a review from a team as a code owner January 29, 2020 15:37
Copy link
Contributor

@agavra agavra left a comment

Choose a reason for hiding this comment

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

nice! I love the detailed error message

@big-andy-coates big-andy-coates merged commit f397ad8 into confluentinc:master Jan 29, 2020
@big-andy-coates big-andy-coates deleted the udf_alternatives branch January 29, 2020 21:34
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