Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A9A74200B3C for ; Wed, 29 Jun 2016 01:26:40 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A86DB160A56; Tue, 28 Jun 2016 23:26:40 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CD964160A6C for ; Wed, 29 Jun 2016 01:26:39 +0200 (CEST) Received: (qmail 79592 invoked by uid 500); 28 Jun 2016 23:26:39 -0000 Mailing-List: contact dev-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@impala.incubator.apache.org Delivered-To: mailing list dev@impala.incubator.apache.org Received: (qmail 79579 invoked by uid 99); 28 Jun 2016 23:26:38 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jun 2016 23:26:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 642C2C0284 for ; Tue, 28 Jun 2016 23:26:38 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.362 X-Spam-Level: X-Spam-Status: No, score=0.362 tagged_above=-999 required=6.31 tests=[RDNS_DYNAMIC=0.363, SPF_PASS=-0.001] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id kCRI_riqcxH0 for ; Tue, 28 Jun 2016 23:26:36 +0000 (UTC) Received: from ip-10-146-233-104.ec2.internal (ec2-75-101-130-251.compute-1.amazonaws.com [75.101.130.251]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 326705F1E5 for ; Tue, 28 Jun 2016 23:26:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ip-10-146-233-104.ec2.internal (8.14.4/8.14.4) with ESMTP id u5SNQZ3p008446; Tue, 28 Jun 2016 23:26:35 GMT Message-Id: <201606282326.u5SNQZ3p008446@ip-10-146-233-104.ec2.internal> Date: Tue, 28 Jun 2016 23:26:35 +0000 From: "Huaisi Xu (Code Review)" To: impala-cr@cloudera.com, dev@impala.incubator.apache.org CC: Dimitris Tsirogiannis Reply-To: hxu@cloudera.com X-Gerrit-MessageType: comment Subject: =?UTF-8?Q?=5BImpala-CR=5D=28cdh5-trunk=29_IMPALA-3711=3A_Check_privileges_when_necessary=0A?= X-Gerrit-Change-Id: I17d8c5b9fb12483e4b01b819fba48b6849311a14 X-Gerrit-ChangeURL: X-Gerrit-Commit: 8b344589e68df301d6270cc6615fb0d7d3530b5e In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.12.2 archived-at: Tue, 28 Jun 2016 23:26:40 -0000 Huaisi Xu has posted comments on this change. Change subject: IMPALA-3711: Check privileges when necessary ...................................................................... Patch Set 8: (25 comments) http://gerrit.cloudera.org:8080/#/c/3371/8//COMMIT_MSG Commit Message: PS8, Line 7: Check privileges when necessary > Maybe "Remove unnecessary privilege checks when accessing catalog objects" Done PS8, Line 13: user only request database name > The description is a bit misleading. In general, requesting a db from the c I will update this later. I need to think about this. http://gerrit.cloudera.org:8080/#/c/3371/8/fe/src/main/java/com/cloudera/impala/catalog/Catalog.java File fe/src/main/java/com/cloudera/impala/catalog/Catalog.java: PS8, Line 132: Returns databases using matcher > "Returns all databases that match the pattern of 'matcher'." Similar commen Done PS8, Line 134: matcher must not be null. > You don't enforce that. Add a Preconditions.checkNotNull() above L137 or re Done PS8, Line 172: tablePatternMatcher > Just rename to "matcher". Done PS8, Line 359: Filter candidates.getName() using matcher > "Return all catalog objects from 'candidates' that match the pattern of 'ma Done http://gerrit.cloudera.org:8080/#/c/3371/8/fe/src/main/java/com/cloudera/impala/catalog/Db.java File fe/src/main/java/com/cloudera/impala/catalog/Db.java: PS8, Line 17: * > Please don't do that. We don't need everything from util. yeah I noticed this.. my IDE changed this.. PS8, Line 427: Returns all functions using fnPatternMatcher > "Returns all functions that match the pattern of 'matcher'. if 'matcher' is Done http://gerrit.cloudera.org:8080/#/c/3371/8/fe/src/main/java/com/cloudera/impala/service/Frontend.java File fe/src/main/java/com/cloudera/impala/service/Frontend.java: PS8, Line 592: Match tables in database dbName with tablePatternMatcher and check user's privileges. > "Returns all tables in database 'dbName' that match the pattern of 'matcher Done PS8, Line 595: Throw ImpalaException when dbName is null > Where does this happen? Also when describing the conditions during which an ok. just removed. it happens in getTableNames(dbName, matcher). PS8, Line 598: tablePatternMatcher > Let's rename all these variables to 'matcher' unless there are multiple ins Done PS8, Line 624: List columns = Lists.newArrayList(); : if (columnPatternMatcher == null) return columns; > swap these two lines and return Collections.emptyList(); Done http://gerrit.cloudera.org:8080/#/c/3371/8/fe/src/main/java/com/cloudera/impala/service/JniFrontend.java File fe/src/main/java/com/cloudera/impala/service/JniFrontend.java: PS8, Line 211: params > Plz don't reference variable names from the body of this function in the fu Done PS8, Line 266: params > Same comment as above. Done http://gerrit.cloudera.org:8080/#/c/3371/8/fe/src/main/java/com/cloudera/impala/service/MetadataOp.java File fe/src/main/java/com/cloudera/impala/service/MetadataOp.java: PS8, Line 226: Class contains all information needed by getMetadataOp(). > "Utility class that represents the input parameters of getDbsMetadata() fun Done PS8, Line 287: JDBC search patterns > You may want to add a ref to the PatternMatcher class so that the reader ca Done PS8, Line 287: metadataParams > 'metadataParams'. Done PS8, Line 286: the : * search pattern > "the associated search patterns" Done PS8, Line 289: The return value result.dbs contains the list of databases that satisfy : * the "dbPattern_" search pattern. : * result.tableNames[i] contains the list of tables inside dbs[i] that satisfy : * the "tablePattern_" search pattern. : * result.columns[i][j] contains the list of columns of table[j] in dbs[i] : * that satisfy the search condition "columnPattern_". : * result.functions[i] contains the list of functions inside dbs[i] that : * satisfy the "functionPattern_" search pattern. > You need to update this comment. e.g. "dbPattern_" doesn't even show up in I was referring to members in metadataParams. Done. PS8, Line 348: if (columnPatternMatcher == null) continue; > I don't think that is correct here. You'll never populate the missingTbls u Agree.. I changed the behavior of this function. thanks! http://gerrit.cloudera.org:8080/#/c/3371/8/fe/src/test/java/com/cloudera/impala/analysis/AuthorizationTest.java File fe/src/test/java/com/cloudera/impala/analysis/AuthorizationTest.java: Line 1543: > Maybe also add a call to getDbs where the pattern matches a db for which th Done PS8, Line 1626: same as "%" > Also indicate what that means (.e.g. matches all). Done PS8, Line 1641: Pattern ".*" or "." works as well > Mention what that matches. Here and everywhere else Done PS8, Line 1657: "_" should work > Not very descriptive comment :) Done http://gerrit.cloudera.org:8080/#/c/3371/8/testdata/workloads/functional-query/queries/QueryTest/show.test File testdata/workloads/functional-query/queries/QueryTest/show.test: PS8, Line 157: # This behaves different than Hive, see IMPALA-3744 : show tables in functional like 'alltypesag.' : ---- RESULTS : ---- TYPES : STRING : ==== : ---- QUERY : show tables in functional like 'alltypesag.*' : ---- RESULTS : ---- TYPES : STRING : ==== : ---- QUERY : show tables in functional like 'alltypesagg%' : ---- RESULTS : ---- TYPES : STRING : ==== : ---- QUERY : show tables in functional like 'alltypesag_' : ---- RESULTS : ---- TYPES : STRING : ==== : ---- QUERY > What are we testing with these cases? I just want to fix the behavior of our end-to-end result. Unit test is only for integrity of those particular methods, and they work as expected. but end-to-end is not necessary. Hive' behavior is different. -- To view, visit http://gerrit.cloudera.org:8080/3371 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I17d8c5b9fb12483e4b01b819fba48b6849311a14 Gerrit-PatchSet: 8 Gerrit-Project: Impala Gerrit-Branch: cdh5-trunk Gerrit-Owner: Huaisi Xu Gerrit-Reviewer: Dimitris Tsirogiannis Gerrit-Reviewer: Huaisi Xu Gerrit-HasComments: Yes