morrySnow commented on code in PR #14733:
URL: https://github.com/apache/doris/pull/14733#discussion_r1038158609


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/CascadesContext.java:
##########
@@ -197,4 +205,70 @@ private CascadesContext execute(Job job) {
         jobScheduler.executeJobPool(this);
         return this;
     }
+
+    public void addToTable(Table table) {
+        tables.add(table);
+    }
+
+    public void lockTableOnRead() {
+        for (Table t : tables) {
+            t.readLock();
+        }
+    }
+
+    public void releaseTableReadLock() {
+        for (Table t : tables) {
+            t.readUnlock();
+        }
+    }
+
+    /**
+     * Find all tables to lock on.
+     */
+    public void extractTables() {

Review Comment:
   add UT to ensure we could lock all tables when statement has view, cte, 
subquery in from clause and subquery in where/having clause



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/CascadesContext.java:
##########
@@ -197,4 +205,70 @@ private CascadesContext execute(Job job) {
         jobScheduler.executeJobPool(this);
         return this;
     }
+
+    public void addToTable(Table table) {

Review Comment:
   ```suggestion
       public void addTable(Table table) {
   ```



-- 
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-unsubscr...@doris.apache.org

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


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

Reply via email to