LENS-851 : Disable union for multi fact queries
Project: http://git-wip-us.apache.org/repos/asf/lens/repo Commit: http://git-wip-us.apache.org/repos/asf/lens/commit/7a3a1734 Tree: http://git-wip-us.apache.org/repos/asf/lens/tree/7a3a1734 Diff: http://git-wip-us.apache.org/repos/asf/lens/diff/7a3a1734 Branch: refs/heads/LENS-581 Commit: 7a3a1734e17898240f9be3812ab886d46718f0e3 Parents: 73716cb Author: Rajat Khandelwal <[email protected]> Authored: Wed Nov 25 10:20:16 2015 +0530 Committer: Amareshwari Sriramadasu <[email protected]> Committed: Wed Nov 25 10:20:16 2015 +0530 ---------------------------------------------------------------------- .../java/org/apache/lens/cube/parse/MultiFactHQLContext.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lens/blob/7a3a1734/lens-cube/src/main/java/org/apache/lens/cube/parse/MultiFactHQLContext.java ---------------------------------------------------------------------- diff --git a/lens-cube/src/main/java/org/apache/lens/cube/parse/MultiFactHQLContext.java b/lens-cube/src/main/java/org/apache/lens/cube/parse/MultiFactHQLContext.java index 2fcea8b..113d8de 100644 --- a/lens-cube/src/main/java/org/apache/lens/cube/parse/MultiFactHQLContext.java +++ b/lens-cube/src/main/java/org/apache/lens/cube/parse/MultiFactHQLContext.java @@ -94,7 +94,7 @@ class MultiFactHQLContext extends SimpleHQLContext { for (int i = 0; i < query.getSelectAST().getChildCount(); i++) { if (selectToFactIndex.get(i) == null) { throw new LensException(LensCubeErrorCode.EXPRESSION_NOT_IN_ANY_FACT.getLensErrorInfo(), - HQLParser.getString((ASTNode) query.getSelectAST().getChild(i))); + HQLParser.getString((ASTNode) query.getSelectAST().getChild(i))); } if (selectToFactIndex.get(i).size() == 1) { select.append("mq").append(selectToFactIndex.get(i).get(0)).append(".") @@ -130,6 +130,10 @@ class MultiFactHQLContext extends SimpleHQLContext { Iterator<CandidateFact> iter = facts.iterator(); while (iter.hasNext()) { CandidateFact fact = iter.next(); + if (fact.getStorageTables().size() > 1) { + // Not supported right now. + throw new LensException(LensCubeErrorCode.STORAGE_UNION_DISABLED.getLensErrorInfo()); + } FactHQLContext facthql = new FactHQLContext(fact, dimsToQuery, factDimMap.get(fact), query); fromBuilder.append("("); fromBuilder.append(facthql.toHQL());
