Uh oh!
There was an error while loading. Please reload this page.
Spark-24742: Fix NullPointerexception in Field Metadata - #21722
Conversation
| x.## | ||
| case x: Metadata => | ||
| hash(x.map) | ||
| case null => |
There was a problem hiding this comment.
Basically, we do not support null in Metadata.
There was a problem hiding this comment.
Yes, the putNull method exists, but is actually not useable because of this bug. Having null in Metadata would be really helpful for me, as I'd like to store default values for fields in the Metadata. And NULL is a very common case as a default value.
SparkQA
commented
Aug 1, 2018
Test build #4227 has finished for PR 21722 at commit
|
SparkQA
commented
Aug 1, 2018
Test build #4228 has finished for PR 21722 at commit
|
| import org.apache.spark.SparkFunSuite | ||
| class MetadataSuite extends SparkFunSuite { | ||
| test("String Metadata") { |
There was a problem hiding this comment.
Oh @kupferk actually just noticed that the indents in this file are too deep. They should be 2-space. I think it might also be useful to use === and !== as test failures produces more detailed error messages then.
There was a problem hiding this comment.
Thanks for your comment, I am happy to fix that :)
HyukjinKwon
commented
Aug 2, 2018
retest this please |
SparkQA
commented
Aug 2, 2018
Test build #93933 has finished for PR 21722 at commit
|
HyukjinKwon
commented
Aug 2, 2018
retest this please |
SparkQA
commented
Aug 2, 2018
Test build #93978 has finished for PR 21722 at commit
|
srowen
commented
Aug 2, 2018
Merged to master |
HyukjinKwon
commented
Aug 2, 2018
ooops.. I merged this master too and looks there's an empty commit by that ... - d182b3d |
## What changes were proposed in this pull request? This pull request provides a fix for SPARK-24742: SQL Field MetaData was throwing an Exception in the hashCode method when a "null" Metadata was added via "putNull" ## How was this patch tested? A new unittest is provided in org/apache/spark/sql/types/MetadataSuite.scala Author: Kaya Kupferschmidt <k.kupferschmidt@dimajix.de> Closes#21722 from kupferk/SPARK-24742.
srowen
commented
Aug 2, 2018
Heh, collided yeah. I thought one commit would end up failing but since they're identical guess it results in an empty commit. No big deal. |
## What changes were proposed in this pull request? This pull request provides a fix for SPARK-24742: SQL Field MetaData was throwing an Exception in the hashCode method when a "null" Metadata was added via "putNull" ## How was this patch tested? A new unittest is provided in org/apache/spark/sql/types/MetadataSuite.scala Author: Kaya Kupferschmidt <k.kupferschmidt@dimajix.de> Closesapache#21722 from kupferk/SPARK-24742.
What changes were proposed in this pull request?
This pull request provides a fix for SPARK-24742: SQL Field MetaData was throwing an Exception in the hashCode method when a "null" Metadata was added via "putNull"
How was this patch tested?
A new unittest is provided in org/apache/spark/sql/types/MetadataSuite.scala