commit | 2b440d08e2ef45e58c0b409a8698adf9111ecb0f | [log] [tgz] |
---|---|---|
author | alexander.behm <alexander.behm@eaa15691-b419-025a-1212-ee371bd00084> | Sat Oct 20 04:56:34 2012 +0000 |
committer | alexander.behm <alexander.behm@eaa15691-b419-025a-1212-ee371bd00084> | Sat Oct 20 04:56:34 2012 +0000 |
tree | dbb2c25aa209777ee49f276b67b7d5f51176add5 | |
parent | ca80afd52d8441a6d10b1d4e5fa96284911000c2 [diff] |
Improve applicability of SimilarityCheckRule. git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_inline_vars@797 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SimilarityCheckRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SimilarityCheckRule.java index 5726ce3..c90b3f1 100644 --- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SimilarityCheckRule.java +++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SimilarityCheckRule.java
@@ -54,8 +54,12 @@ // Gather assigns below this select. List<AssignOperator> assigns = new ArrayList<AssignOperator>(); AbstractLogicalOperator childOp = (AbstractLogicalOperator) select.getInputs().get(0).getValue(); + // Skip selects. + while (childOp.getOperatorTag() == LogicalOperatorTag.SELECT) { + childOp = (AbstractLogicalOperator) childOp.getInputs().get(0).getValue(); + } while (childOp.getOperatorTag() == LogicalOperatorTag.ASSIGN) { - assigns.add((AssignOperator) childOp); + assigns.add((AssignOperator) childOp); childOp = (AbstractLogicalOperator) childOp.getInputs().get(0).getValue(); } return replaceSelectConditionExprs(condExpr, assigns, context);