Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-1921

Cast string->*int with a decimal place always returns NULL

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: Impala 2.0
    • Fix Version/s: None
    • Component/s: Backend
    • Labels:
    • Environment:
      Server version: impalad version 2.0.0-cdh5 RELEASE (build ecf30af0b4d6e56ea80297df2189367ada6b7da7)

      Description

      cast ('-1.0' as int|bigint) should not return NULL but -1.

      Issue:

      Query: select cast("-1.0" as int)
      +---------------------+
      | cast('-1.0' as int) |
      +---------------------+
      | NULL                |
      +---------------------+
      

      Workaround:

      Query: select cast(cast ("-1.0" as double) as int)
      +-------------------------------------+
      | cast(cast('-1.0' as double) as int) |
      +-------------------------------------+
      | -1                                  |
      +-------------------------------------+
      Fetched 1 row(s) in 0.01s
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              gpolaert_impala_e5d3 gpolaert
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated: