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/05/07 10:31:24 UTC

[GitHub] [incubator-doris] stalary commented on a diff in pull request #9206: [feature]: support row policy filter

stalary commented on code in PR #9206:
URL: https://github.com/apache/incubator-doris/pull/9206#discussion_r867336077


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/StmtRewriter.java:
##########
@@ -1141,5 +1147,49 @@ private static Expr createJoinConjunct(Expr exprWithSubquery, InlineViewRef inli
         smap.put(subquery, subquerySubstitute);
         return exprWithSubquery.substitute(smap, analyzer, false);
     }
+    
+    public static void rewriteByPolicy(StatementBase statementBase, Analyzer analyzer) throws UserException {
+        Catalog currentCatalog = Catalog.getCurrentCatalog();
+        if (!(statementBase instanceof SelectStmt)) {
+            return;
+        }
+        SelectStmt selectStmt = (SelectStmt) statementBase;
+        for (int i = 0; i < selectStmt.fromClause_.size(); i++) {
+            TableRef tableRef = selectStmt.fromClause_.get(i);
+            if (tableRef instanceof InlineViewRef) {
+                InlineViewRef viewRef = (InlineViewRef) tableRef;
+                rewriteByPolicy(viewRef.getQueryStmt(), analyzer);
+            }
+            // has been rewrite
+            if (tableRef instanceof InlineViewRef) {
+                continue;

Review Comment:
   I'm going to modify it



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