GitHub user CodingCat opened a pull request:

    https://github.com/apache/spark/pull/11107

    [SPARK-13227] Risky apply() in OpenHashMap

    https://issues.apache.org/jira/browse/SPARK-13227
    
    It might confuse the future developers when they use OpenHashMap.apply() 
with a numeric value type.
    
    null.asInstance[Int], null.asInstance[Long], null.asInstace[Float] and 
null.asInstance[Double] will return 0/0.0/0L, which might confuse the developer 
if the value set contains 0/0.0/0L with an existing key 
    
    
    The current patch only adds the comments describing the issue, with the 
respect to apply the minimum changes to the code base 
    
    The more direct, yet more aggressive, approach is use Option as the return 
type
    
    @andrewor14  @JoshRosen  any thoughts about how to avoid the potential 
issue?

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/CodingCat/spark SPARK-13227

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/11107.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 #11107
    
----
commit b54dbff929f9eefa70a1290750fd6324cb4ee3dd
Author: CodingCat <[email protected]>
Date:   2016-02-07T07:00:15Z

    add comments about risky apply() in OpenHashMap

----


---
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]

Reply via email to