Impala Public Jenkins has submitted this change and it was merged. ( 
https://gerrit.cloudera.org/25025 )

Change subject: IMPALA-15487: Fix DECIMAL truncation precision
......................................................................

IMPALA-15487: Fix DECIMAL truncation precision

Reserve one digit for zero when TRUNC, TRUNCATE or DTRUNC removes all
fractional digits in the Original planner. Preserve positive-scale
and ROUND/DROUND inference.

For example:
  SELECT TRUNC(CAST(0.1 AS DECIMAL(1,1)));

Before the fix, this expression has type DECIMAL(0,0), which has no
digit to represent zero. After the fix, it has type DECIMAL(1,0).

Testing: one parameterized FE test covering 202 type/value checks
across DECIMAL V1/V2. The same test fails without the fix.

Change-Id: I1076caaf278038e37aa7c036dc87f4a81d89746c
Assisted-by: gpt-6.1-sol
Reviewed-on: https://gerrit.cloudera.org/25025
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
M fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java
M fe/src/test/java/org/apache/impala/analysis/AnalyzeExprsTest.java
2 files changed, 51 insertions(+), 0 deletions(-)

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

--
To view, visit https://gerrit.cloudera.org/25025
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I1076caaf278038e37aa7c036dc87f4a81d89746c
Gerrit-Change-Number: 25025
Gerrit-PatchSet: 5
Gerrit-Owner: Aleksandr Efimov <[email protected]>
Gerrit-Reviewer: Aleksandr Efimov <[email protected]>
Gerrit-Reviewer: Arnab Karmakar <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Steve Carlin <[email protected]>

Reply via email to