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 BFB88200CF7 for ; Tue, 19 Sep 2017 21:55:02 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id BE5311609DD; Tue, 19 Sep 2017 19:55: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 10ADC1609BF for ; Tue, 19 Sep 2017 21:55:01 +0200 (CEST) Received: (qmail 79270 invoked by uid 500); 19 Sep 2017 19:55:01 -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 79256 invoked by uid 99); 19 Sep 2017 19:55:01 -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; Tue, 19 Sep 2017 19:55:01 +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 81C90182D62 for ; Tue, 19 Sep 2017 19:55:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-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-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id yjfY9tgd1G2c for ; Tue, 19 Sep 2017 19:54:59 +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-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id C6C7260D90 for ; Tue, 19 Sep 2017 19:54: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 v8JJsu8C004875; Tue, 19 Sep 2017 19:54:56 GMT Message-Id: <201709191954.v8JJsu8C004875@ip-10-146-233-104.ec2.internal> Date: Tue, 19 Sep 2017 19:54:55 +0000 From: "Dan Hecht (Code Review)" To: Zoram Thanga , impala-cr@cloudera.com, reviews@impala.incubator.apache.org CC: Matthew Jacobs Reply-To: dhecht@cloudera.com X-Gerrit-MessageType: comment Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-5599=3A_Fix_for_mis-use_of_TimestampValue=0A?= X-Gerrit-Change-Id: I9b0ae06f6d94968c87a199625aa3332b26988142 X-Gerrit-ChangeURL: X-Gerrit-Commit: c1edb7b13351ebad324d1a4756b53c36a5386ae3 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: Tue, 19 Sep 2017 19:55:02 -0000 Dan Hecht has posted comments on this change. Change subject: IMPALA-5599: Fix for mis-use of TimestampValue ...................................................................... Patch Set 3: (5 comments) > (15 comments) > > > (15 comments) > > > > Do you plan to take care of the other cases noted in the jira? > > Okay to do it in a follow on commit but wondering the plan. > > > Other cases, such as use of TimestampValue as a class member (see > ImpalaServer, for instance where it is used to track start and end > times of queries), need more analysis. The plan is to look at these > other cases in a separate commit. > Sounds good. Let's be sure to not resolve the jira until all the cases it lists are handled (or file a new jira to handle those). > > A unit test would be good for testing this kind of code. You can > > take a look at the various *-test.cc files be/src/*/ for > examples. > > Adding a unit test. Will refresh the patch again once I have it. In > the meantime, please let me know if I have addressed all of your > comments on the implementation. Just a few more minor comments. I'll take another look after the unit test is added. http://gerrit.cloudera.org:8080/#/c/8084/3/be/src/util/time.cc File be/src/util/time.cc: PS3, Line 33: time zone specified by the boolean argument 'utc' since 'utc' doesn't tell you the other time zone, how about: ... in UTC if 'utc' is true, or the local time zone if 'utc' is false. or similar. PS3, Line 75: // Convert time point 't' into date-time string at precision 'p' in the local : // time zone. : static string ToString(const chrono::system_clock::time_point& t, TimePrecision p) : { : stringstream ss; : ss << TimepointToString(t, false); : ss << FormatSubSecond(t, p); : return ss.str(); : } : : // Convert time point 't' into date-time string at precision 'p' in the UTC : // time zone. : static string ToUtcString(const chrono::system_clock::time_point& t, TimePrecision p) : { : stringstream ss; : ss << TimepointToString(t, true); : ss << FormatSubSecond(t, p); : return ss.str(); : } up to you, but you could combine these into a single ToString() function that takes the bool utc, since these functions are the same otherwise. http://gerrit.cloudera.org:8080/#/c/8084/3/be/src/util/time.h File be/src/util/time.h: PS3, Line 79: , maybe add: 's' just to clarify which input. PS3, Line 80: strin string PS3, Line 81: form format -- To view, visit http://gerrit.cloudera.org:8080/8084 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9b0ae06f6d94968c87a199625aa3332b26988142 Gerrit-PatchSet: 3 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Zoram Thanga Gerrit-Reviewer: Dan Hecht Gerrit-Reviewer: Matthew Jacobs Gerrit-Reviewer: Zoram Thanga Gerrit-HasComments: Yes