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

Allow schema matching for UDF with variable length arguments

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.3.0
    • None
    • impl
    • None

    Description

      Pig pick the right version of UDF using a similarity measurement. This mechanism pick the UDF with right input schema to use. However, some UDFs use various number of inputs and currently there is no way to declare such input schema in UDF and similarity measurement do not match against variable number of inputs. We can still write variable inputs UDF, but we cannot rely on schema matching to pick the right UDF version and do the automatic data type conversion.

      Eg:
      If we have:
      Integer udf1(Integer, ......);
      Integer udf1(String, ......);

      Currently we cannot do this:
      a:

      {chararray, chararray}
      b = foreach a generate udf1(a.$0, a.$1); // Pig cannot pick the udf(String, ......) automatically, currently, this statement fails

      Eg:
      If we have:
      Integer udf2(Integer, ......);

      Currently, this script fail
      a: {chararray, chararray}

      b = foreach a generate udf1(a.$0, a.$1); // Currently, Pig cannot convert a.$0 into Integer automatically

      Attachments

        Activity

          People

            thejas Thejas Nair
            daijy Daniel Dai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: