Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Works for Me
-
Impala 2.0
-
None
Description
From the user list:
[testnode01:21000] > select cast('' as DECIMAL(20,7)); Query: select cast('' as DECIMAL(20,7)) +---------------------------+ | cast('' as decimal(20,7)) | +---------------------------+ | 0.0000000 | +---------------------------+ Fetched 1 row(s) in 0.04s [testnode01:21000] > select cast('' as DOUBLE); Query: select cast('' as DOUBLE) +--------------------+ | cast('' as double) | +--------------------+ | NULL | +--------------------+ Fetched 1 row(s) in 0.02s
Users that expect NULL can use the following workaround:
SELECT IF(field = '',null,CAST(field as DECIMAL(20,7)));
Attachments
Issue Links
- duplicates
-
IMPALA-1952 Support CASTing a string literal representing a number in scientific notation to a DECIMAL.
- Resolved