Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-4523

round() function with specified decimal places not consistent with mysql

Log workAgile BoardRank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.7.1
    • 0.13.0
    • UDF

    Description

      // hive
      hive> select round(150.000, 2) from temp limit 1;
      150.0

      hive> select round(150, 2) from temp limit 1;
      150.0

      // mysql
      mysql> select round(150.000, 2) from DUAL limit 1;
      round(150.000, 2)
      150.00

      mysql> select round(150, 2) from DUAL limit 1;
      round(150, 2)
      150

      http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html#function_round

      Attachments

        1. HIVE-4523.patch
          21 kB
          Xuefu Zhang
        2. HIVE-4523.8.patch
          45 kB
          Xuefu Zhang
        3. HIVE-4523.7.patch
          45 kB
          Xuefu Zhang
        4. HIVE-4523.6.patch
          45 kB
          Xuefu Zhang
        5. HIVE-4523.5.patch
          42 kB
          Xuefu Zhang
        6. HIVE-4523.4.patch
          42 kB
          Xuefu Zhang
        7. HIVE-4523.3.patch
          39 kB
          Xuefu Zhang
        8. HIVE-4523.2.patch
          29 kB
          Xuefu Zhang
        9. HIVE-4523.1.patch
          28 kB
          Xuefu Zhang

        Issue Links

        Activity

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

          People

            xuefuz Xuefu Zhang Assign to me
            fdesing Fred Desing
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment