From 7e970c654685c14ef1d3a826e438c16ab6a4d940 Mon Sep 17 00:00:00 2001 From: etherge Date: Sat, 4 Feb 2017 11:31:58 +0800 Subject: [PATCH] KYLIN-2406 fix model match rules when having hanging OLAPTablescan --- query/src/main/java/org/apache/kylin/query/routing/ModelChooser.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/query/src/main/java/org/apache/kylin/query/routing/ModelChooser.java b/query/src/main/java/org/apache/kylin/query/routing/ModelChooser.java index f979f7b..507b371 100644 --- a/query/src/main/java/org/apache/kylin/query/routing/ModelChooser.java +++ b/query/src/main/java/org/apache/kylin/query/routing/ModelChooser.java @@ -106,6 +106,9 @@ public class ModelChooser { // one lookup table String modelAlias = model.findFirstTable(firstTable.getTableIdentity()).getAlias(); matchUp = ImmutableMap.of(firstTable.getAlias(), modelAlias); + } else if (ctx.joins.size() != ctx.allTableScans.size() - 1) { + // has hanging tables + throw new NoRealizationFoundException("Please adjust the sequence of join tables and put subquery or temporary table after lookup tables. " + toErrorMsg(ctx)); } else { // normal big joins if (ctx.joinsTree == null) { -- 2.9.3 (Apple Git-75)