comphead commented on code in PR #10203:
URL: https://github.com/apache/datafusion/pull/10203#discussion_r1576834547
##########
datafusion/optimizer/src/analyzer/type_coercion.rs:
##########
@@ -530,31 +527,30 @@ fn coerce_window_frame(
}
WindowFrameUnits::Rows | WindowFrameUnits::Groups => &DataType::UInt64,
};
- window_frame.start_bound =
- coerce_frame_bound(target_type, &window_frame.start_bound)?;
- window_frame.end_bound = coerce_frame_bound(target_type,
&window_frame.end_bound)?;
+ window_frame.start_bound = coerce_frame_bound(target_type,
window_frame.start_bound)?;
+ window_frame.end_bound = coerce_frame_bound(target_type,
window_frame.end_bound)?;
Ok(window_frame)
}
// Support the `IsTrue` `IsNotTrue` `IsFalse` `IsNotFalse` type coercion.
// The above op will be rewrite to the binary op when creating the physical op.
-fn get_casted_expr_for_bool_op(expr: &Expr, schema: &DFSchemaRef) ->
Result<Expr> {
+fn get_casted_expr_for_bool_op(expr: Expr, schema: &DFSchemaRef) ->
Result<Expr> {
let left_type = expr.get_type(schema)?;
get_input_types(&left_type, &Operator::IsDistinctFrom,
&DataType::Boolean)?;
- cast_expr(expr, &DataType::Boolean, schema)
+ expr.cast_to(&DataType::Boolean, schema)
}
/// Returns `expressions` coerced to types compatible with
/// `signature`, if possible.
///
/// See the module level documentation for more detail on coercion.
fn coerce_arguments_for_signature(
- expressions: &[Expr],
+ expressions: Vec<Expr>,
Review Comment:
I always thought having less possible coercible type is preferred 🤔
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]