Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 470E111101 for ; Sat, 6 Sep 2014 05:57:18 +0000 (UTC) Received: (qmail 81395 invoked by uid 500); 6 Sep 2014 05:57:17 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 81321 invoked by uid 500); 6 Sep 2014 05:57:17 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 81309 invoked by uid 99); 6 Sep 2014 05:57:17 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Sep 2014 05:57:17 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 9AFE91DD4EB; Sat, 6 Sep 2014 05:57:16 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============8783872263489351817==" MIME-Version: 1.0 Subject: Review Request 25412: HIVE-1363: SHOW TABLE EXTENDED LIKE command does not strip single/double quotes From: "Chaoyu Tang" To: "hive" , "Chaoyu Tang" Date: Sat, 06 Sep 2014 05:57:16 -0000 Message-ID: <20140906055716.13389.27230@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "Chaoyu Tang" X-ReviewGroup: hive X-ReviewRequest-URL: https://reviews.apache.org/r/25412/ X-Sender: "Chaoyu Tang" Reply-To: "Chaoyu Tang" X-ReviewRequest-Repository: hive-git --===============8783872263489351817== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- 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 --===============8783872263489351817==--