You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by xx...@apache.org on 2022/01/19 08:10:05 UTC

[kylin] branch main updated: [KYLIN-5152] support boolean expression on where clause

This is an automated email from the ASF dual-hosted git repository.

xxyu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/main by this push:
     new a56732e  [KYLIN-5152] support boolean expression on where clause
a56732e is described below

commit a56732e8bdc55a45c9bffff015bd6a19f6832196
Author: hujiahua <hu...@youzan.com>
AuthorDate: Mon Jan 10 20:22:18 2022 +0800

    [KYLIN-5152] support boolean expression on where clause
---
 kylin-it/src/test/resources/query/sql/query115.sql | 23 ++++++++++++++++++++++
 .../kylin/query/runtime/SparderRexVisitor.scala    |  6 +++++-
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/kylin-it/src/test/resources/query/sql/query115.sql b/kylin-it/src/test/resources/query/sql/query115.sql
new file mode 100644
index 0000000..e6cedee
--- /dev/null
+++ b/kylin-it/src/test/resources/query/sql/query115.sql
@@ -0,0 +1,23 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+--     http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+select lstg_format_name, sum(price) as GMV 
+ from test_kylin_fact 
+ where lstg_format_name='FP-GTC' and true
+ group by lstg_format_name
+;{"scanRowCount":300,"scanBytes":190822,"scanFiles":1,"cuboidId":14336}
\ No newline at end of file
diff --git a/kylin-spark-project/kylin-spark-query/src/main/scala/org/apache/kylin/query/runtime/SparderRexVisitor.scala b/kylin-spark-project/kylin-spark-query/src/main/scala/org/apache/kylin/query/runtime/SparderRexVisitor.scala
index a690f45..5842c9f 100644
--- a/kylin-spark-project/kylin-spark-query/src/main/scala/org/apache/kylin/query/runtime/SparderRexVisitor.scala
+++ b/kylin-spark-project/kylin-spark-query/src/main/scala/org/apache/kylin/query/runtime/SparderRexVisitor.scala
@@ -79,7 +79,11 @@ class SparderRexVisitor(
       }
 
       val childFilter = operand.accept(this)
-      children += childFilter
+      if (childFilter.isInstanceOf[Boolean]) {
+        children += lit(childFilter)
+      }else{
+        children += childFilter
+      }
     }
 
     def getOperands: (Column, Column) = {