You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2018/11/07 05:46:36 UTC

[kylin] branch master updated: KYLIN-3663 fix deleting project error when project has more than one table

This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/master by this push:
     new c154201  KYLIN-3663 fix deleting project error when project has more than one table
c154201 is described below

commit c1542015776bb6bb86225791c4da3caf37d908a8
Author: Rongchuan Jin <ro...@RongchuanJins-MacBook-Pro.local>
AuthorDate: Fri Nov 2 14:41:04 2018 +0800

    KYLIN-3663 fix deleting project error when project has more than one table
---
 .../src/main/java/org/apache/kylin/rest/service/ProjectService.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/server-base/src/main/java/org/apache/kylin/rest/service/ProjectService.java b/server-base/src/main/java/org/apache/kylin/rest/service/ProjectService.java
index 831035a..2677578 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/service/ProjectService.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/service/ProjectService.java
@@ -28,6 +28,7 @@ import java.util.Set;
 
 import javax.annotation.Nullable;
 
+import com.google.common.collect.Sets;
 import org.apache.directory.api.util.Strings;
 import org.apache.kylin.metadata.project.ProjectInstance;
 import org.apache.kylin.metadata.realization.RealizationType;
@@ -137,8 +138,10 @@ public class ProjectService extends BasicService {
     @PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN)
     public void deleteProject(String projectName, ProjectInstance project) throws IOException {
         Set<String> tables = project.getTables();
-        for (String table : tables) {
+        for (String table : Sets.newTreeSet(tables)) {
             tableService.unloadHiveTable(table, projectName);
+            getTableManager().removeTableExt(table, projectName);
+            getTableACLManager().deleteTableACLByTbl(projectName, table);
         }
         getProjectManager().dropProject(projectName);
         accessService.clean(project, true);