hadoop-pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xu Zhang (JIRA)" <j...@apache.org>
Subject [jira] Created: (PIG-184) Parsing issue on the stream statement?
Date Thu, 03 Apr 2008 22:07:25 GMT
Parsing issue on the stream statement?

                 Key: PIG-184
                 URL: https://issues.apache.org/jira/browse/PIG-184
             Project: Pig
          Issue Type: Bug
            Reporter: Xu Zhang
            Assignee: Arun C Murthy

When I ran the following Pig script on the command line (pig -c cluster -latest p_11), Pig
returns immediately with doing any processing.  When I entered the script line by line into
GRUNT, after I entered the second line, I had to type one extra ";" in addition to the original
one in order for Pig to accept the line.  In the end, Pig gave me the correct results.

Here is the script, p_11:

A = load '/user/pig/tests/data/singlefile/studenttab10k';
B = stream A through `python ./python/MySimpleStreamApp.py --upper` as (name, age, gpa);
store B into 'results_11';

Here is the python streaming script, MySimpleStreamApp.py:


import sys
import optparse

def main():
    p = optparse.OptionParser()
    p.add_option('--upper', '-u', action="store_true")
    options, arguments = p.parse_args()

    line = sys.stdin.readline()
    while line:
        if options.upper == True:
            line = line.upper()
        line = sys.stdin.readline()

if __name__ == '__main__':

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message