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

Query with a decimal between predicate needlessly fails

    XMLWordPrintableJSON

Details

    • ghx-label-7

    Description

      The following query causes an analysis exception because decimal(38,2) and decimal(38,3) are not compatible, i.e. it is not possible to cast them to the same decimal type without losing information.

      select cast(1 as decimal(38,2)) between 0.9 * cast(1 as decimal(38,3)) and 3
      

      However, if we rewrite the between predicate, it succeeds.

      select cast(1 as decimal(38,2)) >= 0.9*cast(1 as decimal(38,3)) and cast(1 as decimal(38,2)) <= 3
      

      Both queries should execute successfully.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: