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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: Impala 2.11.0
    • Fix Version/s: Impala 3.0, Impala 2.12.0
    • Component/s: Backend
    • Labels:
      None
    • Target Version:
    • Epic Color:
      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

            • Assignee:
              tarasbob Taras Bobrovytsky
              Reporter:
              tarasbob Taras Bobrovytsky
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: