Skip to content

Conversation

@tarak271
Copy link
Contributor

What changes were proposed in this pull request?

Implement array_join function in Hive

Why are the changes needed?

This enhancement is already implemented in Spark

Does this PR introduce any user-facing change?

How was this patch tested?

Created Junit tests as well as qtests as part of this change

this.minArgCount = minArgCount;
this.maxArgCount = maxArgCount;
this.outputCategory = outputCategory;
this.outputPrimitiveCategory = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

This line seems unnecessary. Isnt this null by default since it is not initialized?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed that variable

if (outputCategory == ObjectInspector.Category.LIST) {
return initListOI(arguments);
} else if (outputCategory == ObjectInspector.Category.PRIMITIVE && outputPrimitiveCategory == PrimitiveObjectInspector.PrimitiveCategory.STRING) {
return PrimitiveObjectInspectorFactory.writableStringObjectInspector;
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel its better to push this down to GenericUDFArrayJoin by overriding initialize in GenericUDFArrayJoin. This condition seems specific to Array join and I dont see this condition used by other potential UDFs.

This will avoid the addition of another constructor as well to this generic class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pushed down to GenericUDFArrayJoin

this.outputPrimitiveCategory = null;
}

public AbstractGenericUDFArrayBase(String functionName, int minArgCount, int maxArgCount, ObjectInspector.Category outputCategory, PrimitiveObjectInspector.PrimitiveCategory outputPrimitiveCategory) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably this constructor and variable might not be required in this class.
Please check this comment - https://github.com/apache/hive/pull/3896/files#r1066553884.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

made changes as recommended

Copy link
Contributor

@SourabhBadhya SourabhBadhya left a comment

Choose a reason for hiding this comment

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

LGTM +1

Copy link
Contributor

@saihemanth-cloudera saihemanth-cloudera left a comment

Choose a reason for hiding this comment

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

LGTM +1. Pending green Jenkins tests

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 2, 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

@saihemanth-cloudera saihemanth-cloudera merged commit de7b63f into apache:master Feb 2, 2023
yeahyung pushed a commit to yeahyung/hive that referenced this pull request Jul 20, 2023
…an array with a specified delimiter (apache#3896)(Taraka Rama Rao Lethavadla, reviewed by Sourabh Badhya, Sai Hemanth)
tarak271 added a commit to tarak271/hive-1 that referenced this pull request Dec 19, 2023
…an array with a specified delimiter (apache#3896)(Taraka Rama Rao Lethavadla, reviewed by Sourabh Badhya, Sai Hemanth)
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