morrySnow commented on code in PR #38623:
URL: https://github.com/apache/doris/pull/38623#discussion_r1698508371
##########
regression-test/suites/nereids_syntax_p0/sql/test_compare_expression.sql:
##########
@@ -34,3 +34,28 @@ select 1 not in (null, 2);
select timestamp '2008-08-08 00:00:00' in ('2008-08-08');
select case when true then timestamp '2008-08-08 00:00:00' else '2008-08-08'
end;
+select 1 is true, 1 is not true, 0 is true, 0 is not true;
+
+
+
+
+
+SET enable_nereids_planner=false;
Review Comment:
do not test legacy planner explicitly, because we will remove it soon
##########
fe/fe-core/src/main/java/org/apache/doris/backup/Untitled-2.cs:
##########
@@ -0,0 +1,254 @@
++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Review Comment:
what's this?
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -3338,6 +3338,18 @@ private Expression withPredicate(Expression
valueExpression, PredicateContext ct
case DorisParser.NULL:
outExpression = new IsNull(valueExpression);
break;
+ case DorisParser.TRUE:
+ outExpression = new EqualTo(
+ valueExpression,
+ BooleanLiteral.of(1)
+ );
Review Comment:
i think should cast left to boolean explicitily
##########
regression-test/suites/nereids_syntax_p0/sql/test_compare_expression.sql:
##########
@@ -34,3 +34,28 @@ select 1 not in (null, 2);
select timestamp '2008-08-08 00:00:00' in ('2008-08-08');
select case when true then timestamp '2008-08-08 00:00:00' else '2008-08-08'
end;
+select 1 is true, 1 is not true, 0 is true, 0 is not true;
+
+
+
+
+
+SET enable_nereids_planner=false;
+
+select 1 in (1, null);
+select 1 in (2, null);
+
+select 1 not in (1, null);
+select 1 not in (2, null);
+
+select 1 in (2, null, 1);
+select 1 in (null, 2);
+
+select 1 not in (null, 1);
+select 1 not in (null, 2);
Review Comment:
add all type with `is (not) true | false`
--
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]