impala-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Armstrong (Code Review)" <>
Subject [Impala-CR](cdh5-trunk) Inject precision and scale constants for all decimal builtins
Date Thu, 17 Mar 2016 03:03:46 GMT
Hello Skye Wanderman-Milne,

I'd like you to reexamine a change.  Please visit

to look at the new patch set (#9).

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

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
M be/src/exec/
M be/src/exprs/
M be/src/exprs/
M be/src/exprs/decimal-functions.h
M be/src/exprs/
M be/src/exprs/decimal-operators.h
M be/src/exprs/
M be/src/exprs/expr.h
M be/src/udf/udf-internal.h
M be/src/udf/udf.h
10 files changed, 313 insertions(+), 225 deletions(-)

  git pull ssh:// refs/changes/35/2535/9
To view, visit
To unsubscribe, visit

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I7b7d1485f357ba88517ca15c5c7428c0ffe25dfd
Gerrit-PatchSet: 9
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Tim Armstrong <>
Gerrit-Reviewer: Dan Hecht <>
Gerrit-Reviewer: Huaisi Xu <>
Gerrit-Reviewer: Michael Ho
Gerrit-Reviewer: Skye Wanderman-Milne <>
Gerrit-Reviewer: Tim Armstrong <>

View raw message