hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chaoyu Tang" <ctang...@gmail.com>
Subject Review Request 25412: HIVE-1363: SHOW TABLE EXTENDED LIKE command does not strip single/double quotes
Date Sat, 06 Sep 2014 05:57:16 GMT

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

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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message