[10/13] kylin git commit: KYLIN-1356 move all it to a seprate module

2016-01-23 Thread mahongbin
http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/kylin-it/src/test/resources/query/h2/query09.sql
--
diff --git a/kylin-it/src/test/resources/query/h2/query09.sql 
b/kylin-it/src/test/resources/query/h2/query09.sql
new file mode 100644
index 000..e6e5576
--- /dev/null
+++ b/kylin-it/src/test/resources/query/h2/query09.sql
@@ -0,0 +1,23 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+select count(*) from (select test_cal_dt.week_beg_dt 
+ from test_kylin_fact 
+ inner JOIN edw.test_cal_dt as test_cal_dt 
+ ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt 
+ group by test_cal_dt.week_beg_dt) t 

http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/kylin-it/src/test/resources/query/h2/query10.sql
--
diff --git a/kylin-it/src/test/resources/query/h2/query10.sql 
b/kylin-it/src/test/resources/query/h2/query10.sql
new file mode 100644
index 000..9511363
--- /dev/null
+++ b/kylin-it/src/test/resources/query/h2/query10.sql
@@ -0,0 +1,25 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+select test_cal_dt.week_beg_dt 
+ from test_kylin_fact 
+ inner JOIN edw.test_cal_dt as test_cal_dt 
+ ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt 
+ where test_kylin_fact.lstg_format_name='FP-GTC' 
+ and test_cal_dt.week_beg_dt between DATE '2013-05-01' and DATE '2013-08-01' 
+ group by test_cal_dt.week_beg_dt 

http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/kylin-it/src/test/resources/query/sql/query00.sql
--
diff --git a/kylin-it/src/test/resources/query/sql/query00.sql 
b/kylin-it/src/test/resources/query/sql/query00.sql
new file mode 100644
index 000..6e4d94b
--- /dev/null
+++ b/kylin-it/src/test/resources/query/sql/query00.sql
@@ -0,0 +1,22 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+select lstg_format_name, sum(price) as GMV 
+ from test_kylin_fact 
+ where lstg_format_name='FP-GTC' 
+ group by lstg_format_name 

http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/kylin-it/src/test/resources/query/sql/query01.sql
--
diff --git a/kylin-it/src/test/resources/query/sql/query01.sql 
b/kylin-it/src/test/resources/query/sql/query01.sql
new file mode 100644
index 000..9ed1db3
--- /dev/null
+++ b/kylin-it/src/test/resources/query/sql/query01.sql
@@ -0,0 +1,20 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this 

[13/13] kylin git commit: KYLIN-1356 move all it to a seprate module

2016-01-23 Thread mahongbin
KYLIN-1356 move all it to a seprate module

use exec instead

set hdp.version

fix classnotdef

fix classnot

fix classnotdef

add fastBuildMode

KYLIN-1340

fix license

fix exit

fix jdbc test

fix war

attachclass

fix cache


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

Branch: refs/heads/2.0-rc
Commit: 59943fee017fe2aa63c29867acb06fc0d56e5af1
Parents: 5e0e8e0
Author: honma 
Authored: Thu Jan 21 23:32:17 2016 +0800
Committer: honma 
Committed: Sun Jan 24 14:33:10 2016 +0800

--
 assembly/pom.xml|  28 +-
 .../apache/kylin/RealizationRegistryTest.java   |  57 +++
 .../engine/spark/BuildCubeWithSparkTest.java| 151 --
 .../kylin/job/BuildCubeWithEngineTest.java  | 333 
 .../kylin/job/BuildCubeWithStreamTest.java  | 114 -
 .../apache/kylin/job/BuildIIWithEngineTest.java | 253 -
 .../apache/kylin/job/BuildIIWithStreamTest.java | 290 ---
 .../kylin/job/DeployLocalMetaToRemoteTest.java  |   5 +-
 .../hive/ITHiveSourceTableLoaderTest.java   |  55 --
 .../source/hive/ITHiveTableReaderTest.java  |  49 --
 .../source/hive/ITSnapshotManagerTest.java  |  83 ---
 .../kylin/common/persistence/ResourceTool.java  |  11 +
 .../org/apache/kylin/common/util/BasicTest.java |   2 +
 .../common/util/HBaseMetadataTestCase.java  |  60 +++
 .../org/apache/kylin/cube/CubeDescManager.java  |   2 +-
 .../org/apache/kylin/cube/model/CubeDesc.java   |   4 +-
 .../org/apache/kylin/job/dao/ExecutableDao.java |   4 +-
 .../cache/AbstractCacheFledgedQuery.java|   5 +-
 kylin-it/pom.xml| 426 
 .../org/apache/kylin/jdbc/ITJDBCDriverTest.java | 281 ++
 .../kylin/provision/BuildCubeWithEngine.java| 338 +
 .../kylin/provision/BuildCubeWithSpark.java | 157 ++
 .../kylin/provision/BuildCubeWithStream.java| 100 
 .../kylin/provision/BuildIIWithEngine.java  | 254 ++
 .../kylin/provision/BuildIIWithStream.java  | 298 +++
 .../java/org/apache/kylin/query/H2Database.java | 130 +
 .../apache/kylin/query/ITCombinationTest.java   |  78 +++
 .../org/apache/kylin/query/ITIIQueryTest.java   |  86 
 .../apache/kylin/query/ITKylinQueryTest.java| 238 +
 .../org/apache/kylin/query/KylinTestBase.java   | 507 +++
 .../hive/ITHiveSourceTableLoaderTest.java   |  55 ++
 .../source/hive/ITHiveTableReaderTest.java  |  49 ++
 .../source/hive/ITSnapshotManagerTest.java  |  83 +++
 .../storage/hbase/ITHBaseResourceStoreTest.java | 213 
 .../kylin/storage/hbase/ITHdfsOpsTest.java  |  67 +++
 .../kylin/storage/hbase/ITStorageTest.java  | 163 ++
 .../hbase/ii/ITInvertedIndexHBaseTest.java  | 115 +
 kylin-it/src/test/resources/logging.properties  |   5 +
 .../src/test/resources/query/debug/query78.sql  |  22 +
 .../src/test/resources/query/h2/query07.sql |  21 +
 .../src/test/resources/query/h2/query09.sql |  23 +
 .../src/test/resources/query/h2/query10.sql |  25 +
 .../src/test/resources/query/sql/query00.sql|  22 +
 .../src/test/resources/query/sql/query01.sql|  20 +
 .../src/test/resources/query/sql/query02.sql|  19 +
 .../src/test/resources/query/sql/query03.sql|  20 +
 .../src/test/resources/query/sql/query04.sql|  21 +
 .../src/test/resources/query/sql/query05.sql|  22 +
 .../src/test/resources/query/sql/query06.sql|  23 +
 .../src/test/resources/query/sql/query07.sql|  22 +
 .../src/test/resources/query/sql/query08.sql|  22 +
 .../src/test/resources/query/sql/query09.sql|  27 +
 .../src/test/resources/query/sql/query10.sql|  30 ++
 .../src/test/resources/query/sql/query11.sql|  30 ++
 .../src/test/resources/query/sql/query12.sql|  29 ++
 .../src/test/resources/query/sql/query13.sql|  28 +
 .../src/test/resources/query/sql/query14.sql|  36 ++
 .../src/test/resources/query/sql/query15.sql|  32 ++
 .../src/test/resources/query/sql/query16.sql|  35 ++
 .../src/test/resources/query/sql/query17.sql|  38 ++
 .../src/test/resources/query/sql/query18.sql|  34 ++
 .../src/test/resources/query/sql/query19.sql|  38 ++
 .../src/test/resources/query/sql/query20.sql|  34 ++
 .../src/test/resources/query/sql/query21.sql|  40 ++
 .../src/test/resources/query/sql/query22.sql|  42 ++
 .../src/test/resources/query/sql/query23.sql|  41 ++
 .../src/test/resources/query/sql/query24.sql|  45 ++
 .../src/test/resources/query/sql/query25.sql|  46 ++
 .../src/test/resources/query/sql/query26.sql|  48 ++
 .../src/test/resources/query/sql/query27.sql|  47 ++
 

[07/13] kylin git commit: KYLIN-1356 move all it to a seprate module

2016-01-23 Thread mahongbin
http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/kylin-it/src/test/resources/query/sql_invalid/query33_invalid_SQL.sql
--
diff --git 
a/kylin-it/src/test/resources/query/sql_invalid/query33_invalid_SQL.sql 
b/kylin-it/src/test/resources/query/sql_invalid/query33_invalid_SQL.sql
new file mode 100644
index 000..d18dbcc
--- /dev/null
+++ b/kylin-it/src/test/resources/query/sql_invalid/query33_invalid_SQL.sql
@@ -0,0 +1,56 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+SELECT 
+ test_cal_dt.week_beg_dt_test 
+ ,test_cal_dt.retail_year 
+ ,test_cal_dt.rtl_month_of_rtl_year_id 
+ ,test_cal_dt.retail_week 
+ ,test_category_groupings.meta_categ_name 
+ ,test_category_groupings.categ_lvl2_name 
+ ,test_category_groupings.categ_lvl3_name 
+ ,test_kylin_fact.lstg_format_name 
+ ,test_sites.site_name 
+ ,test_seller_type_dim.seller_type_desc 
+ ,sum(test_kylin_fact.price) as gmv 
+ , count(*) as trans_cnt 
+ FROM test_kylin_fact 
+ inner JOIN test_cal_dt 
+ ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt 
+ inner JOIN test_category_groupings 
+ ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND 
test_kylin_fact.lstg_site_id = test_category_groupings.site_id 
+ inner JOIN test_sites 
+ ON test_kylin_fact.lstg_site_id = test_sites.site_id 
+ inner JOIN test_seller_type_dim 
+ ON test_kylin_fact.slr_segment_cd = test_seller_type_dim.seller_type_cd 
+ where test_cal_dt.retail_year='2013' 
+ and retail_week in(1,2,3,4,5,6,7,7,7) 
+ and (test_category_groupings.meta_categ_name='Collectibles' or 
test_category_groupings.categ_lvl3_name='Dresses') 
+ and test_sites.site_name='Ebay' 
+ and test_cal_dt.retail_year not in ('2014') 
+ and test_kylin_fact.trans_id=11 
+ group by test_cal_dt.week_beg_dt 
+ ,test_cal_dt.retail_year 
+ ,test_cal_dt.rtl_month_of_rtl_year_id 
+ ,test_cal_dt.retail_week 
+ ,test_category_groupings.meta_categ_name 
+ ,test_category_groupings.categ_lvl2_name 
+ ,test_category_groupings.categ_lvl3_name 
+ ,test_kylin_fact.lstg_format_name 
+ ,test_sites.site_name 
+ ,test_seller_type_dim.seller_type_desc 

http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/kylin-it/src/test/resources/query/sql_invalid/query34_invalid_SQL.sql
--
diff --git 
a/kylin-it/src/test/resources/query/sql_invalid/query34_invalid_SQL.sql 
b/kylin-it/src/test/resources/query/sql_invalid/query34_invalid_SQL.sql
new file mode 100644
index 000..4308735
--- /dev/null
+++ b/kylin-it/src/test/resources/query/sql_invalid/query34_invalid_SQL.sql
@@ -0,0 +1,24 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+SELECT COUNT(DISTINCT "TableauSQL"."TRANS_CNT") AS "ctd_TRANS_CNT_qk", 
"TableauSQL"."LSTG_FORMAT_NAME" AS "none_LSTG_FORMAT_NAME_nk" 
+ FROM ( select test_kylin_fact.lstg_format_name, sum(price) as GMV, 
count(seller_id) as TRANS_CNT 
+ from test_kylin_fact 
+ group by test_kylin_fact.lstg_format_name 
+ ) "TableauSQL" 
+ GROUP BY "TableauSQL"."LSTG_FORMAT_NAME" 

http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/kylin-it/src/test/resources/query/sql_invalid/query_count_distinct_on_dimension.sql.disabled
--
diff --git 
a/kylin-it/src/test/resources/query/sql_invalid/query_count_distinct_on_dimension.sql.disabled
 

[09/13] kylin git commit: KYLIN-1356 move all it to a seprate module

2016-01-23 Thread mahongbin
http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/kylin-it/src/test/resources/query/sql/query46.sql
--
diff --git a/kylin-it/src/test/resources/query/sql/query46.sql 
b/kylin-it/src/test/resources/query/sql/query46.sql
new file mode 100644
index 000..3bfe9d9
--- /dev/null
+++ b/kylin-it/src/test/resources/query/sql/query46.sql
@@ -0,0 +1,19 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+select count(*) as CNT  from test_category_groupings

http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/kylin-it/src/test/resources/query/sql/query47.sql
--
diff --git a/kylin-it/src/test/resources/query/sql/query47.sql 
b/kylin-it/src/test/resources/query/sql/query47.sql
new file mode 100644
index 000..cbd2c6d
--- /dev/null
+++ b/kylin-it/src/test/resources/query/sql/query47.sql
@@ -0,0 +1,19 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+select count(*) as CNT  from edw.test_seller_type_dim

http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/kylin-it/src/test/resources/query/sql/query48.sql
--
diff --git a/kylin-it/src/test/resources/query/sql/query48.sql 
b/kylin-it/src/test/resources/query/sql/query48.sql
new file mode 100644
index 000..54ddb31
--- /dev/null
+++ b/kylin-it/src/test/resources/query/sql/query48.sql
@@ -0,0 +1,19 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+select count(*) as CNT from edw.test_sites

http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/kylin-it/src/test/resources/query/sql/query49.sql
--
diff --git a/kylin-it/src/test/resources/query/sql/query49.sql 
b/kylin-it/src/test/resources/query/sql/query49.sql
new file mode 100644
index 000..a28beb6
--- /dev/null
+++ b/kylin-it/src/test/resources/query/sql/query49.sql
@@ -0,0 +1,36 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR 

[11/13] kylin git commit: KYLIN-1356 move all it to a seprate module

2016-01-23 Thread mahongbin
http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/kylin-it/src/test/java/org/apache/kylin/provision/BuildIIWithStream.java
--
diff --git 
a/kylin-it/src/test/java/org/apache/kylin/provision/BuildIIWithStream.java 
b/kylin-it/src/test/java/org/apache/kylin/provision/BuildIIWithStream.java
new file mode 100644
index 000..8436687
--- /dev/null
+++ b/kylin-it/src/test/java/org/apache/kylin/provision/BuildIIWithStream.java
@@ -0,0 +1,298 @@
+/*
+ *
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *
+ *  contributor license agreements. See the NOTICE file distributed with
+ *
+ *  this work for additional information regarding copyright ownership.
+ *
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *
+ *  (the "License"); you may not use this file except in compliance with
+ *
+ *  the License. You may obtain a copy of the License at
+ *
+ *
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *
+ *  limitations under the License.
+ *
+ * /
+ */
+
+package org.apache.kylin.provision;
+
+import java.io.File;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.TimeZone;
+import java.util.UUID;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.hadoop.hbase.client.HTableInterface;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
+import org.apache.hadoop.util.ToolRunner;
+import org.apache.kylin.common.KylinConfig;
+import org.apache.kylin.common.util.AbstractKylinTestCase;
+import org.apache.kylin.common.util.ClassUtil;
+import org.apache.kylin.common.util.DateFormat;
+import org.apache.kylin.common.util.HBaseMetadataTestCase;
+import org.apache.kylin.common.util.Pair;
+import org.apache.kylin.common.util.StreamingBatch;
+import org.apache.kylin.common.util.StreamingMessage;
+import org.apache.kylin.engine.mr.JobBuilderSupport;
+import org.apache.kylin.invertedindex.IIInstance;
+import org.apache.kylin.invertedindex.IIManager;
+import org.apache.kylin.invertedindex.IISegment;
+import org.apache.kylin.invertedindex.index.Slice;
+import org.apache.kylin.invertedindex.index.SliceBuilder;
+import org.apache.kylin.invertedindex.model.IIDesc;
+import org.apache.kylin.invertedindex.model.IIJoinedFlatTableDesc;
+import org.apache.kylin.invertedindex.model.IIKeyValueCodec;
+import org.apache.kylin.invertedindex.model.IIRow;
+import org.apache.kylin.job.DeployUtil;
+import org.apache.kylin.job.JoinedFlatTable;
+import org.apache.kylin.job.common.ShellExecutable;
+import org.apache.kylin.job.constant.ExecutableConstants;
+import org.apache.kylin.job.engine.JobEngineConfig;
+import org.apache.kylin.metadata.model.TblColRef;
+import org.apache.kylin.metadata.realization.RealizationStatusEnum;
+import org.apache.kylin.source.hive.HiveTableReader;
+import org.apache.kylin.storage.hbase.HBaseConnection;
+import org.apache.kylin.storage.hbase.ii.IICreateHTableJob;
+import org.apache.kylin.storage.hbase.util.StorageCleanupJob;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.collect.Lists;
+
+public class BuildIIWithStream {
+
+private static final Logger logger = 
LoggerFactory.getLogger(BuildIIWithStream.class);
+
+private static final String[] II_NAME = new String[] { 
"test_kylin_ii_left_join", "test_kylin_ii_inner_join" };
+private IIManager iiManager;
+private KylinConfig kylinConfig;
+
+public static void main(String[] args) throws Exception {
+beforeClass();
+BuildIIWithStream buildCubeWithEngine = new BuildIIWithStream();
+buildCubeWithEngine.before();
+buildCubeWithEngine.build();
+logger.info("Build is done");
+afterClass();
+logger.info("Going to exit");
+System.exit(0);
+}
+
+public static void beforeClass() throws Exception {
+logger.info("Adding to classpath: " + new 
File(HBaseMetadataTestCase.SANDBOX_TEST_DATA).getAbsolutePath());
+ClassUtil.addClasspath(new 
File(HBaseMetadataTestCase.SANDBOX_TEST_DATA).getAbsolutePath());
+if (StringUtils.isEmpty(System.getProperty("hdp.version"))) {
+throw new RuntimeException("No hdp.version set; Please set 
hdp.version in your jvm option, for example: -Dhdp.version=2.2.4.2-2");
+}
+
HBaseMetadataTestCase.staticCreateTestMetadata(AbstractKylinTestCase.SANDBOX_TEST_DATA);
+}
+
+public void before() throws Exception {
+

[05/13] kylin git commit: KYLIN-1356 move all it to a seprate module

2016-01-23 Thread mahongbin
http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/query/src/test/resources/query/sql/query02.sql
--
diff --git a/query/src/test/resources/query/sql/query02.sql 
b/query/src/test/resources/query/sql/query02.sql
deleted file mode 100644
index 8d27c93..000
--- a/query/src/test/resources/query/sql/query02.sql
+++ /dev/null
@@ -1,19 +0,0 @@
---
--- Licensed to the Apache Software Foundation (ASF) under one
--- or more contributor license agreements.  See the NOTICE file
--- distributed with this work for additional information
--- regarding copyright ownership.  The ASF licenses this file
--- to you under the Apache License, Version 2.0 (the
--- "License"); you may not use this file except in compliance
--- with the License.  You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
---
-
-select sum(price) as GMV, count(1) as TRANS_CNT from test_kylin_fact 

http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/query/src/test/resources/query/sql/query03.sql
--
diff --git a/query/src/test/resources/query/sql/query03.sql 
b/query/src/test/resources/query/sql/query03.sql
deleted file mode 100644
index a605594..000
--- a/query/src/test/resources/query/sql/query03.sql
+++ /dev/null
@@ -1,20 +0,0 @@
---
--- Licensed to the Apache Software Foundation (ASF) under one
--- or more contributor license agreements.  See the NOTICE file
--- distributed with this work for additional information
--- regarding copyright ownership.  The ASF licenses this file
--- to you under the Apache License, Version 2.0 (the
--- "License"); you may not use this file except in compliance
--- with the License.  You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
---
-
-select test_kylin_fact.lstg_format_name, sum(price) as GMV, count(*) as 
TRANS_CNT from test_kylin_fact 
- group by test_kylin_fact.lstg_format_name 

http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/query/src/test/resources/query/sql/query04.sql
--
diff --git a/query/src/test/resources/query/sql/query04.sql 
b/query/src/test/resources/query/sql/query04.sql
deleted file mode 100644
index a3672f5..000
--- a/query/src/test/resources/query/sql/query04.sql
+++ /dev/null
@@ -1,21 +0,0 @@
---
--- Licensed to the Apache Software Foundation (ASF) under one
--- or more contributor license agreements.  See the NOTICE file
--- distributed with this work for additional information
--- regarding copyright ownership.  The ASF licenses this file
--- to you under the Apache License, Version 2.0 (the
--- "License"); you may not use this file except in compliance
--- with the License.  You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
---
-
-select test_kylin_fact.lstg_format_name,sum(test_kylin_fact.price) as GMV 
- , count(*) as TRANS_CNT from test_kylin_fact 
- group by test_kylin_fact.lstg_format_name having sum(price)>5000 

http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/query/src/test/resources/query/sql/query05.sql
--
diff --git a/query/src/test/resources/query/sql/query05.sql 
b/query/src/test/resources/query/sql/query05.sql
deleted file mode 100644
index 512356a..000
--- a/query/src/test/resources/query/sql/query05.sql
+++ /dev/null
@@ -1,22 +0,0 @@
---
--- Licensed to the Apache Software Foundation (ASF) under one
--- or more contributor license agreements.  See the NOTICE file
--- distributed with this work for additional information
--- regarding copyright ownership.  The ASF licenses this file
--- to you under the Apache License, Version 2.0 (the
--- "License"); you may not use this file except in compliance
--- with the License.  You may obtain a copy of the License at

[06/13] kylin git commit: KYLIN-1356 move all it to a seprate module

2016-01-23 Thread mahongbin
http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/kylin-it/src/test/resources/query/sql_tableau/query27.sql
--
diff --git a/kylin-it/src/test/resources/query/sql_tableau/query27.sql 
b/kylin-it/src/test/resources/query/sql_tableau/query27.sql
new file mode 100644
index 000..beeb168
--- /dev/null
+++ b/kylin-it/src/test/resources/query/sql_tableau/query27.sql
@@ -0,0 +1,24 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+SELECT "TEST_KYLIN_FACT"."CAL_DT", SUM("TEST_KYLIN_FACT"."PRICE") AS 
"sum_PRICE_ok" FROM "TEST_KYLIN_FACT" 
+  INNER JOIN (
+ SELECT COUNT(1) AS "XTableau_join_flag", 
SUM("TEST_KYLIN_FACT"."PRICE") AS "X__alias__A", "TEST_KYLIN_FACT"."CAL_DT" 
AS "none_CAL_DT_ok"   FROM "TEST_KYLIN_FACT" 
+ GROUP BY "TEST_KYLIN_FACT"."CAL_DT"   ORDER BY 2 DESC   LIMIT 7  )
+
+"t0" ON ("TEST_KYLIN_FACT"."CAL_DT" = "t0"."none_CAL_DT_ok") GROUP BY 
"TEST_KYLIN_FACT"."CAL_DT"

http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/kylin-it/src/test/resources/query/sql_tableau/query28.sql
--
diff --git a/kylin-it/src/test/resources/query/sql_tableau/query28.sql 
b/kylin-it/src/test/resources/query/sql_tableau/query28.sql
new file mode 100644
index 000..48cc342
--- /dev/null
+++ b/kylin-it/src/test/resources/query/sql_tableau/query28.sql
@@ -0,0 +1,23 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+-- This query don't result exact same average number as H2 DB
+
+select lstg_format_name, avg(price) as GMV
+ from test_kylin_fact 
+ group by lstg_format_name 

http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/kylin-it/src/test/resources/query/sql_tableau/query67.sql
--
diff --git a/kylin-it/src/test/resources/query/sql_tableau/query67.sql 
b/kylin-it/src/test/resources/query/sql_tableau/query67.sql
new file mode 100644
index 000..25cc110
--- /dev/null
+++ b/kylin-it/src/test/resources/query/sql_tableau/query67.sql
@@ -0,0 +1,23 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+SELECT (CASE "TEST_KYLIN_FACT"."LSTG_FORMAT_NAME" WHEN 'Auction' THEN '111' 
ELSE '222' END) AS "LSTG_FORMAT_NAME__group_",
+  SUM("TEST_KYLIN_FACT"."PRICE") AS "sum_PRICE_ok"
+FROM "TEST_KYLIN_FACT" "TEST_KYLIN_FACT"
+--group by (CASE "TEST_KYLIN_FACT"."LSTG_FORMAT_NAME" WHEN 'Auction' THEN 
'111' ELSE '222' END)  ORDER BY 1 ASC
+GROUP BY "TEST_KYLIN_FACT"."LSTG_FORMAT_NAME"  ORDER BY 1 ASC


[12/13] kylin git commit: KYLIN-1356 move all it to a seprate module

2016-01-23 Thread mahongbin
http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/assembly/src/test/java/org/apache/kylin/source/hive/ITHiveSourceTableLoaderTest.java
--
diff --git 
a/assembly/src/test/java/org/apache/kylin/source/hive/ITHiveSourceTableLoaderTest.java
 
b/assembly/src/test/java/org/apache/kylin/source/hive/ITHiveSourceTableLoaderTest.java
deleted file mode 100644
index 23780cf..000
--- 
a/assembly/src/test/java/org/apache/kylin/source/hive/ITHiveSourceTableLoaderTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.apache.kylin.source.hive;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.Set;
-
-import org.apache.kylin.common.KylinConfig;
-import org.apache.kylin.storage.hbase.steps.HBaseMetadataTestCase;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ITHiveSourceTableLoaderTest extends HBaseMetadataTestCase {
-
-@Before
-public void setup() throws Exception {
-super.createTestMetadata();
-}
-
-@After
-public void after() throws Exception {
-super.cleanupTestMetadata();
-}
-
-@Test
-public void test() throws IOException {
-KylinConfig config = getTestConfig();
-String[] toLoad = new String[] { "DEFAULT.TEST_KYLIN_FACT", 
"EDW.TEST_CAL_DT" };
-Set loaded = HiveSourceTableLoader.reloadHiveTables(toLoad, 
config);
-
-assertTrue(loaded.size() == toLoad.length);
-for (String str : toLoad)
-assertTrue(loaded.contains(str));
-}
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/assembly/src/test/java/org/apache/kylin/source/hive/ITHiveTableReaderTest.java
--
diff --git 
a/assembly/src/test/java/org/apache/kylin/source/hive/ITHiveTableReaderTest.java
 
b/assembly/src/test/java/org/apache/kylin/source/hive/ITHiveTableReaderTest.java
deleted file mode 100644
index 57c0be3..000
--- 
a/assembly/src/test/java/org/apache/kylin/source/hive/ITHiveTableReaderTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.apache.kylin.source.hive;
-
-import java.io.IOException;
-
-import org.apache.kylin.storage.hbase.steps.HBaseMetadataTestCase;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * This test case need the hive runtime; Please run it with sandbox;
- * @author shaoshi
- *
- * It is in the exclude list of default profile in pom.xml
- */
-public class ITHiveTableReaderTest extends HBaseMetadataTestCase {
-
-@Test
-public void test() throws IOException {
-HiveTableReader reader = new HiveTableReader("default", 
"test_kylin_fact");
-int rowNumber = 0;
-while (reader.next()) {
-String[] row = reader.getRow();
-Assert.assertEquals(9, row.length);
-//System.out.println(ArrayUtils.toString(row));
-rowNumber++;
-}
-
-reader.close();
-Assert.assertEquals(1, rowNumber);
-}
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/assembly/src/test/java/org/apache/kylin/source/hive/ITSnapshotManagerTest.java
--
diff --git 

[02/13] kylin git commit: KYLIN-1356 move all it to a seprate module

2016-01-23 Thread mahongbin
http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/query/src/test/resources/query/sql_lookup/query03.sql
--
diff --git a/query/src/test/resources/query/sql_lookup/query03.sql 
b/query/src/test/resources/query/sql_lookup/query03.sql
deleted file mode 100644
index f663627..000
--- a/query/src/test/resources/query/sql_lookup/query03.sql
+++ /dev/null
@@ -1,19 +0,0 @@
---
--- Licensed to the Apache Software Foundation (ASF) under one
--- or more contributor license agreements.  See the NOTICE file
--- distributed with this work for additional information
--- regarding copyright ownership.  The ASF licenses this file
--- to you under the Apache License, Version 2.0 (the
--- "License"); you may not use this file except in compliance
--- with the License.  You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
---
-
-select SELLER_TYPE_DESC, SELLER_TYPE_CD from edw.test_seller_type_dim

http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/query/src/test/resources/query/sql_lookup/query04.sql
--
diff --git a/query/src/test/resources/query/sql_lookup/query04.sql 
b/query/src/test/resources/query/sql_lookup/query04.sql
deleted file mode 100644
index 69a77d7..000
--- a/query/src/test/resources/query/sql_lookup/query04.sql
+++ /dev/null
@@ -1,19 +0,0 @@
---
--- Licensed to the Apache Software Foundation (ASF) under one
--- or more contributor license agreements.  See the NOTICE file
--- distributed with this work for additional information
--- regarding copyright ownership.  The ASF licenses this file
--- to you under the Apache License, Version 2.0 (the
--- "License"); you may not use this file except in compliance
--- with the License.  You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
---
-
-select SITE_NAME, SITE_ID from edw.test_sites

http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/query/src/test/resources/query/sql_optimize/enable-limit01.sql
--
diff --git a/query/src/test/resources/query/sql_optimize/enable-limit01.sql 
b/query/src/test/resources/query/sql_optimize/enable-limit01.sql
deleted file mode 100644
index 4a62d92..000
--- a/query/src/test/resources/query/sql_optimize/enable-limit01.sql
+++ /dev/null
@@ -1,19 +0,0 @@
---
--- Licensed to the Apache Software Foundation (ASF) under one
--- or more contributor license agreements.  See the NOTICE file
--- distributed with this work for additional information
--- regarding copyright ownership.  The ASF licenses this file
--- to you under the Apache License, Version 2.0 (the
--- "License"); you may not use this file except in compliance
--- with the License.  You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
---
-
-select * from test_kylin_fact limit 10

http://git-wip-us.apache.org/repos/asf/kylin/blob/59943fee/query/src/test/resources/query/sql_orderby/query01.sql
--
diff --git a/query/src/test/resources/query/sql_orderby/query01.sql 
b/query/src/test/resources/query/sql_orderby/query01.sql
deleted file mode 100644
index a1d5065..000
--- a/query/src/test/resources/query/sql_orderby/query01.sql
+++ /dev/null
@@ -1,32 +0,0 @@
---
--- Licensed to the Apache Software Foundation (ASF) under one
--- or more contributor license agreements.  See the NOTICE file
--- distributed with this work for additional information
--- regarding copyright ownership.  The ASF licenses this file
--- to you under the Apache License, Version 2.0 (the
--- "License"); you may not use this file except in compliance
--- with the License.  You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or