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 2021/07/12 20:03:37 UTC

[GitHub] [incubator-doris] xy720 commented on a change in pull request #6096: [Bug] Fix bug that nondeterministic functions should not be rewrote in create view stmt

xy720 commented on a change in pull request #6096:
URL: https://github.com/apache/incubator-doris/pull/6096#discussion_r667986535



##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/CreateViewStmt.java
##########
@@ -63,6 +63,11 @@ public void analyze(Analyzer analyzer) throws UserException {
             ErrorReport.reportAnalysisException(ErrorCode.ERR_SPECIFIC_ACCESS_DENIED_ERROR, "CREATE");
         }
 
+        // Do not rewrite nondeterministic functions to constant in create view's def stmt
+        if (ConnectContext.get() != null) {
+            ConnectContext.get().setNotEvalNondeterministicFunction(true);

Review comment:
       When will it set back to false?

##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/CreateViewStmt.java
##########
@@ -63,6 +63,11 @@ public void analyze(Analyzer analyzer) throws UserException {
             ErrorReport.reportAnalysisException(ErrorCode.ERR_SPECIFIC_ACCESS_DENIED_ERROR, "CREATE");
         }
 
+        // Do not rewrite nondeterministic functions to constant in create view's def stmt
+        if (ConnectContext.get() != null) {
+            ConnectContext.get().setNotEvalNondeterministicFunction(true);

Review comment:
       Will it be set back to false after statement finish?

##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/CreateViewStmt.java
##########
@@ -63,6 +63,11 @@ public void analyze(Analyzer analyzer) throws UserException {
             ErrorReport.reportAnalysisException(ErrorCode.ERR_SPECIFIC_ACCESS_DENIED_ERROR, "CREATE");
         }
 
+        // Do not rewrite nondeterministic functions to constant in create view's def stmt
+        if (ConnectContext.get() != null) {
+            ConnectContext.get().setNotEvalNondeterministicFunction(true);

Review comment:
       Will it be set back to false after statement is executed?




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