github-actions[bot] commented on code in PR #67893:
URL: https://github.com/apache/doris/pull/67893#discussion_r4003609670
##########
fe/fe-core/src/test/java/org/apache/doris/nereids/rules/expression/rules/SimplifyComparisonPredicateTest.java:
##########
@@ -1091,6 +1091,24 @@ void testTypeRangeLimitPreservesCastNullability() {
ExpressionUtils.trueOrNull(nullableCast));
}
+ SlotReference nonNullableInt = new SlotReference("int_slot",
IntegerType.INSTANCE, false);
+ DecimalV3Type narrowDecimal = DecimalV3Type.createDecimalV3Type(2, 0);
+ DecimalV3Literal decimalMin = new DecimalV3Literal(new
BigDecimal("-99"));
+ DecimalV3Literal decimalMax = new DecimalV3Literal(new
BigDecimal("99"));
+ List<Cast> nullableDecimalCasts = ImmutableList.of(
+ new Cast(nonNullableInt, narrowDecimal),
+ new TryCast(nonNullableInt, narrowDecimal));
+ for (Cast nullableCast : nullableDecimalCasts) {
Review Comment:
[P1] Cover the strict null-safe-equality path before treating this range
logic as guarded.
With `enable_strict_cast=true`, both `cast(id as decimalv3(2,0)) <=> 100`
and the scaled form `<=> 99.1` are coerced through an outer safe decimal cast.
The former returns bare `FALSE` from the range-limit `NullSafeEqual` branch;
the latter does so earlier when `99.1` cannot be represented at the inner
scale. Both paths drop the inner narrowing cast, so for `id = 100` or `-100`,
rule-off execution raises the required overflow while rule-on returns `FALSE`
without evaluating it. Please audit all `NullSafeEqual -> FALSE` exits when a
potentially failing Cast/TryCast remains, and add exact-AST plus strict `test {
sql; exception }` rule-on/rule-off coverage.
--
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]