Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-6116 DataFrame API improvement umbrella ticket (Spark 1.5)
  3. SPARK-7321

Add Column expression for conditional statements (if, case)

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.0
    • Component/s: SQL
    • Labels:
      None
    • Sprint:
      Spark 1.5 doc/QA sprint

      Description

      A good reference implementation is http://www.jooq.org/doc/3.6/manual-single-page/#case-expressions

      As an example in Python:

      when(df.age == 1, "one").when(df.age == 2, "two").otherwise("unknown")
      

        Attachments

          Activity

            People

            • Assignee:
              smacat Chen Song
              Reporter:
              rxin Reynold Xin
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: