impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Behm (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-4055: Speed up to date() with custom implementation.
Date Wed, 25 Jan 2017 18:28:40 GMT
Alex Behm has posted comments on this change.

Change subject: IMPALA-4055: Speed up to_date() with custom implementation.
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/5791/1/be/src/exprs/timestamp-functions-ir.cc
File be/src/exprs/timestamp-functions-ir.cc:

PS1, Line 344:   // Fill in year.
             :   const int year = ts_value.date().year();
             :   result.ptr[3] = '0' + year % 10;
             :   result.ptr[2] = '0' + (year / 10) % 10;
             :   result.ptr[1] = '0' + (year / 100) % 10;
             :   result.ptr[0] = '0' + (year / 1000) % 10;
             : 
             :   // Fill in month, day, and dashes.
             :   result.ptr[4] = '-';
             :   TwoDigitZeroPaddedItoa(result.ptr + 5, ts_value.date().month());
             :   result.ptr[7] = '-';
             :   TwoDigitZeroPaddedItoa(result.ptr + 8, ts_value.date().day());
             :   return result;
> Appears that the int to string conversion can be factored into a function l
Not quite as simple as that because we need to deal with zero padding, so we need to know
the number of decimal digits before that loop.

We will also end up with a few extra mod operations that are not necessary for this function.

I'll give it a try.


-- 
To view, visit http://gerrit.cloudera.org:8080/5791
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I5713b3e0c27b739aae597a6911cf3b2ddd01f822
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <alex.behm@cloudera.com>
Gerrit-Reviewer: Alex Behm <alex.behm@cloudera.com>
Gerrit-Reviewer: Michael Ho <kwho@cloudera.com>
Gerrit-HasComments: Yes

Mime
View raw message