From 15197a71fb8cda650e6097c1272651e1ef7d2f21 Mon Sep 17 00:00:00 2001 From: etherge Date: Wed, 15 Feb 2017 13:30:44 +0800 Subject: [PATCH] KYLIN-2407 fix OLAPTableScan choose exec function issue --- .../test/resources/query/sql_subquery/query15.sql | 29 ++++++++++++++++++++++ .../apache/kylin/query/relnode/OLAPTableScan.java | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 kylin-it/src/test/resources/query/sql_subquery/query15.sql diff --git a/kylin-it/src/test/resources/query/sql_subquery/query15.sql b/kylin-it/src/test/resources/query/sql_subquery/query15.sql new file mode 100644 index 0000000..330dc27 --- /dev/null +++ b/kylin-it/src/test/resources/query/sql_subquery/query15.sql @@ -0,0 +1,29 @@ +-- +-- 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 + week_beg_dt +FROM + edw.test_cal_dt t1 +WHERE + t1.cal_dt IN (SELECT + cal_dt + FROM + test_kylin_fact + WHERE + lstg_format_name = 'ABIN') \ No newline at end of file diff --git a/query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java b/query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java index f7877be..30d9e24 100644 --- a/query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java +++ b/query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java @@ -282,7 +282,7 @@ public class OLAPTableScan extends TableScan implements OLAPRel, EnumerableRel { private String genExecFunc() { // if the table to scan is not the fact table of cube, then it's a lookup table - if (context.hasJoin == false && context.realization.getModel().isLookupTable(tableName)) { + if (context.realization.getModel().isLookupTable(tableName)) { return "executeLookupTableQuery"; } else { return "executeOLAPQuery"; -- 2.9.3 (Apple Git-75)