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 baae2c8 KYLIN-3645 clean table metadata when drop project baae2c8 is described below commit baae2c8627da0f2ba92320e4348d244209fad83a Author: Rongchuan Jin <rongchuan.jin@RongchuanJins-MacBook-Pro.local> AuthorDate: Wed Oct 24 10:56:21 2018 +0800 KYLIN-3645 clean table metadata when drop project --- .../main/java/org/apache/kylin/rest/service/ProjectService.java | 9 ++++++++- 1 file changed, 8 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 cf37d37..831035a 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 @@ -24,6 +24,7 @@ import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; import java.util.Locale; +import java.util.Set; import javax.annotation.Nullable; @@ -69,6 +70,9 @@ public class ProjectService extends BasicService { @Autowired private AclEvaluate aclEvaluate; + @Autowired + private TableService tableService; + @PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN) public ProjectInstance createProject(ProjectInstance newProject) throws IOException { Message msg = MsgPicker.getMsg(); @@ -132,8 +136,11 @@ 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) { + tableService.unloadHiveTable(table, projectName); + } getProjectManager().dropProject(projectName); - accessService.clean(project, true); }