commit | 1713d1a09f6e9c72ee0dec5791010fd50631d599 | [log] [tgz] |
---|---|---|
author | buyingyi <buyingyi@gmail.com> | Tue May 14 00:20:24 2013 -0700 |
committer | buyingyi <buyingyi@gmail.com> | Tue May 14 00:20:24 2013 -0700 |
tree | 81fb059b5c51429b109f28234975cbdaf81494cb | |
parent | 2bfc33655021777cef02a1e5130dcb251bb16a31 [diff] |
fix asterixdb issue51
diff --git a/algebricks/algebricks-rewriter/src/main/java/edu/uci/ics/hyracks/algebricks/rewriter/rules/IntroduceGroupByForSubplanRule.java b/algebricks/algebricks-rewriter/src/main/java/edu/uci/ics/hyracks/algebricks/rewriter/rules/IntroduceGroupByForSubplanRule.java index 18c483e..489167f 100644 --- a/algebricks/algebricks-rewriter/src/main/java/edu/uci/ics/hyracks/algebricks/rewriter/rules/IntroduceGroupByForSubplanRule.java +++ b/algebricks/algebricks-rewriter/src/main/java/edu/uci/ics/hyracks/algebricks/rewriter/rules/IntroduceGroupByForSubplanRule.java
@@ -143,8 +143,10 @@ Set<LogicalVariable> pkVars = computeGbyVars(outerNts, free, context); if (pkVars == null || pkVars.size() < 1) { - // could not group only by primary keys - return false; + // there is no non-trivial primary key, group-by keys are all live variables + ILogicalOperator subplanInput = subplan.getInputs().get(0).getValue(); + pkVars = new HashSet<LogicalVariable>(); + VariableUtilities.getLiveVariables(subplanInput, pkVars); } AlgebricksConfig.ALGEBRICKS_LOGGER.fine("Found FD for introducing group-by: " + pkVars);