Skip to content

Commit

Permalink
revisit union interval logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ch-sc committed Feb 14, 2025
1 parent b4bd851 commit aaf116b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions datafusion/expr-common/src/interval_arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,9 @@ impl Interval {
};

// If the intervals overlap or touch, return a single merged interval
if (self.is_not_null() && rhs.is_not_null()) && self.upper >= rhs.lower
|| rhs.upper >= self.lower
if self.is_not_null()
&& rhs.is_not_null()
&& (self.upper >= rhs.lower || rhs.upper >= self.lower)
{
return Ok(Some(Self::new(lower_bound.unwrap(), upper_bound.unwrap())));
}
Expand Down

0 comments on commit aaf116b

Please sign in to comment.