Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
Impala 2.6.0
-
None
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.