You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by traflm <gi...@git.apache.org> on 2018/08/19 10:15:11 UTC

[GitHub] trafodion pull request #1699: [TRAFODION-2404] enhance the regexpr performan...

GitHub user traflm opened a pull request:

    https://github.com/apache/trafodion/pull/1699

    [TRAFODION-2404] enhance the regexpr performance

    Previously, each time evaluate a row, it needs to invoke the regcomp(), by this change, only when the pattern is changed, invoke the regcomp()

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/traflm/trafodion TRAFODION-2404

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/trafodion/pull/1699.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1699
    
----
commit cadd9e90526a5b857912805894d17d2bb1f5e8de
Author: Liu Ming <ov...@...>
Date:   2018-08-19T08:49:07Z

    first check in, must switch to other task

commit c41d24b8c73cc583c13e978e76ffb3ac2391d9a1
Author: Liu Ming <ov...@...>
Date:   2018-08-19T10:13:04Z

    enhance by adding comments and adding error check

----


---

[GitHub] trafodion pull request #1699: [TRAFODION-2404] enhance the regexpr performan...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/trafodion/pull/1699


---

[GitHub] trafodion pull request #1699: [TRAFODION-2404] enhance the regexpr performan...

Posted by traflm <gi...@git.apache.org>.
Github user traflm commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1699#discussion_r211479574
  
    --- Diff: core/sql/exp/exp_like.cpp ---
    @@ -513,11 +512,16 @@ ex_expr::exp_return_type ExRegexpClauseChar::eval(char *op_data[],
     
       str_cpy_all(pattern, op_data[2], len2);
       str_cpy_all(srcStr, op_data[1], len1);
    -
    -  z = regcomp(&reg, pattern, cflags);
    +  if(rpattern_ != pattern)
    --- End diff --
    
    Hi, Dave, rpattern_ is NAString, so I think this comparison is correct? My intent is to compare the content.
    Let me check the NAString further.


---

[GitHub] trafodion pull request #1699: [TRAFODION-2404] enhance the regexpr performan...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1699#discussion_r211423746
  
    --- Diff: core/sql/exp/exp_like.cpp ---
    @@ -513,11 +512,16 @@ ex_expr::exp_return_type ExRegexpClauseChar::eval(char *op_data[],
     
       str_cpy_all(pattern, op_data[2], len2);
       str_cpy_all(srcStr, op_data[1], len1);
    -
    -  z = regcomp(&reg, pattern, cflags);
    +  if(rpattern_ != pattern)
    --- End diff --
    
    This is a pointer comparison rather than a content comparison. Since rpattern_ is a data member and pattern is a stack variable, I expect this comparison will always mismatch, so (rpattern_ != pattern) will always be true. I am guessing that you intended to compare the content instead?


---