You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2017/03/12 11:48:42 UTC
[10/48] kylin git commit: KYLIN-2474 check lookup table after build
snapshot
KYLIN-2474 check lookup table after build snapshot
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/aed28ec4
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/aed28ec4
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/aed28ec4
Branch: refs/heads/master-hbase0.98
Commit: aed28ec4b315f760ce902794b8041c1239c467a3
Parents: a800122
Author: Li Yang <li...@apache.org>
Authored: Tue Feb 28 16:51:45 2017 +0800
Committer: Yang Li <li...@apache.org>
Committed: Tue Feb 28 21:30:48 2017 +0800
----------------------------------------------------------------------
.../apache/kylin/cube/cli/DictionaryGeneratorCLI.java | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/aed28ec4/core-cube/src/main/java/org/apache/kylin/cube/cli/DictionaryGeneratorCLI.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/cli/DictionaryGeneratorCLI.java b/core-cube/src/main/java/org/apache/kylin/cube/cli/DictionaryGeneratorCLI.java
index 2e5a38e..e8c53f7 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/cli/DictionaryGeneratorCLI.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/cli/DictionaryGeneratorCLI.java
@@ -32,6 +32,7 @@ import org.apache.kylin.dict.DictionaryProvider;
import org.apache.kylin.dict.DistinctColumnValuesProvider;
import org.apache.kylin.metadata.MetadataManager;
import org.apache.kylin.metadata.model.DataModelDesc;
+import org.apache.kylin.metadata.model.JoinDesc;
import org.apache.kylin.metadata.model.TableDesc;
import org.apache.kylin.metadata.model.TableRef;
import org.apache.kylin.metadata.model.TblColRef;
@@ -77,16 +78,25 @@ public class DictionaryGeneratorCLI {
// snapshot
Set<String> toSnapshot = Sets.newHashSet();
+ Set<TableRef> toCheckLookup = Sets.newHashSet();
for (DimensionDesc dim : cubeSeg.getCubeDesc().getDimensions()) {
TableRef table = dim.getTableRef();
- if (cubeSeg.getModel().isLookupTable(table))
+ if (cubeSeg.getModel().isLookupTable(table)) {
toSnapshot.add(table.getTableIdentity());
+ toCheckLookup.add(table);
+ }
}
for (String tableIdentity : toSnapshot) {
logger.info("Building snapshot of " + tableIdentity);
cubeMgr.buildSnapshotTable(cubeSeg, tableIdentity);
}
+
+ for (TableRef lookup : toCheckLookup) {
+ logger.info("Checking snapshot of " + lookup);
+ JoinDesc join = cubeSeg.getModel().getJoinsTree().getJoinByPKSide(lookup);
+ cubeMgr.getLookupTable(cubeSeg, join);
+ }
}
private static ReadableTable decideInputTable(DataModelDesc model, TblColRef col, DistinctColumnValuesProvider factTableValueProvider) {