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

HIVE-27563: Add typeof UDF #4547

Merged
merged 3 commits into from
Aug 7, 2023
Merged

HIVE-27563: Add typeof UDF #4547

merged 3 commits into from
Aug 7, 2023

Conversation

jfsii
Copy link
Contributor

@jfsii jfsii commented Aug 3, 2023

What changes were proposed in this pull request?

New UDF to get type of supplied argument

Why are the changes needed?

Helpful in tests and debugging

Does this PR introduce any user-facing change?

It adds a new UDF the users can use.

Is the change a dependency upgrade?

No

How was this patch tested?

Unit test added
q test added

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most of the functionality is tested in the unit test.
The q test is mostly verification that the UDF is registered correctly and executable.

Copy link
Member

@ayushtkn ayushtkn left a comment

Choose a reason for hiding this comment

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

LGTM


@Override
public Object evaluate(DeferredObject[] arguments) throws HiveException {
Text returnValue = new Text();
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've made the suggested change of reusing the returnValue. I also eliminated the inputType variable and just set the returnValue directly in initialize.
I've also added a multi row test.

@sonarcloud
Copy link

sonarcloud bot commented Aug 4, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

warning The version of Java (11.0.8) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

@ayushtkn ayushtkn merged commit 39c3861 into apache:master Aug 7, 2023
5 checks passed
tarak271 pushed a commit to tarak271/hive-1 that referenced this pull request Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants