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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Not A Bug
    • Impala 2.0
    • None
    • Backend
    • 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

            Unassigned Unassigned
            gpolaert_impala_e5d3 gpolaert
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: