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

There is no error under Decimal v2 when there is an overflow when casting String to Decimal

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • Impala 2.11.0
    • Impala 3.0, Impala 2.12.0
    • Backend
    • None
    • ghx-label-2

    Description

      The following query correctly returns an error when Decimal v2 is enabled:

      select cast(123 as decimal(2, 0));
      ERROR: UDF ERROR: Decimal expression overflowed
      

      However, this query incorrectly returns a NULL:

      select cast("123" as decimal(2, 0))
      +-----------------------------+
      | cast('123' as decimal(2,0)) |
      +-----------------------------+
      | NULL                        |
      +-----------------------------+
      

      Attachments

        Activity

          People

            tarasbob Taras Bobrovytsky
            tarasbob Taras Bobrovytsky
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: