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

Create cbrt (cube root) UDF

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.2.0
    • UDF
    • None

    Description

      returns the cube root of a double value
      cbrt(double a) : double

      For example:

      select cbrt(87860583272930481.0);
      OK
      444561.0
      

      I noticed that Math.pow(a, 1.0/3.0) and hive power UDF return 444560.99999999965 for the example above.
      However Math.cbrt returns 444561.0
      This is why we should have hive cbrt function in hive

      Attachments

        1. HIVE-9858.1.patch
          12 kB
          Alexander Pivovarov
        2. HIVE-9858.1.patch
          12 kB
          Alexander Pivovarov
        3. HIVE-9858.2.patch
          12 kB
          Alexander Pivovarov

        Activity

          People

            apivovarov Alexander Pivovarov
            apivovarov Alexander Pivovarov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: