Hive
  1. Hive
  2. HIVE-2714

Lots of special characters are not handled in LIKE

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.0
    • Component/s: None
    • Labels:
      None

      Description

      Currently LIKE converts the string to a regular expression. It tries to handle special characters but many are not correctly handled, e.g. +, ?, |, etc. That code should just use Pattern.quote.

        Activity

        Jonathan Chang created issue -
        Hide
        Phabricator added a comment -

        jonchang requested code review of "HIVE-2714 [jira] Lots of special characters are not handled in LIKE".
        Reviewers: JIRA

        HIVE-2714

        Currently LIKE converts the string to a regular expression. It tries to handle special characters but many are not correctly handled, e.g. +, ?, |, etc. That code should just use Pattern.quote.

        TEST PLAN
        EMPTY

        REVISION DETAIL
        https://reviews.facebook.net/D1239

        AFFECTED FILES
        ql/src/java/org/apache/hadoop/hive/ql/udf/UDFLike.java
        ql/src/test/queries/clientpositive/udf_like.q
        ql/src/test/results/clientpositive/udf_like.q.out

        MANAGE HERALD DIFFERENTIAL RULES
        https://reviews.facebook.net/herald/view/differential/

        WHY DID I GET THIS EMAIL?
        https://reviews.facebook.net/herald/transcript/2541/

        Tip: use the X-Herald-Rules header to filter Herald messages in your client.

        Show
        Phabricator added a comment - jonchang requested code review of " HIVE-2714 [jira] Lots of special characters are not handled in LIKE". Reviewers: JIRA HIVE-2714 Currently LIKE converts the string to a regular expression. It tries to handle special characters but many are not correctly handled, e.g. +, ?, |, etc. That code should just use Pattern.quote. TEST PLAN EMPTY REVISION DETAIL https://reviews.facebook.net/D1239 AFFECTED FILES ql/src/java/org/apache/hadoop/hive/ql/udf/UDFLike.java ql/src/test/queries/clientpositive/udf_like.q ql/src/test/results/clientpositive/udf_like.q.out MANAGE HERALD DIFFERENTIAL RULES https://reviews.facebook.net/herald/view/differential/ WHY DID I GET THIS EMAIL? https://reviews.facebook.net/herald/transcript/2541/ Tip: use the X-Herald-Rules header to filter Herald messages in your client.
        Phabricator made changes -
        Field Original Value New Value
        Attachment HIVE-2714.D1239.1.patch [ 12510435 ]
        Jonathan Chang made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Phabricator added a comment -

        kevinwilfong has accepted the revision "HIVE-2714 [jira] Lots of special characters are not handled in LIKE".

        +1 Will commit if tests pass

        REVISION DETAIL
        https://reviews.facebook.net/D1239

        BRANCH
        like

        Show
        Phabricator added a comment - kevinwilfong has accepted the revision " HIVE-2714 [jira] Lots of special characters are not handled in LIKE". +1 Will commit if tests pass REVISION DETAIL https://reviews.facebook.net/D1239 BRANCH like
        Jonathan Chang made changes -
        Attachment HIVE-2714.D1239.1.patch [ 12518081 ]
        Hide
        Kevin Wilfong added a comment -

        Committed. Thanks Jonathan.

        Show
        Kevin Wilfong added a comment - Committed. Thanks Jonathan.
        Kevin Wilfong made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Hudson added a comment -

        Integrated in Hive-trunk-h0.21 #1307 (See https://builds.apache.org/job/Hive-trunk-h0.21/1307/)
        HIVE-2714. Lots of special characters are not handled in LIKE. (jonchang via kevinwilfong) (Revision 1299948)

        Result = FAILURE
        kevinwilfong : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1299948
        Files :

        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFLike.java
        • /hive/trunk/ql/src/test/queries/clientpositive/udf_like.q
        • /hive/trunk/ql/src/test/results/clientpositive/udf_like.q.out
        Show
        Hudson added a comment - Integrated in Hive-trunk-h0.21 #1307 (See https://builds.apache.org/job/Hive-trunk-h0.21/1307/ ) HIVE-2714 . Lots of special characters are not handled in LIKE. (jonchang via kevinwilfong) (Revision 1299948) Result = FAILURE kevinwilfong : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1299948 Files : /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFLike.java /hive/trunk/ql/src/test/queries/clientpositive/udf_like.q /hive/trunk/ql/src/test/results/clientpositive/udf_like.q.out
        Ashutosh Chauhan made changes -
        Fix Version/s 0.9.0 [ 12317742 ]
        Hide
        Ashutosh Chauhan added a comment -

        This issue is closed now. It was released with the fix in 0.9.0. If there is a problem, please open a new jira and link this one with that.

        Show
        Ashutosh Chauhan added a comment - This issue is closed now. It was released with the fix in 0.9.0. If there is a problem, please open a new jira and link this one with that.
        Ashutosh Chauhan made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Hudson added a comment -

        Integrated in Hive-trunk-hadoop2 #54 (See https://builds.apache.org/job/Hive-trunk-hadoop2/54/)
        HIVE-2714. Lots of special characters are not handled in LIKE. (jonchang via kevinwilfong) (Revision 1299948)

        Result = ABORTED
        kevinwilfong : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1299948
        Files :

        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFLike.java
        • /hive/trunk/ql/src/test/queries/clientpositive/udf_like.q
        • /hive/trunk/ql/src/test/results/clientpositive/udf_like.q.out
        Show
        Hudson added a comment - Integrated in Hive-trunk-hadoop2 #54 (See https://builds.apache.org/job/Hive-trunk-hadoop2/54/ ) HIVE-2714 . Lots of special characters are not handled in LIKE. (jonchang via kevinwilfong) (Revision 1299948) Result = ABORTED kevinwilfong : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1299948 Files : /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFLike.java /hive/trunk/ql/src/test/queries/clientpositive/udf_like.q /hive/trunk/ql/src/test/results/clientpositive/udf_like.q.out

          People

          • Assignee:
            Jonathan Chang
            Reporter:
            Jonathan Chang
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development