Sha256: f7ac67757e2a156d746b55e438bccdd5ac50161e8ea8eda0f41aefa8c36d95eb

Contents?: true

Size: 464 Bytes

Versions: 234

Compression:

Stored size: 464 Bytes

Contents

from pig_util import outputSchema

# 
# This is where we write python UDFs (User-Defined Functions) that we can call from pig.
# Pig needs to know the schema of the data coming out of the function, 
# which we specify using the @outputSchema decorator.
#
@outputSchema('example_udf:int')
def example_udf(input_str):
    """
    A simple example function that just returns the length of the string passed in.
    """
    return len(input_str) if input_str else None

Version data entries

234 entries across 117 versions & 1 rubygems

Version Path
mortar-0.15.23 lib/mortar/templates/pigscript/python_udf.py
mortar-0.15.23 lib/mortar/templates/udf/python_udf.py
mortar-0.15.22 lib/mortar/templates/udf/python_udf.py
mortar-0.15.22 lib/mortar/templates/pigscript/python_udf.py
mortar-0.15.21 lib/mortar/templates/udf/python_udf.py
mortar-0.15.21 lib/mortar/templates/pigscript/python_udf.py
mortar-0.15.20 lib/mortar/templates/udf/python_udf.py
mortar-0.15.20 lib/mortar/templates/pigscript/python_udf.py
mortar-0.15.19 lib/mortar/templates/udf/python_udf.py
mortar-0.15.19 lib/mortar/templates/pigscript/python_udf.py
mortar-0.15.18 lib/mortar/templates/udf/python_udf.py
mortar-0.15.18 lib/mortar/templates/pigscript/python_udf.py
mortar-0.15.17 lib/mortar/templates/udf/python_udf.py
mortar-0.15.17 lib/mortar/templates/pigscript/python_udf.py
mortar-0.15.16 lib/mortar/templates/udf/python_udf.py
mortar-0.15.16 lib/mortar/templates/pigscript/python_udf.py
mortar-0.15.15 lib/mortar/templates/udf/python_udf.py
mortar-0.15.15 lib/mortar/templates/pigscript/python_udf.py
mortar-0.15.14 lib/mortar/templates/udf/python_udf.py
mortar-0.15.14 lib/mortar/templates/pigscript/python_udf.py