impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zach Amsden (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-5607: Add additional units to EXTRACT, DATE PART, TRUNC
Date Thu, 26 Oct 2017 23:13:01 GMT
Zach Amsden has posted comments on this change. ( )

Change subject: IMPALA-5607: Add additional units to EXTRACT, DATE_PART, TRUNC

Patch Set 2:


Overall this looks good - and thank you for the tests.  It is worth debating whether NANOSECONDs
should be supported at all - let's do that in the JIRA.
File be/src/exprs/
PS2, Line 5959:   TestStringValue(
I don't think the additional test cases add any value unless you add greater precision, i.e.

"cast(trunc(cast('2012-09-10 07:02:03.1234' as timestamp), 'SS') as string)"
File be/src/exprs/
PS2, Line 120:   return time.fractional_seconds() + time.seconds() * 1000 * 1000 * 1000;
> The seconds field, including fractional parts, multiplied by 1 000 000 000;
PS2, Line 125:   return ExtractNanosecond(time) / 1000;
Instead of dividing the result of another function, these should be implement directly, i.e.

  time.fractional_seconds() / NANOS_PER_MICRO + time.seconds() * MICROS_PER_SEC
PS2, Line 130:   return ExtractMicrosecond(time) / 1000;
same comment applies
PS2, Line 154: BigIntVal
> Return type should be changed from INT to BIGINT because INT data type's ra
We only need to change this if we actually implement nanosecond units for EXTRACT; no other
referenced system in the JIRA currently supports that, so it is worth debating whether we
should or not.
File common/thrift/Exprs.thrift:
We shouldn't have redundant field definitions here; instead we should be lenient with parsing

To view, visit
To unsubscribe, visit

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If23ea310ddcc5c1c806b2b1ac24d24a4bd6aa4d9
Gerrit-Change-Number: 8311
Gerrit-PatchSet: 2
Gerrit-Owner: Kim Jin Chul <>
Gerrit-Reviewer: Greg Rahn <>
Gerrit-Reviewer: Kim Jin Chul <>
Gerrit-Reviewer: Zach Amsden <>
Gerrit-Comment-Date: Thu, 26 Oct 2017 23:13:01 +0000
Gerrit-HasComments: Yes

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