You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Deborah Siegel (JIRA)" <ji...@apache.org> on 2015/08/26 23:04:45 UTC
[jira] [Comment Edited] (SPARK-9316) Add support for filtering
using `[` (synonym for filter / select)
[ https://issues.apache.org/jira/browse/SPARK-9316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14715472#comment-14715472 ]
Deborah Siegel edited comment on SPARK-9316 at 8/26/15 9:03 PM:
----------------------------------------------------------------
Hi. I just built spark from the latest github today.
This worked as expected:
>subsetdf <- df[df$name == "Andy", c(1,2)]
However, with all due respect, got some errors.
>subsetdf <- df[df$age %in% c(19, 30), 1:2]
Error in df[df$age %in% c(19, 30), 1:2] :
error in evaluating the argument 'i' in selecting a method for function '[': Error in match(x, table, nomatch = 0L) :
'match' requires vector arguments
the following filter worked previously for me:
>subsetdf <- filter(df, "age in (19, 30)")
so I tried this syntax, which gave different error:
> subsetdf <- df["age in (19, 30),1:2"]
Error in df["age in (19, 30),1:2"] :
object of type 'S4' is not subsettable
was (Author: dsiegel):
Hi. I just built spark from the latest github today.
This worked as expected:
>subsetdf <- df[df$name == "Andy", c(1,2)]
However, not sure about this:
>subsetdf <- df[df$age %in% c(19, 30), 1:2]
Error in df[df$age %in% c(19, 30), 1:2] :
error in evaluating the argument 'i' in selecting a method for function '[': Error in match(x, table, nomatch = 0L) :
'match' requires vector arguments
the following filter works for me:
>subsetdf <- filter(df, "age in (19, 30)")
so I tried this syntax, which didn't work:
> subsetdf <- df["age in (19, 30),1:2"]
Error in df["age in (19, 30),1:2"] :
object of type 'S4' is not subsettable
> Add support for filtering using `[` (synonym for filter / select)
> -----------------------------------------------------------------
>
> Key: SPARK-9316
> URL: https://issues.apache.org/jira/browse/SPARK-9316
> Project: Spark
> Issue Type: Sub-task
> Components: SparkR
> Reporter: Shivaram Venkataraman
> Assignee: Felix Cheung
> Fix For: 1.6.0, 1.5.1
>
>
> Will help us support queries of the form
> {code}
> air[air$UniqueCarrier %in% c("UA", "HA"), c(1,2,3,5:9)]
> {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