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 13CCC200BB3 for ; Wed, 19 Oct 2016 00:15:57 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0C061160AF7; Tue, 18 Oct 2016 22:15:57 +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 51B3A160AE5 for ; Wed, 19 Oct 2016 00:15:56 +0200 (CEST) Received: (qmail 36659 invoked by uid 500); 18 Oct 2016 22:15:55 -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 36644 invoked by uid 99); 18 Oct 2016 22:15:55 -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, 18 Oct 2016 22:15:55 +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 AC3BBC0E09 for ; Tue, 18 Oct 2016 22:15:54 +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-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id U-c3EWQnpJso for ; Tue, 18 Oct 2016 22:15:52 +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-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 1AE0E5F1D5 for ; Tue, 18 Oct 2016 22:15:51 +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 u9IMFpJu029081; Tue, 18 Oct 2016 22:15:51 GMT Message-Id: <201610182215.u9IMFpJu029081@ip-10-146-233-104.ec2.internal> Date: Tue, 18 Oct 2016 22:15:50 +0000 From: "Lars Volker (Code Review)" To: impala-cr@cloudera.com, reviews@impala.incubator.apache.org CC: Alex Behm , Marcel Kornacker Reply-To: lv@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: 8150cd7e27afafc2b90823809448085747494155 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, 18 Oct 2016 22:15:57 -0000 Lars Volker has posted comments on this change. Change subject: IMPALA-2521: Add clustered hint to insert statements ...................................................................... Patch Set 1: (12 comments) Thanks for the reviews, please see PS2 http://gerrit.cloudera.org:8080/#/c/4745/1/fe/src/main/java/org/apache/impala/analysis/InsertStmt.java File fe/src/main/java/org/apache/impala/analysis/InsertStmt.java: Line 121: private boolean hasClusteredHint_ = false; > might be better to use ternary logic here with a single Boolean (which can We actually only need the ternary logic to detect conflicting hints, so I made it a boolean and used another local variable in analyzePlanHints() to detect that error. Line 631: if (hasNoShuffleHint_) { > did you mean noclustered? Yes, done. Line 632: throw new AnalysisException("Conflicting INSERT hint: " + hint); > list both conflicting hints (otherwise it's hard to tell how to fix the pro Done http://gerrit.cloudera.org:8080/#/c/4745/1/fe/src/main/java/org/apache/impala/analysis/SortInfo.java File fe/src/main/java/org/apache/impala/analysis/SortInfo.java: Line 68: * sorted. Its source exprs are update to those in tupleSlotExprs. > second sentence incomprehensible. Done Line 123: * the exprs used by the SortNode refer to the materialized tuples instead of the > don't refer to the sort node here, SortInfo shouldn't have to know about th Done http://gerrit.cloudera.org:8080/#/c/4745/1/fe/src/main/java/org/apache/impala/planner/DistributedPlanner.java File fe/src/main/java/org/apache/impala/planner/DistributedPlanner.java: Line 269: * clustered/noclustered plan hint. The clustering re-order the data in 'inputFragment' > Better to be specific: Say that it adds a sort node that orders on the part Done Line 272: // TODO: this function shares some code with QueryStmt::createSortTupleInfo(). However > You could move most of the code into SortInfo.createSortTupleInfo(List you should move the logic (minus the createSortTupleInfo part that alex bro createInsertFragment has several early exits (return inputFragment) and it isn't that clear to me, how adding this orthogonal functionality would fit in nicely. We need to support both cases, adding shuffling and/or clustering independently. Should I replace them with nested if-else-clauses? For now I moved it to the Planner as suggested by Alex and enabled it for single-node-plans, too. Line 275: public PlanFragment addClusteringFragment(PlanFragment inputFragment, > createInsertFragment() is only called for distributed plans. Should cluster Done Line 309: sortTupleDesc.setIsMaterialized(true); > To indicate that this tuple is a physical tuple needed during runtime execu Done Line 324: // TODO Why is this needed here but not in QueryStmt.java? If it is omitted, the query > Before plan generation we call QueryStmt.materializeRequiredSlots() to make Done http://gerrit.cloudera.org:8080/#/c/4745/1/fe/src/main/java/org/apache/impala/planner/Planner.java File fe/src/main/java/org/apache/impala/planner/Planner.java: Line 144: rootFragment = distributedPlanner.addClusteringFragment( > 1. we should also do this for single-node plans, so adding the clustering d Done -- 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: 1 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