Skip to content

Commit 08cdacc

Browse files
committed
fix: uses ScalarValue::try_cmp
See apache#16624
1 parent 942bab8 commit 08cdacc

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

datafusion/optimizer/src/simplify_expressions/simplify_predicates.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ fn find_most_restrictive_predicate(
204204

205205
if let Some(scalar) = scalar_value {
206206
if let Some(current_best) = best_value {
207-
<<<<<<< HEAD
208207
let comparison = scalar.try_cmp(current_best)?;
209208
let is_better = if find_greater {
210209
comparison == std::cmp::Ordering::Greater
@@ -215,20 +214,12 @@ fn find_most_restrictive_predicate(
215214
|| (comparison == std::cmp::Ordering::Equal
216215
&& op == &Operator::Lt)
217216
};
218-
=======
219-
if let Some(comparison) = scalar.partial_cmp(current_best) {
220-
let is_better = if find_greater {
221-
comparison == std::cmp::Ordering::Greater
222-
} else {
223-
comparison == std::cmp::Ordering::Less
224-
};
225-
>>>>>>> origin/branch-51
226217

227218
if is_better {
228219
best_value = Some(scalar);
229220
most_restrictive_idx = idx;
230221
}
231-
}
222+
232223
} else {
233224
best_value = Some(scalar);
234225
most_restrictive_idx = idx;

0 commit comments

Comments
 (0)