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 1E68E200C4D for ; Wed, 5 Apr 2017 23:10:02 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1CDE3160B94; Wed, 5 Apr 2017 21:10:02 +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 6361A160B76 for ; Wed, 5 Apr 2017 23:10:01 +0200 (CEST) Received: (qmail 89070 invoked by uid 500); 5 Apr 2017 21:10:00 -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 89054 invoked by uid 99); 5 Apr 2017 21:10:00 -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; Wed, 05 Apr 2017 21:10:00 +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 0063BC023E for ; Wed, 5 Apr 2017 21:10:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-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 (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id iSZRqblOXTz2 for ; Wed, 5 Apr 2017 21:09:58 +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 92FE95F1A0 for ; Wed, 5 Apr 2017 21:09: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 v35L9woO015688; Wed, 5 Apr 2017 21:09:58 GMT Message-Id: <201704052109.v35L9woO015688@ip-10-146-233-104.ec2.internal> Date: Wed, 5 Apr 2017 21:09:58 +0000 From: "Lars Volker (Code Review)" To: impala-cr@cloudera.com, reviews@impala.incubator.apache.org CC: Marcel Kornacker , Thomas Tauber-Marshall , Dimitris Tsirogiannis Reply-To: lv@cloudera.com X-Gerrit-MessageType: comment Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-4166=3A_Add_SORT_BY_sql_clause=0A?= X-Gerrit-Change-Id: I08834f38a941786ab45a4381c2732d929a934f75 X-Gerrit-ChangeURL: X-Gerrit-Commit: b26821eb2f8f0823bf7817788384ecb4123b954e 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.7 archived-at: Wed, 05 Apr 2017 21:10:02 -0000 Lars Volker has posted comments on this change. Change subject: IMPALA-4166: Add SORT BY sql clause ...................................................................... Patch Set 10: (8 comments) Thank you for your reviews. Please see my inline comments and PS10. http://gerrit.cloudera.org:8080/#/c/6495/9/fe/src/main/java/org/apache/impala/analysis/InsertStmt.java File fe/src/main/java/org/apache/impala/analysis/InsertStmt.java: PS9, Line 376: analyzeSortByColumn > Instead of checking this here, it's a bit cleaner to alway call analyzeSort Done http://gerrit.cloudera.org:8080/#/c/6495/9/fe/src/main/java/org/apache/impala/analysis/TablePropertyAnalyzer.java File fe/src/main/java/org/apache/impala/analysis/TablePropertyAnalyzer.java: PS9, Line 49: roperties.containsKe > The caller is not supposed to modify the return values, correct? You may ju Done, I ended up using ImmutableList, since I already use it below. PS9, Line 77: > Same comment as above. Done PS9, Line 89: t by column in the li > You can still construct and return an ImmutableList. See Guava's ImmutableL I needed the contains() method in line 105, as well as size(), so I ended up using a LinkedHashSet. http://gerrit.cloudera.org:8080/#/c/6495/9/fe/src/test/java/org/apache/impala/analysis/AnalyzeDDLTest.java File fe/src/test/java/org/apache/impala/analysis/AnalyzeDDLTest.java: Line 515: AnalyzesOk("alter table functional.alltypes set tblproperties(" + > why allow this in addition to the '... sort by ()' clause? Alex and I discussed this and Alex suggested that we allow this, since it is easier than explicitly disabling it, and we'll always have the possibility that someone changes the values in Hive. The alternative would be to try and hide the table property completely. If Alex doesn't object and you think it's worth the effort to hide this from the users, I can implement it. Line 1905: "tblproperties ('sort.by.columns'='i')", "Table definition must not contain " + > same here, why allow the sort.by.columns table property? Please see my reply above. http://gerrit.cloudera.org:8080/#/c/6495/9/fe/src/test/java/org/apache/impala/analysis/ParserTest.java File fe/src/test/java/org/apache/impala/analysis/ParserTest.java: PS9, Line 2374: // SORT BY must be the first table option : ParserError("CREATE > You may want to comment why this results in a parsing error. Done http://gerrit.cloudera.org:8080/#/c/6495/9/fe/src/test/java/org/apache/impala/analysis/ToSqlTest.java File fe/src/test/java/org/apache/impala/analysis/ToSqlTest.java: Line 304: "TBLPROPERTIES ('sort.by.columns'='a')", true); > why not print that as a 'sort by' clause? I commented on the decision to keep the sort.by.columns property visible in AnalyzeDDLTest.java. I discussed ToSqlTest() with Alex, too, and IIRC he explained that this is only really relevant for views, in which create table statements cannot occur anyways. Therefore, this should never be visible to a user and is tested here only for completeness. Should I add a comment to explain this? -- To view, visit http://gerrit.cloudera.org:8080/6495 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I08834f38a941786ab45a4381c2732d929a934f75 Gerrit-PatchSet: 10 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Lars Volker Gerrit-Reviewer: Dimitris Tsirogiannis Gerrit-Reviewer: Lars Volker Gerrit-Reviewer: Marcel Kornacker Gerrit-Reviewer: Thomas Tauber-Marshall Gerrit-HasComments: Yes