impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Csaba Ringhofer (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-5664: Unix time to timestamp conversions may crash Impala
Date Thu, 07 Sep 2017 19:23:48 GMT
Csaba Ringhofer has posted comments on this change.

Change subject: IMPALA-5664: Unix time to timestamp conversions may crash Impala

Patch Set 2:

Commit Message:

PS1, Line 7: Impala
> nit: Capitalize Impala (it's a name)

PS1, Line 9: FromSubsecondUnixTime
> We usually refer to functions as Function().

PS1, Line 11: 1400-01-01 00:00:00
> You could write dates in the more standard format (1400-01-01 00:00:00).

PS1, Line 13: The maximum
            : case, 9999-12-31 59:59:59 is a bit different, because as I understand,
            : with nanosecond precision posix times, the maximum value is actually
            : 10000-01-01. 00:00:00 minus 1 nanosec.
> Can you add tests with sub-second deltas around the upper bound, too?
File be/src/runtime/

Line 637:   // FromUnixTime functions incorrectly accepted the last second of 1399 as valid,
> Please wrap lines at 90 characters. Please follow the surrounding code for 

PS1, Line 637: he last second of 1399 as valid,
> Please outline in the comment briefly why the last second needs special att

PS1, Line 637: ns i
> Extra word?

Line 640:       MIN_DATE_AS_UNIX_TIME - 0.1).HasDate());
> While you are here, can you also add tests for the exact beginning of the l
File be/src/runtime/timestamp-value.h:

PS1, Line 80: s_special() && UNLI
> Can you add a comment explaining why this check is necessary?

Line 80:     if(!date_.is_special() && UNLIKELY(!IsValidDate())){
> Please use spaces instead of tabs.
File be/src/runtime/timestamp-value.h:

Line 84:       time_ = boost::posix_time::time_duration(boost::posix_time::not_a_date_time);
The first patch was incorrect - it did not set time_ to not_a_date_time, but 00:00:00 instead.
This caused the last second of year 1399 to be inconsistent with other dates before year 1400.

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: I77b2f6284d3a597f57e61c17a67c959eff9e38ff
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Csaba Ringhofer <>
Gerrit-Reviewer: Csaba Ringhofer <>
Gerrit-Reviewer: Lars Volker <>
Gerrit-HasComments: Yes

View raw message