impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zoram Thanga (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-5599: Fix for mis-use of TimestampValue
Date Tue, 19 Sep 2017 16:45:37 GMT
Zoram Thanga has posted comments on this change.

Change subject: IMPALA-5599: Fix for mis-use of TimestampValue

Patch Set 2:


 > 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.
 > A unit test would be good for testing this kind of code.  You can
 > take a look at the various * 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.
File be/src/service/

PS2, Line 921: UnixMillis()
> for consistency in these values, how about setting this to 'now_us / MICROS

PS2, Line 1146:  Precision::Second
> seems okay to print milliseconds here

PS2, Line 1845: , Precision::Second
> here too

PS2, Line 1924:  Precision::Second
> and here
File be/src/util/

Line 32: static std::string TimepointToString(const chrono::system_clock::time_point&
> for static things not defined in header, it's helpful to include a short fu

PS2, Line 46:   std::string s(buf);
            :   return s;
> return string(buf);

Line 53: 
> nit: consider removing blank lines here and line 68 to make more code fit o

Line 65:     // 1-second precision or unknown unit. Return empty string.
> nice to document (and prove) that invariant with a dcheck:
Done. But I had to change TimePrecision from an enum class to a regular enum, because DCHECK
requires the argument to have an "<<" operator.

PS2, Line 89:   chrono::system_clock::time_point t(chrono::duration_cast<chrono::seconds>(
            :         chrono::seconds(s)));
            :   return t;
> could consider combing these like suggested at line 46-47 (but given how lo

PS2, Line 95: system_clock
> the docs for chrono::system_clock::time_point claim that the epoch is unspe
It's correct that the standard does not specify the epoch for chrono::system_clock. The Windows
and Linux implementations, however, are based on the Unix epoch. This is a good read

PS2, Line 101: chrono::microseconds
> given that the "to" type is the same as the "from" type, why is the duratio
Removed the cast by combining class instantiation and return statements.
File be/src/util/time.h:

PS2, Line 72: Precision
> "precision" seems kind of generic. How about calling that TimePrecision?

PS2, Line 79: Unix timestamp
> I think we usually refer to this as "Unix time", and timestamp often invoke

PS2, Line 81: p
> nit: in header comments to distinguish variables, we usually use single quo

PS2, Line 85: Precision p=Precision::Second
> normally we should avoid default arguments, but in this case it does seem r

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: I9b0ae06f6d94968c87a199625aa3332b26988142
Gerrit-PatchSet: 2
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

View raw message