Ah you're right, unless they are "by segment" results that wouldn't work. 
We'll have to add a test case to ensure it populated the right thing to the cache to catch those sort of things. 

> On Apr 2, 2014, at 21:58, nishantmonu51 <notifications@github.com> wrote:
> 
> In server/src/main/java/io/druid/client/CachePopulatingQueryRunner.java:
> 
> > -      CacheUtil.populate(
> > -          cache,
> > -          mapper,
> > -          key,
> > -          Lists.transform(resultAsList, strategy.prepareForCache())
> > +
> > +      final Function cacheFn = strategy.prepareForCache();
> > +      return Sequences.map(
> > +          results,
> > +          new Function<T, T>()
> > +          {
> > +            @Nullable
> > +            @Override
> > +            public T apply(@Nullable T input)
> > +            {
> > +              CacheUtil.populate(cache, mapper, key, ImmutableList.of(cacheFn.apply(input)));
> I thought about similar approach earlier also, but wont it populate individual result valued rather than the sequence, 
> so the cache will have only the last value from the result ?
> 
> —
> Reply to this email directly or view it on GitHub.