github-actions[bot] commented on code in PR #64696:
URL: https://github.com/apache/doris/pull/64696#discussion_r3459281466
##########
regression-test/data/query_p0/sql_functions/test_is_true_false_predicate.out:
##########
@@ -0,0 +1,20 @@
+-- This file is automatically generated. You should know what you did if you
want to edit this
+-- !is_true --
+1
+
+-- !is_false --
+2
+
+-- !is_not_true --
+2
+3
+
+-- !is_not_false --
+1
+3
+
+-- !truth_table --
+1 true false false true
+2 false true true false
+3 false false true true
+
Review Comment:
fails on this new output file: Please regenerate or trim the file so it
ends at the last expected result row.
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/ExpressionAnalyzer.java:
##########
@@ -939,6 +942,22 @@ public Expression visitBetween(Between between,
ExpressionRewriteContext context
}
}
+ @Override
+ public Expression visitIsTrue(IsTrue isTrue, ExpressionRewriteContext
context) {
+ Expression child = isTrue.child().accept(this, context);
+ return new And(
Review Comment:
This lowering still is not equivalent to a two-valued predicate. Doris'
varchar-to-boolean cast returns NULL for non-NULL strings such as , so becomes
; the inner is NULL and the outer stays NULL, even though the new / nodes are
declared . It also evaluates twice because the same expression is placed under
both and ; an observable example is , where FE does not mark volatile and BE
actually sleeps for each evaluation. Please lower through a single, null-safe
boolean result (or keep a first-class operator until execution) and add
regression coverage for non-boolean operands that cast to true, false, NULL,
and SQL NULL, including the forms.
--
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]