pub mod aggregates {
pub use datafusion_expr_common::type_coercion::aggregates::*;
}
pub mod functions;
pub mod other;
pub use datafusion_expr_common::type_coercion::binary;
use arrow::datatypes::DataType;
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::Decimal32(_, _)
| DataType::Decimal64(_, _)
| DataType::Decimal128(_, _)
| DataType::Decimal256(_, _),
)
}
pub fn is_null(dt: &DataType) -> bool {
*dt == DataType::Null
}
pub fn is_timestamp(dt: &DataType) -> bool {
matches!(dt, DataType::Timestamp(_, _))
}
pub fn is_interval(dt: &DataType) -> bool {
matches!(dt, DataType::Interval(_))
}
pub fn is_datetime(dt: &DataType) -> bool {
matches!(
dt,
DataType::Date32 | DataType::Date64 | DataType::Timestamp(_, _)
)
}
pub fn is_utf8_or_utf8view_or_large_utf8(dt: &DataType) -> bool {
matches!(
dt,
DataType::Utf8 | DataType::Utf8View | DataType::LargeUtf8
)
}
pub fn is_decimal(dt: &DataType) -> bool {
matches!(
dt,
DataType::Decimal32(_, _)
| DataType::Decimal64(_, _)
| DataType::Decimal128(_, _)
| DataType::Decimal256(_, _)
)
}