(
left: Arc<dyn PhysicalExpr>,
op: Operator,
right: Arc<dyn PhysicalExpr>,
schema: &Schema,
)
| 233 | use datafusion_physical_expr_common::physical_expr::PhysicalExpr; |
| 234 | |
| 235 | pub fn binary_expr( |
| 236 | left: Arc<dyn PhysicalExpr>, |
| 237 | op: Operator, |
| 238 | right: Arc<dyn PhysicalExpr>, |
| 239 | schema: &Schema, |
| 240 | ) -> Result<Arc<dyn PhysicalExpr>> { |
| 241 | let left_type = left.data_type(schema)?; |
| 242 | let right_type = right.data_type(schema)?; |
| 243 | let binary_type_coercer = BinaryTypeCoercer::new(&left_type, &op, &right_type); |
| 244 | let (lhs, rhs) = binary_type_coercer.get_input_types()?; |
| 245 | |
| 246 | let left_expr = try_cast(left, schema, lhs)?; |
| 247 | let right_expr = try_cast(right, schema, rhs)?; |
| 248 | binary(left_expr, op, right_expr, schema) |
| 249 | } |
| 250 | |
| 251 | #[test] |
| 252 | fn test_stats_integration() -> Result<()> { |
searching dependent graphs…