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 D1171200BD3 for ; Tue, 22 Nov 2016 02:07:03 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id CE26E160B19; Tue, 22 Nov 2016 01:07:03 +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 25D7A160AF9 for ; Tue, 22 Nov 2016 02:07:03 +0100 (CET) Received: (qmail 20643 invoked by uid 500); 22 Nov 2016 01:07:02 -0000 Mailing-List: contact reviews-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@impala.incubator.apache.org Received: (qmail 20596 invoked by uid 99); 22 Nov 2016 01:07:01 -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; Tue, 22 Nov 2016 01:07:01 +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 D942DC1961 for ; Tue, 22 Nov 2016 01:07:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.363 X-Spam-Level: X-Spam-Status: No, score=0.363 tagged_above=-999 required=6.31 tests=[RDNS_DYNAMIC=0.363, SPF_PASS=-0.001, URIBL_BLOCKED=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 VuISwBRjdyjD for ; Tue, 22 Nov 2016 01:06:59 +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 mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 057875FC9C for ; Tue, 22 Nov 2016 01:06:58 +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 uAM14wnK002746; Tue, 22 Nov 2016 01:04:58 GMT Message-Id: <201611220104.uAM14wnK002746@ip-10-146-233-104.ec2.internal> Date: Tue, 22 Nov 2016 01:04:58 +0000 From: "Alex Behm (Code Review)" To: Dimitris Tsirogiannis , impala-cr@cloudera.com, reviews@impala.incubator.apache.org Reply-To: alex.behm@cloudera.com X-Gerrit-MessageType: comment Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-4283=3A_Ensure_Kudu-specific_lineage_and_audit_behavior=0A?= X-Gerrit-Change-Id: Idc4ca1cd63bcfa4370c240a5c4a4126ed6704f4d X-Gerrit-ChangeURL: X-Gerrit-Commit: 53db1538cfe9ca5fb687e2b5e535a06e11d70d2a 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, 22 Nov 2016 01:07:04 -0000 Alex Behm has posted comments on this change. Change subject: IMPALA-4283: Ensure Kudu-specific lineage and audit behavior ...................................................................... Patch Set 1: (7 comments) http://gerrit.cloudera.org:8080/#/c/5151/1/fe/src/main/java/org/apache/impala/analysis/ColumnLineageGraph.java File fe/src/main/java/org/apache/impala/analysis/ColumnLineageGraph.java: Line 689: if (mentionedColumns.isEmpty()) { Can we reverse the logic as follows: if (tbl instanceof KuduTable) { List mentionedColumns = insertStmt.getMentionedColumns(); Preconditions.checkState(!mentionedColumns.isEmpty()); ... } else { ... } That way the Kudu-specific nature seems clearer. Once this logic is reversed, it almost seems simpler to inline this at the single caller (which already has a similar instanceof KuduTable check). http://gerrit.cloudera.org:8080/#/c/5151/1/fe/src/main/java/org/apache/impala/analysis/InsertStmt.java File fe/src/main/java/org/apache/impala/analysis/InsertStmt.java: Line 795: for (int i = 0; i < resultExprs_.size(); ++i) { We don't really need resultExprs_ right? for (Integer i: mentionedColumns_) { result.add(columns.get(i).getName()); } http://gerrit.cloudera.org:8080/#/c/5151/1/fe/src/main/java/org/apache/impala/planner/Planner.java File fe/src/main/java/org/apache/impala/planner/Planner.java: Line 186: if (ctx_.isUpdateOrDelete()) return fragments; Does this line do anything? I though we established that this is an INSERT or CTAS in L180. I think we need to move this check somewhere else. http://gerrit.cloudera.org:8080/#/c/5151/1/fe/src/test/java/org/apache/impala/analysis/AuditingTest.java File fe/src/test/java/org/apache/impala/analysis/AuditingTest.java: Line 374: public void TestKuduStatements() throws AuthorizationException, AnalysisException { nice! http://gerrit.cloudera.org:8080/#/c/5151/1/testdata/workloads/functional-planner/queries/PlannerTest/lineage.test File testdata/workloads/functional-planner/queries/PlannerTest/lineage.test: Line 4656: # Insert into a Kudu table with a column list specified Upsert Line 4661: "queryText":"insert into functional_kudu.alltypes (int_col, id) select int_col, id from\nfunctional.alltypes where id < 10", upsert? Line 4925: ==== What happens for DELETE and UPDATE statements? Might be worth adding a test. -- To view, visit http://gerrit.cloudera.org:8080/5151 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idc4ca1cd63bcfa4370c240a5c4a4126ed6704f4d Gerrit-PatchSet: 1 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Dimitris Tsirogiannis Gerrit-Reviewer: Alex Behm Gerrit-HasComments: Yes