jayzhan211 commented on code in PR #11978:
URL: https://github.com/apache/datafusion/pull/11978#discussion_r1719925643
##########
datafusion/expr-common/src/columnar_value.rs:
##########
@@ -195,6 +214,10 @@ impl ColumnarValue {
kernels::cast::cast_with_options(array, cast_type,
&cast_options)?,
)),
ColumnarValue::Scalar(scalar) => {
+ if scalar.data_type().logically_eq(cast_type) {
Review Comment:
This function is also used in physical expr `CastExpr`. But we should not do
logical equality check for physical casting, we do actual arrow cast instead. I
think it makes sense to have 2 casting function, one do logical eq check, one
do actual casting.
With this, I think `into_array_of_type ` is no longer required
##########
datafusion/expr-common/src/columnar_value.rs:
##########
@@ -195,6 +214,10 @@ impl ColumnarValue {
kernels::cast::cast_with_options(array, cast_type,
&cast_options)?,
)),
ColumnarValue::Scalar(scalar) => {
+ if scalar.data_type().logically_eq(cast_type) {
Review Comment:
This function is also used in physical expr `CastExpr`. But we should not do
logical equality check for physical casting, we do actual arrow cast instead. I
think it makes sense to have 2 casting function, one do logical eq check, one
do actual casting.
With this, I think `into_array_of_type` is no longer required
--
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]