[ 
https://issues.apache.org/jira/browse/SPARK-21291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16613832#comment-16613832
 ] 

Huaxin Gao commented on SPARK-21291:
------------------------------------

[~felixcheung]

I am working on this, but not sure if my approach is correct. I am thinking of 
having the following code:
{code:java}
setMethod("write.partitionBy",
          signature(x = "SparkDataFrame"),
          function(x, ...) {
             jcols <- lapply(list(...), function(arg) {
               stopifnot(class(arg) == "character")
               arg
             })
            write <- callJMethod(x@sdf, "write")
            invisible(handledCallJMethod(write, "partitionBy", jcols))
          })
{code}
The method returns a DataFrameWriter, but it seems that the DataFrameWriter 
can't be used directly in R. The DataFrameWriter methods, for example, 
text(path: String), is implemented in R as write.text in DataFrame.R, so I am 
not sure if it's correct for me to return a DataFrameWriter for partitionBy. 

> R bucketBy partitionBy API
> --------------------------
>
>                 Key: SPARK-21291
>                 URL: https://issues.apache.org/jira/browse/SPARK-21291
>             Project: Spark
>          Issue Type: Improvement
>          Components: SparkR
>    Affects Versions: 2.2.0
>            Reporter: Felix Cheung
>            Priority: Major
>
> partitionBy exists but it's for windowspec only



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to