Hive
  1. Hive
  2. HIVE-656

Add a PMOD (POSITIVE_MOD) function

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.4.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Release Note:
      HIVE-656. Add a PMOD (POSITIVE MOD) function. (Scott Chen via zshao)

      Description

      There are a lot of cases people want to get a positive modulo result.
      For example, people want to bucket the data into 10 buckets. They use the hash code in Hive (based on Java) which can return a negative number. Then they need this POSITIVE_MOD(a, b) to return the results.

      Otherwise they can still do it but it will be very verbose:

      ((hash(xxx) % 10) + 10) % 10
      
      1. hive-656-2009-07-27.patch
        6 kB
        Scott Chen
      2. hive-656-2009-07-27-1.patch
        6 kB
        Scott Chen
      3. hive-656-2009-07-27-2.patch
        6 kB
        Scott Chen

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Scott Chen
            Reporter:
            Zheng Shao
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development