You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Shivaram Venkataraman (JIRA)" <ji...@apache.org> on 2016/04/25 07:11:13 UTC

[jira] [Resolved] (SPARK-14883) Fix wrong R examples and make them up-to-date

     [ https://issues.apache.org/jira/browse/SPARK-14883?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shivaram Venkataraman resolved SPARK-14883.
-------------------------------------------
       Resolution: Fixed
    Fix Version/s: 2.0.0

Issue resolved by pull request 12649
[https://github.com/apache/spark/pull/12649]

> Fix wrong R examples and make them up-to-date
> ---------------------------------------------
>
>                 Key: SPARK-14883
>                 URL: https://issues.apache.org/jira/browse/SPARK-14883
>             Project: Spark
>          Issue Type: Bug
>          Components: Documentation, Examples
>            Reporter: Dongjoon Hyun
>             Fix For: 2.0.0
>
>
> This issue aims to fix some errors in R examples and make them up-to-date in docs and example modules.
> - Remove the wrong usage of map. We need to use `lapply` in `SparkR` if needed. However, `lapply` is private now. The correct usage will be added later.
> {code}
> -teenNames <- map(teenagers, function(p) { paste("Name:", p$name)})
> ...
> {code}
> - Fix the wrong example in Section `Generic Load/Save Functions` of `docs/sql-programming-guide.md` for consistency.
> {code}
> -df <- loadDF(sqlContext, "people.parquet")
> -saveDF(select(df, "name", "age"), "namesAndAges.parquet")
> +df <- read.df(sqlContext, "examples/src/main/resources/users.parquet")
> +write.df(select(df, "name", "favorite_color"), "namesAndFavColors.parquet")
> {code}
> - Fix datatypes in `sparkr.md`.
> {code}
> -#  |-- age: integer (nullable = true)
> +#  |-- age: long (nullable = true)
> {code}
> {code}
> -## DataFrame[eruptions:double, waiting:double]
> +## SparkDataFrame[eruptions:double, waiting:double]
> {code}
> - Update data results
> {code}
>  head(summarize(groupBy(df, df$waiting), count = n(df$waiting)))
>  ##  waiting count
> -##1      81    13
> -##2      60     6
> -##3      68     1
> +##1      70     4
> +##2      67     1
> +##3      69     2
> {code}
> - Replace deprecated functions: jsonFile -> read.json, parquetFile -> read.parquet
> {code}
> df <- jsonFile(sqlContext, "examples/src/main/resources/people.json")
> Warning message:
> 'jsonFile' is deprecated.
> Use 'read.json' instead.
> See help("Deprecated") 
> {code}
> - Use up-to-date R-like functions: loadDF -> read.df, saveDF -> write.df, saveAsParquetFile -> write.parquet
> - Replace `SparkR DataFrame` with `SparkDataFrame` in `dataframe.R` and `data-manipulation.R`.
> - Other minor syntax fixes and typos.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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