You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Khurram Faraaz (JIRA)" <ji...@apache.org> on 2017/02/28 10:29:45 UTC
[jira] [Commented] (DRILL-4897) NumberFormatException in Drill SQL
while casting to BIGINT when its actually a number
[ https://issues.apache.org/jira/browse/DRILL-4897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15887750#comment-15887750 ]
Khurram Faraaz commented on DRILL-4897:
---------------------------------------
[~kkhatua] this can be reproduced on Drill 1.10.0 git commit ID: 300e9349
{noformat}
0: jdbc:drill:schema=dfs.tmp> select CAST(case isnumeric(columns[0]) WHEN 0 THEN 0 ELSE columns[0] END AS BIGINT) from `powers_of_two.csv` ;
Error: SYSTEM ERROR: NumberFormatException: 2147483648
Fragment 0:0
[Error Id: dc8b20db-e70a-4117-873a-ed3a559f2f87 on centos-01.qa.lab:31010] (state=,code=0)
{noformat}
Data used in test
{noformat}
[root@centos-01 ~]# cat powers_of_two.csv
1
2
4
8
16
32
64
128
256
512
1024
2048
4096
8192
16384
32768
65536
131072
262144
524288
1048576
2097152
4194304
8388608
16777216
33554432
67108864
134217728
268435456
536870912
1073741824
2147483648
4294967296
{noformat}
> NumberFormatException in Drill SQL while casting to BIGINT when its actually a number
> -------------------------------------------------------------------------------------
>
> Key: DRILL-4897
> URL: https://issues.apache.org/jira/browse/DRILL-4897
> Project: Apache Drill
> Issue Type: Bug
> Components: Functions - Drill
> Reporter: Srihari Karanth
> Assignee: Khurram Faraaz
> Priority: Blocker
>
> In the following SQL, drill cribs when trying to convert a number which is in varchar
> select cast (case IsNumeric(Delta_Radio_Delay)
> when 0 then 0 else Delta_Radio_Delay end as BIGINT)
> from datasource.`./sometable`
> where Delta_Radio_Delay='4294967294';
> BIGINT should be able to take very large number. I dont understand how it throws the below error:
> 0: jdbc:drill:> select cast (case IsNumeric(Delta_Radio_Delay)
> when 0 then 0 else Delta_Radio_Delay end as BIGINT)
> from datasource.`./sometable`
> where Delta_Radio_Delay='4294967294';
> Error: SYSTEM ERROR: NumberFormatException: 4294967294
> Fragment 1:29
> [Error Id: a63bb113-271f-4d8b-8194-2c9728543200 on cluster-3:31010] (state=,code=0)
> How can i modify SQL to fix this?
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)