You're right. Can you parameterize the field name and substitute it depending on the version of schema?
On Tue, Dec 24, 2013 at 2:51 AM, Zebeljan, Nebojsa < [email protected]> wrote: > Hi, > I've added a condition in my pig script which shall use in case A field x > and in case B field y. > > Something like: > (Schema.Version == 1 ? Field.x : Field.y) AS SomeField > > The intention was to make my pig script future safe, because with the next > schema (version != 1) the new "Field.y" is added and shall be used. When I > run my script on the data with the "current" schema (version=1), I'm > getting the following exception: > > pig script failed to validate: > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1128: Cannot find > field y in … > > Unfortunately it looks like pig is validating every field, even if it's > not used/called?! > > Thanks in advance! > Nebo > >
