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: [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]