Skip to content
Snippets Groups Projects
  • Reynold Xin's avatar
    cbbcd8e4
    [SPARK-12791][SQL] Simplify CaseWhen by breaking "branches" into "conditions" and "values" · cbbcd8e4
    Reynold Xin authored
    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.
    cbbcd8e4
    History
    [SPARK-12791][SQL] Simplify CaseWhen by breaking "branches" into "conditions" and "values"
    Reynold Xin authored
    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.