irenjj commented on PR #17110:
URL: https://github.com/apache/datafusion/pull/17110#issuecomment-3230232039
> duckdb has a notion of `PropagatesNullValues`, i wonder if we have some
thing similar
>
> ```
> impl ExprSchemable for Expr {
> fn nullable(&self, input_schema: &dyn ExprSchema) -> Result<bool> {
> ```
>
> we have something like this, but they are quite different i believe
We can follow the main function in duckdb:
```cpp
bool Expression::PropagatesNullValues() const {
if (type == ExpressionType::OPERATOR_IS_NULL || type ==
ExpressionType::OPERATOR_IS_NOT_NULL ||
type == ExpressionType::COMPARE_NOT_DISTINCT_FROM || type ==
ExpressionType::COMPARE_DISTINCT_FROM ||
type == ExpressionType::CONJUNCTION_OR || type ==
ExpressionType::CONJUNCTION_AND ||
type == ExpressionType::OPERATOR_COALESCE || type ==
ExpressionType::CASE_EXPR) {
return false;
}
bool propagate_null_values = true;
ExpressionIterator::EnumerateChildren(*this, [&](const Expression
&child) {
if (!child.PropagatesNullValues()) {
propagate_null_values = false;
}
});
return propagate_null_values;
}
``
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]