deemoliu commented on code in PR #12437:
URL: https://github.com/apache/pinot/pull/12437#discussion_r1514972783
##########
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/StringFunctions.java:
##########
@@ -597,6 +596,39 @@ public static String splitPart(String input, String
delimiter, int index) {
}
}
+ /**
+ * @param input the input String to be split into parts.
+ * @param delimiter the specified delimiter to split the input string.
+ * @param index the specified index for the splitted parts to be returned.
+ * @param max the max count of parts that the input string can be splitted
into.
+ * @return splits string on the delimiter with the limit count and returns
String at specified index from the split.
+ */
+ @ScalarFunction
+ public static String splitPart(String input, String delimiter, int index,
int max) {
+ String[] splitString = StringUtils.splitByWholeSeparator(input, delimiter,
max);
Review Comment:
Thanks for review @satishd
I think the current behavior is to return a invalid value "null" instead of
error and stop ingestion.
I also think that "null" value is not a good indicator to differentiate
different kinds of invalid values, but it might need a discussion with OSS
since it's a backward incompatible change since this is already used in many
existing UDFs (e.g. line 594-596).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]