-
Notifications
You must be signed in to change notification settings - Fork 118
[HIVEMALL-142] Implement SingularizeUDF #110
Conversation
@@ -172,12 +172,17 @@ public static void clear(@Nonnull final StringBuilder buf) { | |||
|
|||
public static String concat(@Nonnull final List<String> list, @Nonnull final String sep) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@myui I guess you originally assumed this method behaves in a similar way to what org.apache.commons.lang3.StringUtils.join
does. However, the original code appends a separator even at the end of result string as:
- expected:
concat(["a", "b", "c"], "-")
=>a-b-c
- actual:
concat(["a", "b", "c"], "-")
=>a-b-c-
So, I fixed the method in 796d388. Is this okay? If my assumption was incorrect, I revert the modification and introduce alternative method StringUtils.join()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
former is expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, so I revert and create join method here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
This behavior is similar to org.apache.commons.lang3.StringUtils.join
👍 Merged. Thanks! |
What changes were proposed in this pull request?
Implement
singularize(string word)
to obtain singular form ofword
.The implementation referred the following third-party code:
What type of PR is it?
Feature
What is the Jira issue?
https://issues.apache.org/jira/browse/HIVEMALL-142
How was this patch tested?
unit test & manual test on EMR
How to use this feature?
as documented
Checklist
mvn formatter:format
, for your commit?