You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Matt Tanquary <ma...@gmail.com> on 2010/11/30 23:22:44 UTC
Cast bytearray
I have the following bytearray:
--------------------------------
| F | bytearray |
--------------------------------
| | {(l1n2), (0,0), (1)} |
| | {(l2n2), (0,0), (1)} |
| | {(l3n2), (0,0), (1)} |
| | {(l4n2), (0,0), (1)} |
| | {(l5n2), (0,0), (1)} |
| | {(l1n1), (0), (1)} |
| | {(l2n1), (0), (1)} |
| | {(l3n1), (0), (1)} |
| | {(l4n1), (0), (1)} |
| | {(l5n1), (0), (1)} |
--------------------------------
I would like to cast it to something like bag{tuple(chararray),
tuple(chararray), tuple(int)}. Is this possible? I've only been able
to cast it to bat{(chararray)}.
Thanks!
-M@
--
Have you thanked a teacher today? ---> http://www.liftateacher.org
Re: Cast bytearray
Posted by Daniel Dai <ji...@yahoo-inc.com>.
No, bag assumes all tuples inside it share the same schema.
Daniel
Matt Tanquary wrote:
> I have the following bytearray:
>
> --------------------------------
> | F | bytearray |
> --------------------------------
> | | {(l1n2), (0,0), (1)} |
> | | {(l2n2), (0,0), (1)} |
> | | {(l3n2), (0,0), (1)} |
> | | {(l4n2), (0,0), (1)} |
> | | {(l5n2), (0,0), (1)} |
> | | {(l1n1), (0), (1)} |
> | | {(l2n1), (0), (1)} |
> | | {(l3n1), (0), (1)} |
> | | {(l4n1), (0), (1)} |
> | | {(l5n1), (0), (1)} |
> --------------------------------
>
>
> I would like to cast it to something like bag{tuple(chararray),
> tuple(chararray), tuple(int)}. Is this possible? I've only been able
> to cast it to bat{(chararray)}.
>
> Thanks!
> -M@
>
> --
> Have you thanked a teacher today? ---> http://www.liftateacher.org
>