GitHub user wangyum opened a pull request:
https://github.com/apache/spark/pull/23164
[SPARK-26198][SQL] Fix Metadata serialize null values throw NPE
## What changes were proposed in this pull request?
How to reproduce this issue:
```scala
scala> val meta = new
org.apache.spark.sql.types.MetadataBuilder().putNull("key").build()
java.lang.NullPointerException
at
org.apache.spark.sql.types.Metadata$.org$apache$spark$sql$types$Metadata$$toJsonValue(Metadata.scala:196)
at
org.apache.spark.sql.types.Metadata$$anonfun$1.apply(Metadata.scala:180)
```
This pr fix `NullPointerException` when `Metadata` serialize `null` values.
## How was this patch tested?
unit tests
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/wangyum/spark SPARK-26198
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/23164.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 #23164
----
commit 03101868a72b5ae68bf6324e627f1874af32f040
Author: Yuming Wang <yumwang@...>
Date: 2018-11-28T12:22:09Z
Fix Metadata serialize null values throw NPE
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]