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 BEB7F200C23 for ; Wed, 22 Feb 2017 22:59:17 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BD452160B72; Wed, 22 Feb 2017 21:59:17 +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 0A66E160B49 for ; Wed, 22 Feb 2017 22:59:16 +0100 (CET) Received: (qmail 48655 invoked by uid 500); 22 Feb 2017 21:59:16 -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 48644 invoked by uid 99); 22 Feb 2017 21:59:16 -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; Wed, 22 Feb 2017 21:59:16 +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 66FABC86E7 for ; Wed, 22 Feb 2017 21:59:15 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-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 (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id rwsjtYBOn-zQ for ; Wed, 22 Feb 2017 21:59:14 +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 9CD665FAD4 for ; Wed, 22 Feb 2017 21:59:14 +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 v1MLxDgB004706; Wed, 22 Feb 2017 21:59:13 GMT Message-Id: <201702222159.v1MLxDgB004706@ip-10-146-233-104.ec2.internal> Date: Wed, 22 Feb 2017 21:59:13 +0000 From: "anujphadke (Code Review)" To: anujphadke , impala-cr@cloudera.com, reviews@impala.incubator.apache.org CC: Alex Behm Reply-To: aphadke@cloudera.com X-Gerrit-MessageType: comment Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-4848=3A_Add_WIDHT_BUCKET=28=29_function=0A?= X-Gerrit-Change-Id: I081bc916b1bef7b929ca161a9aade3b54c6b858f X-Gerrit-ChangeURL: X-Gerrit-Commit: ff42663265d13e6cae55c4fd3f460eeb7525f2d5 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, 22 Feb 2017 21:59:17 -0000 anujphadke has posted comments on this change. Change subject: IMPALA-4848: Add WIDHT_BUCKET() function ...................................................................... Patch Set 2: (7 comments) Please review this change after I push a new patch which addresses some overflow bugs. http://gerrit.cloudera.org:8080/#/c/6023/1/be/src/exprs/math-functions-ir.cc File be/src/exprs/math-functions-ir.cc: Line 427: const IntVal& num_buckets) { > do all null checks in one if Done Line 429: return IntVal::null(); > use min_range.val directly because the == operator will check for null agai Done Line 430: } > Lower... Done Line 434: } > should -> must Done http://gerrit.cloudera.org:8080/#/c/6023/2/be/src/exprs/math-functions-ir.cc File be/src/exprs/math-functions-ir.cc: Line 455: double bucket_width = (max_range.val - min_range.val) / num_buckets.val; This can overflow. Working on handling this. select width_bucket(1.5e+200, -1.7e+308, 1.2e+308, 900); Line 457: int64_t result = static_cast((expr.val - min_range.val) / bucket_width) + 1; This can overflow. Working on handling this. http://gerrit.cloudera.org:8080/#/c/6023/1/be/src/exprs/math-functions.h File be/src/exprs/math-functions.h: Line 128: /// Returns true if no parse_res == PARSE_SUCCESS || parse_res == PARSE_OVERFLOW. > Move in the public section like the other functions. Done -- To view, visit http://gerrit.cloudera.org:8080/6023 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I081bc916b1bef7b929ca161a9aade3b54c6b858f Gerrit-PatchSet: 2 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: anujphadke Gerrit-Reviewer: Alex Behm Gerrit-Reviewer: anujphadke Gerrit-HasComments: Yes