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

Casting a boolean to decimal produces an analysis exception.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • Impala 1.4
    • Impala 2.0
    • None

    Description

      We should be able to cast booleans to decimal (unless I'm missing something). Currently, it runs into an AnalysisException.

      [localhost:21000] > select cast(cast(1 as boolean) as float);
      Query: select cast(cast(1 as boolean) as float)
      +-----------------------------------+
      | cast(cast(1 as boolean) as float) |
      +-----------------------------------+
      | 1                                 |
      +-----------------------------------+
      Returned 1 row(s) in 0.17s
      [localhost:21000] > select cast(cast(1 as boolean) as double);
      Query: select cast(cast(1 as boolean) as double)
      +------------------------------------+
      | cast(cast(1 as boolean) as double) |
      +------------------------------------+
      | 1                                  |
      +------------------------------------+
      Returned 1 row(s) in 0.18s
      [localhost:21000] > select cast(cast(1 as boolean) as decimal(1,0));
      Query: select cast(cast(1 as boolean) as decimal(1,0))
      ERROR: AnalysisException: Invalid type cast of CAST(1 AS BOOLEAN) from BOOLEAN to DECIMAL(1,0)
      

      Attachments

        Activity

          People

            nong_impala_60e1 Nong Li
            ishaan Ishaan Joshi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: