liukun4515 commented on code in PR #4149:
URL: https://github.com/apache/arrow-datafusion/pull/4149#discussion_r1021063144


##########
datafusion/optimizer/src/unwrap_cast_in_comparison.rs:
##########
@@ -292,6 +296,25 @@ fn is_support_data_type(data_type: &DataType) -> bool {
     )
 }
 
+fn is_decimal_type(dt: &DataType) -> bool {
+    matches!(dt, DataType::Decimal128(_, _))
+}
+
+fn is_unsigned_type(dt: &DataType) -> bool {
+    matches!(
+        dt,
+        DataType::UInt8 | DataType::UInt16 | DataType::UInt32 | 
DataType::UInt64
+    )
+}
+
+/// Until https://github.com/apache/arrow-rs/issues/1043 is done
+/// (support for unsigned <--> decimal casts) we also don't do that
+/// kind of cast in this optimizer
+fn is_unsupported_cast(dt1: &DataType, dt2: &DataType) -> bool {

Review Comment:
   Casting for `unsigned value <-> decimal ` is not supported now.



-- 
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]

Reply via email to