drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sachouche <...@git.apache.org>
Subject [GitHub] drill pull request #1072: DRILL-5879: Improved SQL Pattern Contains Performa...
Date Wed, 20 Dec 2017 16:35:06 GMT
Github user sachouche commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1072#discussion_r158072762
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/SqlPatternContainsMatcher.java
---
    @@ -19,44 +19,283 @@
     
     import io.netty.buffer.DrillBuf;
     
    -public class SqlPatternContainsMatcher extends AbstractSqlPatternMatcher {
    +/** SQL Pattern Contains implementation */
    +public final class SqlPatternContainsMatcher extends AbstractSqlPatternMatcher {
    +  private final MatcherFcn matcherFcn;
     
       public SqlPatternContainsMatcher(String patternString) {
         super(patternString);
    +
    +    // Pattern matching is 1) a CPU intensive operation and 2) pattern and input dependent.
The conclusion is
    +    // that there is no single implementation that can do it all well. So, we use multiple
implementations
    +    // chosen based on the pattern length.
    +    if (patternLength == 1) {
    +      matcherFcn = new Matcher1();
    +    } else if (patternLength == 2) {
    +      matcherFcn = new Matcher2();
    +    } else if (patternLength == 3) {
    --- End diff --
    
    will do.


---

Mime
View raw message