Internal Jenkins has submitted this change and it was merged.

Change subject: Inject precision and scale constants for all decimal builtins
......................................................................


Inject precision and scale constants for all decimal builtins

Decimal functions already had some codegen support, but in many cases
they would still have to to branch on the precision and scale at
runtime. The patch uses the Expr::GetConstant() mechanism to inject
tese constants into decimal cross-compiled code. All uses of
FunctionContext::GetArgType() to get decimal precision and scale
in operators, functions, and aggregated functions have been replaced
with Expr::GetConstant().

This required adding support for Expr::GetConstant() to UDAFs and
adding support for getting precision and scale information from
Expr::GetConstant().

This leads to significant speedups for many decimal operations.
E.g. in TPC-H Q1 scale factor 20 the aggregation time was reduced
from ~18s of CPU time to ~10s of CPU time: an 80% speedup.

Change-Id: I7b7d1485f357ba88517ca15c5c7428c0ffe25dfd
Reviewed-on: http://gerrit.cloudera.org:8080/2535
Reviewed-by: Tim Armstrong <[email protected]>
Tested-by: Internal Jenkins
---
M be/src/codegen/llvm-codegen.cc
M be/src/exec/partitioned-aggregation-node.cc
M be/src/exprs/aggregate-functions.cc
M be/src/exprs/conditional-functions-ir.cc
M be/src/exprs/decimal-functions.cc
M be/src/exprs/decimal-functions.h
M be/src/exprs/decimal-operators.cc
M be/src/exprs/decimal-operators.h
M be/src/exprs/expr-codegen-test.cc
M be/src/exprs/expr.cc
M be/src/exprs/expr.h
M be/src/exprs/math-functions.cc
M be/src/udf/udf-internal.h
M be/src/udf/udf.h
14 files changed, 324 insertions(+), 259 deletions(-)

Approvals:
  Internal Jenkins: Verified
  Tim Armstrong: Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7b7d1485f357ba88517ca15c5c7428c0ffe25dfd
Gerrit-PatchSet: 13
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Tim Armstrong <[email protected]>
Gerrit-Reviewer: Dan Hecht <[email protected]>
Gerrit-Reviewer: Huaisi Xu <[email protected]>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Michael Ho
Gerrit-Reviewer: Skye Wanderman-Milne <[email protected]>
Gerrit-Reviewer: Tim Armstrong <[email protected]>

Reply via email to