You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Yanbo Liang (JIRA)" <ji...@apache.org> on 2015/12/09 07:37:10 UTC
[jira] [Updated] (SPARK-12234) SparkR subset throw error when only
set "select" argument
[ https://issues.apache.org/jira/browse/SPARK-12234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yanbo Liang updated SPARK-12234:
--------------------------------
Description:
SparkR subset throw error when only set "select" argument, it's easy to repreduce.
In SparkR:
{code}
> df <- suppressWarnings(createDataFrame(sqlContext, iris))
> subset(df, select=c("Sepal_Length", "Petal_Length", "Species"))
Error in x[subset, select, ...] :
error in evaluating the argument 'i' in selecting a method for function '[': Error: argument "subset" is missing, with no default
{code}
But in base R, the subset function works well with only specifying "select" argument:
{code}
> df <- iris
> subset(df, select=c("Sepal.Length", "Petal.Length", "Species"))
Sepal.Length Petal.Length Species
1 5.1 1.4 setosa
2 4.9 1.4 setosa
3 4.7 1.3 setosa
4 4.6 1.5 setosa
5 5.0 1.4 setosa
......
{code}
was:SparkR subset throw error when only set "select" argument
> SparkR subset throw error when only set "select" argument
> ---------------------------------------------------------
>
> Key: SPARK-12234
> URL: https://issues.apache.org/jira/browse/SPARK-12234
> Project: Spark
> Issue Type: Bug
> Components: SparkR
> Reporter: Yanbo Liang
>
> SparkR subset throw error when only set "select" argument, it's easy to repreduce.
> In SparkR:
> {code}
> > df <- suppressWarnings(createDataFrame(sqlContext, iris))
> > subset(df, select=c("Sepal_Length", "Petal_Length", "Species"))
> Error in x[subset, select, ...] :
> error in evaluating the argument 'i' in selecting a method for function '[': Error: argument "subset" is missing, with no default
> {code}
> But in base R, the subset function works well with only specifying "select" argument:
> {code}
> > df <- iris
> > subset(df, select=c("Sepal.Length", "Petal.Length", "Species"))
> Sepal.Length Petal.Length Species
> 1 5.1 1.4 setosa
> 2 4.9 1.4 setosa
> 3 4.7 1.3 setosa
> 4 4.6 1.5 setosa
> 5 5.0 1.4 setosa
> ......
> {code}
--
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