RequiredFields contents

2009-11-05 Thread Dmitriy Ryaboy
Hi all,

I am looking at the RequiredFields class and it has this explanation
of what getFields() returns:

/**
 * List of fields required from the input. This includes fields that are
 * transformed, and thus are no longer the same fields. Using the example 'B
 * = foreach A generate $0, $2, $3, udf($1)' would produce the list (0, 0),
 * (0, 2), (0, 3), (0, 1). Note that the order is not guaranteed.
 */


The second element of the pair is self-explanatory -- but what is the
first element in the pair?

Thanks,
-Dmitriy


RE: RequiredFields contents

2009-11-05 Thread RichardGUO Fei

Hi,

I am also curious. I studied this and I guess that it could be the input index. 
For example, foreach A generate  Here A's index is 0 in the inputs of the 
operator foreach.

Let me know if I am wrong.

Thanks,
Richard

 Date: Fri, 6 Nov 2009 00:04:36 -0500
 Subject: RequiredFields contents
 From: dvrya...@gmail.com
 To: pig-dev@hadoop.apache.org
 
 Hi all,
 
 I am looking at the RequiredFields class and it has this explanation
 of what getFields() returns:
 
 /**
  * List of fields required from the input. This includes fields that are
  * transformed, and thus are no longer the same fields. Using the example 
 'B
  * = foreach A generate $0, $2, $3, udf($1)' would produce the list (0, 
 0),
  * (0, 2), (0, 3), (0, 1). Note that the order is not guaranteed.
  */
 
 
 The second element of the pair is self-explanatory -- but what is the
 first element in the pair?
 
 Thanks,
 -Dmitriy
  
_
“游日本,拿现金”MClub白领股神大赛火热报名中
http://club.msn.cn/pr/?a=emoney

RE: RequiredFields contents

2009-11-05 Thread Santhosh Srinivasan
The first element in the pair is the input number. Its mostly 0 for most
operators. For multi-input operators like join and cogroup, it will
range from 0 to (n - 1) where  n is the number of inputs.

Santhosh

-Original Message-
From: Dmitriy Ryaboy [mailto:dvrya...@gmail.com] 
Sent: Thursday, November 05, 2009 9:05 PM
To: pig-dev@hadoop.apache.org
Subject: RequiredFields contents

Hi all,

I am looking at the RequiredFields class and it has this explanation of
what getFields() returns:

/**
 * List of fields required from the input. This includes fields that
are
 * transformed, and thus are no longer the same fields. Using the
example 'B
 * = foreach A generate $0, $2, $3, udf($1)' would produce the list
(0, 0),
 * (0, 2), (0, 3), (0, 1). Note that the order is not guaranteed.
 */


The second element of the pair is self-explanatory -- but what is the
first element in the pair?

Thanks,
-Dmitriy