yujun777 commented on code in PR #55884:
URL: https://github.com/apache/doris/pull/55884#discussion_r2338363505
##########
fe/fe-core/src/test/java/org/apache/doris/nereids/rules/expression/rules/SimplifyComparisonPredicateTest.java:
##########
@@ -596,6 +596,17 @@ void testDoubleLiteral() {
new LessThan(bigIntSlot, new BigIntLiteral(13L)));
assertRewrite(new LessThanEqual(new Cast(bigIntSlot,
DoubleType.INSTANCE), new DoubleLiteral(12.3f)),
new LessThanEqual(bigIntSlot, new BigIntLiteral(12L)));
+
+ // big int and literal near no loss bound
+ double noLossBound = 9007199254740992.0;
+ assertRewrite(new EqualTo(new Cast(bigIntSlot, DoubleType.INSTANCE),
new DoubleLiteral(-noLossBound)),
+ new EqualTo(new Cast(bigIntSlot, DoubleType.INSTANCE), new
DoubleLiteral(-noLossBound)));
+ assertRewrite(new EqualTo(new Cast(bigIntSlot, DoubleType.INSTANCE),
new DoubleLiteral(-9007199254740991.0)),
+ new EqualTo(bigIntSlot, new
BigIntLiteral(-9007199254740991L)));
+ assertRewrite(new EqualTo(new Cast(bigIntSlot, DoubleType.INSTANCE),
new DoubleLiteral(9007199254740991.0)),
+ new EqualTo(bigIntSlot, new BigIntLiteral(9007199254740991L)));
+ assertRewrite(new EqualTo(new Cast(bigIntSlot, DoubleType.INSTANCE),
new DoubleLiteral(noLossBound)),
Review Comment:
have add float test
--
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]