Skip to content
Snippets Groups Projects
Commit cbbcd8e4 authored by Reynold Xin's avatar Reynold Xin
Browse files

[SPARK-12791][SQL] Simplify CaseWhen by breaking "branches" into "conditions" and "values"

This pull request rewrites CaseWhen expression to break the single, monolithic "branches" field into a sequence of tuples (Seq[(condition, value)]) and an explicit optional elseValue field.

Prior to this pull request, each even position in "branches" represents the condition for each branch, and each odd position represents the value for each branch. The use of them have been pretty confusing with a lot sliding windows or grouped(2) calls.

Author: Reynold Xin <rxin@databricks.com>

Closes #10734 from rxin/simplify-case.
parent c2ea79f9
No related branches found
No related tags found
No related merge requests found
Showing
with 156 additions and 138 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment