[ 
https://issues.apache.org/jira/browse/PIG-965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12790928#action_12790928
 ] 

Thejas M Nair commented on PIG-965:
-----------------------------------

The new patch does not address the following comment -
* RegexInit.java, in determineBestRegexMethod Line 85 - 120
There are while loops where we are testing only for preceding '\'

For example -
${code}
            if( index != 0 ) {
                while( pattern.charAt(index -1 ) == '\\' ) {
                    index = pattern.indexOf('[');
                }

${code}
Should be -

${code}
            if( index != 0 ) {
                while( isCharEscaped(pattern,index) ) {
                    index = pattern.indexOf('[');
                }
${code}

There are 3 such while loops between lines 68-96 (in new patch) that needs to 
be fixed.


* The indentation in RegexInit.isCharEscaped needs to be fixed. 

Everything else looks good.


> PERFORMANCE: optimize common case in matches (PORegex)
> ------------------------------------------------------
>
>                 Key: PIG-965
>                 URL: https://issues.apache.org/jira/browse/PIG-965
>             Project: Pig
>          Issue Type: Improvement
>          Components: impl
>            Reporter: Thejas M Nair
>            Assignee: Ankit Modi
>         Attachments: automaton.jar, poregex2.patch
>
>
> Some frequently seen use cases of 'matches' comparison operator have follow 
> properties -
> 1. The rhs is a constant string . eg "c1 matches 'abc%' "
> 2. Regexes such that look for matching prefix , suffix etc are very common. 
> eg - "abc%', "%abc", '%abc%' 
> To optimize for these common cases , PORegex.java can be changed to -
> 1. Compile the pattern (rhs of matches) re-use it if the pattern string has 
> not changed. 
> 2. Use string comparisons for simple common regexes (in 2 above).
> The implementation of Hive like clause uses similar optimizations.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to