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

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

    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

            People

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

              Dates

                Created:
                Updated:
                Resolved: