GitHub user weiqingy opened a pull request:

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

    [SPARK-18746][SQL] Add newBigDecimalEncoder

    ## What changes were proposed in this pull request?
    Add `newBigDecimalEncoder` in `SQLImplicits.scala`.
    
    ## How was this patch tested?
    Pass build, existing unit tests, and the tests below .
    Before:
    ```
    scala> spark.createDataset(Seq(new java.math.BigDecimal(10)))
    <console>:24: error: Unable to find encoder for type stored in a Dataset.  
Primitive types (Int, String, etc) and Product types (case classes) are 
supported by importing spark.implicits._  Support for serializing other types 
will be added in future releases.
           spark.createDataset(Seq(new java.math.BigDecimal(10)))
                              ^
    
    scala>
    ```
    After:
    ```
    scala> spark.createDataset(Seq(new java.math.BigDecimal(10)))
    res0: org.apache.spark.sql.Dataset[java.math.BigDecimal] = [value: 
decimal(38,18)]
    ```

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

    $ git pull https://github.com/weiqingy/spark SPARK-18746

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

    https://github.com/apache/spark/pull/16176.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 #16176
    
----
commit 9cc8d7048eea1617856298e0a44249d7f81836e8
Author: Weiqing Yang <[email protected]>
Date:   2016-12-06T19:44:23Z

    [SPARK-18746][SQL] Add newBigDecimalEncoder

----


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