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 94CD9200C0A for ; Sat, 28 Jan 2017 17:29:01 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 9355C160B51; Sat, 28 Jan 2017 16:29:01 +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 DE1A0160B33 for ; Sat, 28 Jan 2017 17:29:00 +0100 (CET) Received: (qmail 12384 invoked by uid 500); 28 Jan 2017 16:29: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 12373 invoked by uid 99); 28 Jan 2017 16:28:59 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Jan 2017 16:28:59 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 71D191A0139 for ; Sat, 28 Jan 2017 16:28:59 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-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 (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id eVvvWKLMDKyV for ; Sat, 28 Jan 2017 16:28:57 +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 331705F4A9 for ; Sat, 28 Jan 2017 16:28:57 +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 v0SGSqDb020348; Sat, 28 Jan 2017 16:28:52 GMT Message-Id: <201701281628.v0SGSqDb020348@ip-10-146-233-104.ec2.internal> Date: Sat, 28 Jan 2017 16:28:52 +0000 From: "Marcel Kornacker (Code Review)" To: Joe McDonnell , impala-cr@cloudera.com, reviews@impala.incubator.apache.org CC: Alex Behm Reply-To: marcel@cloudera.com X-Gerrit-MessageType: comment Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-4792=3A_Fix_number_of_distinct_values_for_a_CASE_with_constant_outputs=0A?= X-Gerrit-Change-Id: I21dbdaad8452b7e58c477612b47847dccd9d98d2 X-Gerrit-ChangeURL: X-Gerrit-Commit: 405ba6518b2c7db1b06306ccabc1493909c973db 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, 28 Jan 2017 16:29:01 -0000 Marcel Kornacker has posted comments on this change. Change subject: IMPALA-4792: Fix number of distinct values for a CASE with constant outputs ...................................................................... Patch Set 2: (1 comment) http://gerrit.cloudera.org:8080/#/c/5768/2/fe/src/main/java/org/apache/impala/analysis/CaseExpr.java File fe/src/main/java/org/apache/impala/analysis/CaseExpr.java: Line 384: // Otherwise, take a max over all the outputs as well as all the slotrefs that > Yes. The alternative is to take the max over the 'then/else exprs' and igno hm, not sure what to do here. we could try out both variants, and i can make arguments for both (don't throw information away; counterexample: case when a < 10 then 1 else a end will get it really wrong if ndv(a) == -1 but in reality it has 10^9 values). or maybe start with the -1 propagation, and then see how many benchmark queries we regress. -- To view, visit http://gerrit.cloudera.org:8080/5768 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I21dbdaad8452b7e58c477612b47847dccd9d98d2 Gerrit-PatchSet: 2 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Joe McDonnell Gerrit-Reviewer: Alex Behm Gerrit-Reviewer: Joe McDonnell Gerrit-Reviewer: Marcel Kornacker Gerrit-HasComments: Yes