kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liy...@apache.org
Subject [2/2] kylin git commit: KYLIN-2462 don't always using FK in place of PK dimension
Date Thu, 23 Feb 2017 10:40:45 GMT
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/7eb0e054
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/7eb0e054
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/7eb0e054

Branch: refs/heads/KYLIN-2462
Commit: 7eb0e054cc44a73333084367a39afe1531461a46
Parents: fa18b11
Author: Li Yang <liyang@apache.org>
Authored: Thu Feb 23 18:40:28 2017 +0800
Committer: Li Yang <liyang@apache.org>
Committed: Thu Feb 23 18:40:28 2017 +0800

----------------------------------------------------------------------
 .../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/7eb0e054/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/7eb0e054/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);
     }
 


Mime
View raw message