Leon-WTF commented on a change in pull request #2227:
URL: https://github.com/apache/drill/pull/2227#discussion_r637377363
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/StringFunctions.java
##########
@@ -434,6 +434,64 @@ public void eval() {
}
+ @FunctionTemplate(name = "split_part", scope = FunctionScope.SIMPLE, nulls =
NullHandling.NULL_IF_NULL,
+ outputWidthCalculatorType =
OutputWidthCalculatorType.CUSTOM_FIXED_WIDTH_DEFAULT)
+ public static class SplitPartStartEnd implements DrillSimpleFunc {
+ @Param
+ VarCharHolder in;
+ @Param
+ VarCharHolder delimiter;
+ @Param
+ IntHolder start;
+ @Param
+ IntHolder end;
+
+ @Workspace
+ com.google.common.base.Splitter splitter;
+
+ @Workspace
+ com.google.common.base.Joiner joiner;
+
+ @Inject
+ DrillBuf buffer;
+
+ @Output
+ VarCharHolder out;
+
+ @Override
+ public void setup() {
+ if (start.value < 1) {
Review comment:
Hi cgivre, thanks for your review. I don't understand your question:
"What happens if the start and end values are dynamic?". In my option,
SplitPartStartEnd is choosen as the function only when all four parameters are
provided, so what does dynamic mean here?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]