incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Lee <e...@c11software.com>
Subject Re: Cassandra and Pig - how to get column values?
Date Sun, 17 Oct 2010 00:03:13 GMT
Ah nice, even better, thanks!

On Sat, Oct 16, 2010 at 2:31 PM, Brandon Williams <driftx@gmail.com> wrote:

> 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
>



-- 
WonderAffect

http://www.wonderaffect.com
http://www.wonderaffect.com/blog

Mime
View raw message