You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (JIRA)" <ji...@apache.org> on 2017/10/18 01:30:00 UTC

[jira] [Commented] (SPARK-17902) collect() ignores stringsAsFactors

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

Hyukjin Kwon commented on SPARK-17902:
--------------------------------------

Hi [~falaki] and [~shivaram], I was thinking a just simple way such as :

{quote}
if (stringsAsFactors) {
  df[sapply(df, is.character)] <- lapply(df[sapply(df, is.character)], as.factor)
}
{quote}

Would it make sense?

> collect() ignores stringsAsFactors
> ----------------------------------
>
>                 Key: SPARK-17902
>                 URL: https://issues.apache.org/jira/browse/SPARK-17902
>             Project: Spark
>          Issue Type: Bug
>          Components: SparkR
>    Affects Versions: 2.0.1
>            Reporter: Hossein Falaki
>
> `collect()` function signature includes an optional flag named `stringsAsFactors`. It seems it is completely ignored.
> {code}
> str(collect(createDataFrame(iris), stringsAsFactors = TRUE)))
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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