Skip to content

[SQL] Optimize nested if expressions with the same condition #5507

@mihaibudiu

Description

@mihaibudiu

The compiler generates code with the following shape:

if (x) {
   if (x) { a } else { b }
} else {
   c
}

This can be simplified to

if (x) {
    a
} else {
    c
}

This code appears especially in apply nodes, so it is not particularly performance sensitive.

Metadata

Metadata

Assignees

Labels

SQL compilerRelated to the SQL compiler

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions