Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> Problem with loading complex data types


Copy link to this message
-
RE: Problem with loading complex data types
Hi Marco,

Is the data tab separated? If not, you need to specify the delimiter
explicitly as:

A = LOAD 'data' using PigStorage(' ') AS (t1:tuple(t1a:int,
t1b:int,t1c:int),t2:tuple(t2a:int,t2b:int,t2c:int));

Santhosh

-----Original Message-----
From: Marco Nicosia [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 10, 2009 6:48 PM
To: [EMAIL PROTECTED]
Subject: Problem with loading complex data types

Hi all, I'm new to this list. Pardon me if this is a FAQ. Pardon
me also that the only version I have available, for some reason,
is pig 0.3.0.

Anyways, has something changed regarding loading complex data types
from version 0.2.0 to version 0.3.0? I'll explain, I've been trying
to do some interesting things, and nothing was working as I expected,
so eventually I just tried pasting in the example from:

   *
<http://hadoop.apache.org/pig/docs/r0.2.0/piglatin.html#Referencing+Fiel
ds>

... and whoa, that didn't work either? Here's the session output:

> 118 [marco@gw15 1:38am] ~$ pig -version
> USING: /grid/0/gs/pig/current
> Apache Pig version 0.3.0-dev (r776716)
> compiled May 20 2009, 15:02:33
> 119 [marco@gritgw1005 1:38am] ~$ pig -v -x local
> USING: /grid/0/gs/pig/current
> grunt> cat data;
> (3,8,9) (4,5,6)
> (1,4,7) (3,7,5)
> (2,5,8) (9,5,8)
> grunt> A = LOAD 'data' AS (t1:tuple(t1a:int,
t1b:int,t1c:int),t2:tuple(t2a:int,t2b:int,t2c:int));
> grunt> dump A;
> 2009-06-11 01:38:46,942 [main] WARN
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigHadoopLo
gger -
org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOp
erators.POProject: Attempt to access field which was not found in the
input
> 2009-06-11 01:38:46,944 [main] WARN
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigHadoopLo
gger -
org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOp
erators.POProject: Attempt to access field which was not found in the
input
> 2009-06-11 01:38:46,944 [main] WARN
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigHadoopLo
gger -
org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOp
erators.POProject: Attempt to access field which was not found in the
input
> 2009-06-11 01:38:46,945 [main] INFO
org.apache.pig.backend.local.executionengine.LocalPigLauncher - 100%
complete!
> 2009-06-11 01:38:46,945 [main] INFO
org.apache.pig.backend.local.executionengine.LocalPigLauncher -
Success!!
> ((3,8,9),)
> ((1,4,7),)
> ((2,5,8),)
>

... Wah?

_______________________________________________________________________
Marco E. Nicosia  |  http://www.escape.org/~marco/  |  [EMAIL PROTECTED]