impl split_part

This commit is contained in:
wenchengyao 2024-10-26 11:32:23 +08:00
parent 99f8bc3cad
commit 62cbbef0de

View File

@ -18,8 +18,8 @@ import org.apache.commons.lang3.StringUtils;
public class SplitPart {
@UdfDefine(name = "split_part", compatibleName = "SplitPart")
public String split(String str, String delim, Integer partNum) throws Exception {
String[] strings = StringUtils.split(str, delim);
public String split(String str, String separator, Integer partNum) throws Exception {
String[] strings = StringUtils.split(str, separator);
int length = strings.length;
if (partNum < 0) {
partNum = length - 1;