Impala Public Jenkins has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/19829 )

Change subject: IMPALA-12111: Speed up DATE to STRING conversion
......................................................................

IMPALA-12111: Speed up DATE to STRING conversion

Before this patch DATE to STRING conversion seemed slow in
general (slower than TIMESTAMP to STRING) which was visible
especially on the coordinator where result DATEs are returned
as STRINGs in HS2/Beeswax and the conversion happens on a
single thread.

The main cause seems to be using std::stringstream in
DateValue::ToString(). The patch switches to using
impala::TimestampParser::Format() similarly to TimestampValue.

HS2 result set generation is also changed to avoid using
stringstream for TIMESTAMP/DATE and call ToString() directly.

Benchmarks:
- Added benchmark that shows ~4x impovement for DateValue.ToString().
- Manually tested EE scanerio: RowMaterializationTimer dropped from
  1.7s to 0.6s in
  impala-shell -B -q "select cast(l_shipdate as date) from 
tpch_parquet.lineitem;" > /dev/null
  (note that the query above converts STRING to DATE first and then
   from DATE to std::string before returning it in HS2 - the
   improvement comes from the second conversion)

Testing:
- ran core tests

Change-Id: I9a233ae92b1461fc5c47d8345667e36c2632f4c4
Reviewed-on: http://gerrit.cloudera.org:8080/19829
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
M be/src/benchmarks/date-benchmark.cc
M be/src/runtime/date-value.cc
M be/src/runtime/datetime-simple-date-format-parser.h
M be/src/runtime/raw-value.cc
M be/src/service/hs2-util.cc
5 files changed, 86 insertions(+), 28 deletions(-)

Approvals:
  Impala Public Jenkins: Looks good to me, approved; Verified

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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I9a233ae92b1461fc5c47d8345667e36c2632f4c4
Gerrit-Change-Number: 19829
Gerrit-PatchSet: 6
Gerrit-Owner: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Daniel Becker <[email protected]>
Gerrit-Reviewer: Gabor Kaszab <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Kurt Deschler <[email protected]>

Reply via email to