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

Add Bigdecimal functions in Over function

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.15.0
    • 0.17.0
    • piggybank
    • None
    • Hortonworks 2.4.2

    • Patch Available
    • Reviewed
    • Hide
      -4 new functions: SUM, AVG, MAX and MIN for BigDecimal and 4 test for each function.
      -An another outputschema. This output takes the inner alias and type of inputschema and returns the same alias with "_over" and the type. This is because in a foreach like the next:

      x = FOREACH SUM {
      ini = FOREACH test GENERATE id, id_2;
      GENERATE FLATTEN(MYSTITCH(ini, MYOVER(test.impt_prima, 'sum(bigdecimal)'), MYOVER(test.impt_1, 'sum(bigdecimal)'),
      MYOVER(test.impt_2, 'sum(bigdecimal)')));

      with the normal OVER function the foreach fails because all MYOVERS return the same alias.
      Show
      -4 new functions: SUM, AVG, MAX and MIN for BigDecimal and 4 test for each function. -An another outputschema. This output takes the inner alias and type of inputschema and returns the same alias with "_over" and the type. This is because in a foreach like the next: x = FOREACH SUM { ini = FOREACH test GENERATE id, id_2; GENERATE FLATTEN(MYSTITCH(ini, MYOVER(test.impt_prima, 'sum(bigdecimal)'), MYOVER(test.impt_1, 'sum(bigdecimal)'), MYOVER(test.impt_2, 'sum(bigdecimal)'))); with the normal OVER function the foreach fails because all MYOVERS return the same alias.
    • Patch

    Description

      In the piggybank, the Over function class don't include the bigdecimals methods for sum, max, min and avg.

      I attach Over.class with this changes. I attach the patch with this changes and I add a new output schema also. If anybody can do the PR, I appreciate it

      Attachments

        1. over.patch
          13 kB
          Cristian Galán

        Activity

          People

            cgalan Cristian Galán
            cgalan Cristian Galán
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0.25h
                0.25h
                Remaining:
                Remaining Estimate - 0.25h
                0.25h
                Logged:
                Time Spent - Not Specified
                Not Specified