Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Pig >> mail # user >> PigUnit test for script with non-default PigStorage delimiter


+
siddhi mehta 2013-02-05, 19:44
Copy link to this message
-
Re: PigUnit test for script with non-default PigStorage delimiter
Hi Siddhi,

You're right. Looking at PigUnit source code, "assertOutput(String
aliasInput, String[] input, String alias, String[] expected)" assumes the
default delimiter.

TestPig.java: override(aliasInput, String.format("%s = LOAD '%s' AS %s;",
aliasInput, destination, sb.toString()));

>> Is there a reason pigunit works only with default storage and default
delimiter only?

I don't think there is a reason for it. I filed a jira to fix it:
https://issues.apache.org/jira/browse/PIG-3162

One workaround would be use "assertOutput(String alias, String[] expected)"
and feed input data as a file.

Thanks,
Cheolsoo
On Tue, Feb 5, 2013 at 11:44 AM, siddhi mehta <[EMAIL PROTECTED]> wrote:

> Hey All,
>
> I have a pigscript where the load uses PigStorage with a different
> delimiter. I noticed that pigunit doesnot correctly parse the line of
> input. Pigunit parses happens correctly only with default delimiter for
> pigstorage.
>
> Here is my sample script and the test input
>  A =Load 'foo' using PigStorage(',') AS (name:chararray,age:int)
> String[] input1 = {"foo,20","bar,62"};
>
>
> Has anyboby else faced this issue?Is there a reason pigunit works only with
> default storage and default delimiter only?
>
> Thanks,
> Siddhi
>