Github user huaxingao commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21835#discussion_r205609369
  
    --- Diff: R/pkg/R/functions.R ---
    @@ -3320,7 +3321,7 @@ setMethod("explode",
     #' @aliases sequence sequence,Column-method
     #' @note sequence since 2.4.0
     setMethod("sequence",
    -         signature(x = "Column", y = "Column"),
    +         signature(),
    --- End diff --
    
    I will need to make the ```sequence``` method  still callable without 
base:: prefix, right?
    Is the following implementation OK?
    ```
    setMethod("sequence",
              signature(),
              function(x, y = NULL, step = NULL) {
                if (is.null(y) && is.null(step))
                  base::sequence(x)
                else {
                  jc <- if (is.null(step)) {
                    callJStatic("org.apache.spark.sql.functions", "sequence", 
x@jc, y@jc)
                  } else {
                    stopifnot(class(step) == "Column")
                    callJStatic("org.apache.spark.sql.functions", "sequence", 
x@jc, y@jc, step@jc)
                  }
                  column(jc)
                }
              })
    ```


---

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

Reply via email to