Repository: kylin Updated Branches: refs/heads/2.0-rc 0ab80b180 -> eea008c4d
KYLIN-1294 Add test cases first Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/eea008c4 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/eea008c4 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/eea008c4 Branch: refs/heads/2.0-rc Commit: eea008c4d28a13437ea3250c433b104673f5658b Parents: 0ab80b1 Author: Li, Yang <[email protected]> Authored: Thu Jan 7 11:30:56 2016 +0800 Committer: Li, Yang <[email protected]> Committed: Thu Jan 7 11:30:56 2016 +0800 ---------------------------------------------------------------------- .../kylin/query/test/ITKylinQueryTest.java | 4 +-- query/src/test/resources/query/sql/query90.sql | 30 ++++++++++++++++++++ query/src/test/resources/query/sql/query91.sql | 30 ++++++++++++++++++++ query/src/test/resources/query/sql/query92.sql | 30 ++++++++++++++++++++ query/src/test/resources/query/sql/query93.sql | 30 ++++++++++++++++++++ 5 files changed, 122 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/eea008c4/query/src/test/java/org/apache/kylin/query/test/ITKylinQueryTest.java ---------------------------------------------------------------------- diff --git a/query/src/test/java/org/apache/kylin/query/test/ITKylinQueryTest.java b/query/src/test/java/org/apache/kylin/query/test/ITKylinQueryTest.java index 90d327c..3b56942 100644 --- a/query/src/test/java/org/apache/kylin/query/test/ITKylinQueryTest.java +++ b/query/src/test/java/org/apache/kylin/query/test/ITKylinQueryTest.java @@ -40,7 +40,7 @@ import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; -@Ignore("KylinQueryTest is contained by ITCombinationTest") +//@Ignore("KylinQueryTest is contained by ITCombinationTest") public class ITKylinQueryTest extends KylinTestBase { @BeforeClass @@ -95,7 +95,7 @@ public class ITKylinQueryTest extends KylinTestBase { @Test public void testSingleRunQuery() throws Exception { - String queryFileName = "src/test/resources/query/temp/query01.sql"; + String queryFileName = "src/test/resources/query/sql/sample.txt"; File sqlFile = new File(queryFileName); if (sqlFile.exists()) { http://git-wip-us.apache.org/repos/asf/kylin/blob/eea008c4/query/src/test/resources/query/sql/query90.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql/query90.sql b/query/src/test/resources/query/sql/query90.sql new file mode 100644 index 0000000..e551a45 --- /dev/null +++ b/query/src/test/resources/query/sql/query90.sql @@ -0,0 +1,30 @@ +-- +-- 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 meta_categ_name, count(1) as cnt, sum(price) as GMV + + from test_kylin_fact + left JOIN edw.test_cal_dt as test_cal_dt + ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt + left 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 + left JOIN edw.test_sites as test_sites + ON test_kylin_fact.lstg_site_id = test_sites.site_id + + where meta_categ_name not in ('', 'a') + group by meta_categ_name http://git-wip-us.apache.org/repos/asf/kylin/blob/eea008c4/query/src/test/resources/query/sql/query91.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql/query91.sql b/query/src/test/resources/query/sql/query91.sql new file mode 100644 index 0000000..cc6dca5 --- /dev/null +++ b/query/src/test/resources/query/sql/query91.sql @@ -0,0 +1,30 @@ +-- +-- 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 meta_categ_name, count(1) as cnt, sum(price) as GMV + + from test_kylin_fact + left JOIN edw.test_cal_dt as test_cal_dt + ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt + left 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 + left JOIN edw.test_sites as test_sites + ON test_kylin_fact.lstg_site_id = test_sites.site_id + + where meta_categ_name is not null + group by meta_categ_name http://git-wip-us.apache.org/repos/asf/kylin/blob/eea008c4/query/src/test/resources/query/sql/query92.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql/query92.sql b/query/src/test/resources/query/sql/query92.sql new file mode 100644 index 0000000..c7899fd --- /dev/null +++ b/query/src/test/resources/query/sql/query92.sql @@ -0,0 +1,30 @@ +-- +-- 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 meta_categ_name, count(1) as cnt, sum(price) as GMV + + from test_kylin_fact + left JOIN edw.test_cal_dt as test_cal_dt + ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt + left 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 + left JOIN edw.test_sites as test_sites + ON test_kylin_fact.lstg_site_id = test_sites.site_id + + where meta_categ_name not in ('Unknown') + group by meta_categ_name http://git-wip-us.apache.org/repos/asf/kylin/blob/eea008c4/query/src/test/resources/query/sql/query93.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql/query93.sql b/query/src/test/resources/query/sql/query93.sql new file mode 100644 index 0000000..578b93f --- /dev/null +++ b/query/src/test/resources/query/sql/query93.sql @@ -0,0 +1,30 @@ +-- +-- 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 meta_categ_name, count(1) as cnt, sum(price) as GMV + + from test_kylin_fact + left JOIN edw.test_cal_dt as test_cal_dt + ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt + left 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 + left JOIN edw.test_sites as test_sites + ON test_kylin_fact.lstg_site_id = test_sites.site_id + + where meta_categ_name not in ('Unknown', 'ToyHobbies', '', 'a', 'BookMagazines') + group by meta_categ_name
