impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Behm (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-3436: Return a decimal when rounding a double
Date Tue, 07 Nov 2017 01:26:21 GMT
Alex Behm has posted comments on this change. ( )

Change subject: IMPALA-3436: Return a decimal when rounding a double

Patch Set 3: Code-Review+1


I'm happy with the FE changes. Would be good to get a second pair of eyes on the BE portion.
File be/src/exprs/
PS1, Line 111:   DCHECK(!scale.is_null);
> Added a test.
Agree it's good to be consistent, but it might bite users when we switch DECIMAL_V2 to the
default (their queries that have non-constant args in round() will not analyze). We should
be sure to clearly document this new behavior/limitation.
File common/function-registry/
PS1, Line 284:   # TODO: Remove when DECIMAL_V1 is removed.
> Because what if someone typed in "select dround(x)". We need to be able to 
Good point. I was thinking dround() vs round() in toSql() doesn't matter that much, but probably
it's better to preserve the existing behavior like you suggest.
File common/function-registry/
PS3, Line 289:   [['round','dround','round_v1','dround_v1'],
This function is used both decimal_v1/v2 modes.
File fe/src/test/java/org/apache/impala/analysis/
PS3, Line 2439:     AnalyzesOk("select round(cast(1.123 as double), int_col) from functional.alltypes",
add a positive test with a non-NULL constant second argument to both v1/v2

To view, visit
To unsubscribe, visit

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I240ec70da7996bbfefcf6438eba4dff8d33d7bd6
Gerrit-Change-Number: 8398
Gerrit-PatchSet: 3
Gerrit-Owner: Taras Bobrovytsky <>
Gerrit-Reviewer: Alex Behm <>
Gerrit-Reviewer: Taras Bobrovytsky <>
Gerrit-Comment-Date: Tue, 07 Nov 2017 01:26:21 +0000
Gerrit-HasComments: Yes

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