http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_tableau/query07.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query07.sql b/query/src/test/resources/query/sql_tableau/query07.sql deleted file mode 100644 index 5c137e3..0000000 --- a/query/src/test/resources/query/sql_tableau/query07.sql +++ /dev/null @@ -1,26 +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("TableauSQL"."GMV") AS "sum_GMV_ok", SUM("TableauSQL"."TRANS_CNT") AS "sum_TRANS_CNT_ok" - FROM ( - SELECT test_cal_dt.week_beg_dt ,test_category_groupings.meta_categ_name ,test_category_groupings.categ_lvl2_name ,test_category_groupings.categ_lvl3_name ,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT - 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 - 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 - group by test_cal_dt.week_beg_dt ,test_category_groupings.meta_categ_name ,test_category_groupings.categ_lvl2_name ,test_category_groupings.categ_lvl3_name - ) "TableauSQL" HAVING (COUNT(1) > 0)
http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_tableau/query08.sql.disabled ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query08.sql.disabled b/query/src/test/resources/query/sql_tableau/query08.sql.disabled deleted file mode 100644 index c2fc675..0000000 --- a/query/src/test/resources/query/sql_tableau/query08.sql.disabled +++ /dev/null @@ -1,24 +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. --- - --- LEAF_CATEG_ID is a join field on fact table, but no on cuboid. We really support this? - -SELECT "TEST_KYLIN_FACT"."LEAF_CATEG_ID" AS "NONE_LEAF_CATEG_ID_OK" -FROM "olap"."TEST_KYLIN_FACT" "TEST_KYLIN_FACT" -GROUP BY "TEST_KYLIN_FACT"."LEAF_CATEG_ID" - http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_tableau/query09.sql.disabled ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query09.sql.disabled b/query/src/test/resources/query/sql_tableau/query09.sql.disabled deleted file mode 100644 index 6b6ad41..0000000 --- a/query/src/test/resources/query/sql_tableau/query09.sql.disabled +++ /dev/null @@ -1,57 +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_CATEGORY_GROUPINGS"."ADULT_CATEG_YN" AS "ADULT_CATEG_YN", - "TEST_CATEGORY_GROUPINGS"."BSNS_VRTCL_NAME" AS "BSNS_VRTCL_NAME", - "TEST_CATEGORY_GROUPINGS"."CATEG_BUSN_MGR" AS "CATEG_BUSN_MGR", - "TEST_CATEGORY_GROUPINGS"."CATEG_BUSN_UNIT" AS "CATEG_BUSN_UNIT", - "TEST_CATEGORY_GROUPINGS"."CATEG_FLAGS" AS "CATEG_FLAGS", - "TEST_CATEGORY_GROUPINGS"."CATEG_LVL2_ID" AS "CATEG_LVLC_ID", - "TEST_CATEGORY_GROUPINGS"."CATEG_LVL2_NAME" AS "CATEG_LVLC_NAME", - "TEST_CATEGORY_GROUPINGS"."CATEG_LVL3_ID" AS "CATEG_LVLD_ID", - "TEST_CATEGORY_GROUPINGS"."CATEG_LVL3_NAME" AS "CATEG_LVLD_NAME", - "TEST_CATEGORY_GROUPINGS"."CATEG_LVL4_ID" AS "CATEG_LVLE_ID", - "TEST_CATEGORY_GROUPINGS"."CATEG_LVL4_NAME" AS "CATEG_LVLE_NAME", - "TEST_CATEGORY_GROUPINGS"."CATEG_LVL5_ID" AS "CATEG_LVLF_ID", - "TEST_CATEGORY_GROUPINGS"."CATEG_LVL5_NAME" AS "CATEG_LVLF_NAME", - "TEST_CATEGORY_GROUPINGS"."CATEG_LVL6_ID" AS "CATEG_LVLG_ID", - "TEST_CATEGORY_GROUPINGS"."CATEG_LVL6_NAME" AS "CATEG_LVLG_NAME", - "TEST_CATEGORY_GROUPINGS"."CATEG_LVL7_ID" AS "CATEG_LVLH_ID", - "TEST_CATEGORY_GROUPINGS"."CATEG_LVL7_NAME" AS "CATEG_LVLH_NAME", - "TEST_CATEGORY_GROUPINGS"."CRE_DATE" AS "CRE_DATE", - "TEST_CATEGORY_GROUPINGS"."CRE_USER" AS "CRE_USER", - "TEST_CATEGORY_GROUPINGS"."DOMAIN_ID" AS "DOMAIN_ID", - "TEST_CATEGORY_GROUPINGS"."GCS_ID" AS "GCS_ID", - "TEST_CATEGORY_GROUPINGS"."LEAF_CATEG_ID" AS "LEAF_CATEG_ID", - "TEST_CATEGORY_GROUPINGS"."LEAF_CATEG_NAME" AS "LEAF_CATEG_NAME", - "TEST_CATEGORY_GROUPINGS"."META_CATEG_ID" AS "META_CATEG_ID", - "TEST_CATEGORY_GROUPINGS"."META_CATEG_NAME" AS "META_CATEG_NAME", - "TEST_CATEGORY_GROUPINGS"."MOVE_TO" AS "MOVE_TO", - 1 AS "Number_of_Records", - "TEST_CATEGORY_GROUPINGS"."REGN_CATEG" AS "REGN_CATEG", - "TEST_CATEGORY_GROUPINGS"."SAP_CATEGORY_ID" AS "SAP_CATEGORY_ID", - "TEST_CATEGORY_GROUPINGS"."SITE_ID" AS "SITE_ID", - "TEST_CATEGORY_GROUPINGS"."SRC_ID" AS "SRC_ID", - "TEST_CATEGORY_GROUPINGS"."UPD_DATE" AS "UPD_DATE", - "TEST_CATEGORY_GROUPINGS"."UPD_USER" AS "UPD_USER", - "TEST_CATEGORY_GROUPINGS"."USER_DEFINED_FIELD1" AS "USER_DEFINED_FIELDB", - "TEST_CATEGORY_GROUPINGS"."USER_DEFINED_FIELD3" AS "USER_DEFINED_FIELDD", - "TEST_CATEGORY_GROUPINGS"."USER_DEFINED_FIELD5" AS "USER_DEFINED_FIELDF", - "TEST_CATEGORY_GROUPINGS"."VCS_ID" AS "VCS_ID" -FROM "olap"."TEST_CATEGORY_GROUPINGS" "TEST_CATEGORY_GROUPINGS" -LIMIT 10000 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_tableau/query10.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query10.sql b/query/src/test/resources/query/sql_tableau/query10.sql deleted file mode 100644 index cf43fa7..0000000 --- a/query/src/test/resources/query/sql_tableau/query10.sql +++ /dev/null @@ -1,23 +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_CAL_DT"."WEEK_BEG_DT" AS "none_WEEK_BEG_DT_nk", - SUM("TEST_KYLIN_FACT"."PRICE") AS "sum_PRICE_ok" - 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" http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_tableau/query11.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query11.sql b/query/src/test/resources/query/sql_tableau/query11.sql deleted file mode 100644 index 7d908fd..0000000 --- a/query/src/test/resources/query/sql_tableau/query11.sql +++ /dev/null @@ -1,24 +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 COUNT(1) AS cnt_ITEM_COUNT_ok, - TEST_CAL_DT.WEEK_BEG_DT AS none_WEEK_BEG_DT_nk - 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" - http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_tableau/query12.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query12.sql b/query/src/test/resources/query/sql_tableau/query12.sql deleted file mode 100644 index cf43fa7..0000000 --- a/query/src/test/resources/query/sql_tableau/query12.sql +++ /dev/null @@ -1,23 +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_CAL_DT"."WEEK_BEG_DT" AS "none_WEEK_BEG_DT_nk", - SUM("TEST_KYLIN_FACT"."PRICE") AS "sum_PRICE_ok" - 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" http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_tableau/query13.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query13.sql b/query/src/test/resources/query/sql_tableau/query13.sql deleted file mode 100644 index e1b00d9..0000000 --- a/query/src/test/resources/query/sql_tableau/query13.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 --- --- 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 EXTRACT(YEAR FROM TEST_CAL_DT.WEEK_BEG_DT) AS yr_WEEK_BEG_DT_ok - 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 EXTRACT(YEAR FROM TEST_CAL_DT.WEEK_BEG_DT) http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_tableau/query14.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query14.sql b/query/src/test/resources/query/sql_tableau/query14.sql deleted file mode 100644 index 50d8952..0000000 --- a/query/src/test/resources/query/sql_tableau/query14.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 QUARTER("TEST_CAL_DT"."WEEK_BEG_DT") AS "qr_WEEK_BEG_DT_ok", EXTRACT(YEAR FROM "TEST_CAL_DT"."WEEK_BEG_DT") AS "yr_WEEK_BEG_DT_ok" 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 QUARTER("TEST_CAL_DT"."WEEK_BEG_DT"), EXTRACT(YEAR FROM "TEST_CAL_DT"."WEEK_BEG_DT") http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_tableau/query15.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query15.sql b/query/src/test/resources/query/sql_tableau/query15.sql deleted file mode 100644 index 8f30460..0000000 --- a/query/src/test/resources/query/sql_tableau/query15.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 --- --- 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 QUARTER(TEST_CAL_DT.WEEK_BEG_DT) AS qr_WEEK_BEG_DT_ok - 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 QUARTER(TEST_CAL_DT.WEEK_BEG_DT) http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_tableau/query16.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query16.sql b/query/src/test/resources/query/sql_tableau/query16.sql deleted file mode 100644 index aaa4ab2..0000000 --- a/query/src/test/resources/query/sql_tableau/query16.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 --- --- 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 EXTRACT(YEAR FROM TEST_CAL_DT.WEEK_BEG_DT) AS yr_WEEK_BEG_DT_ok, QUARTER(TEST_CAL_DT.WEEK_BEG_DT) AS qr_WEEK_BEG_DT_ok - 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 EXTRACT(YEAR FROM TEST_CAL_DT.WEEK_BEG_DT), QUARTER(TEST_CAL_DT.WEEK_BEG_DT) http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_tableau/query17.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query17.sql b/query/src/test/resources/query/sql_tableau/query17.sql deleted file mode 100644 index 11f6df1..0000000 --- a/query/src/test/resources/query/sql_tableau/query17.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 EXTRACT(MONTH FROM "TEST_CAL_DT"."WEEK_BEG_DT") AS "mn_WEEK_BEG_DT_ok", (( EXTRACT(YEAR FROM "TEST_CAL_DT"."WEEK_BEG_DT") * 100) + EXTRACT(MONTH FROM "TEST_CAL_DT"."WEEK_BEG_DT")) AS "my_WEEK_BEG_DT_ok", QUARTER("TEST_CAL_DT"."WEEK_BEG_DT") AS "qr_WEEK_BEG_DT_ok", EXTRACT(YEAR FROM "TEST_CAL_DT"."WEEK_BEG_DT") AS "yr_WEEK_BEG_DT_ok" 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 EXTRACT(YEAR FROM "TEST_CAL_DT"."WEEK_BEG_DT"), QUARTER("TEST_CAL_DT"."WEEK_BEG_DT"), (( EXTRACT(YEAR FROM "TEST_CAL_DT"."WEEK_BEG_DT") * 100) + EXTRACT(MONTH FROM "TEST_CAL_DT"."WEEK_BEG_DT")), EXTRACT(MONTH FROM "TEST_CAL_DT"."WEEK_BEG_DT") http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_tableau/query18.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query18.sql b/query/src/test/resources/query/sql_tableau/query18.sql deleted file mode 100644 index 188ceb7..0000000 --- a/query/src/test/resources/query/sql_tableau/query18.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(price) as GMV, count(seller_id) 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/1428bbc4/query/src/test/resources/query/sql_tableau/query19.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query19.sql b/query/src/test/resources/query/sql_tableau/query19.sql deleted file mode 100644 index 5f6e086..0000000 --- a/query/src/test/resources/query/sql_tableau/query19.sql +++ /dev/null @@ -1,26 +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 "TableauSQL"."LSTG_FORMAT_NAME" AS "none_LSTG_FORMAT_NAME_nk", SUM("TableauSQL"."TRANS_CNT") AS "sum_TRANS_CNT_qk" - 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/1428bbc4/query/src/test/resources/query/sql_tableau/query20.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query20.sql b/query/src/test/resources/query/sql_tableau/query20.sql deleted file mode 100644 index c776128..0000000 --- a/query/src/test/resources/query/sql_tableau/query20.sql +++ /dev/null @@ -1,26 +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 "TableauSQL"."LSTG_FORMAT_NAME" AS "none_LSTG_FORMAT_NAME_nk", SUM("TableauSQL"."TRANS_CNT") AS "sum_TRANS_CNT_qk" - FROM ( select test_kylin_fact.lstg_format_name, sum(price) as GMV, count(seller_id) as TRANS_CNT - from test_kylin_fact where test_kylin_fact.lstg_format_name > 'ab' - group by test_kylin_fact.lstg_format_name having count(seller_id) > 2 ) "TableauSQL" - GROUP BY "TableauSQL"."LSTG_FORMAT_NAME" http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_tableau/query21.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query21.sql b/query/src/test/resources/query/sql_tableau/query21.sql deleted file mode 100644 index 3e3208b..0000000 --- a/query/src/test/resources/query/sql_tableau/query21.sql +++ /dev/null @@ -1,27 +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, test_cal_dt.week_beg_dt,sum(test_kylin_fact.price) as GMV - , count(*) as TRANS_CNT - 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_cal_dt.week_beg_dt between DATE '2013-05-01' and DATE '2013-08-01' - group by test_kylin_fact.lstg_format_name, test_cal_dt.week_beg_dt - having sum(price)>500 - limit 1 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_tableau/query22.sql.disabled ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query22.sql.disabled b/query/src/test/resources/query/sql_tableau/query22.sql.disabled deleted file mode 100644 index 17ec731..0000000 --- a/query/src/test/resources/query/sql_tableau/query22.sql.disabled +++ /dev/null @@ -1,28 +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 fact.cal_dt, sum(fact.price) from test_kylin_fact fact -left join test_cal_dt cal - on fact.cal_dt=cal.cal_dt -inner join -( - select test_kylin_fact.cal_dt, count(1) from test_kylin_fact left join test_cal_dt - on test_kylin_fact.cal_dt=test_cal_dt.cal_dt group by test_kylin_fact.cal_dt order by 2 desc limit 2 -) cal_2 - on fact.cal_dt = cal_2.cal_dt -group by fact.cal_dt http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_tableau/query23.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query23.sql b/query/src/test/resources/query/sql_tableau/query23.sql deleted file mode 100644 index 10430ab..0000000 --- a/query/src/test/resources/query/sql_tableau/query23.sql +++ /dev/null @@ -1,23 +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 fact.cal_dt, sum(fact.price) from test_kylin_fact fact -left join EDW.TEST_CAL_DT cal on fact.cal_dt=cal.cal_dt -where cal.cal_dt = date '2012-05-17' or cal.cal_dt = date '2013-05-17' -group by fact.cal_dt http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_tableau/query24.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query24.sql b/query/src/test/resources/query/sql_tableau/query24.sql deleted file mode 100644 index 29a69aa..0000000 --- a/query/src/test/resources/query/sql_tableau/query24.sql +++ /dev/null @@ -1,24 +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.cal_dt, count(1) as cnt_1 -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 -group by test_kylin_fact.cal_dt -order by 2 desc -limit 3 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_tableau/query25.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query25.sql b/query/src/test/resources/query/sql_tableau/query25.sql deleted file mode 100644 index cdc98b7..0000000 --- a/query/src/test/resources/query/sql_tableau/query25.sql +++ /dev/null @@ -1,28 +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"."CAL_DT", SUM("TEST_KYLIN_FACT"."PRICE") AS "sum_PRICE_ok" - 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") - 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" - INNER JOIN "EDW"."TEST_CAL_DT" AS "TEST_CAL_DT" ON ("TEST_KYLIN_FACT"."CAL_DT" = "TEST_CAL_DT"."CAL_DT") - GROUP BY "TEST_KYLIN_FACT"."CAL_DT" ORDER BY 2 DESC LIMIT 10 ) "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/1428bbc4/query/src/test/resources/query/sql_tableau/query27.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query27.sql b/query/src/test/resources/query/sql_tableau/query27.sql deleted file mode 100644 index beeb168..0000000 --- a/query/src/test/resources/query/sql_tableau/query27.sql +++ /dev/null @@ -1,24 +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"."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/1428bbc4/query/src/test/resources/query/sql_tableau/query28.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query28.sql b/query/src/test/resources/query/sql_tableau/query28.sql deleted file mode 100644 index 48cc342..0000000 --- a/query/src/test/resources/query/sql_tableau/query28.sql +++ /dev/null @@ -1,23 +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. --- - --- 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/1428bbc4/query/src/test/resources/query/sql_tableau/query67.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_tableau/query67.sql b/query/src/test/resources/query/sql_tableau/query67.sql deleted file mode 100644 index 25cc110..0000000 --- a/query/src/test/resources/query/sql_tableau/query67.sql +++ /dev/null @@ -1,23 +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 (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 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_topn/query81.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_topn/query81.sql b/query/src/test/resources/query/sql_topn/query81.sql deleted file mode 100644 index 93868e7..0000000 --- a/query/src/test/resources/query/sql_topn/query81.sql +++ /dev/null @@ -1,28 +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_cal_dt.week_beg_dt, sum(price) as GMV - 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 - 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 edw.test_sites as test_sites - ON test_kylin_fact.lstg_site_id = test_sites.site_id - where test_cal_dt.week_beg_dt between DATE '2013-09-01' and DATE '2013-10-01' and (lstg_format_name='FP-GTC' or 'a' = 'b') - group by test_cal_dt.week_beg_dt \ No newline at end of file http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_topn/query82.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_topn/query82.sql b/query/src/test/resources/query/sql_topn/query82.sql deleted file mode 100644 index 57e9de0..0000000 --- a/query/src/test/resources/query/sql_topn/query82.sql +++ /dev/null @@ -1,27 +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.cal_dt, seller_id - 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 - 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 - group by - test_kylin_fact.cal_dt, test_kylin_fact.seller_id order by sum(test_kylin_fact.price) desc limit 20 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_topn/query83.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_topn/query83.sql b/query/src/test/resources/query/sql_topn/query83.sql deleted file mode 100644 index 514beb4..0000000 --- a/query/src/test/resources/query/sql_topn/query83.sql +++ /dev/null @@ -1,29 +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_id - 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 - 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 - where test_kylin_fact.cal_dt < DATE '2013-02-01' - group by - test_kylin_fact.seller_id order by sum(test_kylin_fact.price) desc limit 20 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_verifyCount/query04.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_verifyCount/query04.sql b/query/src/test/resources/query/sql_verifyCount/query04.sql deleted file mode 100644 index 9d3e409..0000000 --- a/query/src/test/resources/query/sql_verifyCount/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 * from test_kylin_fact limit 100 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_verifyCount/query04.sql.expected ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_verifyCount/query04.sql.expected b/query/src/test/resources/query/sql_verifyCount/query04.sql.expected deleted file mode 100644 index 29d6383..0000000 --- a/query/src/test/resources/query/sql_verifyCount/query04.sql.expected +++ /dev/null @@ -1 +0,0 @@ -100 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_verifyCount/query05.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_verifyCount/query05.sql b/query/src/test/resources/query/sql_verifyCount/query05.sql deleted file mode 100644 index 753a85a..0000000 --- a/query/src/test/resources/query/sql_verifyCount/query05.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 price from test_kylin_fact limit 100 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_verifyCount/query05.sql.expected ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_verifyCount/query05.sql.expected b/query/src/test/resources/query/sql_verifyCount/query05.sql.expected deleted file mode 100644 index 29d6383..0000000 --- a/query/src/test/resources/query/sql_verifyCount/query05.sql.expected +++ /dev/null @@ -1 +0,0 @@ -100 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_verifyCount/query06.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_verifyCount/query06.sql b/query/src/test/resources/query/sql_verifyCount/query06.sql deleted file mode 100644 index 39578a4..0000000 --- a/query/src/test/resources/query/sql_verifyCount/query06.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 lstg_format_name from test_kylin_fact limit 100 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_verifyCount/query06.sql.expected ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_verifyCount/query06.sql.expected b/query/src/test/resources/query/sql_verifyCount/query06.sql.expected deleted file mode 100644 index 29d6383..0000000 --- a/query/src/test/resources/query/sql_verifyCount/query06.sql.expected +++ /dev/null @@ -1 +0,0 @@ -100 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_verifyCount/query07.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_verifyCount/query07.sql b/query/src/test/resources/query/sql_verifyCount/query07.sql deleted file mode 100644 index 0afb493..0000000 --- a/query/src/test/resources/query/sql_verifyCount/query07.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 price,lstg_format_name from test_kylin_fact limit 100 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_verifyCount/query07.sql.expected ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_verifyCount/query07.sql.expected b/query/src/test/resources/query/sql_verifyCount/query07.sql.expected deleted file mode 100644 index 29d6383..0000000 --- a/query/src/test/resources/query/sql_verifyCount/query07.sql.expected +++ /dev/null @@ -1 +0,0 @@ -100 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_verifyCount/query08.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_verifyCount/query08.sql b/query/src/test/resources/query/sql_verifyCount/query08.sql deleted file mode 100644 index 0f467f8..0000000 --- a/query/src/test/resources/query/sql_verifyCount/query08.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 lstg_format_name,sum(price) as sp from test_kylin_fact group by lstg_format_name limit 1 offset 2 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/sql_verifyCount/query08.sql.expected ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/sql_verifyCount/query08.sql.expected b/query/src/test/resources/query/sql_verifyCount/query08.sql.expected deleted file mode 100644 index d00491f..0000000 --- a/query/src/test/resources/query/sql_verifyCount/query08.sql.expected +++ /dev/null @@ -1 +0,0 @@ -1 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/tableau_probing/query01.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/tableau_probing/query01.sql b/query/src/test/resources/query/tableau_probing/query01.sql deleted file mode 100644 index 11fce3e..0000000 --- a/query/src/test/resources/query/tableau_probing/query01.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 1 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/tableau_probing/query02.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/tableau_probing/query02.sql b/query/src/test/resources/query/tableau_probing/query02.sql deleted file mode 100644 index f2f9f42..0000000 --- a/query/src/test/resources/query/tableau_probing/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 1 AS "COL" http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/tableau_probing/query03.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/tableau_probing/query03.sql b/query/src/test/resources/query/tableau_probing/query03.sql deleted file mode 100644 index 19613c9b..0000000 --- a/query/src/test/resources/query/tableau_probing/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 "COL" FROM (SELECT 1 AS "COL") AS "SUBQUERY" http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/tableau_probing/query04.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/tableau_probing/query04.sql b/query/src/test/resources/query/tableau_probing/query04.sql deleted file mode 100644 index da0d3a2..0000000 --- a/query/src/test/resources/query/tableau_probing/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 TOP 1 "COL" FROM (SELECT 1 AS "COL") AS "CHECKTOP" http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/tableau_probing/query05.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/tableau_probing/query05.sql b/query/src/test/resources/query/tableau_probing/query05.sql deleted file mode 100644 index 7fae0d7..0000000 --- a/query/src/test/resources/query/tableau_probing/query05.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 "COL" FROM (SELECT 1 AS "COL") AS "CHECKTOP" LIMIT 1 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/tableau_probing/query06.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/tableau_probing/query06.sql b/query/src/test/resources/query/tableau_probing/query06.sql deleted file mode 100644 index 1a609bb..0000000 --- a/query/src/test/resources/query/tableau_probing/query06.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 "SUBCOL" AS "COL" FROM ( SELECT 1 AS "SUBCOL" ) "SUBQUERY" GROUP BY 1 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/tableau_probing/query07.sql ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/tableau_probing/query07.sql b/query/src/test/resources/query/tableau_probing/query07.sql deleted file mode 100644 index e2722d6..0000000 --- a/query/src/test/resources/query/tableau_probing/query07.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 "SUBCOL" AS "COL" FROM ( SELECT 1 AS "SUBCOL" ) "SUBQUERY" GROUP BY 2 http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/query/src/test/resources/query/temp/.gitignore ---------------------------------------------------------------------- diff --git a/query/src/test/resources/query/temp/.gitignore b/query/src/test/resources/query/temp/.gitignore deleted file mode 100644 index d1b811b..0000000 --- a/query/src/test/resources/query/temp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.sql http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/server/pom.xml ---------------------------------------------------------------------- diff --git a/server/pom.xml b/server/pom.xml index abf898e..7c1d58a 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -17,7 +17,8 @@ limitations under the License. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>kylin-server</artifactId> @@ -82,7 +83,7 @@ <scope>test</scope> <version>${project.parent.version}</version> </dependency> - + <!-- depends on kylin-jdbc just for running jdbc test cases in server module --> <dependency> <groupId>org.apache.kylin</groupId> @@ -258,7 +259,7 @@ <artifactId>super-csv</artifactId> <version>2.1.0</version> </dependency> - + <!-- spring aop --> <dependency> <groupId>org.aspectj</groupId> @@ -385,7 +386,7 @@ </exclusion> </exclusions> </dependency> - <dependency> + <dependency> <groupId>org.apache.hive.hcatalog</groupId> <artifactId>hive-hcatalog-core</artifactId> <version>${hive-hcatalog.version}</version> @@ -400,7 +401,7 @@ <artifactId>jsp-api</artifactId> </exclusion> </exclusions> - </dependency> + </dependency> <!-- Tomcat Env --> <dependency> <groupId>org.apache.tomcat</groupId> @@ -469,6 +470,14 @@ <build> <plugins> <plugin> + <artifactId>maven-war-plugin</artifactId> + <version>2.1.1</version> + <configuration> + <attachClasses>true</attachClasses> + <classesClassifier>classes</classesClassifier> + </configuration> + </plugin> + <plugin> <artifactId>maven-compiler-plugin</artifactId> </plugin> <plugin> http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/server/src/main/java/org/apache/kylin/rest/DebugTomcat.java ---------------------------------------------------------------------- diff --git a/server/src/main/java/org/apache/kylin/rest/DebugTomcat.java b/server/src/main/java/org/apache/kylin/rest/DebugTomcat.java index 0b7aa70..c0f61d2 100644 --- a/server/src/main/java/org/apache/kylin/rest/DebugTomcat.java +++ b/server/src/main/java/org/apache/kylin/rest/DebugTomcat.java @@ -27,6 +27,7 @@ import org.apache.catalina.core.AprLifecycleListener; import org.apache.catalina.core.StandardServer; import org.apache.catalina.deploy.ErrorPage; import org.apache.catalina.startup.Tomcat; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.util.Shell; import org.apache.kylin.common.KylinConfig; import org.apache.kylin.rest.util.ClasspathUtil; @@ -36,7 +37,7 @@ public class DebugTomcat { public static void setupDebugEnv() { try { System.setProperty("log4j.configuration", "kylin-log4j.properties"); - + // test_case_data/sandbox/ contains HDP 2.2 site xmls which is dev sandbox ClasspathUtil.addClasspath(new File("../examples/test_case_data/sandbox").getAbsolutePath()); System.setProperty(KylinConfig.KYLIN_CONF, "../examples/test_case_data/sandbox"); @@ -48,7 +49,7 @@ public class DebugTomcat { if (System.getProperty("catalina.home") == null) System.setProperty("catalina.home", "."); - if (System.getProperty("hdp.version") == null) { + 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"); } http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/server/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java ---------------------------------------------------------------------- diff --git a/server/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java b/server/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java deleted file mode 100644 index 1546576..0000000 --- a/server/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java +++ /dev/null @@ -1,281 +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.jdbc; - -import java.io.File; -import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.Statement; -import java.util.HashMap; -import java.util.List; -import java.util.Properties; - -import org.apache.commons.io.FileUtils; -import org.apache.kylin.storage.hbase.steps.HBaseMetadataTestCase; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.webapp.WebAppContext; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -import com.google.common.collect.Lists; - -/** - */ -public class ITJDBCDriverTest extends HBaseMetadataTestCase { - - private static Server server = null; - private static SystemPropertiesOverride sysPropsOverride = new SystemPropertiesOverride(); - - @BeforeClass - public static void beforeClass() throws Exception { - sysPropsOverride.override("spring.profiles.active", "testing"); - sysPropsOverride.override("catalina.home", "."); // resources/log4j.properties ref ${catalina.home} - staticCreateTestMetadata(); - startJetty(); - } - - @AfterClass - public static void afterClass() throws Exception { - stopJetty(); - staticCleanupTestMetadata(); - sysPropsOverride.restore(); - } - - protected static void stopJetty() throws Exception { - if (server != null) - server.stop(); - - File workFolder = new File("work"); - if (workFolder.isDirectory() && workFolder.exists()) { - FileUtils.deleteDirectory(workFolder); - } - } - - protected static void startJetty() throws Exception { - - server = new Server(7070); - - WebAppContext context = new WebAppContext(); - context.setDescriptor("./src/main/webapp/WEB-INF/web.xml"); - context.setResourceBase("./src/main/webapp"); - context.setContextPath("/kylin"); - context.setParentLoaderPriority(true); - - server.setHandler(context); - - server.start(); - - } - - protected Connection getConnection() throws Exception { - - Driver driver = (Driver) Class.forName("org.apache.kylin.jdbc.Driver").newInstance(); - Properties info = new Properties(); - info.put("user", "ADMIN"); - info.put("password", "KYLIN"); - Connection conn = driver.connect("jdbc:kylin://localhost:7070/default", info); - - return conn; - } - - @Test - public void testMetadata1() throws Exception { - - // check the JDBC API here: http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html - Connection conn = getConnection(); - - // test getSchemas(); - List<String> schemaList = Lists.newArrayList(); - DatabaseMetaData dbMetadata = conn.getMetaData(); - ResultSet resultSet = dbMetadata.getSchemas(); - while (resultSet.next()) { - String schema = resultSet.getString("TABLE_SCHEM"); - String catalog = resultSet.getString("TABLE_CATALOG"); - - System.out.println("Get schema: schema=" + schema + ", catalog=" + catalog); - schemaList.add(schema); - - } - - resultSet.close(); - Assert.assertTrue(schemaList.contains("DEFAULT")); - Assert.assertTrue(schemaList.contains("EDW")); - - // test getCatalogs(); - resultSet = dbMetadata.getCatalogs(); - - List<String> catalogList = Lists.newArrayList(); - while (resultSet.next()) { - String catalog = resultSet.getString("TABLE_CAT"); - - System.out.println("Get catalog: catalog=" + catalog); - catalogList.add(catalog); - - } - Assert.assertTrue(catalogList.size() > 0 && catalogList.contains("defaultCatalog")); - - /** //Disable the test on getTableTypes() as it is not ready - resultSet = dbMetadata.getTableTypes(); - - List<String> tableTypes = Lists.newArrayList(); - while (resultSet.next()) { - String type = resultSet.getString("TABLE_TYPE"); - - System.out.println("Get table type: type=" + type); - tableTypes.add(type); - - } - - Assert.assertTrue(tableTypes.size() > 0 && tableTypes.contains("TABLE")); - resultSet.close(); - - **/ - conn.close(); - } - - @Test - public void testMetadata2() throws Exception { - Connection conn = getConnection(); - - List<String> tableList = Lists.newArrayList(); - DatabaseMetaData dbMetadata = conn.getMetaData(); - ResultSet resultSet = dbMetadata.getTables(null, "%", "%", new String[] { "TABLE" }); - while (resultSet.next()) { - String schema = resultSet.getString("TABLE_SCHEM"); - String name = resultSet.getString("TABLE_NAME"); - - System.out.println("Get table: schema=" + schema + ", name=" + name); - tableList.add(schema + "." + name); - - } - - resultSet.close(); - Assert.assertTrue(tableList.contains("DEFAULT.TEST_KYLIN_FACT")); - - resultSet = dbMetadata.getColumns(null, "%", "TEST_KYLIN_FACT", "%"); - - List<String> columns = Lists.newArrayList(); - while (resultSet.next()) { - String name = resultSet.getString("COLUMN_NAME"); - String type = resultSet.getString("TYPE_NAME"); - - System.out.println("Get column: name=" + name + ", data_type=" + type); - columns.add(name); - - } - - Assert.assertTrue(columns.size() > 0 && columns.contains("CAL_DT")); - resultSet.close(); - conn.close(); - } - - @Test - public void testSimpleStatement() throws Exception { - Connection conn = getConnection(); - Statement statement = conn.createStatement(); - - statement.execute("select count(*) from test_kylin_fact"); - - ResultSet rs = statement.getResultSet(); - - Assert.assertTrue(rs.next()); - int result = rs.getInt(1); - - Assert.assertTrue(result > 0); - - rs.close(); - statement.close(); - conn.close(); - - } - - @Test - public void testPreparedStatement() throws Exception { - Connection conn = getConnection(); - - PreparedStatement statement = conn.prepareStatement("select LSTG_FORMAT_NAME, sum(price) as GMV, count(1) as TRANS_CNT from test_kylin_fact " + "where LSTG_FORMAT_NAME = ? group by LSTG_FORMAT_NAME"); - - statement.setString(1, "FP-GTC"); - - ResultSet rs = statement.executeQuery(); - - Assert.assertTrue(rs.next()); - - String format_name = rs.getString(1); - - Assert.assertTrue("FP-GTC".equals(format_name)); - - rs.close(); - statement.close(); - conn.close(); - - } - - @Test - public void testResultSet() throws Exception { - String sql = "select LSTG_FORMAT_NAME, sum(price) as GMV, count(1) as TRANS_CNT from test_kylin_fact \n" + " group by LSTG_FORMAT_NAME "; - - Connection conn = getConnection(); - Statement statement = conn.createStatement(); - - statement.execute(sql); - - ResultSet rs = statement.getResultSet(); - - int count = 0; - while (rs.next()) { - count++; - String lstg = rs.getString(1); - double gmv = rs.getDouble(2); - int trans_count = rs.getInt(3); - - System.out.println("Get a line: LSTG_FORMAT_NAME=" + lstg + ", GMV=" + gmv + ", TRANS_CNT=" + trans_count); - } - - Assert.assertTrue(count > 0); - statement.close(); - rs.close(); - conn.close(); - - } - - private static class SystemPropertiesOverride { - HashMap<String, String> backup = new HashMap<String, String>(); - - public void override(String key, String value) { - backup.put(key, System.getProperty(key)); - System.setProperty(key, value); - } - - public void restore() { - for (String key : backup.keySet()) { - String value = backup.get(key); - if (value == null) - System.clearProperty(key); - else - System.setProperty(key, value); - } - backup.clear(); - } - } -} http://git-wip-us.apache.org/repos/asf/kylin/blob/1428bbc4/server/src/test/java/org/apache/kylin/rest/controller/ITTableControllerTest.java ---------------------------------------------------------------------- diff --git a/server/src/test/java/org/apache/kylin/rest/controller/ITTableControllerTest.java b/server/src/test/java/org/apache/kylin/rest/controller/ITTableControllerTest.java deleted file mode 100644 index b2b0f22..0000000 --- a/server/src/test/java/org/apache/kylin/rest/controller/ITTableControllerTest.java +++ /dev/null @@ -1,75 +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.rest.controller; - -import java.io.IOException; -import java.util.List; -import java.util.Map; - -import org.apache.kylin.metadata.model.TableDesc; -import org.apache.kylin.rest.service.CubeService; -import org.apache.kylin.rest.service.ServiceTestBase; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.springframework.beans.factory.annotation.Autowired; - -/** - * @author shaoshi - */ -//TODO: break this into unit tests -@Ignore("ServiceTestBase has been changed to local meta tests, thus not suitable for hive related tests") -public class ITTableControllerTest extends ServiceTestBase { - - private TableController tableController; - private CubeDescController cubeDescController; - - @Autowired - CubeService cubeService; - - @Before - public void setup() throws Exception { - super.setup(); - - tableController = new TableController(); - tableController.setCubeService(cubeService); - } - - @Test - public void testBasics() throws IOException { - List<TableDesc> tables = tableController.getHiveTables(true, "default"); - - Assert.assertTrue(tables != null && tables.size() > 0); - - TableDesc factTable = null; - for (TableDesc t : tables) { - if (t.getName().equalsIgnoreCase("test_kylin_fact")) { - factTable = t; - break; - } - } - Assert.assertNotNull(factTable); - - Map<String, String[]> loadResult = tableController.loadHiveTable("test_kylin_fact,TEST_CATEGORY_GROUPINGS", "default"); - Assert.assertNotNull(loadResult); - - Assert.assertTrue(loadResult.get("result.loaded").length == 2); - } -}