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

Shravan Matthur Narayanamurthy updated PIG-327:
-----------------------------------------------

    Status: Patch Available  (was: Open)

Had to fix src/org/apache/pig/impl/builtin/ShellBagEvalFunc.java. I thought the 
earlier code looked fine as it uses the os.flush() method to signal the shell 
cmd to compute the output. However, this did not seem to work. So added a call 
to the finish() method where we explictly close the stream. Also for it to work 
for other inputs, we also need to set the reference to os to null. This fixes 
it.

So this reduces the 2 errors & 1 failure in TestBuiltin to 1 error in 
testSumFinal

Please take a look at the patch. The only thing is we create the process for 
every input tuple. I feel that the earlier code should have worked but somehow 
the flush is not doing its function. Only an explicit close starts the process 
going.

> testShellFuncSingle/Multiple fail in TestBuiltin
> ------------------------------------------------
>
>                 Key: PIG-327
>                 URL: https://issues.apache.org/jira/browse/PIG-327
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: types_branch
>            Reporter: Alan Gates
>            Assignee: Shravan Matthur Narayanamurthy
>             Fix For: types_branch
>
>         Attachments: 327.patch
>
>
> Testcase: testShellFuncSingle took 7.152 sec
>     FAILED
> null expected:<{[(f00)]}> but was:<{[]}>
> junit.framework.ComparisonFailure: null expected:<{[(f00)]}> but was:<{[]}>
>     at 
> org.apache.pig.test.TestBuiltin.testShellFuncSingle(TestBuiltin.java:900)
> Testcase: testShellFuncMultiple took 6.68 sec
>     Caused an ERROR
> null
> java.lang.NullPointerException
>     at 
> org.apache.pig.test.TestBuiltin.testShellFuncMultiple(TestBuiltin.java:933)

-- 
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