Pig
  1. Pig
  2. PIG-1577

support to variable number of arguments in UDF

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.6.0
    • Fix Version/s: 0.13.0
    • Component/s: None
    • Labels:
      None
    • Release Note:
      Fixed as part of PIG-3444.

      Description

      In the current implementation, functionality that allows to map arguments to classes does not support functions with variable number of arguments. Also it does not support funtions that can have variable (but fixed in number) number of arguments.

      This causes problems for string UDFs such as CONCAT that can take an arbitrary number of arguments or TRIM that can take 1,2, or 3 arguments

        Issue Links

          Activity

          Hide
          David Ciemiewicz added a comment -

          Olga, can you clarify the issue?

          I've been writing and using UDFs with multiple parameters for years so there must be some subtlety that is escaping me in this JIRA problem description.

          Thanks.

          Show
          David Ciemiewicz added a comment - Olga, can you clarify the issue? I've been writing and using UDFs with multiple parameters for years so there must be some subtlety that is escaping me in this JIRA problem description. Thanks.
          Hide
          Daniel Dai added a comment -

          The issue in this Jira is that Pig has no ability to declare input schema of the UDF with variable number of arguments (in getArgToFuncMapping). You can interpret input tuple arbitrarily and use that for variable number of arguments. But with getArgToFuncMapping, you can get UDF signature matching and early input schema checking.

          Show
          Daniel Dai added a comment - The issue in this Jira is that Pig has no ability to declare input schema of the UDF with variable number of arguments (in getArgToFuncMapping). You can interpret input tuple arbitrarily and use that for variable number of arguments. But with getArgToFuncMapping, you can get UDF signature matching and early input schema checking.
          Hide
          Olga Natkovich added a comment -

          The issue is that if your function takes sometimes two and sometimes three parameters and has getArgToFuncMapping it is likely to result in an error. If you don't use getArgToFuncMapping things work just fine

          Show
          Olga Natkovich added a comment - The issue is that if your function takes sometimes two and sometimes three parameters and has getArgToFuncMapping it is likely to result in an error. If you don't use getArgToFuncMapping things work just fine

            People

            • Assignee:
              Unassigned
              Reporter:
              Olga Natkovich
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development