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 Wed, 04 Oct 2017 15:09:06 GMT
Csaba Ringhofer has posted comments on this change. (

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

Patch Set 9:

File be/src/exprs/
PS9, Line 136: if(!tv.HasDateAndTime()){
> here an elsewhere - please follow the style used by the rest of impala.
PS9, Line 137: UnixMicrosToUtcTimestamp
> is that meaningful to the user?
I have changed it to its query name.
PS9, Line 139:   }
> are the ones you added the only places where your new validation might prod
Literal::Literal(ColumnType type, double v) also uses TimestampValue::FromSubsecondUnixTime,
but there is no function context there, and I do not know how to call that constructor. If
I put a double to a place where a timestamp is expected, I get an analyses exception.

I have also noticed someting strange:
select timestamp_cmp(timstamp_col, cast(cast(-17987443200.1 as double) as timestamp)) from
The table has 3 rows and 4 "UDF WARNING: Could not convert -17987443200.1 to timestamp" are

It would make more sense to me to have 1 call to cast (if the casts with constant arguments
would be optimized away) or 3 (if no optimization takes place, and the cast is called for
every row).

Does Impala try to optimize functions calls with constant parameters?
PS9, Line 751:;
> it still seems like this is doing the same validation. should we remove thi
It is the same check, but I would prefer to leave it as it is for now - it leads to a nice
warning message, and the try-catch block is needed anyway because of AddInterval. It could
be done in another commit + jira like clean up/speed up timestamp functions.

To view, visit
To unsubscribe, visit

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I77b2f6284d3a597f57e61c17a67c959eff9e38ff
Gerrit-Change-Number: 7954
Gerrit-PatchSet: 9
Gerrit-Owner: Csaba Ringhofer <>
Gerrit-Reviewer: Csaba Ringhofer <>
Gerrit-Reviewer: Dan Hecht <>
Gerrit-Reviewer: Lars Volker <>
Gerrit-Comment-Date: Wed, 04 Oct 2017 15:09:06 +0000
Gerrit-HasComments: Yes

  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message