Csaba Ringhofer has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/17980 )

Change subject: IMPALA-10984: Improve TimestampValue to String casting
......................................................................


Patch Set 3: Code-Review+1

(3 comments)

lgtm
I have some additional ideas on how to optimize common cases of timestamp 
formatting, but this patch is ok without them, the comments are more like a 
brain dump.

http://gerrit.cloudera.org:8080/#/c/17980/2/be/src/runtime/timestamp-parse-util.cc
File be/src/runtime/timestamp-parse-util.cc:

http://gerrit.cloudera.org:8080/#/c/17980/2/be/src/runtime/timestamp-parse-util.cc@271
PS2, Line 271:
optional: we could optimize the case when day/month/year are all needed by 
using boost::gregorian's year_month_day()

Here is an example:
https://www.boost.org/doc/libs/1_61_0/doc/html/date_time/examples.html#date_time.examples.dates_as_strings

My guess is that it is not too common to use only a subset of year/month/date, 
so we could probably always compute year_month_day if we need any date 
component.


http://gerrit.cloudera.org:8080/#/c/17980/2/be/src/runtime/timestamp-parse-util.cc@305
PS2, Line 305: CATOR: {
optional:
this could be replaced with a division with a precomputed int in 
DateTimeFormatContext - the current logic should make Format() much slower if 
we use low fractional precision, e.g. millisecs

At least a benchmark could be added to see how bad it is.

A similar thing could be done for AdjustYearToLength() to avoid calling 
std::pow per row.


http://gerrit.cloudera.org:8080/#/c/17980/2/be/src/runtime/timestamp-parse-util.cc@351
PS2, Line 351:   DCHECK(!d.is_special());
> Done.
After changing AppendToBuffer() now we can't this dcheck, even if we want to 
write too many characters. My idea is to copy only a limited amount, but 
increase the pos with the original length to hit the dcheck is something goes 
wrong.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4fcb4545d9c9a3fdb38c4db58bb4b1321a429d61
Gerrit-Change-Number: 17980
Gerrit-PatchSet: 3
Gerrit-Owner: Riza Suminto <riza.sumi...@cloudera.com>
Gerrit-Reviewer: Bikramjeet Vig <bikramjeet....@cloudera.com>
Gerrit-Reviewer: Csaba Ringhofer <csringho...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kdesc...@cloudera.com>
Gerrit-Reviewer: Riza Suminto <riza.sumi...@cloudera.com>
Gerrit-Comment-Date: Fri, 29 Oct 2021 07:11:00 +0000
Gerrit-HasComments: Yes

Reply via email to