Skip to content

Commit

Permalink
remove mysterious code snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
xzhseh committed Feb 4, 2024
1 parent b74d18c commit 6798822
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/frontend/src/binder/expr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,12 +493,6 @@ impl Binder {
let Ok(operand) = self.bind_expr_inner(*operand) else {
return false;
};
// This optimization should be done in subsequent optimization phase
// if the operand is const
// e.g., select case 1 when 1 then 114514 else 1919810 end;
if operand.is_const() {
return false;
}
constant_lookup_inputs.push(operand);
} else {
return false;
Expand All @@ -512,7 +506,7 @@ impl Binder {
constant_lookup_inputs.push(input);
} else {
// If at least one condition is not in the simple form / not constant,
// we can NOT do the subsequent optimization pass
// we can NOT do the subsequent optimization then
return false;
}

Expand Down Expand Up @@ -544,7 +538,6 @@ impl Binder {
.transpose()?;

let mut constant_lookup_inputs = Vec::new();
let mut constant_case_when_eval_inputs = Vec::new();

// See if the case-when expression can be optimized
let optimize_flag = self.check_bind_case_optimization(
Expand Down

0 comments on commit 6798822

Please sign in to comment.