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

support non default constructor with variable number of arguments

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.1.0
    • Component/s: None
    • Labels:
      None

      Description

      pig does not support non default constructor with variable number of arguments support. In our case we need this because the number of variables that are specified by the user are varying. The fix is simple. Pig calls getConstr("agr1","arg2",...,"argn") and if it doesn't find it throws a noSuchMethodFound exception. In the catch block we just need to add code to check if we can wrap the arg1..n in a String[] and check if a constructor can be found with this signature getConstr(args[]). This would resolve the variable num args issue.

        Activity

        Hide
        pi_song Pi Song added a comment -

        This seems to follow the dispatching mechanism in Java so I agree.

        Show
        pi_song Pi Song added a comment - This seems to follow the dispatching mechanism in Java so I agree.
        Hide
        olgan Olga Natkovich added a comment -

        sounds reasonable. please, attach the patch if you already have one

        Show
        olgan Olga Natkovich added a comment - sounds reasonable. please, attach the patch if you already have one
        Hide
        pi_song Pi Song added a comment -

        Simple fix.
        All tests passed Local/MapReduce.

        Show
        pi_song Pi Song added a comment - Simple fix. All tests passed Local/MapReduce.
        Hide
        olgan Olga Natkovich added a comment -

        +1. The patch looks good! Please, commit

        Show
        olgan Olga Natkovich added a comment - +1. The patch looks good! Please, commit
        Hide
        pi_song Pi Song added a comment -

        Committed. Thanks Olga for review.

        Show
        pi_song Pi Song added a comment - Committed. Thanks Olga for review.

          People

          • Assignee:
            pi_song Pi Song
            Reporter:
            ajaygarg Ajay Garg
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development