Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Pig >> mail # user >> ERROR 1128: Cannot find field -


+
Zebeljan, Nebojsa 2013-12-24, 10:51
Copy link to this message
-
Re: ERROR 1128: Cannot find field -
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
>
>
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB