You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Zheng Shao (JIRA)" <ji...@apache.org> on 2009/06/04 10:29:07 UTC

[jira] Created: (HIVE-542) Faster String Like

Faster String Like
------------------

                 Key: HIVE-542
                 URL: https://issues.apache.org/jira/browse/HIVE-542
             Project: Hadoop Hive
          Issue Type: Improvement
          Components: Query Processor
    Affects Versions: 0.4.0
            Reporter: Zheng Shao


Currently Hive uses regular expression to do string like which is really really slow. We should implement "LIKE" natively using Text.


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


[jira] Updated: (HIVE-542) Faster String Like

Posted by "Yuntao Jia (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-542?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yuntao Jia updated HIVE-542:
----------------------------

    Attachment: HIVE-542.1.patch

I tried to make the function checkSimplePattern() static. However, there are two member variables modified in that function, so I left it unchanged. If static is necessary,  I can decompose it to two functions. One function checks if the pattern is a simple pattern, the second function finds out the strings to match in that pattern. 



> Faster String Like
> ------------------
>
>                 Key: HIVE-542
>                 URL: https://issues.apache.org/jira/browse/HIVE-542
>             Project: Hadoop Hive
>          Issue Type: Improvement
>          Components: Query Processor
>    Affects Versions: 0.4.0
>            Reporter: Zheng Shao
>         Attachments: HIVE-542.1.patch
>
>
> Currently Hive uses regular expression to do string like which is really really slow. We should implement "LIKE" natively using Text.

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


[jira] Commented: (HIVE-542) Faster String Like

Posted by "Zheng Shao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12719728#action_12719728 ] 

Zheng Shao commented on HIVE-542:
---------------------------------

Since there are so many advanced string matching algorithms (e.g. KMP and its variants), we should limit the scope here and maybe only optimize for the simplest case: "LIKE" that can be replaced by something like String.find().

Basically, if the pattern is in the form of "%xxx%" where xxx does not contain any wildcards, we can do "find".
If the pattern is in the form of "%xxx" or "xxx%", we can also do very efficient computation.


> Faster String Like
> ------------------
>
>                 Key: HIVE-542
>                 URL: https://issues.apache.org/jira/browse/HIVE-542
>             Project: Hadoop Hive
>          Issue Type: Improvement
>          Components: Query Processor
>    Affects Versions: 0.4.0
>            Reporter: Zheng Shao
>
> Currently Hive uses regular expression to do string like which is really really slow. We should implement "LIKE" natively using Text.

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


[jira] Assigned: (HIVE-542) Faster String Like

Posted by "Zheng Shao (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-542?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zheng Shao reassigned HIVE-542:
-------------------------------

    Assignee: Yuntao Jia

> Faster String Like
> ------------------
>
>                 Key: HIVE-542
>                 URL: https://issues.apache.org/jira/browse/HIVE-542
>             Project: Hadoop Hive
>          Issue Type: Improvement
>          Components: Query Processor
>    Affects Versions: 0.4.0
>            Reporter: Zheng Shao
>            Assignee: Yuntao Jia
>         Attachments: HIVE-542.1.patch
>
>
> Currently Hive uses regular expression to do string like which is really really slow. We should implement "LIKE" natively using Text.

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


[jira] Updated: (HIVE-542) Faster String Like

Posted by "Yuntao Jia (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-542?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yuntao Jia updated HIVE-542:
----------------------------

    Attachment: HIVE-542.2.patch

I changed the function name from checkSimplePattern(...) to parseSimplePattern(...) and added some comments. Now it is easier to understand how it works. I also changed the "if ... else if ... else ... " statement to a switch statement to make the code in evaluate(...) more readable. 

> Faster String Like
> ------------------
>
>                 Key: HIVE-542
>                 URL: https://issues.apache.org/jira/browse/HIVE-542
>             Project: Hadoop Hive
>          Issue Type: Improvement
>          Components: Query Processor
>    Affects Versions: 0.4.0
>            Reporter: Zheng Shao
>            Assignee: Yuntao Jia
>         Attachments: HIVE-542.1.patch, HIVE-542.2.patch
>
>
> Currently Hive uses regular expression to do string like which is really really slow. We should implement "LIKE" natively using Text.

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


[jira] Resolved: (HIVE-542) Faster String Like

Posted by "Zheng Shao (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-542?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zheng Shao resolved HIVE-542.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 0.4.0
     Release Note: HIVE-542. UDF: Faster String Like. (Yuntao Jia via zshao)
     Hadoop Flags: [Reviewed]

Committed. Thanks Yuntao!

> Faster String Like
> ------------------
>
>                 Key: HIVE-542
>                 URL: https://issues.apache.org/jira/browse/HIVE-542
>             Project: Hadoop Hive
>          Issue Type: Improvement
>          Components: Query Processor
>    Affects Versions: 0.4.0
>            Reporter: Zheng Shao
>            Assignee: Yuntao Jia
>             Fix For: 0.4.0
>
>         Attachments: HIVE-542.1.patch, HIVE-542.2.patch
>
>
> Currently Hive uses regular expression to do string like which is really really slow. We should implement "LIKE" natively using Text.

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