Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-4897

NumberFormatException in Drill SQL while casting to BIGINT when its actually a number

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Not A Problem
    • Affects Version/s: None
    • Fix Version/s: 1.15.0
    • Component/s: Functions - Drill
    • Labels:
      None

      Description

      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?

        Attachments

          Activity

            People

            • Assignee:
              karthikm Karthikeyan Manivannan
              Reporter:
              karanthsrihari@gmail.com Srihari Karanth
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: