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

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

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete CommentsDelete
    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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment