kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liy...@apache.org
Subject [45/50] [abbrv] kylin git commit: KYLIN-1077 remove calcite-core from kylin-it’s pom
Date Sun, 08 May 2016 13:30:12 GMT
KYLIN-1077 remove calcite-core from kylin-it’s pom

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

Branch: refs/heads/1.5.x-HBase1.x
Commit: f17ba5c04ce121ceb0c98f985771ccf9587ee157
Parents: a930bd6
Author: shaofengshi <shaofengshi@apache.org>
Authored: Fri May 6 15:18:48 2016 +0800
Committer: shaofengshi <shaofengshi@apache.org>
Committed: Fri May 6 15:19:10 2016 +0800

----------------------------------------------------------------------
 .../test/java/org/apache/kylin/job/DeployUtil.java | 12 ++++++++----
 kylin-it/pom.xml                                   | 17 -----------------
 .../apache/kylin/source/hive/HiveCmdBuilder.java   |  6 ++++++
 3 files changed, 14 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/f17ba5c0/assembly/src/test/java/org/apache/kylin/job/DeployUtil.java
----------------------------------------------------------------------
diff --git a/assembly/src/test/java/org/apache/kylin/job/DeployUtil.java b/assembly/src/test/java/org/apache/kylin/job/DeployUtil.java
index b6b8536..8e28740 100644
--- a/assembly/src/test/java/org/apache/kylin/job/DeployUtil.java
+++ b/assembly/src/test/java/org/apache/kylin/job/DeployUtil.java
@@ -46,6 +46,7 @@ import org.apache.kylin.metadata.model.ColumnDesc;
 import org.apache.kylin.metadata.model.TableDesc;
 import org.apache.kylin.metadata.model.TblColRef;
 import org.apache.kylin.source.hive.HiveClient;
+import org.apache.kylin.source.hive.HiveCmdBuilder;
 import org.apache.kylin.source.kafka.TimedJsonStreamParser;
 import org.apache.kylin.source.kafka.config.KafkaConfig;
 import org.apache.maven.model.Model;
@@ -211,11 +212,9 @@ public class DeployUtil {
         temp.delete();
 
         HiveClient hiveClient = new HiveClient();
-
         // create hive tables
         hiveClient.executeHQL("CREATE DATABASE IF NOT EXISTS EDW");
         hiveClient.executeHQL(generateCreateTableHql(metaMgr.getTableDesc(TABLE_CAL_DT.toUpperCase())));
-        hiveClient.executeHQL(generateCreateViewHql(VIEW_CAL_DT, metaMgr.getTableDesc(TABLE_CAL_DT.toUpperCase())));
         hiveClient.executeHQL(generateCreateTableHql(metaMgr.getTableDesc(TABLE_CATEGORY_GROUPINGS.toUpperCase())));
         hiveClient.executeHQL(generateCreateTableHql(metaMgr.getTableDesc(TABLE_KYLIN_FACT.toUpperCase())));
         hiveClient.executeHQL(generateCreateTableHql(metaMgr.getTableDesc(TABLE_SELLER_TYPE_DIM.toUpperCase())));
@@ -228,6 +227,11 @@ public class DeployUtil {
         hiveClient.executeHQL(generateLoadDataHql(TABLE_KYLIN_FACT, tableFileDir));
         hiveClient.executeHQL(generateLoadDataHql(TABLE_SELLER_TYPE_DIM, tableFileDir));
         hiveClient.executeHQL(generateLoadDataHql(TABLE_SITES, tableFileDir));
+
+        final HiveCmdBuilder hiveCmdBuilder = new HiveCmdBuilder();
+        hiveCmdBuilder.addStatements(generateCreateViewHql(VIEW_CAL_DT, metaMgr.getTableDesc(TABLE_CAL_DT.toUpperCase())));
+
+        config().getCliCommandExecutor().execute(hiveCmdBuilder.build());
     }
 
     private static String generateLoadDataHql(String tableName, String tableFileDir) {
@@ -259,10 +263,10 @@ public class DeployUtil {
 
     private static String[] generateCreateViewHql(String viewName, TableDesc tableDesc) {
 
-        String dropsql = "DROP VIEW IF EXISTS " + viewName;
+        String dropsql = "DROP VIEW IF EXISTS " + viewName + ";";
         StringBuilder ddl = new StringBuilder();
 
-        ddl.append("CREATE VIEW " + viewName + " AS SELECT * FROM " + tableDesc.getIdentity()
+ "\n");
+        ddl.append("CREATE VIEW " + viewName + " AS SELECT * FROM " + tableDesc.getIdentity()
+ ";\n");
 
         return new String[] { dropsql, ddl.toString() };
     }

http://git-wip-us.apache.org/repos/asf/kylin/blob/f17ba5c0/kylin-it/pom.xml
----------------------------------------------------------------------
diff --git a/kylin-it/pom.xml b/kylin-it/pom.xml
index 9e1a9e4..1a3efb7 100644
--- a/kylin-it/pom.xml
+++ b/kylin-it/pom.xml
@@ -259,23 +259,6 @@
                 </exclusion>
             </exclusions>
         </dependency>
-        <!-- add this for hive-exec, its 0.14 is compiled with calcite 0.9.2 -->
-        <dependency>
-            <groupId>org.apache.calcite</groupId>
-            <artifactId>calcite-core</artifactId>
-            <version>0.9.2-incubating</version>
-            <scope>test</scope>
-            <exclusions>
-                <exclusion>
-                    <artifactId>hsqldb</artifactId>
-                    <groupId>org.hsqldb</groupId>
-                </exclusion>
-                <exclusion>
-                    <artifactId>jackson-databind</artifactId>
-                    <groupId>com.fasterxml.jackson.core</groupId>
-                </exclusion>
-            </exclusions>
-        </dependency>
     </dependencies>
 
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/f17ba5c0/source-hive/src/main/java/org/apache/kylin/source/hive/HiveCmdBuilder.java
----------------------------------------------------------------------
diff --git a/source-hive/src/main/java/org/apache/kylin/source/hive/HiveCmdBuilder.java b/source-hive/src/main/java/org/apache/kylin/source/hive/HiveCmdBuilder.java
index f510780..5a8278e 100644
--- a/source-hive/src/main/java/org/apache/kylin/source/hive/HiveCmdBuilder.java
+++ b/source-hive/src/main/java/org/apache/kylin/source/hive/HiveCmdBuilder.java
@@ -99,6 +99,12 @@ public class HiveCmdBuilder {
         statements.add(statement);
     }
 
+    public void addStatements(String[] stats) {
+        for(String s : stats) {
+            statements.add(s);
+        }
+    }
+
     @Override
     public String toString() {
         return build();


Mime
View raw message