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/04/18 07:20:25 UTC

[GitHub] [incubator-doris] EmmyMiao87 commented on a diff in pull request #9050: [feature](optimizer): spilt implicit `is not null`

EmmyMiao87 commented on code in PR #9050:
URL: https://github.com/apache/incubator-doris/pull/9050#discussion_r851938464


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/SelectStmt.java:
##########
@@ -603,14 +604,92 @@ public List<TupleId> collectTupleIds() {
         return result;
     }
 
-    private void whereClauseRewrite() {
+    private void rewriteWhereClause() {
         if (whereClause instanceof IntLiteral) {
             if (((IntLiteral) whereClause).getLongValue() == 0) {
                 whereClause = new BoolLiteral(false);
             } else {
                 whereClause = new BoolLiteral(true);
             }
         }
+
+        whereClause = inferIsNotNull(whereClause);
+    }
+
+    /*-
+     * Infer `IS NOT NULL` from predicate in whereClause.
+     * And spilt it into two parts.
+     * Example:
+     * Where col > 0; -> Where col > 0 and col is not null;
+     */
+    private Expr inferIsNotNull(Expr expr) {

Review Comment:
   It should be a new Rule ~



-- 
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