Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-296

UDF for cumulative statistics

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      udf for computive cumulative sum, row, rank, dense rank.

      To use
      A = load 'data' using PigStorage as ( query, freq );
      B = group A all;
      C = foreach B {
      Ordered = order A by freq using numeric.OrderDescending;
      generate
      statistics.CUMULATIVE_COLUMN(Ordered, 1) as – Pig starts with 0th column, this refers to the column freq by offset
      ( query, freq, freq_cumulative_sum, freq_row, freq_rank, freq_dense_rank );
      };
      D = foreach C generate FLATTEN(A);

        Attachments

        1. cumulative.patch
          12 kB
          Ajay Garg
        2. newCumulative.patch
          13 kB
          Ajay Garg

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ajaygarg Ajay Garg
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: