Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-12234

SparkR subset throw error when only set "select" argument

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.6.0
    • SparkR
    • None

    Description

      SparkR subset function throw error when only set "select" argument, it's easy to repreduce.
      In SparkR:

      > 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
      

      But in base R, the subset function works well with only specifying "select" argument:

      > 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
      ......
      

      Attachments

        Activity

          People

            yanboliang Yanbo Liang
            yanboliang Yanbo Liang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: