You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "liyunzhang_intel (JIRA)" <ji...@apache.org> on 2014/12/29 02:37:13 UTC

[jira] [Updated] (PIG-4361) Fix perl script problem in TestStreaming.java

     [ https://issues.apache.org/jira/browse/PIG-4361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

liyunzhang_intel updated PIG-4361:
----------------------------------
    Attachment: PIG-4361.patch

> Fix perl script problem in TestStreaming.java
> ---------------------------------------------
>
>                 Key: PIG-4361
>                 URL: https://issues.apache.org/jira/browse/PIG-4361
>             Project: Pig
>          Issue Type: Bug
>            Reporter: liyunzhang_intel
>            Assignee: liyunzhang_intel
>         Attachments: PIG-4361.patch
>
>
> TestStreaming.java  line 495
> {code}
>   // Perl script
> 	    String[] script =
> 	        new String[] {
> 	                      "#!/usr/bin/perl",
>                           "open(OUTFILE, \">\", $ARGV[0]) or die \"Can't open \".$ARGV[1].\"!: $!\";",
>                           "open(OUTFILE2, \">\", $ARGV[1]) or die \"Can't open \".$ARGV[2].\"!: $!\";",
>                           "while (<STDIN>) {",
>                           "  print OUTFILE \"$_\n\";",
>                           "  print STDERR \"STDERR: $_\n\";",
>                           "  print OUTFILE2 \"A,10\n\";",
>                           "}",
> 	                     };
> {code}
> this script has some problem when dealing with the input arguments. made some modifications:
> {code}
>   // Perl script
> 	    String[] script =
> 	        new String[] {
> 	                      "#!/usr/bin/perl",
>                           "open(OUTFILE, \">\", $ARGV[0]) or die \"Can't open \".$ARGV[0].\"!: $!\";",
>                           "open(OUTFILE2, \">\", $ARGV[1]) or die \"Can't open \".$ARGV[1].\"!: $!\";",
>                           "while (<STDIN>) {",
>                           "  print OUTFILE \"$_\n\";",
>                           "  print STDERR \"STDERR: $_\n\";",
>                           "  print OUTFILE2 \"A,10\n\";",
>                           "}",
> 	                     };
> {code}
> The same problem happens in line 554.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)