You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Reynold Xin (JIRA)" <ji...@apache.org> on 2015/05/08 00:53:00 UTC
[jira] [Comment Edited] (SPARK-7435) Make DataFrame.show()
consistent with that of Scala and pySpark
[ https://issues.apache.org/jira/browse/SPARK-7435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14533478#comment-14533478 ]
Reynold Xin edited comment on SPARK-7435 at 5/7/15 10:52 PM:
-------------------------------------------------------------
The problem with this is that `show` is a reserved keyword in R -- the show method gets called when you just type in the name of a variable. For example if we have
{code}
> df <- jsonFile(sqlCtx, "./examples/src/main/resources/people.json")
> df
DataFrame[age:bigint, name:string]
{code}
So this print statement comes from `show` here and we should maintain this behavior as this is similar to the behavior in spark-shell, pyspark and is natural.
Actually I might be in favor of getting rid of `showDF` -- We already have `head` which does the same thing ?
was (Author: shivaram):
The problem with this is that `show` is a reserved keyword in R -- the show method gets called when you just type in the name of a variable. For example if we have
```
> df <- jsonFile(sqlCtx, "./examples/src/main/resources/people.json")
> df
DataFrame[age:bigint, name:string]
```
So this print statement comes from `show` here and we should maintain this behavior as this is similar to the behavior in spark-shell, pyspark and is natural.
Actually I might be in favor of getting rid of `showDF` -- We already have `head` which does the same thing ?
> Make DataFrame.show() consistent with that of Scala and pySpark
> ---------------------------------------------------------------
>
> Key: SPARK-7435
> URL: https://issues.apache.org/jira/browse/SPARK-7435
> Project: Spark
> Issue Type: Improvement
> Components: SparkR
> Affects Versions: 1.4.0
> Reporter: Sun Rui
> Priority: Blocker
>
> Currently in SparkR, DataFrame has two methods show() and showDF(). show() prints the DataFrame column names and types and showDF() prints the first numRows rows of a DataFrame.
> In Scala and pySpark, show() is used to prints rows of a DataFrame.
> We'd better keep API consistent unless there is some important reason. So propose to interchange the names (show() and showDF()) in SparkR.
--
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