GitHub user cloud-fan opened a pull request:
https://github.com/apache/spark/pull/17454
[SPARK-20125][SQL] Dataset of type option of map does not work
## What changes were proposed in this pull request?
When we build the deserializer expression for map type, we will use
`StaticInvoke` to call `ArrayBasedMapData.toScalaMap`, and declare the return
type as `scala.collection.immutable.Map`. If the map is inside an Option, we
will wrap this `StaticInvoke` with `WrapOption`, which requires the input to be
`scala.collect.Map`. Ideally this should be fine, as
`scala.collection.immutable.Map` extends `scala.collect.Map`, but our
`ObjectType` is too strict about this, this PR fixes it.
## How was this patch tested?
new regression test
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/cloud-fan/spark map
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/17454.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #17454
----
commit 29a014374b7e8800133379cdf8ea921fc0381be8
Author: Wenchen Fan <[email protected]>
Date: 2017-03-28T08:18:08Z
option of map should work
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]