You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by falaki <gi...@git.apache.org> on 2016/10/11 21:02:40 UTC

[GitHub] spark pull request #11336: [SPARK-9325][SPARK-R] collect() head() and show()...

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

    https://github.com/apache/spark/pull/11336#discussion_r82888061
  
    --- Diff: R/pkg/R/column.R ---
    @@ -32,35 +34,65 @@ setOldClass("jobj")
     #' @export
     #' @note Column since 1.4.0
     setClass("Column",
    -         slots = list(jc = "jobj"))
    +         slots = list(jc = "jobj", df = "SparkDataFrameOrNull"))
     
     #' A set of operations working with SparkDataFrame columns
     #' @rdname columnfunctions
     #' @name columnfunctions
     NULL
    -
    -setMethod("initialize", "Column", function(.Object, jc) {
    +setMethod("initialize", "Column", function(.Object, jc, df) {
       .Object@jc <- jc
    +
    +  # Some Column objects don't have any referencing DataFrame. In such case, df will be NULL.
    +  if (missing(df)) {
    +    df <- NULL
    +  }
    +  .Object@df <- df
       .Object
     })
     
    +setMethod("show", signature = "Column", definition = function(object) {
    --- End diff --
    
    Maybe this can be implemented as `head` with default number of elements?


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