MCPcopy Create free account
hub / github.com/apache/datafusion / binary_expr

Function binary_expr

datafusion/physical-expr/src/statistics/stats_solver.rs:235–249  ·  view source on GitHub ↗
(
        left: Arc<dyn PhysicalExpr>,
        op: Operator,
        right: Arc<dyn PhysicalExpr>,
        schema: &Schema,
    )

Source from the content-addressed store, hash-verified

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<()> {

Callers 1

test_stats_integrationFunction · 0.70

Calls 5

newFunction · 0.85
binaryFunction · 0.85
get_input_typesMethod · 0.80
try_castFunction · 0.50
data_typeMethod · 0.45

Tested by 1

test_stats_integrationFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…