KYLIN-2625 not null filter clause should be evaluable in storage
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/c9dc7cc7
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/c9dc7cc7
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/c9dc7cc7
Branch: refs/heads/master
Commit: c9dc7cc78c5eed40f4c5a438423b857a145f17b1
Parents: a38b02d
Author: Hongbin Ma <mahongbin@apache.org>
Authored: Tue May 16 18:04:03 2017 +0800
Committer: Roger Shi <rogershijicheng@gmail.com>
Committed: Tue May 16 20:59:12 2017 +0800
----------------------------------------------------------------------
.../metadata/filter/CompareTupleFilter.java | 3 ++-
.../test/resources/query/sql_limit/query04.sql | 25 ++++++++++++++++++++
2 files changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/c9dc7cc7/core-metadata/src/main/java/org/apache/kylin/metadata/filter/CompareTupleFilter.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/CompareTupleFilter.java
b/core-metadata/src/main/java/org/apache/kylin/metadata/filter/CompareTupleFilter.java
index d783e52..2771250 100755
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/CompareTupleFilter.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/filter/CompareTupleFilter.java
@@ -215,7 +215,8 @@ public class CompareTupleFilter extends TupleFilter {
@Override
public boolean isEvaluable() {
return (column != null || (function != null && function.isEvaluable())) //
- && !conditionValues.isEmpty() && secondColumn == null;
+ && (!conditionValues.isEmpty() || operator == FilterOperatorEnum.ISNOTNULL
|| operator == FilterOperatorEnum.ISNULL) //
+ && secondColumn == null;
}
public boolean alwaysReturnTrue() {
http://git-wip-us.apache.org/repos/asf/kylin/blob/c9dc7cc7/kylin-it/src/test/resources/query/sql_limit/query04.sql
----------------------------------------------------------------------
diff --git a/kylin-it/src/test/resources/query/sql_limit/query04.sql b/kylin-it/src/test/resources/query/sql_limit/query04.sql
new file mode 100644
index 0000000..381ab65
--- /dev/null
+++ b/kylin-it/src/test/resources/query/sql_limit/query04.sql
@@ -0,0 +1,25 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements. See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership. The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+
+
+select * from (
+select * from test_kylin_fact
+ where lstg_format_name is not null
+ ) limit 20
+
|