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 2019/09/29 11:28:18 UTC
[kylin] branch 2.6.x updated: KYLIN-4176 Filter the intermediate
tables when loading table metadata from tree
This is an automated email from the ASF dual-hosted git repository.
shaofengshi pushed a commit to branch 2.6.x
in repository https://gitbox.apache.org/repos/asf/kylin.git
The following commit(s) were added to refs/heads/2.6.x by this push:
new baba299 KYLIN-4176 Filter the intermediate tables when loading table metadata from tree
baba299 is described below
commit baba299866d5544bd54a758f7d185769ba57e6bf
Author: Kehua Wu <wu...@zte.com.cn>
AuthorDate: Mon Sep 23 13:57:38 2019 +0800
KYLIN-4176 Filter the intermediate tables when loading table metadata from tree
---
.../java/org/apache/kylin/rest/service/TableService.java | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/server-base/src/main/java/org/apache/kylin/rest/service/TableService.java b/server-base/src/main/java/org/apache/kylin/rest/service/TableService.java
index f5c6d2d..328f699 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/service/TableService.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/service/TableService.java
@@ -29,6 +29,8 @@ import java.util.Locale;
import java.util.Map;
import java.util.UUID;
+import javax.annotation.Nullable;
+
import org.apache.commons.lang.StringUtils;
import org.apache.kylin.common.KylinConfig;
import org.apache.kylin.common.util.HadoopUtil;
@@ -48,6 +50,7 @@ import org.apache.kylin.engine.mr.common.MapReduceExecutable;
import org.apache.kylin.job.execution.DefaultChainedExecutable;
import org.apache.kylin.job.execution.ExecutableManager;
import org.apache.kylin.job.execution.ExecutableState;
+import org.apache.kylin.metadata.MetadataConstants;
import org.apache.kylin.metadata.TableMetadataManager;
import org.apache.kylin.metadata.model.ColumnDesc;
import org.apache.kylin.metadata.model.ISourceAware;
@@ -74,6 +77,8 @@ import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import com.google.common.base.Preconditions;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
import com.google.common.collect.LinkedHashMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@@ -290,7 +295,14 @@ public class TableService extends BasicService {
public List<String> getSourceTableNames(String project, String database) throws Exception {
ISourceMetadataExplorer explr = SourceManager.getInstance(getConfig()).getProjectSource(project)
.getSourceMetadataExplorer();
- return explr.listTables(database);
+ List<String> hiveTableNames = explr.listTables(database);
+ Iterable<String> kylinApplicationTableNames = Iterables.filter(hiveTableNames, new Predicate<String>() {
+ @Override
+ public boolean apply(@Nullable String input) {
+ return input != null && !input.startsWith(MetadataConstants.KYLIN_INTERMEDIATE_PREFIX);
+ }
+ });
+ return Lists.newArrayList(kylinApplicationTableNames);
}
private TableDescResponse cloneTableDesc(TableDesc table, String prj) {