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

Method nullable

datafusion/physical-expr/src/expressions/cast.rs:235–244  ·  view source on GitHub ↗
(&self, input_schema: &Schema)

Source from the content-addressed store, hash-verified

233 }
234
235 fn nullable(&self, input_schema: &Schema) -> Result<bool> {
236 // A cast is nullable if **either** the child is nullable or the
237 // target field allows nulls. This conservative rule prevents
238 // optimizers from assuming a non-null result when a null input could
239 // still propagate. `return_field()` continues to expose the exact
240 // target metadata separately.
241 let child_nullable = self.expr.nullable(input_schema)?;
242 let target_nullable = self.resolved_target_field(input_schema)?.is_nullable();
243 Ok(child_nullable || target_nullable)
244 }
245
246 fn evaluate(&self, batch: &RecordBatch) -> Result<ColumnarValue> {
247 let value = self.expr.evaluate(batch)?;

Callers

nothing calls this directly

Calls 2

resolved_target_fieldMethod · 0.80
is_nullableMethod · 0.45

Tested by

no test coverage detected