Query to Invoke mapper.py - Aster Execution Engine

Teradata Aster® Developer Guide

Product
Aster Execution Engine
Release Number
7.00.02
Published
July 2017
Language
English (United States)
Last Update
2018-04-13
dita:mapPath
xnl1494366523182.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
ffu1489104705746
lifecycle
previous
Product Category
Software

This example query uses the input table "input_table" when invoking the mapper.py function.

Example input table

Example input table: input_table
content
Old MacDonald had a farm

Example STREAM query

Use ACT to run this SQL-MapReduce query, which calls the Script API:

SELECT * FROM STREAM
(ON (SELECT content FROM input_table)
SCRIPT ('python mapper.py')
OUTPUTS ('word varchar', 'count int'));

Output

Run on a small sample table, this generates:

Example output table
word count
Old 1
MacDonald 1
had 1
a 1
farm 1