GitHub user wangyum opened a pull request:

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

    [SPARK-20754][SQL] Support TRUNC (number)

    ## What changes were proposed in this pull request?
    
    Add support for `TRUNC(number)`, it's similar to Oracle 
[TRUNC(number)](https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions200.htm):
    
    ```sql
    > SELECT TRUNC(1234567891.1234567891, 4);
     1.2345678911234E9
    > SELECT TRUNC(1234567891.1234567891, -4);
     1.23456E9
    > SELECT TRUNC(1234567891.1234567891, 0);
     1.234567891E9
    > SELECT TRUNC(1234567891.1234567891);
     1.234567891E9
    ```
    
    ## 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-20754-trunc

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

    https://github.com/apache/spark/pull/18106.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 #18106
    
----
commit a5ade70afe7601db16ec24956f270feb4499ee42
Author: Yuming Wang <wgy...@gmail.com>
Date:   2017-05-25T10:21:15Z

    Support TRUNC (number)

----


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