As I know, Pig use object serilazation to put object into configration and then transfer it to map and reduce task, and then map and reduce task desericalbe these object.
Could you give more details, at least object serilazation works as I know. Jeff Zhang On Mon, Nov 30, 2009 at 4:04 PM, Tim Robertson <timrobertson...@gmail.com>wrote: > How do you pass it to every map function? > Are you putting it in a DistributedCache and pulling it during the Map > configuration? > Are you running on a single machine? > > > Cheers > Tim > > On Sun, Nov 29, 2009 at 11:10 PM, <aa...@buffalo.edu> wrote: > > Hello Everybody, > > I have a question about object serialization in Hadoop. I > have > > an object A which I want to pass to every map function. Currently the > code I am > > using for this is as under. The problem is if I run my program, the code > crashes > > the first time with an error say that Java cannot deserialize the object > list( > > but no error when java tries to serialize it ) and then when I run the > program > > for the 2 time, without changing anything, the code works perfectly. > > > > I read on some blog post that the method I have used to serialize is not > the > > ideal way. But this also does not explain the weird results I am getting. > > > > try > > { > > ByteArrayOutputStream baos= new > ByteArrayOutputStream(); > > ObjectOutputStream oos= new > ObjectOutputStream(baos); > > oos.writeObject(list); > > stock_list= encode.encode(baos.toByteArray()); > > } > > catch(IOException e) > > { > > e.printStackTrace(); > > } > > > > Thank You > > > > Abhishek Agrawal > > > > SUNY- Buffalo > > (716-435-7122) > > > > > > > > >