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 1D31A200CB0 for ; Fri, 9 Jun 2017 03:24:47 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1BA16160BE5; Fri, 9 Jun 2017 01:24:47 +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 62013160BD5 for ; Fri, 9 Jun 2017 03:24:46 +0200 (CEST) Received: (qmail 21026 invoked by uid 500); 9 Jun 2017 01:24:45 -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 21015 invoked by uid 99); 9 Jun 2017 01:24:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jun 2017 01:24:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id C100D18843A for ; Fri, 9 Jun 2017 01:24:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-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 (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id w_HbHAI8dRBT for ; Fri, 9 Jun 2017 01:24:43 +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 73A755FCC4 for ; Fri, 9 Jun 2017 01:24:43 +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 v591Og6Y002910; Fri, 9 Jun 2017 01:24:42 GMT Message-Id: <201706090124.v591Og6Y002910@ip-10-146-233-104.ec2.internal> Date: Fri, 9 Jun 2017 01:24:42 +0000 From: "Tim Armstrong (Code Review)" To: Lars Volker , impala-cr@cloudera.com, reviews@impala.incubator.apache.org CC: Taras Bobrovytsky , Jim Apple , Dimitris Tsirogiannis Reply-To: tarmstrong@cloudera.com X-Gerrit-MessageType: comment Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-3643/IMPALA-5344=3A_Fix_FE_tests_on_Java_8=0A?= X-Gerrit-Change-Id: Iad8e1dccec3a51293a109c420bd2b88b9d1e0625 X-Gerrit-ChangeURL: X-Gerrit-Commit: fc8cf3749778e864feaac0134e934407c1a98703 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: Fri, 09 Jun 2017 01:24:47 -0000 Tim Armstrong has posted comments on this change. Change subject: IMPALA-3643/IMPALA-5344: Fix FE tests on Java 8 ...................................................................... Patch Set 5: (6 comments) I had a few high-level comments: * A lot of this depends on order being preserved across multiple classes. If one class depends on another class returning things in a particular order, we should document that as part of the interface (either in a comment or via the types) * In a lot of cases, if it's important that a particular data structure preserves insertion order, we should declare the member or return value as a LinkedHash* instead of just a Hash*. Otherwise it's all very mysterious. * I think in many cases, instead of trying to preserve an arbitrary order across multiple processing steps, we should instead put the elements into a canonical order at the point where we iterate over them. It's hard to understand why things work otherwise. http://gerrit.cloudera.org:8080/#/c/7073/5/fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java File fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java: Line 443: Map> tablePrivReqs = Maps.newLinkedHashMap(); Mention that the LinkedHashMap is used to preserve the order. I also wonder if TreeMap would be better - that way the order would be alphabetical rather than arbitrary. http://gerrit.cloudera.org:8080/#/c/7073/5/fe/src/main/java/org/apache/impala/analysis/Analyzer.java File fe/src/main/java/org/apache/impala/analysis/Analyzer.java: Line 203: public final Map conjuncts = Maps.newLinkedHashMap(); The changes in here all feel a bit arbitrary. Do we understand why it's necessary to change all of these? Line 1811: private Map> getEquivClasses(List tids) { I don't understand why the order should matter here. It looks like there is some interaction between this, DisjointSet, and createEquivConjuncts() but it's not clear what the contract between the components is with regards to ordering. http://gerrit.cloudera.org:8080/#/c/7073/5/fe/src/main/java/org/apache/impala/analysis/ColumnLineageGraph.java File fe/src/main/java/org/apache/impala/analysis/ColumnLineageGraph.java: It's really hard to understand why the ordering is necessary in most of these places or what the contracts are between the different data structures. Is there a way we can just enforce the ordering on output, rather than trying to maintain an arbitrary order the whole way through. http://gerrit.cloudera.org:8080/#/c/7073/5/fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java File fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java: Line 187: Maps.newLinkedHashMap(innerStmt.getTblProperties()); It was not obvious the me that getTblProperties() had any specific order. I had to look at the cup file to figure that out! http://gerrit.cloudera.org:8080/#/c/7073/5/fe/src/main/java/org/apache/impala/planner/RuntimeFilterGenerator.java File fe/src/main/java/org/apache/impala/planner/RuntimeFilterGenerator.java: Line 437: public Set getRuntimeFilters() { I think it would be less brittle to just return a list of filters sorted by filterId here. That also will make it less likely that we will unintentionally change the result if we change the algorithms in here. -- To view, visit http://gerrit.cloudera.org:8080/7073 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iad8e1dccec3a51293a109c420bd2b88b9d1e0625 Gerrit-PatchSet: 5 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Lars Volker Gerrit-Reviewer: Dimitris Tsirogiannis Gerrit-Reviewer: Jim Apple Gerrit-Reviewer: Lars Volker Gerrit-Reviewer: Taras Bobrovytsky Gerrit-Reviewer: Tim Armstrong Gerrit-HasComments: Yes