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: allow UDF's to be created with any name (irrespective of class name) #600

Merged

Conversation

suryatejreddy
Copy link
Collaborator

@suryatejreddy suryatejreddy commented Mar 9, 2023

Note: Inspired from work on decorators coming in another PR.

Current Behavior

We currently enforce that the UDF be named same as the class in the impl file. This seems like an unnecessary restriction.

Modification

This PR introduces the following way of loading the UDF:

  • Check if a class with UDF name exists, if yes, loads that.
  • If the class with UDF name doesn't exist,
    - If the file has a single class load that.
    - Else, raise an error asking user to specify the class name as UDF in case of multiple classes in file.

Testing

Added test cases.

@suryatejreddy suryatejreddy changed the title feat: allow UDF's to be defined with any name (irrespective of class name) feat: allow UDF's to be created with any name (irrespective of class name) Mar 9, 2023
@suryatejreddy suryatejreddy merged commit 9df9c9a into georgia-tech-db:master Mar 10, 2023
@suryatejreddy suryatejreddy deleted the fix_loading_udf_from_file branch March 10, 2023 15:53
@jarulraj jarulraj mentioned this pull request Apr 3, 2023
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