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

SparkR subset throw error when only set "select" argument

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.0
    • Component/s: SparkR
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: