You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/01/20 02:13:09 UTC
[GitHub] [arrow-datafusion] liukun4515 commented on a change in pull request #1607: consolidate binary_expr coercion rule code into `binary_rule.rs` module
liukun4515 commented on a change in pull request #1607:
URL: https://github.com/apache/arrow-datafusion/pull/1607#discussion_r788294707
##########
File path: datafusion/src/physical_plan/coercion_rule/binary_rule.rs
##########
@@ -293,14 +289,192 @@ fn coercion_decimal_mathematics_type(
}
}
+/// Determine if a DataType is signed numeric or not
+pub fn is_signed_numeric(dt: &DataType) -> bool {
Review comment:
https://github.com/apache/arrow-datafusion/issues/1613
##########
File path: datafusion/src/physical_plan/coercion_rule/binary_rule.rs
##########
@@ -293,14 +289,192 @@ fn coercion_decimal_mathematics_type(
}
}
+/// Determine if a DataType is signed numeric or not
+pub fn is_signed_numeric(dt: &DataType) -> bool {
+ matches!(
+ dt,
+ DataType::Int8
+ | DataType::Int16
+ | DataType::Int32
+ | DataType::Int64
+ | DataType::Float16
+ | DataType::Float32
+ | DataType::Float64
+ | DataType::Decimal(_, _)
+ )
+}
+
+/// Determine if a DataType is numeric or not
+pub fn is_numeric(dt: &DataType) -> bool {
Review comment:
https://github.com/apache/arrow-datafusion/issues/1613
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org