KYLIN-2212 add more test queries
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/af429e5c Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/af429e5c Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/af429e5c Branch: refs/heads/master-hbase1.x Commit: af429e5cbbda2a64159b25bc5ce4ad70f2f1a1f2 Parents: 8f3239b Author: Hongbin Ma <mahong...@apache.org> Authored: Mon Dec 5 15:05:35 2016 +0800 Committer: Hongbin Ma <mahong...@apache.org> Committed: Mon Dec 5 15:05:35 2016 +0800 ---------------------------------------------------------------------- .../metadata/filter/LogicalTupleFilter.java | 3 +- .../src/test/resources/query/sql/query101.sql | 13 ++++++++ .../src/test/resources/query/sql/query102.sql | 13 ++++++++ .../src/test/resources/query/sql/query103.sql | 13 ++++++++ .../test/resources/query/sql_like/query21.sql | 31 ++++++++++++++++++++ 5 files changed, 71 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/af429e5c/core-metadata/src/main/java/org/apache/kylin/metadata/filter/LogicalTupleFilter.java ---------------------------------------------------------------------- diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/LogicalTupleFilter.java b/core-metadata/src/main/java/org/apache/kylin/metadata/filter/LogicalTupleFilter.java index 61657fb..1744309 100644 --- a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/LogicalTupleFilter.java +++ b/core-metadata/src/main/java/org/apache/kylin/metadata/filter/LogicalTupleFilter.java @@ -64,8 +64,7 @@ public class LogicalTupleFilter extends TupleFilter { public TupleFilter reverse() { switch (operator) { case NOT: - throw new IllegalStateException("not( not in ()) is invalid syntax"); - //return reverseNestedNots(this, 0); + throw new IllegalStateException("NOT will be replaced in org.apache.kylin.query.relnode.OLAPFilterRel.TupleFilterVisitor"); case AND: case OR: LogicalTupleFilter reverse = new LogicalTupleFilter(REVERSE_OP_MAP.get(operator)); http://git-wip-us.apache.org/repos/asf/kylin/blob/af429e5c/kylin-it/src/test/resources/query/sql/query101.sql ---------------------------------------------------------------------- diff --git a/kylin-it/src/test/resources/query/sql/query101.sql b/kylin-it/src/test/resources/query/sql/query101.sql new file mode 100644 index 0000000..fb42bca --- /dev/null +++ b/kylin-it/src/test/resources/query/sql/query101.sql @@ -0,0 +1,13 @@ + +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 not ( meta_categ_name not in ('', 'a','Computers') ) + group by meta_categ_name \ No newline at end of file http://git-wip-us.apache.org/repos/asf/kylin/blob/af429e5c/kylin-it/src/test/resources/query/sql/query102.sql ---------------------------------------------------------------------- diff --git a/kylin-it/src/test/resources/query/sql/query102.sql b/kylin-it/src/test/resources/query/sql/query102.sql new file mode 100644 index 0000000..bd1e15e --- /dev/null +++ b/kylin-it/src/test/resources/query/sql/query102.sql @@ -0,0 +1,13 @@ + +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 not ( meta_categ_name not in ('', 'a','Computers') and meta_categ_name not in ('Crafts','Computers')) + group by meta_categ_name \ No newline at end of file http://git-wip-us.apache.org/repos/asf/kylin/blob/af429e5c/kylin-it/src/test/resources/query/sql/query103.sql ---------------------------------------------------------------------- diff --git a/kylin-it/src/test/resources/query/sql/query103.sql b/kylin-it/src/test/resources/query/sql/query103.sql new file mode 100644 index 0000000..c5f9bf9 --- /dev/null +++ b/kylin-it/src/test/resources/query/sql/query103.sql @@ -0,0 +1,13 @@ + +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 not ( meta_categ_name not in ('', 'a','Computers') or meta_categ_name not in ('Crafts','Computers')) + group by meta_categ_name \ No newline at end of file http://git-wip-us.apache.org/repos/asf/kylin/blob/af429e5c/kylin-it/src/test/resources/query/sql_like/query21.sql ---------------------------------------------------------------------- diff --git a/kylin-it/src/test/resources/query/sql_like/query21.sql b/kylin-it/src/test/resources/query/sql_like/query21.sql new file mode 100644 index 0000000..368a15c --- /dev/null +++ b/kylin-it/src/test/resources/query/sql_like/query21.sql @@ -0,0 +1,31 @@ +-- +-- 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 as lstg_format_name, count(*) as 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 + inner JOIN edw.test_sites as test_sites + ON test_kylin_fact.lstg_site_id = test_sites.site_id + + +where not(lstg_format_name not like '%BIN%') +group by lstg_format_name \ No newline at end of file