incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brandon Williams <dri...@gmail.com>
Subject Re: Cassandra and Pig - how to get column values?
Date Sat, 16 Oct 2010 21:31:09 GMT
On Sat, Oct 16, 2010 at 3:55 PM, Eric Lee <eric@c11software.com> wrote:

> I have this working now with the following:
>
> rows = LOAD 'cassandra://TwitterExample/User' using CassandraStorage();
> *cols = FOREACH rows GENERATE
> FLATTEN((bag{tuple(chararray,chararray)})$1);*
> users = FOREACH cols GENERATE $1;
>
> Not sure if that operation with *cols *is correct or not, but it appears
> to be working. Any thoughts would be appreciated.
>

You can do what you want in a single pass by dereferencing the bag:

rows = LOAD 'cassandra://TwitterExample/User' USING CassandraStorage() AS
(key, columns: bag {T: tuple(name, value)});
values = FOREACH rows GENERATE columns.value;

-Brandon

Mime
View raw message