You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by actuaryzhang <gi...@git.apache.org> on 2017/05/26 00:12:11 UTC

[GitHub] spark pull request #18116: [SPARK-20892][SparkR] Add SQL trunc function

GitHub user actuaryzhang opened a pull request:

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

    [SPARK-20892][SparkR] Add SQL trunc function

    ## What changes were proposed in this pull request?
    Add SQL trunc function
    
    ## How was this patch tested?
    standard test


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

    $ git pull https://github.com/actuaryzhang/spark sparkRTrunc

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

    https://github.com/apache/spark/pull/18116.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 #18116
    
----
commit 95e032c9c3d71aa9095c8193361f3eefb91e9a0c
Author: Wayne Zhang <ac...@uber.com>
Date:   2017-05-26T00:09:12Z

    add SQL trunc function

----


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/77407/
    Test PASSed.


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

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


[GitHub] spark pull request #18116: [SPARK-20892][SparkR] Add SQL trunc function to S...

Posted by actuaryzhang <gi...@git.apache.org>.
Github user actuaryzhang closed the pull request at:

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


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

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


[GitHub] spark pull request #18116: [SPARK-20892][SparkR] Add SQL trunc function to S...

Posted by actuaryzhang <gi...@git.apache.org>.
Github user actuaryzhang commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18116#discussion_r118634921
  
    --- Diff: R/pkg/R/functions.R ---
    @@ -4015,3 +4015,29 @@ setMethod("input_file_name", signature("missing"),
                 jc <- callJStatic("org.apache.spark.sql.functions", "input_file_name")
                 column(jc)
               })
    +
    +#' trunc
    +#'
    +#' Returns date truncated to the unit specified by the format.
    +#'
    +#' @param x Column to compute on.
    +#' @param format string used for specify the truncation method. For example, "year", "yyyy",
    +#' "yy" for truncate by year, or "month", "mon", "mm" for truncate by month.
    +#'
    +#' @rdname trunc
    +#' @name trunc
    +#' @family date time functions
    +#' @aliases trunc,Column-method
    +#' @export
    +#' @examples
    +#' \dontrun{
    +#' trunc(df$c, "year")
    +#' trunc(df$c, "month")
    +#' }
    +#' @note trunc since 2.3.0
    +setMethod("trunc",
    +          signature(x = "Column"),
    +          function(x, format = "year") {
    --- End diff --
    
    Sure. Removed the default value. 


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    Merged build finished. Test PASSed.


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by actuaryzhang <gi...@git.apache.org>.
Github user actuaryzhang commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    @felixcheung @wangmiao1981 


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    **[Test build #77408 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77408/testReport)** for PR 18116 at commit [`4e357fd`](https://github.com/apache/spark/commit/4e357fda98a7e67bf5840bcb426de0c0828e0144).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    **[Test build #77556 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77556/testReport)** for PR 18116 at commit [`7af4490`](https://github.com/apache/spark/commit/7af4490794e1e2dc654ae5c37d0805f249931589).


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    **[Test build #77393 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77393/testReport)** for PR 18116 at commit [`95e032c`](https://github.com/apache/spark/commit/95e032c9c3d71aa9095c8193361f3eefb91e9a0c).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by zero323 <gi...@git.apache.org>.
Github user zero323 commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    It is manually edited. We don't manage it with `roxygen`.


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    **[Test build #77407 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77407/testReport)** for PR 18116 at commit [`9bce156`](https://github.com/apache/spark/commit/9bce1560b75b65c4bf3eed4e4d4384a4dac81397).


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    **[Test build #77409 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77409/testReport)** for PR 18116 at commit [`ccdcf5c`](https://github.com/apache/spark/commit/ccdcf5c2e75e2b56bc7f95fc66ef50fe3237925b).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/77408/
    Test PASSed.


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/77556/
    Test PASSed.


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

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


[GitHub] spark pull request #18116: [SPARK-20892][SparkR] Add SQL trunc function to S...

Posted by actuaryzhang <gi...@git.apache.org>.
Github user actuaryzhang commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18116#discussion_r118634873
  
    --- Diff: R/pkg/inst/tests/testthat/test_sparkSQL.R ---
    @@ -1404,6 +1404,8 @@ test_that("column functions", {
       c20 <- to_timestamp(c) + to_timestamp(c, "yyyy") + to_date(c, "yyyy")
       c21 <- posexplode_outer(c) + explode_outer(c)
       c22 <- not(c)
    +  c23 <- trunc(c) + trunc(c, "year") + trunc(c, "yyyy") + trunc(c, "yy") +
    --- End diff --
    
    Got it. Thank you!


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by actuaryzhang <gi...@git.apache.org>.
Github user actuaryzhang commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    Sorry, I messed up git. Close and reopen in another PR.


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

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


[GitHub] spark pull request #18116: [SPARK-20892][SparkR] Add SQL trunc function to S...

Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18116#discussion_r118634196
  
    --- Diff: R/pkg/R/functions.R ---
    @@ -4015,3 +4015,29 @@ setMethod("input_file_name", signature("missing"),
                 jc <- callJStatic("org.apache.spark.sql.functions", "input_file_name")
                 column(jc)
               })
    +
    +#' trunc
    +#'
    +#' Returns date truncated to the unit specified by the format.
    +#'
    +#' @param x Column to compute on.
    +#' @param format string used for specify the truncation method. For example, "year", "yyyy",
    +#' "yy" for truncate by year, or "month", "mon", "mm" for truncate by month.
    +#'
    +#' @rdname trunc
    +#' @name trunc
    +#' @family date time functions
    +#' @aliases trunc,Column-method
    +#' @export
    +#' @examples
    +#' \dontrun{
    +#' trunc(df$c, "year")
    +#' trunc(df$c, "month")
    +#' }
    +#' @note trunc since 2.3.0
    +setMethod("trunc",
    +          signature(x = "Column"),
    +          function(x, format = "year") {
    --- End diff --
    
    perhaps we shouldn't have a default value? python or scala doesn't


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    Merged build finished. Test PASSed.


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

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


[GitHub] spark pull request #18116: [SPARK-20892][SparkR] Add SQL trunc function to S...

Posted by actuaryzhang <gi...@git.apache.org>.
Github user actuaryzhang commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18116#discussion_r118612551
  
    --- Diff: R/pkg/inst/tests/testthat/test_sparkSQL.R ---
    @@ -1404,6 +1404,8 @@ test_that("column functions", {
       c20 <- to_timestamp(c) + to_timestamp(c, "yyyy") + to_date(c, "yyyy")
       c21 <- posexplode_outer(c) + explode_outer(c)
       c22 <- not(c)
    +  c23 <- trunc(c) + trunc(c, "year") + trunc(c, "yyyy") + trunc(c, "yy") +
    --- End diff --
    
    Not sure what this does. Is this the current test for these SQL functions? 


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

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


[GitHub] spark pull request #18116: [SPARK-20892][SparkR] Add SQL trunc function to S...

Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18116#discussion_r118633949
  
    --- Diff: R/pkg/inst/tests/testthat/test_sparkSQL.R ---
    @@ -1404,6 +1404,8 @@ test_that("column functions", {
       c20 <- to_timestamp(c) + to_timestamp(c, "yyyy") + to_date(c, "yyyy")
       c21 <- posexplode_outer(c) + explode_outer(c)
       c22 <- not(c)
    +  c23 <- trunc(c) + trunc(c, "year") + trunc(c, "yyyy") + trunc(c, "yy") +
    --- End diff --
    
    this just makes sure it can be called and no error. for simple call to JVM we don't generally test the behavior/result


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by actuaryzhang <gi...@git.apache.org>.
Github user actuaryzhang commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    Thanks @zero323. Anything else needed for this one?


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/77409/
    Test PASSed.


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    **[Test build #77996 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77996/testReport)** for PR 18116 at commit [`dbffb90`](https://github.com/apache/spark/commit/dbffb902dd1a0e5880ebb886360750d552e12975).
     * This patch **fails SparkR unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    **[Test build #77555 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77555/testReport)** for PR 18116 at commit [`0896845`](https://github.com/apache/spark/commit/0896845cf65fb4ccdaebda40f21745d3fa0bd3ba).


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by actuaryzhang <gi...@git.apache.org>.
Github user actuaryzhang commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    @dongjoon-hyun Thanks for pointing this out. Fixed now. 
    I thought the `@export` tag will instruct roxygen to export this method automatically in the namespace. Or was this namespace file always manually edited? 


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    **[Test build #77408 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77408/testReport)** for PR 18116 at commit [`4e357fd`](https://github.com/apache/spark/commit/4e357fda98a7e67bf5840bcb426de0c0828e0144).


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    **[Test build #77393 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77393/testReport)** for PR 18116 at commit [`95e032c`](https://github.com/apache/spark/commit/95e032c9c3d71aa9095c8193361f3eefb91e9a0c).


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    **[Test build #77555 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77555/testReport)** for PR 18116 at commit [`0896845`](https://github.com/apache/spark/commit/0896845cf65fb4ccdaebda40f21745d3fa0bd3ba).
     * This patch **fails some tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    **[Test build #77996 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77996/testReport)** for PR 18116 at commit [`dbffb90`](https://github.com/apache/spark/commit/dbffb902dd1a0e5880ebb886360750d552e12975).


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/77996/
    Test FAILed.


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    Merged build finished. Test FAILed.


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    Merged build finished. Test PASSed.


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

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


[GitHub] spark pull request #18116: [SPARK-20892][SparkR] Add SQL trunc function to S...

Posted by dongjoon-hyun <gi...@git.apache.org>.
Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18116#discussion_r119211021
  
    --- Diff: R/pkg/R/functions.R ---
    @@ -4015,3 +4015,31 @@ setMethod("input_file_name", signature("missing"),
                 jc <- callJStatic("org.apache.spark.sql.functions", "input_file_name")
                 column(jc)
               })
    +
    +#' trunc
    +#'
    +#' Returns date truncated to the unit specified by the format.
    +#'
    +#' @param x Column to compute on.
    +#' @param format string used for specify the truncation method. For example, "year", "yyyy",
    +#' "yy" for truncate by year, or "month", "mon", "mm" for truncate by month.
    +#'
    +#' @rdname trunc
    +#' @name trunc
    +#' @family date time functions
    +#' @aliases trunc,Column-method
    +#' @export
    +#' @examples
    +#' \dontrun{
    +#' trunc(df$c, "year")
    +#' trunc(df$c, "yy")
    +#' trunc(df$c, "month")
    +#' trunc(df$c, "mon")
    +#' }
    +#' @note trunc since 2.3.0
    +setMethod("trunc",
    --- End diff --
    
    Hi, @actuaryzhang .
    It seems that we need to expose this to `R/pkg/NAMESPACE`. 


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    **[Test build #77407 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77407/testReport)** for PR 18116 at commit [`9bce156`](https://github.com/apache/spark/commit/9bce1560b75b65c4bf3eed4e4d4384a4dac81397).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    Merged build finished. Test PASSed.


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    **[Test build #77556 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77556/testReport)** for PR 18116 at commit [`7af4490`](https://github.com/apache/spark/commit/7af4490794e1e2dc654ae5c37d0805f249931589).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/77555/
    Test FAILed.


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    Merged build finished. Test PASSed.


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    Merged build finished. Test FAILed.


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    **[Test build #77409 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77409/testReport)** for PR 18116 at commit [`ccdcf5c`](https://github.com/apache/spark/commit/ccdcf5c2e75e2b56bc7f95fc66ef50fe3237925b).


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/77393/
    Test PASSed.


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

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


[GitHub] spark issue #18116: [SPARK-20892][SparkR] Add SQL trunc function to SparkR

Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on the issue:

    https://github.com/apache/spark/pull/18116
  
    add @zero323 


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

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