Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-17494

Floor/ceil of decimal returns wrong result if it's in compact format

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.6.1, 2.0.0
    • 2.0.1, 2.1.0
    • SQL

    Description

      If you create tables as follows:

      create table a as select 'A' as str, cast(10.5 as decimal(15,6)) as num;
      create table b as select 'A' as str;

      Then

      select floor(num) from a;

      returns 10
      but

      select floor(num) from a join b on a.str = b.str;

      returns 11

      Attachments

        Activity

          People

            davies Davies Liu
            gcivan Gokhan Civan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: