This example query uses the input table "input_table" when invoking the mapper.py function.
Example 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:
word | count |
---|---|
Old | 1 |
MacDonald | 1 |
had | 1 |
a | 1 |
farm | 1 |