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

Avoid NPE if not function exists that handles required types. #1407

Conversation

big-andy-coates
Copy link
Contributor

Description

Current a statement such as select concat('foo',1) from blah; results in NPE:

java.lang.NullPointerException

With this change it results in:

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

Replaces #1399 (Rebased onto 5.0 branch)

Testing done

Added unit test + manual testing.

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 #")

… function don't match ones the function supports.

Current a statement such as `select concat('foo',1) from blah;` results in NPE:

`java.lang.NullPointerException`

With this change it results in:

`Function 'CONCAT' does not accept parameters of types:[VARCHAR(STRINT), BIGINT]`
@big-andy-coates
Copy link
Contributor Author

Copied from other PR:

Hey @hjafarpour - thanks for the review.

I've switched the code to use SchemaUtil.TYPE_MAP, however I had to add a new method to access it, (please review!), and I've some questions about SchemaUtil here: #1399 (comment)

@big-andy-coates big-andy-coates changed the base branch from master to 5.0.x June 11, 2018 13:06
@big-andy-coates big-andy-coates requested review from dguy, hjafarpour and apurvam and removed request for hjafarpour June 11, 2018 13:07
Copy link
Contributor

@dguy dguy left a comment

Choose a reason for hiding this comment

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

Thanks @big-andy-coates, LGTM

@big-andy-coates big-andy-coates merged commit cecc51a into confluentinc:5.0.x Jun 11, 2018
@big-andy-coates big-andy-coates deleted the msg_on_function_param_mismatch_5 branch June 11, 2018 18:02
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.

None yet

2 participants