You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spark.apache.org by Doris Xin <do...@gmail.com> on 2014/06/03 23:08:02 UTC

collectAsMap doesn't return a multiMap?

Hey guys,

Just wanted to check real quick if collectAsMap was by design not to
return a multimap (so multiple values to the same key can overwrite
the same entry). It seems like it's only used in some unit tests in
the codebase. I added a warning in the comment saying not to expect a
multimap. Let me know if this is actually a bug that needs to be
fixed.

Thanks,
Doris

Re: collectAsMap doesn't return a multiMap?

Posted by Matei Zaharia <ma...@gmail.com>.
Yup, it’s meant to be just a Map. You should probably use collect() and build a multimap instead if you’d like that.

Matei

On Jun 3, 2014, at 2:08 PM, Doris Xin <do...@gmail.com> wrote:

> Hey guys,
> 
> Just wanted to check real quick if collectAsMap was by design not to
> return a multimap (so multiple values to the same key can overwrite
> the same entry). It seems like it's only used in some unit tests in
> the codebase. I added a warning in the comment saying not to expect a
> multimap. Let me know if this is actually a bug that needs to be
> fixed.
> 
> Thanks,
> Doris