Hive
  1. Hive
  2. HIVE-2153

Stats JDBC LIKE queries should escape '_' and '%'

    Details

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

      Description

      DELETE /* Hive stats aggregation: org.apache.hadoop.hive.ql.stats.jdbc.JDBCStatsAggregator */ FROM PARTITION_STAT_TBL WHERE ID LIKE 'hdfs://dfsnode:9000/tmp/hive-root/hive_2011-05-09_04-30-28_586_4184342157898880918/-ext-10000/ds=2011-05-08/table_name=dim_page_to_user_suggest_assoc/%'

      It is a prefix query but the '_' in the ID column should be escaped. The same applies to '%' if they appear in ID.

      1. HIVE-2153.2.patch
        4 kB
        Ning Zhang
      2. HIVE-2153.patch
        4 kB
        Ning Zhang

        Activity

        Hide
        Ning Zhang added a comment -
        Show
        Ning Zhang added a comment - review board https://reviews.apache.org/r/702/
        Hide
        jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        This is an automatically generated e-mail. To reply, visit:
        https://reviews.apache.org/r/702/
        -----------------------------------------------------------

        Review request for hive.

        Summary
        -------

        Escape '_' and '%' in the LIKE operands.

        This addresses bug HIVE-2153.
        https://issues.apache.org/jira/browse/HIVE-2153

        Diffs


        trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java 1101220
        trunk/ql/src/java/org/apache/hadoop/hive/ql/stats/jdbc/JDBCStatsAggregator.java 1101220

        Diff: https://reviews.apache.org/r/702/diff

        Testing
        -------

        passed the stats test suite, also tested it manually on mysql in addition to derby.

        Thanks,

        Ning

        Show
        jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/702/ ----------------------------------------------------------- Review request for hive. Summary ------- Escape '_' and '%' in the LIKE operands. This addresses bug HIVE-2153 . https://issues.apache.org/jira/browse/HIVE-2153 Diffs trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java 1101220 trunk/ql/src/java/org/apache/hadoop/hive/ql/stats/jdbc/JDBCStatsAggregator.java 1101220 Diff: https://reviews.apache.org/r/702/diff Testing ------- passed the stats test suite, also tested it manually on mysql in addition to derby. Thanks, Ning
        Hide
        Ning Zhang added a comment -

        escape the escaping char itself.

        Show
        Ning Zhang added a comment - escape the escaping char itself.
        Hide
        jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        This is an automatically generated e-mail. To reply, visit:
        https://reviews.apache.org/r/702/
        -----------------------------------------------------------

        (Updated 2011-05-09 23:25:51.497027)

        Review request for hive.

        Summary
        -------

        Escape '_' and '%' in the LIKE operands.

        This addresses bug HIVE-2153.
        https://issues.apache.org/jira/browse/HIVE-2153

        Diffs (updated)


        trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java 1101220
        trunk/ql/src/java/org/apache/hadoop/hive/ql/stats/jdbc/JDBCStatsAggregator.java 1101220

        Diff: https://reviews.apache.org/r/702/diff

        Testing
        -------

        passed the stats test suite, also tested it manually on mysql in addition to derby.

        Thanks,

        Ning

        Show
        jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/702/ ----------------------------------------------------------- (Updated 2011-05-09 23:25:51.497027) Review request for hive. Summary ------- Escape '_' and '%' in the LIKE operands. This addresses bug HIVE-2153 . https://issues.apache.org/jira/browse/HIVE-2153 Diffs (updated) trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java 1101220 trunk/ql/src/java/org/apache/hadoop/hive/ql/stats/jdbc/JDBCStatsAggregator.java 1101220 Diff: https://reviews.apache.org/r/702/diff Testing ------- passed the stats test suite, also tested it manually on mysql in addition to derby. Thanks, Ning
        Hide
        Paul Yang added a comment -

        +1 Will test and commit

        Show
        Paul Yang added a comment - +1 Will test and commit
        Hide
        Paul Yang added a comment -

        Committed. Thanks Ning!

        Show
        Paul Yang added a comment - Committed. Thanks Ning!
        Hide
        Hudson added a comment -

        Integrated in Hive-trunk-h0.20 #726 (See https://builds.apache.org/hudson/job/Hive-trunk-h0.20/726/)

        Show
        Hudson added a comment - Integrated in Hive-trunk-h0.20 #726 (See https://builds.apache.org/hudson/job/Hive-trunk-h0.20/726/ )

          People

          • Assignee:
            Ning Zhang
            Reporter:
            Ning Zhang
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development