Sha256: ef461256b3402307d6b2241da3c04d727d5c1965d63cb9202bfa6ced7027d66c

Contents?: true

Size: 1.14 KB

Versions: 87

Compression:

Stored size: 1.14 KB

Contents

/**
 * <%= script_name %>
 */
 
/** 
 * Parameters - set default values here; you can override with -p on the command-line.
 */
 
<%= '%default'%> INPUT_PATH 's3n://mortar-example-data/tutorial/excite.log.bz2'
<%= '%default'%> OUTPUT_PATH 's3n://my-output-bucket/$MORTAR_EMAIL_S3_ESCAPED/<%= script_name_alias %>'

<% if not options[:skip_udf] %>
/**
 * User-Defined Functions (UDFs)
 */

REGISTER '../udfs/python/<%= script_name %>.py' USING streaming_python AS <%= script_name %>;
<% end %>

-- This is an example of loading up input data
my_input_data = LOAD '$INPUT_PATH' 
               USING PigStorage('\t') 
                  AS (field0:chararray, field1:chararray, field2:chararray);

-- This is an example pig operation
filtered = FILTER my_input_data
               BY field0 IS NOT NULL;

-- This is an example call to a python user-defined function
with_udf_output = FOREACH filtered 
                 GENERATE field0..field2, 
                          <%= script_name_alias %>.example_udf(field0) AS example_udf_field;

-- remove any existing data
rmf $OUTPUT_PATH;

-- store the results
STORE with_udf_output 
 INTO '$OUTPUT_PATH' 
USING PigStorage('\t');

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
mortar-0.15.13 lib/mortar/templates/pigscript/pigscript.pig
mortar-0.15.12 lib/mortar/templates/pigscript/pigscript.pig
mortar-0.15.11 lib/mortar/templates/pigscript/pigscript.pig
mortar-0.15.7 lib/mortar/templates/pigscript/pigscript.pig
mortar-0.15.6 lib/mortar/templates/pigscript/pigscript.pig
mortar-0.15.5 lib/mortar/templates/pigscript/pigscript.pig
mortar-0.15.4 lib/mortar/templates/pigscript/pigscript.pig
mortar-0.15.3 lib/mortar/templates/pigscript/pigscript.pig
mortar-0.15.2 lib/mortar/templates/pigscript/pigscript.pig
mortar-0.15.1 lib/mortar/templates/pigscript/pigscript.pig
mortar-0.15.0 lib/mortar/templates/pigscript/pigscript.pig
mortar-0.14.1 lib/mortar/templates/pigscript/pigscript.pig
mortar-0.14.0 lib/mortar/templates/pigscript/pigscript.pig
mortar-0.13.5 lib/mortar/templates/pigscript/pigscript.pig
mortar-0.13.4 lib/mortar/templates/pigscript/pigscript.pig
mortar-0.13.3 lib/mortar/templates/pigscript/pigscript.pig
mortar-0.13.2 lib/mortar/templates/pigscript/pigscript.pig
mortar-0.13.1 lib/mortar/templates/pigscript/pigscript.pig
mortar-0.13.0 lib/mortar/templates/pigscript/pigscript.pig
mortar-0.12.6 lib/mortar/templates/pigscript/pigscript.pig