----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/25412/#review52540 -----------------------------------------------------------
ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java <https://reviews.apache.org/r/25412/#comment91339> Minor nit: could we have a local var for tableOrColumnNode.getToken().getType(), as this is long and used twice in the same method? - Xuefu Zhang On Sept. 6, 2014, 5:57 a.m., Chaoyu Tang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/25412/ > ----------------------------------------------------------- > > (Updated Sept. 6, 2014, 5:57 a.m.) > > > Review request for hive. > > > Repository: hive-git > > > Description > ------- > > 'SHOW TABLE EXTENDED [IN|FROM database_name] LIKE identifier_with_wildcards' > command does not strip single/double quotes around identifier_with_wildcards > and returns empty results. It is because the identifier_with_wildcards in > this query is a token type of HiveParser.StringLiteral and the method > unescapeIdentifier used in BaseSemanticAnalyzer.getUnescapedName could not > strip its quotes. The quotes become parts of the tablename regexp and > therefore no matched tables are returned for this pattern. > For the token of HiveParser.StringLiteral from this kind of query, we can use > unescapeSQLString to strip their quotes. The change in this patch is to use > unescapeSQLString to remove the quotes around identifier_with_wildcards. > > > Diffs > ----- > > ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java > b5b2b609b2bda7180219ae95fbbe42ad07ed0d97 > ql/src/test/queries/clientpositive/show_tables.q > f33325dbb9e410a828b3bb8b1e5bdce234025d3b > ql/src/test/results/clientpositive/show_tables.q.out > 0d4aa5713e22bec90c8dd68ab08de4f8ff9d6eb8 > > Diff: https://reviews.apache.org/r/25412/diff/ > > > Testing > ------- > > 1. Manual test: with the changes, all following cases are working just like > the other command "SHOW TABLES..." > SHOW TABLE EXTENDED IN test_db LIKE 'ba*'; > SHOW TABLE EXTENDED IN test_db LIKE "ba*"; > SHOW TABLE EXTENDED IN test_db LIKE `ba*`; > 2. six related unit tests are added to show_tables.q and they work as expected > 3. submit this patch for pre-commit test to see if the changes will cause > other regression. > > > Thanks, > > Chaoyu Tang > >