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

Add `ifelse` Column function to SparkR

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.5.0
    • SparkR
    • None

    Description

      Add a column function on a DataFrame like `ifelse` in R to SparkR.
      I guess we could implement it with a combination with when and otherwise.

      Example

      If df$x > 0 is TRUE, then return 0, otherwise return 1.

      ifelse(df$x > 0, 0, 1)
      

      Attachments

        Activity

          People

            yuu.ishikawa@gmail.com Yu Ishikawa
            yuu.ishikawa@gmail.com Yu Ishikawa
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: