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 B5D7C200B56 for ; Sat, 30 Jul 2016 09:23:57 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B46E0160A8B; Sat, 30 Jul 2016 07:23: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 01A4E160A81 for ; Sat, 30 Jul 2016 09:23:56 +0200 (CEST) Received: (qmail 37802 invoked by uid 500); 30 Jul 2016 07:23:56 -0000 Mailing-List: contact dev-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@impala.incubator.apache.org Delivered-To: mailing list dev@impala.incubator.apache.org Received: (qmail 37790 invoked by uid 99); 30 Jul 2016 07:23: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; Sat, 30 Jul 2016 07:23: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 1F55EC158E for ; Sat, 30 Jul 2016 07:23:55 +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 mx2-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 AcvEnZXIBrIl for ; Sat, 30 Jul 2016 07:23: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 mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 7DC395FB01 for ; Sat, 30 Jul 2016 07:23:52 +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 u6U7NqMi022161; Sat, 30 Jul 2016 07:23:52 GMT Message-Id: <201607300723.u6U7NqMi022161@ip-10-146-233-104.ec2.internal> Date: Sat, 30 Jul 2016 07:23:52 +0000 From: "Internal Jenkins (Code Review)" To: Alex Behm , impala-cr@cloudera.com, dev@impala.incubator.apache.org X-Gerrit-MessageType: merged Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-3861=3A_Replace_BetweenPredicates_with_their_equivalent_CompoundPredicate=2E=0A?= X-Gerrit-Change-Id: I0838b30444ed9704ce6a058d30718a24caa7444a X-Gerrit-ChangeURL: X-Gerrit-Commit: ac1215fd3162bfda3eb87759b7098002837a1307 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: Sat, 30 Jul 2016 07:23:57 -0000 Internal Jenkins has submitted this change and it was merged. Change subject: IMPALA-3861: Replace BetweenPredicates with their equivalent CompoundPredicate. ...................................................................... IMPALA-3861: Replace BetweenPredicates with their equivalent CompoundPredicate. The bug: Our BetweenPredicate has a complex object structure that is unlike most other Exprs because we generate an equivalent CompoundPredicate during analysis and replace the original children. Keeping the various members in sync and preserving the object structure during clone() and substitute() is very difficult and error prone. In particular, subquery rewriting is difficult because we extract and replace correlated BinaryPredicates. Substituting BinaryPredicates in a BetweenPredicate's children is not equivalent to a substitution on the BetweenPredicat's original children, so keeping the various redundant members in sync is quite difficult. The fix is to replace BetweenPredicates with their equivalent CompoundPredicates before performing subquery rewrites. We ultimately still want to fix clone() and substitute() for BetweenPredicates, but an elegant solution is likely to more involved. Change-Id: I0838b30444ed9704ce6a058d30718a24caa7444a Reviewed-on: http://gerrit.cloudera.org:8080/3804 Reviewed-by: Alex Behm Tested-by: Internal Jenkins --- M fe/src/main/java/com/cloudera/impala/analysis/StmtRewriter.java M fe/src/test/java/com/cloudera/impala/analysis/AnalyzeSubqueriesTest.java M testdata/workloads/functional-planner/queries/PlannerTest/subquery-rewrite.test 3 files changed, 53 insertions(+), 10 deletions(-) Approvals: Internal Jenkins: Verified Alex Behm: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/3804 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0838b30444ed9704ce6a058d30718a24caa7444a Gerrit-PatchSet: 7 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Alex Behm Gerrit-Reviewer: Alex Behm Gerrit-Reviewer: Bharath Vissapragada Gerrit-Reviewer: Dimitris Tsirogiannis Gerrit-Reviewer: Internal Jenkins