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

Allow in line scripting UDF definitions

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 0.18.0
    • Component/s: None
    • Labels:
      None

      Description

      For small udfs in scripting languages, it may be cumbersome to force users to make a script, put it on the classpath, ship it, etc. It would be great to support a syntax that allows people to declare UDFs in line (essentially, to define a snippet of code that will be interpreted as a scriptlet)

        Activity

        Hide
        aniket486 Aniket Mokashi added a comment -

        similar to PIG-1471?

        Show
        aniket486 Aniket Mokashi added a comment - similar to PIG-1471 ?
        Hide
        jcoveney Jonathan Coveney added a comment -

        Ah, that it is. Does that work? I'm not sure why that ticket was closed... AFAIK that syntax doesn't exist?

        Show
        jcoveney Jonathan Coveney added a comment - Ah, that it is. Does that work? I'm not sure why that ticket was closed... AFAIK that syntax doesn't exist?
        Hide
        aniket486 Aniket Mokashi added a comment -

        I think we accepted

        DEFINE hellopig org.apache.pig.scripting.jython.JythonFunction('def helloworld():\n\treturn (\'Hello, World\')', 'x:{t:(word:chararray)}');
        

        as a solution. It needs to have \t \ns in order to make python happy. It would be nice to have a better syntax.

        Show
        aniket486 Aniket Mokashi added a comment - I think we accepted DEFINE hellopig org.apache.pig.scripting.jython.JythonFunction('def helloworld():\n\treturn (\'Hello, World\')', 'x:{t:(word:chararray)}'); as a solution. It needs to have \t \ns in order to make python happy. It would be nice to have a better syntax.
        Hide
        olgan Olga Natkovich added a comment -

        Moving to 0.12 since it is an improvement with no work done yet

        Show
        olgan Olga Natkovich added a comment - Moving to 0.12 since it is an improvement with no work done yet

          People

          • Assignee:
            Unassigned
            Reporter:
            jcoveney Jonathan Coveney
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:

              Development