Sha256: 0137a80b284d1a1060919ebbfc184eab34a8a67204e044382eeed585b24d6e51

Contents?: true

Size: 465 Bytes

Versions: 193

Compression:

Stored size: 465 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

193 entries across 117 versions & 1 rubygems

Version Path
mortar-0.15.53 lib/mortar/templates/project/udfs/python/python_udf.py
mortar-0.15.53 lib/mortar/templates/characterize/udfs/python/python_udf.py
mortar-0.15.52 lib/mortar/templates/characterize/udfs/python/python_udf.py
mortar-0.15.52 lib/mortar/templates/project/udfs/python/python_udf.py
mortar-0.15.51 lib/mortar/templates/characterize/udfs/python/python_udf.py
mortar-0.15.51 lib/mortar/templates/project/udfs/python/python_udf.py
mortar-0.15.50 lib/mortar/templates/characterize/udfs/python/python_udf.py
mortar-0.15.50 lib/mortar/templates/project/udfs/python/python_udf.py
mortar-0.15.49 lib/mortar/templates/characterize/udfs/python/python_udf.py
mortar-0.15.49 lib/mortar/templates/project/udfs/python/python_udf.py
mortar-0.15.48 lib/mortar/templates/characterize/udfs/python/python_udf.py
mortar-0.15.48 lib/mortar/templates/project/udfs/python/python_udf.py
mortar-0.15.47 lib/mortar/templates/project/udfs/python/python_udf.py
mortar-0.15.47 lib/mortar/templates/characterize/udfs/python/python_udf.py
mortar-0.15.46 lib/mortar/templates/characterize/udfs/python/python_udf.py
mortar-0.15.46 lib/mortar/templates/project/udfs/python/python_udf.py
mortar-0.15.45 lib/mortar/templates/characterize/udfs/python/python_udf.py
mortar-0.15.45 lib/mortar/templates/project/udfs/python/python_udf.py
mortar-0.15.44 lib/mortar/templates/characterize/udfs/python/python_udf.py
mortar-0.15.44 lib/mortar/templates/project/udfs/python/python_udf.py