Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ch-sc committed Dec 19, 2024
1 parent a2d97eb commit aac7baf
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions datafusion/expr/src/interval_arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -846,10 +846,13 @@ pub fn apply_operator(op: &Operator, lhs: &Interval, rhs: &Interval) -> Result<I
Operator::Multiply => lhs.mul(rhs),
Operator::Divide => lhs.div(rhs),
Operator::IsDistinctFrom | Operator::IsNotDistinctFrom => {
let nullable_interval = NullableInterval::from(lhs).apply_operator(op, &NullableInterval::from(rhs));
nullable_interval.and_then(|x|x.values()
.cloned()
.ok_or(DataFusionError::Internal("Unexpected null value interval".to_string())))
let nullable_interval = NullableInterval::from(lhs)
.apply_operator(op, &NullableInterval::from(rhs));
nullable_interval.and_then(|x| {
x.values().cloned().ok_or(DataFusionError::Internal(
"Unexpected null value interval".to_string(),
))
})
}
_ => internal_err!("Interval arithmetic does not support the operator {op}"),
}
Expand Down Expand Up @@ -1581,7 +1584,9 @@ impl From<&Interval> for NullableInterval {
datatype: value.data_type(),
}
} else {
Self::MaybeNull { values: value.clone() }
Self::MaybeNull {
values: value.clone(),
}
}
}
}
Expand Down

0 comments on commit aac7baf

Please sign in to comment.