[storm] how do I return specific columns from an 'is_in' fetch

Jamu Kakar jkakar at kakar.ca
Mon Feb 14 17:11:14 UTC 2011


Hi Roy,

On Mon, Feb 14, 2011 at 5:55 PM, Roy Mathew <rmathew8 at gmail.com> wrote:
> I'm trying to achieve the following query via the storm API:
>   select A,B from T where C in [list-of-values];
> I see that I can use the 'is_in' function, but it seems that this
> approach returns all columns; is there is a way to 'narrow' the set of
> columns returned?

You can do this a couple of ways:

result = store.find((T.a, T.b), T.c.is_in([...]))
values = list(result)

or

result = store.find(T, T.c.is_in([...]))
values = list(result.values(T.a, T.b))

Thanks,
J.



More information about the storm mailing list