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 8EBE1200B73 for ; Mon, 29 Aug 2016 15:53:02 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8BA5C160AB8; Mon, 29 Aug 2016 13:53: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 D20C8160AA7 for ; Mon, 29 Aug 2016 15:53:01 +0200 (CEST) Received: (qmail 29450 invoked by uid 500); 29 Aug 2016 13:53:01 -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 29439 invoked by uid 99); 29 Aug 2016 13:53: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; Mon, 29 Aug 2016 13:53: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 2A021C00B6 for ; Mon, 29 Aug 2016 13:53:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-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 (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id O-hsNUoVu0vE for ; Mon, 29 Aug 2016 13:52: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 mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 1F8765FB40 for ; Mon, 29 Aug 2016 13:52: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 u7TDqvWe023514; Mon, 29 Aug 2016 13:52:57 GMT Message-Id: <201608291352.u7TDqvWe023514@ip-10-146-233-104.ec2.internal> Date: Mon, 29 Aug 2016 13:52:57 +0000 From: "Zoltan Ivanfi (Code Review)" To: impala-cr@cloudera.com, dev@impala.incubator.apache.org CC: Lars Volker Reply-To: zi@cloudera.com X-Gerrit-MessageType: comment Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-3973=3A_add_position_and_occurrence_to_instr=28=29=0A?= X-Gerrit-Change-Id: Ie9648de458d243306fa14adc5e7f7002bf6f67fd X-Gerrit-ChangeURL: X-Gerrit-Commit: 91da30cf29b532dc59430d51f3b7d9bee1b9d6d7 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: Mon, 29 Aug 2016 13:53:02 -0000 Zoltan Ivanfi has posted comments on this change. Change subject: IMPALA-3973: add position and occurrence to instr() ...................................................................... Patch Set 1: (6 comments) http://gerrit.cloudera.org:8080/#/c/4094/1/be/src/exprs/expr-test.cc File be/src/exprs/expr-test.cc: Line 2070: > I saw below that some tests use something like "cast(10 as bigint)" for num Done PS1, Line 2077: 1 > The Oracle docs say this value must be >0, please add failure tests for 0 a Done http://gerrit.cloudera.org:8080/#/c/4094/1/be/src/exprs/string-functions-ir.cc File be/src/exprs/string-functions-ir.cc: Line 305: // When searching backwards, position is counted from the end. > For readability, [lease don't interleave comments and ternary expressions. Done Line 312: std::basic_string haystack(str.ptr); > Isn't this equivalent to std::string? No, std::string is signed, therefore I would need to apply a reinterpret_cast on str.ptr, which is far less elegant and more error-prone than using std::basic_string. http://gerrit.cloudera.org:8080/#/c/4094/1/be/src/exprs/string-functions.h File be/src/exprs/string-functions.h: PS1, Line 65: str > We usually wrap arguments greedily at 90 chars, so str would fit in the pre I wrapped the parameters this way intentionally, as the two string parameters make one logical group of the arguments and the two bigint parameters can be considered another logical group. Wrapping them accordingly makes the function signature easier to read in my opinion. Regarding the line length limit, the Impala wiki (https://cwiki.apache.org/confluence/display/IMPALA/Contributing+to+Impala) links to the Google C++ style guide, which specifies 80 chars as the line length. If we use 90 chars instead, we should mention this as an exception on our wiki page. http://gerrit.cloudera.org:8080/#/c/4094/1/common/function-registry/impala_functions.py File common/function-registry/impala_functions.py: PS1, Line 435: [['instr'], 'INT', ['STRING', 'STRING', 'BIGINT', 'BIGINT'], 'impala::StringFunctions::Instr'], > long line Done -- To view, visit http://gerrit.cloudera.org:8080/4094 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9648de458d243306fa14adc5e7f7002bf6f67fd Gerrit-PatchSet: 1 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Zoltan Ivanfi Gerrit-Reviewer: Internal Jenkins Gerrit-Reviewer: Lars Volker Gerrit-Reviewer: Zoltan Ivanfi Gerrit-HasComments: Yes