GitHub user windpiger opened a pull request:

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

    [SPARK-18555][SQL]DataFrameNaFunctions.fill miss up original values in long 
integers

    ## What changes were proposed in this pull request?
      
       DataSet.na.fill(0) used on a DataSet which has a long value column, it 
will change the original long value. For example:
    ```  
    scala> val df = Seq[(Long, Long)]((1, 2), (-1, -2), (9123146099426677101L, 
9123146560113991650L)).toDF("a", "b")
    df: org.apache.spark.sql.DataFrame = [a: bigint, b: bigint]
    
    scala> df.show
    +-------------------+-------------------+
    |                  a|                  b|
    +-------------------+-------------------+
    |                  1|                  2|
    |                 -1|                 -2|
    |9123146099426677101|9123146560113991650|
    +-------------------+-------------------+
    
    scala> df.na.fill(0).show
    +-------------------+-------------------+
    |                  a|                  b|
    +-------------------+-------------------+
    |                  1|                  2|
    |                 -1|                 -2|
    |9123146099426676736|9123146560113991680|
    +-------------------+-------------------+
     ```
    
    the original values changed [which is not we expected result]:
    ```
     9123146099426677101 -> 9123146099426676736
     9123146560113991650 -> 9123146560113991680
    ```
    
    ## How was this patch tested?
    
    unit test added.

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

    $ git pull https://github.com/windpiger/spark nafillMissupOriginalValue

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

    https://github.com/apache/spark/pull/15994.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 #15994
    
----
commit 1ecc21e35aa52e6989ae86a92740fe8235de28a9
Author: root <root@izbp1gsnrlfzjxh82cz80vz.(none)>
Date:   2016-11-23T13:33:16Z

    [SPARK-18555][SQL]DataFrameNaFunctions.fill miss up original values in long 
integers

----


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to