impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Taras Bobrovytsky (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-5017: Error on decimal overflow
Date Tue, 07 Nov 2017 21:59:18 GMT
Taras Bobrovytsky has uploaded a new patch set (#2). (

Change subject: IMPALA-5017: Error on decimal overflow

IMPALA-5017: Error on decimal overflow

Before this patch, decimal operations would either silently overflow (in
the case of sum() and avg()), or produce a warning.

In this patch, the behaviour is changed so that an error is produced in
the case of overflow when DECIMAL_v2 is enabled. Decimal v1 behaviour is

We introduce overflow checks when computing sum() and avg(). This
results in a ~30% performance regression when we are in decimal v2 mode
compared to decimal v1.

  select sum(dec_38_19) from decimal_tbl
    Decimal v1: 13.09s
    Decimal v2: 17.10s

  select avg(dec_38_19) from decimal_tbl
    Decimal v1: 13.60s
    Decimal v2: 19.10s

  select avg(dec_9_5) from decimal_tbl
    Decimal v1: 12.06s
    Decimal v2: 18.07s

- Added several end to end tests.
- Updated Expr tests to check for error in case of overflow.

Change-Id: Id98a92c9a9469ec8cf14e518c741a2dab7053019
M be/src/exprs/
M be/src/exprs/
M be/src/exprs/
M be/src/exprs/
M testdata/workloads/functional-query/queries/QueryTest/decimal-exprs.test
M testdata/workloads/functional-query/queries/QueryTest/decimal.test
6 files changed, 214 insertions(+), 69 deletions(-)

  git pull ssh:// refs/changes/04/8404/2
To view, visit
To unsubscribe, visit

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id98a92c9a9469ec8cf14e518c741a2dab7053019
Gerrit-Change-Number: 8404
Gerrit-PatchSet: 2
Gerrit-Owner: Taras Bobrovytsky <>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: John Sherman <>
Gerrit-Reviewer: Michael Ho <>
Gerrit-Reviewer: Taras Bobrovytsky <>
Gerrit-Reviewer: Tim Armstrong <>
Gerrit-Reviewer: Zach Amsden <>

  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message