Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
xzhseh committed Feb 3, 2024
1 parent 2d2f412 commit 4d9cd6c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
11 changes: 9 additions & 2 deletions src/frontend/src/binder/expr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,10 @@ impl Binder {
}

// Otherwise this will eventually go through fallback arm
debug_assert!(constant_case_when_eval_inputs.is_empty(), "expect `inputs` to be empty");
debug_assert!(
constant_case_when_eval_inputs.is_empty(),
"expect `inputs` to be empty"
);

let Some(fallback) = fallback else {
return false;
Expand Down Expand Up @@ -602,7 +605,11 @@ impl Binder {
);

if constant_case_when_flag {
return Ok(FunctionCall::new(ExprType::ConstantLookup, constant_case_when_eval_inputs)?.into());
return Ok(FunctionCall::new(
ExprType::ConstantLookup,
constant_case_when_eval_inputs,
)?
.into());
}

// See if the case-when expression can be optimized
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

use risingwave_common::error::RwError;

use crate::expr::{ExprImpl, ExprRewriter, FunctionCall, ExprType};
use crate::expr::{ExprImpl, ExprRewriter, ExprType, FunctionCall};

pub struct ConstCaseWhenRewriter {
pub error: Option<RwError>,
Expand All @@ -31,4 +31,4 @@ impl ExprRewriter for ConstCaseWhenRewriter {
}
func_call.inputs()[0].clone().into()
}
}
}
4 changes: 2 additions & 2 deletions src/frontend/src/optimizer/plan_expr_rewriter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

mod const_case_when_rewriter;
mod const_eval_rewriter;
mod cse_rewriter;
mod const_case_when_rewriter;

pub(crate) use const_case_when_rewriter::ConstCaseWhenRewriter;
pub(crate) use const_eval_rewriter::ConstEvalRewriter;
pub(crate) use cse_rewriter::CseRewriter;
pub(crate) use const_case_when_rewriter::ConstCaseWhenRewriter;
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ impl ConstCaseWhenEvalRule {
pub fn create() -> BoxedRule {
Box::new(ConstCaseWhenEvalRule {})
}
}
}

0 comments on commit 4d9cd6c

Please sign in to comment.