|
|
-
Re: PigStorageWithInputPath and space as delimiterCheolsoo Park 2012-10-26, 17:46
Hi Diederik,
I assume that you're using the example code in the wiki page? If so, you need to add a constructor that takes arguments to your UDF. The reason why PigStorage works with arguments is because it has the following constructor: public PigStorage(String delimiter) { this(); fieldDel = StorageUtil.parseFieldDel(delimiter); } But this constructor is not inherited by PigStorageWithInputPath even though it extends PigStorage. Thanks, Cheolsoo On Wed, Oct 24, 2012 at 9:24 PM, Diederik van Liere <[EMAIL PROTECTED]>wrote: > Hi folks, > > I have been experimenting with the PigStorageWithInputPath example (see > > https://cwiki.apache.org/confluence/display/PIG/FAQ#FAQ-Q%3AIloaddatafromadirectorywhichcontainsdifferentfile.HowdoIfindoutwherethedatacomesfrom%3F > ) > and it compiles. > > However when I instantiate it like PigStorageWithInputPath(' ') in Grunt I > get the following error: > > could not instantiate 'PigStorageWithInputPath' with arguments '[ ]'. I > have also tried supplying '\s' and '\\s' but it doesn't work. I don't fully > understand why this happens as PigStorage(' ') does work > and PigStorageWithInputPath does not change the instantiation of the class > (AFAICT). I am using Hive 0.9.2 > > Any suggestions are greatly appreciated! > > Best, > > Diederik > |