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 348D4200BB1 for ; Thu, 20 Oct 2016 07:53:51 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 33230160AFB; Thu, 20 Oct 2016 05:53:51 +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 78BC1160AEA for ; Thu, 20 Oct 2016 07:53:50 +0200 (CEST) Received: (qmail 78221 invoked by uid 500); 20 Oct 2016 05:53:49 -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 78206 invoked by uid 99); 20 Oct 2016 05:53:48 -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; Thu, 20 Oct 2016 05:53:48 +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 7FC73C167B for ; Thu, 20 Oct 2016 05:53:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-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 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 z6ZrRrpTVrnh for ; Thu, 20 Oct 2016 05:53:45 +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 2749C5F5D3 for ; Thu, 20 Oct 2016 05:53:45 +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 u9K5r7L2006804; Thu, 20 Oct 2016 05:53:07 GMT Message-Id: <201610200553.u9K5r7L2006804@ip-10-146-233-104.ec2.internal> Date: Thu, 20 Oct 2016 05:53:07 +0000 From: "Alex Behm (Code Review)" To: Lars Volker , impala-cr@cloudera.com, reviews@impala.incubator.apache.org CC: Marcel Kornacker Reply-To: alex.behm@cloudera.com X-Gerrit-MessageType: comment Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-2521=3A_Add_clustered_hint_to_insert_statements=0A?= X-Gerrit-Change-Id: I412153bd8435d792bd61dea268d7a3b884048f14 X-Gerrit-ChangeURL: X-Gerrit-Commit: c9af12d7e2e67e363f14d28e620d4378a3886638 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: Thu, 20 Oct 2016 05:53:51 -0000 Alex Behm has posted comments on this change. Change subject: IMPALA-2521: Add clustered hint to insert statements ...................................................................... Patch Set 5: (7 comments) http://gerrit.cloudera.org:8080/#/c/4745/5/fe/src/main/java/org/apache/impala/analysis/InsertStmt.java File fe/src/main/java/org/apache/impala/analysis/InsertStmt.java: Line 132: private ArrayList kuduKeyExprs_ = Lists.newArrayList(); how about primaryKeyExprs_? Line 517: * expressions. Result exprs for key columns of kudu tables are stored in kuduKeyExprs_. Mention that as point 4 Line 601: // Store exprs for kudu key columns. Kudu (it's a proper noun) Line 602: if (matchFound && table_ instanceof KuduTable) { You also need to substitute the kuduExprs_ in InsertStmt.substituteResultExprs(). You can try something like this (and add a test): INSERT INTO kudu_table /*+ clustered */ SELECT * FROM (SELECT c1, c2, k1, k2) FROM src_table Line 604: for (String kuduKeyColumnName: kuduTable.getKuduKeyColumnNames()) { add helper KuduTable.isPrimaryKeyColumn() http://gerrit.cloudera.org:8080/#/c/4745/5/fe/src/main/java/org/apache/impala/planner/Planner.java File fe/src/main/java/org/apache/impala/planner/Planner.java: Line 499: * (key columns for kudu tables), so that partitions can be written sequentially in the Kudu tables http://gerrit.cloudera.org:8080/#/c/4745/5/testdata/workloads/functional-planner/queries/PlannerTest/kudu.test File testdata/workloads/functional-planner/queries/PlannerTest/kudu.test: Line 248: insert into table functional_kudu.alltypes /*+ clustered,shuffle */ shuffle/noshuffle don't do anything for Kudu tables, so I don't think this is necessary they might do something in the future -- To view, visit http://gerrit.cloudera.org:8080/4745 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I412153bd8435d792bd61dea268d7a3b884048f14 Gerrit-PatchSet: 5 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Lars Volker Gerrit-Reviewer: Alex Behm Gerrit-Reviewer: Lars Volker Gerrit-Reviewer: Marcel Kornacker Gerrit-HasComments: Yes