You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/06/29 06:57:37 UTC

[GitHub] [doris] yinzhijian commented on a diff in pull request #10377: [feature](nereids) Add brackets expr and ssbSql and inPredicate Expr

yinzhijian commented on code in PR #10377:
URL: https://github.com/apache/doris/pull/10377#discussion_r909264103


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -567,13 +578,26 @@ public Expression withPredicate(PredicateContext ctx, Expression e) {
      * @return Expression
      */
     public Expression withBetween(PredicateContext ctx, Expression e) {
-        boolean isNotBetween = ctx.NOT() != null ? true : false;
         BetweenPredicate betweenPredicate = new BetweenPredicate(
                 e,
                 expression(ctx.lower),
                 expression(ctx.upper)
         );
-        return isNotBetween ? new Not(betweenPredicate) : betweenPredicate;
+        return betweenPredicate;
+    }
+
+    /**
+     * Generate In predicate.
+     *
+     * @param ctx PredicateContext
+     * @param e Expression
+     * @return Expression
+     */
+    public Expression withIn(PredicateContext ctx, Expression e) {
+        List<Expression> expressions = ctx.expression().stream()
+                .map(expr -> expression(expr)).collect(ImmutableList.toImmutableList());
+        InPredicate inPredicate = new InPredicate(e, expressions);
+        return inPredicate;

Review Comment:
   ```suggestion
           return new InPredicate(e, expressions);
   ```



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org