Repository: kylin
Updated Branches:
  refs/heads/master 6cf9749e2 -> 32cce58da


KYLIN-2462 don't always using FK in place of PK dimension


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/32cce58d
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/32cce58d
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/32cce58d

Branch: refs/heads/master
Commit: 32cce58da28929a1ff9076a1afa35cce93460b87
Parents: 5ed2a07
Author: Li Yang <liy...@apache.org>
Authored: Thu Feb 23 18:40:28 2017 +0800
Committer: root <r...@sandbox.hortonworks.com>
Committed: Thu Feb 23 12:30:50 2017 +0000

----------------------------------------------------------------------
 .../java/org/apache/kylin/common/util/SSHClient.java  | 14 ++++++--------
 .../java/org/apache/kylin/cube/model/CubeDesc.java    | 13 ++-----------
 2 files changed, 8 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/32cce58d/core-common/src/main/java/org/apache/kylin/common/util/SSHClient.java
----------------------------------------------------------------------
diff --git 
a/core-common/src/main/java/org/apache/kylin/common/util/SSHClient.java 
b/core-common/src/main/java/org/apache/kylin/common/util/SSHClient.java
index 9c83fbd..5e27d9d 100644
--- a/core-common/src/main/java/org/apache/kylin/common/util/SSHClient.java
+++ b/core-common/src/main/java/org/apache/kylin/common/util/SSHClient.java
@@ -64,7 +64,7 @@ public class SSHClient {
     public void scpFileToRemote(String localFile, String 
remoteTargetDirectory) throws Exception {
         FileInputStream fis = null;
         try {
-            System.out.println("SCP file " + localFile + " to " + 
remoteTargetDirectory);
+            logger.info("SCP file " + localFile + " to " + 
remoteTargetDirectory);
 
             Session session = newJSchSession();
             session.connect();
@@ -149,7 +149,7 @@ public class SSHClient {
     public void scpFileToLocal(String rfile, String lfile) throws Exception {
         FileOutputStream fos = null;
         try {
-            System.out.println("SCP remote file " + rfile + " to local " + 
lfile);
+            logger.info("SCP remote file " + rfile + " to local " + lfile);
 
             String prefix = null;
             if (new File(lfile).isDirectory()) {
@@ -205,8 +205,6 @@ public class SSHClient {
                     }
                 }
 
-                //System.out.println("filesize="+filesize+", file="+file);
-
                 // send '\0'
                 buf[0] = 0;
                 out.write(buf, 0, 1);
@@ -259,7 +257,7 @@ public class SSHClient {
 
     public SSHClientOutput execCommand(String command, int timeoutSeconds, 
Logger logAppender) throws Exception {
         try {
-            System.out.println("[" + username + "@" + hostname + "] Execute 
command: " + command);
+            logger.info("[" + username + "@" + hostname + "] Execute command: 
" + command);
 
             StringBuffer text = new StringBuffer();
             int exitCode = -1;
@@ -311,7 +309,7 @@ public class SSHClient {
                     if (in.available() > 0)
                         continue;
                     exitCode = channel.getExitStatus();
-                    System.out.println("[" + username + "@" + hostname + "] 
Command exit-status: " + exitCode);
+                    logger.info("[" + username + "@" + hostname + "] Command 
exit-status: " + exitCode);
 
                     break;
                 }
@@ -364,10 +362,10 @@ public class SSHClient {
                 sb.append((char) c);
             } while (c != '\n');
             if (b == 1) { // error
-                System.out.print(sb.toString());
+                logger.error(sb.toString());
             }
             if (b == 2) { // fatal error
-                System.out.print(sb.toString());
+                logger.error(sb.toString());
             }
         }
         return b;

http://git-wip-us.apache.org/repos/asf/kylin/blob/32cce58d/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java 
b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
index 95e3343..c1469fe 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
@@ -529,7 +529,7 @@ public class CubeDesc extends RootPersistentEntity 
implements IEngineAware {
         this.errors.clear();
 
         checkArgument(StringUtils.isNotBlank(name), "CubeDesc name is blank");
-        checkArgument(StringUtils.isNotBlank(modelName), "CubeDesc(%s) has 
blank modelName", name);
+        checkArgument(StringUtils.isNotBlank(modelName), "CubeDesc (%s) has 
blank model name", name);
 
         // note CubeDesc.name == CubeInstance.name
         List<ProjectInstance> ownerPrj = 
ProjectManager.getInstance(config).findProjects(RealizationType.CUBE, name);
@@ -571,7 +571,7 @@ public class CubeDesc extends RootPersistentEntity 
implements IEngineAware {
 
         // check all dimension columns are presented on rowkey
         List<TblColRef> dimCols = listDimensionColumnsExcludingDerived(true);
-        checkState(rowkey.getRowKeyColumns().length == dimCols.size(), "RowKey 
columns count (%d) doesn't match dimensions columns count (%d)", 
rowkey.getRowKeyColumns().length, dimCols.size());
+        checkState(rowkey.getRowKeyColumns().length == dimCols.size(), "RowKey 
columns count (%s) doesn't match dimensions columns count (%s)", 
rowkey.getRowKeyColumns().length, dimCols.size());
 
         initDictionaryDesc();
         amendAllColumns();
@@ -857,15 +857,6 @@ public class CubeDesc extends RootPersistentEntity 
implements IEngineAware {
 
     private TblColRef initDimensionColRef(DimensionDesc dim, String colName) {
         TblColRef col = model.findColumn(dim.getTable(), colName);
-
-        // always use FK instead PK, FK could be shared by more than one 
lookup tables
-        JoinDesc join = dim.getJoin();
-        if (join != null) {
-            int idx = ArrayUtils.indexOf(join.getPrimaryKeyColumns(), col);
-            if (idx >= 0) {
-                col = join.getForeignKeyColumns()[idx];
-            }
-        }
         return initDimensionColRef(col);
     }
 

Reply via email to