Number of outpit rows in the log seems to be invalid when streaming application 
fails
-------------------------------------------------------------------------------------

                 Key: PIG-232
                 URL: https://issues.apache.org/jira/browse/PIG-232
             Project: Pig
          Issue Type: Bug
            Reporter: Olga Natkovich
            Assignee: Arun C Murthy


My pig script:

define CMD `perl PigStreamingBad.pl end` ship('PigStreamingBad.pl') 
stderr('CMD' limit 1);
A = load 'studenttab10k';
B = stream A through CMD;
store B into 'out';

My perl script:

use strict;

# This script is used to test streaming error cases in pig.
# Usage: PigStreaming.pl <start|middle|end>
# the parameter tells the application when to exit with error

if ($#ARGV < 0)
{
        print STDERR "Usage PigStreaming.pl <start|middle|end>\n";
        exit (-1);
}

my $pos = $ARGV[0];

if ($pos eq "start")
{
        print STDERR "Failed in the beginning of the processing\n";
        exit(1);
}


print STDERR "PigStreamingBad.pl: starting processing\n";

my $cnt = 0;
while (<STDIN>)
{
        print "$_";
        $cnt++;
        print STDERR "PigStreaming.pl: processing $_\n";
        if (($cnt > 100) && ($pos eq "middle"))
        {
                print STDERR "Failed in the middle of processing\n";
                exit(2);
        }
}

print STDERR "Failed at the end of processing\n";
exit(3);

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

Reply via email to