Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-3744

"show ... like ..." does not work reasonably

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: Impala 2.6.0
    • Fix Version/s: None
    • Component/s: Frontend

      Description

      In impala:

      [localhost:21000] > show tables;
      Query: show tables
      +------+
      | name |
      +------+
      | a    |
      | aa   |
      | aaa  |
      +------+
      Fetched 3 row(s) in 0.01s
      [localhost:21000] > show tables like "a";
      Query: show tables like "a"
      +------+
      | name |
      +------+
      | a    |
      +------+
      Fetched 1 row(s) in 0.01s
      [localhost:21000] > show tables like "a_";
      Query: show tables like "a_"
      
      Fetched 0 row(s) in 0.01s
      [localhost:21000] > show tables like "a%";                                                                                                                                                                                                                                                 
      Query: show tables like "a%"
      
      Fetched 0 row(s) in 0.00s
      [localhost:21000] > show tables like "a.";                                                                                                                                                                                                                                                 
      Query: show tables like "a."
      
      Fetched 0 row(s) in 0.00s
      [localhost:21000] > show tables like "a*";
      Query: show tables like "a*"
      +------+
      | name |
      +------+
      | a    |
      | aa   |
      | aaa  |
      +------+
      Fetched 3 row(s) in 0.01s
      

      In Hive:

      hive> show tables;
      OK
      a
      aa
      aaa
      Time taken: 0.013 seconds, Fetched: 3 row(s)
      hive> show tables like "a";
      OK
      a
      Time taken: 0.012 seconds, Fetched: 1 row(s)
      hive> show tables like "a_";
      OK
      aa
      Time taken: 0.014 seconds, Fetched: 1 row(s)
      hive> show tables like "a%";
      OK
      a
      aa
      aaa
      Time taken: 0.014 seconds, Fetched: 3 row(s)
      hive> show tables like "a.";
      OK
      aa
      Time taken: 0.011 seconds, Fetched: 1 row(s)
      hive> show tables like "a*";
      OK
      a
      aa
      aaa
      Time taken: 0.015 seconds, Fetched: 3 row(s)
      

      The problem seems to be http://github.mtv.cloudera.com/CDH/Impala/blob/cdh5-trunk/fe/src/main/java/com/cloudera/impala/util/PatternMatcher.java

      It is very confusing to have two pattern matcher.. we use Hive pattern matcher in this case, but it escapes ".", which is a bit surprising.

      Solution is to only use JdbcPatternMatcher, but this may break our API.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              HuaisiXu Huaisi Xu
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: