Skip to content

HIVE-27563: Add typeof UDF#4547

Merged
ayushtkn merged 3 commits into
apache:masterfrom
jfsii:HIVE-27563
Aug 7, 2023
Merged

HIVE-27563: Add typeof UDF#4547
ayushtkn merged 3 commits into
apache:masterfrom
jfsii:HIVE-27563

Conversation

@jfsii

@jfsii jfsii commented Aug 3, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

@ayushtkn ayushtkn left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
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.

@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2023

Copy link
Copy Markdown

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
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

Development

Successfully merging this pull request may close these issues.

4 participants