Return-Path: X-Original-To: apmail-hawq-dev-archive@minotaur.apache.org Delivered-To: apmail-hawq-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B40AE19B85 for ; Mon, 21 Mar 2016 23:25:51 +0000 (UTC) Received: (qmail 17342 invoked by uid 500); 21 Mar 2016 23:25:51 -0000 Delivered-To: apmail-hawq-dev-archive@hawq.apache.org Received: (qmail 17274 invoked by uid 500); 21 Mar 2016 23:25:51 -0000 Mailing-List: contact dev-help@hawq.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hawq.incubator.apache.org Delivered-To: mailing list dev@hawq.incubator.apache.org Received: (qmail 17263 invoked by uid 99); 21 Mar 2016 23:25:51 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Mar 2016 23:25:51 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 87EAEC6484 for ; Mon, 21 Mar 2016 23:25:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.021 X-Spam-Level: X-Spam-Status: No, score=-4.021 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id A7P5G4UcesGo for ; Mon, 21 Mar 2016 23:25:50 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id C7B575F33E for ; Mon, 21 Mar 2016 23:25:49 +0000 (UTC) Received: (qmail 17214 invoked by uid 99); 21 Mar 2016 23:25:49 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Mar 2016 23:25:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2823ADFA43; Mon, 21 Mar 2016 23:25:49 +0000 (UTC) From: sansanichfb To: dev@hawq.incubator.apache.org Reply-To: dev@hawq.incubator.apache.org References: In-Reply-To: Subject: [GitHub] incubator-hawq pull request: HAWQ 459 Enhanced metadata api to sup... Content-Type: text/plain Message-Id: <20160321232549.2823ADFA43@git1-us-west.apache.org> Date: Mon, 21 Mar 2016 23:25:49 +0000 (UTC) Github user sansanichfb commented on a diff in the pull request: https://github.com/apache/incubator-hawq/pull/477#discussion_r56914927 --- Diff: pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/HiveUtilities.java --- @@ -225,15 +245,53 @@ private static boolean verifyModifers(String[] modifiers) { } if (toks.size() == 1) { - dbName = HIVE_DEFAULT_DBNAME; - tableName = toks.get(0); + dbPattern = HIVE_DEFAULT_DBNAME; + tablePattern = toks.get(0); } else if (toks.size() == 2) { - dbName = toks.get(0); - tableName = toks.get(1); + dbPattern = toks.get(0); + tablePattern = toks.get(1); } else { - throw new IllegalArgumentException("\"" + qualifiedName + "\"" + errorMsg); + throw new IllegalArgumentException("\"" + pattern + "\"" + errorMsg); } - return new Metadata.Table(dbName, tableName); + return getTablesFromPattern(client, dbPattern, tablePattern); + + } + + private static List getTablesFromPattern(HiveMetaStoreClient client, String dbPattern, String tablePattern) { + + List databases = null; + List itemList = new ArrayList(); + List tables = new ArrayList(); + + if(client == null || (!dbPattern.contains(WILDCARD) && !tablePattern.contains(WILDCARD)) ) { + /* This case occurs when the call is invoked as part of the fragmenter api or when metadata is requested for a specific table name */ + itemList.add(new Metadata.Item(dbPattern, tablePattern)); + return itemList; + } + + try { + /*if(dbPattern.contains(WILDCARD)) { --- End diff -- Remove it? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---