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/02/23 10:40:44 UTC

[1/2] kylin git commit: KYLIN 1875 update add data model

Repository: kylin
Updated Branches:
  refs/heads/KYLIN-2462 [created] 7eb0e054c


KYLIN 1875 update add data model

Signed-off-by: Li Yang <li...@apache.org>


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

Branch: refs/heads/KYLIN-2462
Commit: fa18b11bb76353744a37a86510934ca84858e763
Parents: 37aab3c
Author: chenzhx <34...@qq.com>
Authored: Thu Feb 23 17:55:23 2017 +0800
Committer: Li Yang <li...@apache.org>
Committed: Thu Feb 23 18:29:31 2017 +0800

----------------------------------------------------------------------
 .../app/partials/modelDesigner/data_model.html  | 48 ++++++++++----------
 1 file changed, 23 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/fa18b11b/webapp/app/partials/modelDesigner/data_model.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/modelDesigner/data_model.html b/webapp/app/partials/modelDesigner/data_model.html
index d6a6023..9b7070c 100644
--- a/webapp/app/partials/modelDesigner/data_model.html
+++ b/webapp/app/partials/modelDesigner/data_model.html
@@ -130,47 +130,45 @@
                     <ng-form name="lookup_form">
                       <div class="form-group">
                         <div class="row">
-                          <div class="col-xs-12">
-                            <div>
-                              <select chosen ng-model="newLookup.joinTable" class="col-sm-4"
+                          <div class="col-xs-12 form-group">
+                              <select chosen ng-model="newLookup.joinTable" class="chosen-select col-sm-5"
                                       ng-options="table as table for table in aliasName"
                                       name="table_name"  ng-disabled="lookupState.editing"
-                                      ng-required="true"
-                                      class="chosen-select">
+                                      ng-required="true">
                                 <option value=""> &#45;&#45; From Table &#45;&#45; </option>
                               </select>
+                          </div>
+                        </div>
+                        <div class="row">
+                          <div class="col-xs-12 form-group">
                               <!--Join Type-->
-                              <select class="form-control"  chosen ng-init="newLookup.join.type='inner'"  ng-model="newLookup.join.type" style="width:120px;"
-                                            ng-options="joinType.value as joinType.name for joinType in cubeConfig.joinTypes">
+                              <select class="chosen-select col-sm-5"  chosen ng-init="newLookup.join.type='inner'"  ng-model="newLookup.join.type"
+                                            ng-options="joinType.value as joinType.name+'  Join' for joinType in cubeConfig.joinTypes">
                                 <option value=""></option>
                               </select>
-                              <label class="control-label font-color-default"><b>Join</b></label>
-                              <select chosen ng-model="newLookup.table" class="col-sm-4"
+                          </div>
+                        </div>
+                        <div class="row">
+                          <div class="col-xs-12 form-group">
+                              <select chosen ng-model="newLookup.table" class="chosen-select col-sm-5"
                                       ng-options="table.name as VdmUtil.removeNameSpace(table.name) for table in tableModel.selectProjectTables"
                                       name="table_name"  ng-disabled="lookupState.editing"
-                                      ng-required="true"  ng-change="changeJoinTable()"
-                                      class="chosen-select">
+                                      ng-required="true"  ng-change="changeJoinTable()">
                                 <option value=""> &#45;&#45; Select Lookup Table &#45;&#45; </option>
                               </select>
-                            </div>
+                              <div class="chosen-select col-sm-6" style="float:right;padding-left:0;">
+                                <input type="text" class="form-control " name="joinTable_alias" placeholder="Input Table Alias" ng-required="true"
+                                     ng-model="newLookup.alias"  ng-pattern="/^[A-Z_\d]+$/">
+                                <small class="help-block red" ng-show="!lookup_form.joinTable_alias.$error.required&&lookup_form.joinTable_alias.$invalid && (lookup_form.joinTable_alias.$dirty||lookup_form.$submitted)"><i class="fa fa-exclamation-triangle"></i>&nbsp;&nbsp; Table alias is invalid(A Combination of numbers, uppercase letters or underscores).</small>
+                              </div>
+                              <span class="col-sm-1 font-color-default" style="float:right;font-size:large;line-height: 30px;"><b>AS</b></span>
                           </div>
                         </div>
                       </div>
-                    <div class="form-group">
-                        <div class="row">
-                            <label class="col-sm-6 control-label font-color-default" ><b style="float:right">Table Alias :</b></label>
-                            <div class="col-sm-5">
-                              <input type="text" class="form-control " name="joinTable_alias" placeholder="Input Table Alias" ng-required="true"
-                                     ng-model="newLookup.alias"  ng-pattern="/^[A-Z_\d]+$/">
-                              <small class="help-block red" ng-show="!lookup_form.joinTable_alias.$error.required&&lookup_form.joinTable_alias.$invalid && (lookup_form.joinTable_alias.$dirty||lookup_form.$submitted)"><i class="fa fa-exclamation-triangle"></i>&nbsp;&nbsp; Table alias is invalid(A Combination of numbers, uppercase letters or underscores).</small>
-                            </div>
-                        </div>
-                    </div>
                     <!--Table Type-->
-                    <div class="form-group">
+                    <div class="form-group form-group middle-popover">
                         <div class="row">
-                          <label class="col-sm-6"></label>
-                          <div class="col-sm-5">
+                          <div class="col-sm-5" >
                             <label>
                               <input type="checkbox" ng-model="newLookup.kind" ng-true-value="FACT" ng-false-value="LOOKUP" >&nbsp;Is Limited
                             </label>


[2/2] kylin git commit: KYLIN-2462 don't always using FK in place of PK dimension

Posted by li...@apache.org.
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 <li...@apache.org>
Authored: Thu Feb 23 18:40:28 2017 +0800
Committer: Li Yang <li...@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);
     }