Github user jinfengni commented on a diff in the pull request:
https://github.com/apache/drill/pull/512#discussion_r65994671
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/StringFunctions.java
---
@@ -268,7 +284,13 @@ public void eval() {
@Override
public void setup() {
- matcher =
java.util.regex.Pattern.compile(org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(pattern.start,
pattern.end, pattern.buffer)).matcher("");
+ CharSequenceWrapper patternWrapper = new
CharSequenceWrapper(pattern.start, pattern.end, pattern.buffer);
+ char[] chars = new char[patternWrapper.length()];
+ for(int i=0; i<patternWrapper.length(); i++){
+ chars[i] = patternWrapper.charAt(i);
+ }
+ String patternChars = new String(chars);
--- End diff --
I can not see why we want to use CharSequenceWrapper here. You created
String object, same as prior method. Any benefit of using CharSequenceWrapper?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---