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 #1001: JIRA DRILL-5879: Like operator performance improve...
Date Tue, 24 Oct 2017 22:03:01 GMT
Github user sachouche commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1001#discussion_r146705325
  
    --- Diff: exec/java-exec/src/main/codegen/templates/CastFunctionsSrcVarLenTargetVarLen.java
---
    @@ -73,6 +73,9 @@ public void eval() {
         out.start =  in.start;
         if (charCount <= length.value || length.value == 0 ) {
           out.end = in.end;
    +      if (charCount == (out.end - out.start)) {
    +        out.asciiMode = org.apache.drill.exec.expr.holders.VarCharHolder.CHAR_MODE_IS_ASCII;
// we can conclude this string is ASCII
    --- End diff --
    
    - As previously stated (when responding to Paul'd comment), the expression framework is
able to use the same VarCharHolder input variable when it is shared amongst multiple expressions
    - If the original column was of type var-binary, then the expression framework will include
a cast to var-char
    - The cast logic will also compute the string length
    - Using this information to deduce whether the string is pure ASCII or not
    - UTF-8 encoding uses 1 byte for ASCII and 2, 3, or 4 for other character sets
    - If the encoded length and character length are equal, then this means this is an ASCII
string 


---

Mime
View raw message