You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Taras Bobrovytsky (JIRA)" <ji...@apache.org> on 2017/07/31 22:05:00 UTC
[jira] [Resolved] (IMPALA-5722) Converting a string decimal with a
large negative exponent causes a crash
[ https://issues.apache.org/jira/browse/IMPALA-5722?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Taras Bobrovytsky resolved IMPALA-5722.
---------------------------------------
Resolution: Fixed
Fix Version/s: Impala 2.10.0
{code}
commit 862314599614fd20f6e64ccb8600cd53f0f879d5
Author: Taras Bobrovytsky <tb...@cloudera.com>
Date: Wed Jul 26 18:06:21 2017 -0700
IMPALA-5722: Fix string to decimal cast
When converting a string to a decimal, we didn't handle the case where
the exponent is a large negative number. The function for computing the
divisor returns -1 when the exponent is too large. The problem is fixed
by making sure that the divisor is positive.
Testing:
-Added decimal tests.
Change-Id: I1f5eb5b64a6924af2e8eb7f9a50da67015757efe
Reviewed-on: http://gerrit.cloudera.org:8080/7517
Reviewed-by: Tim Armstrong <ta...@cloudera.com>
Reviewed-by: Jim Apple <jb...@apache.org>
Tested-by: Impala Public Jenkins
{code}
> Converting a string decimal with a large negative exponent causes a crash
> -------------------------------------------------------------------------
>
> Key: IMPALA-5722
> URL: https://issues.apache.org/jira/browse/IMPALA-5722
> Project: IMPALA
> Issue Type: Bug
> Components: Backend
> Reporter: Taras Bobrovytsky
> Assignee: Taras Bobrovytsky
> Priority: Blocker
> Fix For: Impala 2.10.0
>
>
> The following query causes a crash:
> {code}
> select cast("1.234e-30" as decimal(10, 2))
> {code}
> We hit a DCHECK:
> {code}
> string-parser.h:221] Check failed: value >= 0
> {code}
> One a release build, the result is incorrect:
> {code}
> +------------------------------------+
> | cast('1.234e-30' as decimal(10,2)) |
> +------------------------------------+
> | -12.34 |
> +------------------------------------+
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)