STORE USING AvroStorage - ignores Pig field names, only using their position

2013-11-16 Thread Ruslan Al-Fakikh
Hey guys, When I store with AvroStorage, the names from Pig tuple fields are completely ignored. The field values are put to the result file only by their position. Here is a simplified test case: %declare WORKDIR `pwd` REGISTER ../../../../lib/external/avro-1.7.4.jar REGISTER

Re: STORE USING AvroStorage - ignores Pig field names, only using their position

2013-11-16 Thread Russell Jurney
Pig tuples have field order. Swap the order of the fields in your avro schema and try again. On Nov 16, 2013, at 6:19 PM, Ruslan Al-Fakikh metarus...@gmail.com wrote: Hey guys, When I store with AvroStorage, the names from Pig tuple fields are completely ignored. The field values are

Re: STORE USING AvroStorage - ignores Pig field names, only using their position

2013-11-16 Thread Ruslan Al-Fakikh
Thanks, Russel! Do you mean that this is the expected behavior? Shouldn't AvroStorage map the pig fields by their names (not their field order) matching them to the names in the avro schema? Thanks, Ruslan Al-Fakikh On Sun, Nov 17, 2013 at 6:53 AM, Russell Jurney russell.jur...@gmail.comwrote:

Re: STORE USING AvroStorage - ignores Pig field names, only using their position

2013-11-16 Thread Russell Jurney
How can pig map from a to nonsence_name? On Saturday, November 16, 2013, Ruslan Al-Fakikh wrote: Thanks, Russel! Do you mean that this is the expected behavior? Shouldn't AvroStorage map the pig fields by their names (not their field order) matching them to the names in the avro schema?

Re: STORE USING AvroStorage - ignores Pig field names, only using their position

2013-11-16 Thread Ruslan Al-Fakikh
Russel, Actually this problem came from the situation when I had the same names in pig relation schema and avro schema. And it turned out that AvroStorage switches fields if the order is different. So, my impression is that it should work this way: 1) names correspond - then AvroStorage uses them

Re: STORE USING AvroStorage - ignores Pig field names, only using their position

2013-11-16 Thread Ruslan Al-Fakikh
including this last message to pig user list On Sun, Nov 17, 2013 at 7:40 AM, Ruslan Al-Fakikh metarus...@gmail.comwrote: Russel, Actually this problem came from the situation when I had the same names in pig relation schema and avro schema. And it turned out that AvroStorage switches

Re: STORE USING AvroStorage - ignores Pig field names, only using their position

2013-11-16 Thread Russell Jurney
I think the expected behavior of AvroStorage is to use the tuple-ordered fields in the order they exist in the tuple. So to fix your problem, swap the order of b/nonsense_name. Otherwise I can't see a way to map from b to nonsense_name at all. Pig can't know how to do that without referencing