We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 97441cc commit c0a69a7Copy full SHA for c0a69a7
datafusion/expr/src/expr.rs
@@ -1869,10 +1869,14 @@ mod test {
1869
let exp2 = col("a") + lit(2);
1870
let exp3 = !(col("a") + lit(2));
1871
1872
- assert!(exp1 < exp2);
1873
- assert!(exp2 > exp1);
1874
- assert!(exp2 > exp3);
1875
- assert!(exp3 < exp2);
+ // Since comparisons are done using hash value of the expression
+ // expr < expr2 may return false, or true. There is no guaranteed result.
+ // The only guarantee is "<" operator should have the opposite result of ">=" operator
+ let greater_or_equal = exp1 >= exp2;
1876
+ assert_eq!(exp1 < exp2, !greater_or_equal);
1877
+
1878
+ let greater_or_equal = exp3 >= exp2;
1879
+ assert_eq!(exp3 < exp2, !greater_or_equal);
1880
}
1881
1882
#[test]
0 commit comments