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

feat: support implicit casting in UDFs #4406

Merged
merged 1 commit into from
Jan 30, 2020
Merged

Conversation

agavra
Copy link
Contributor

@agavra agavra commented Jan 29, 2020

fixes #4400
fixes #3791

Description

This PR adds functionality to automagically cast parameters when calling into a user defined function.

Review Guide:

  1. Look at SchemaUtil#areCompatible which now supports implicit casting to determine whether or not a sqltype and param type are compatible
  2. Look at UdfIndex which now first checks the strict compatibility, and if it finds nothing will check the implicit cast compatibility
  3. Look at SqlToJavaVisitor, which will perform the implicit casts when the arguments are not the exact types

Testing done

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

@agavra agavra requested a review from vpapavas January 29, 2020 23:14
@agavra agavra requested a review from a team as a code owner January 29, 2020 23:14
Copy link
Member

@vpapavas vpapavas left a comment

Choose a reason for hiding this comment

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

LGTM

@agavra agavra merged commit 6fc4f72 into confluentinc:master Jan 30, 2020
@agavra agavra deleted the udf_casts branch January 30, 2020 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants