Removed the Die statement footprint and the corresponding test cases.
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/base/Clause.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/base/Clause.java
index 8be2d40..3e92653 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/base/Clause.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/base/Clause.java
@@ -9,7 +9,6 @@
WHERE_CLAUSE,
ORDER_BY_CLAUSE,
LIMIT_CLAUSE,
- DIE_CLAUSE,
GROUP_BY_CLAUSE,
DISTINCT_BY_CLAUSE,
UPDATE_CLAUSE
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/DeleteStatement.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/DeleteStatement.java
index 48b7909..b56d628 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/DeleteStatement.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/DeleteStatement.java
@@ -1,6 +1,5 @@
package edu.uci.ics.asterix.aql.expression;
-import edu.uci.ics.asterix.aql.base.Clause;
import edu.uci.ics.asterix.aql.base.Expression;
import edu.uci.ics.asterix.aql.base.Statement;
import edu.uci.ics.asterix.aql.expression.visitor.IAqlExpressionVisitor;
@@ -13,16 +12,14 @@
private Identifier dataverseName;
private Identifier datasetName;
private Expression condition;
- private Clause dieClause;
private int varCounter;
public DeleteStatement(VariableExpr vars, Identifier dataverseName, Identifier datasetName, Expression condition,
- Clause dieClause, int varCounter) {
+ int varCounter) {
this.vars = vars;
this.dataverseName = dataverseName;
this.datasetName = datasetName;
this.condition = condition;
- this.dieClause = dieClause;
this.varCounter = varCounter;
}
@@ -47,10 +44,6 @@
return condition;
}
- public Clause getDieClause() {
- return dieClause;
- }
-
public int getVarCounter() {
return varCounter;
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/DieClause.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/DieClause.java
deleted file mode 100644
index 3a77d58..0000000
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/DieClause.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package edu.uci.ics.asterix.aql.expression;
-
-import edu.uci.ics.asterix.aql.base.Clause;
-import edu.uci.ics.asterix.aql.base.Expression;
-import edu.uci.ics.asterix.aql.expression.visitor.IAqlExpressionVisitor;
-import edu.uci.ics.asterix.aql.expression.visitor.IAqlVisitorWithVoidReturn;
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-
-public class DieClause implements Clause {
- private Expression expr;
-
- public DieClause() {
- }
-
- public DieClause(Expression dieexpr) {
- this.expr = dieexpr;
- }
-
- public Expression getDieExpr() {
- return expr;
- }
-
- public void setDieExpr(Expression dieexpr) {
- this.expr = dieexpr;
- }
-
- @Override
- public ClauseType getClauseType() {
- return ClauseType.DIE_CLAUSE;
- }
-
- @Override
- public <T> void accept(IAqlVisitorWithVoidReturn<T> visitor, T arg) throws AsterixException {
- visitor.visit(this, arg);
- }
-
- @Override
- public <R, T> R accept(IAqlExpressionVisitor<R, T> visitor, T arg) throws AsterixException {
- return visitor.visitDieClause(this, arg);
- }
-}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/AQLPrintVisitor.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/AQLPrintVisitor.java
index ab55e34..3506e61 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/AQLPrintVisitor.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/AQLPrintVisitor.java
@@ -7,7 +7,6 @@
import edu.uci.ics.asterix.aql.base.Clause;
import edu.uci.ics.asterix.aql.base.Expression;
import edu.uci.ics.asterix.aql.base.Literal;
-import edu.uci.ics.asterix.aql.base.Statement;
import edu.uci.ics.asterix.aql.expression.BeginFeedStatement;
import edu.uci.ics.asterix.aql.expression.CallExpr;
import edu.uci.ics.asterix.aql.expression.ControlFeedStatement;
@@ -18,7 +17,6 @@
import edu.uci.ics.asterix.aql.expression.DataverseDecl;
import edu.uci.ics.asterix.aql.expression.DataverseDropStatement;
import edu.uci.ics.asterix.aql.expression.DeleteStatement;
-import edu.uci.ics.asterix.aql.expression.DieClause;
import edu.uci.ics.asterix.aql.expression.DistinctClause;
import edu.uci.ics.asterix.aql.expression.DropStatement;
import edu.uci.ics.asterix.aql.expression.FLWOGRExpression;
@@ -284,12 +282,6 @@
}
@Override
- public void visit(DieClause lc, Integer step) throws AsterixException {
- out.println(skip(step) + "Limit");
- lc.getDieExpr().accept(this, step + 1);
- }
-
- @Override
public void visit(FunctionDecl fd, Integer step) throws AsterixException {
out.println(skip(step) + "FunctionDecl " + fd.getSignature().getName() + "(" + fd.getParamList().toString()
+ ") {");
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/IAqlExpressionVisitor.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/IAqlExpressionVisitor.java
index 6c8b844..1f8e980 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/IAqlExpressionVisitor.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/IAqlExpressionVisitor.java
@@ -10,7 +10,6 @@
import edu.uci.ics.asterix.aql.expression.DataverseDecl;
import edu.uci.ics.asterix.aql.expression.DataverseDropStatement;
import edu.uci.ics.asterix.aql.expression.DeleteStatement;
-import edu.uci.ics.asterix.aql.expression.DieClause;
import edu.uci.ics.asterix.aql.expression.DistinctClause;
import edu.uci.ics.asterix.aql.expression.DropStatement;
import edu.uci.ics.asterix.aql.expression.FLWOGRExpression;
@@ -141,7 +140,7 @@
R visitSetStatement(SetStatement ss, T arg) throws AsterixException;
R visitBeginFeedStatement(BeginFeedStatement bf, T arg) throws AsterixException;
-
+
R visitControlFeedStatement(ControlFeedStatement del, T arg) throws AsterixException;
R visitCallExpr(CallExpr pf, T arg) throws AsterixException;
@@ -150,8 +149,6 @@
R visitWriteFromQueryResultStatement(WriteFromQueryResultStatement stmtLoad, T arg) throws AsterixException;
- R visitDieClause(DieClause stmtLoad, T arg) throws AsterixException;
-
R visit(CreateFunctionStatement cfs, T arg) throws AsterixException;
R visitFunctionDropStatement(FunctionDropStatement del, T arg) throws AsterixException;
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/IAqlVisitorWithVoidReturn.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/IAqlVisitorWithVoidReturn.java
index d4891ac..ff04032 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/IAqlVisitorWithVoidReturn.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/IAqlVisitorWithVoidReturn.java
@@ -10,7 +10,6 @@
import edu.uci.ics.asterix.aql.expression.DataverseDecl;
import edu.uci.ics.asterix.aql.expression.DataverseDropStatement;
import edu.uci.ics.asterix.aql.expression.DeleteStatement;
-import edu.uci.ics.asterix.aql.expression.DieClause;
import edu.uci.ics.asterix.aql.expression.DistinctClause;
import edu.uci.ics.asterix.aql.expression.DropStatement;
import edu.uci.ics.asterix.aql.expression.FLWOGRExpression;
@@ -143,13 +142,11 @@
void visit(DataverseDropStatement stmtDel, T arg) throws AsterixException;
void visit(TypeDropStatement stmtDel, T arg) throws AsterixException;
-
+
void visit(BeginFeedStatement stmtDel, T arg) throws AsterixException;
void visit(ControlFeedStatement stmtDel, T arg) throws AsterixException;
- void visit(DieClause stmtDel, T arg) throws AsterixException;
-
void visit(CreateFunctionStatement cfs, T arg) throws AsterixException;
void visit(FunctionDropStatement fds, T arg) throws AsterixException;
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/AqlRewriter.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/AqlRewriter.java
index 62e40fa..84d8321 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/AqlRewriter.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/AqlRewriter.java
@@ -20,7 +20,6 @@
import edu.uci.ics.asterix.aql.expression.DataverseDecl;
import edu.uci.ics.asterix.aql.expression.DataverseDropStatement;
import edu.uci.ics.asterix.aql.expression.DeleteStatement;
-import edu.uci.ics.asterix.aql.expression.DieClause;
import edu.uci.ics.asterix.aql.expression.DistinctClause;
import edu.uci.ics.asterix.aql.expression.DropStatement;
import edu.uci.ics.asterix.aql.expression.FLWOGRExpression;
@@ -343,12 +342,6 @@
}
@Override
- public Void visitDieClause(DieClause lc, Void arg) throws AsterixException {
- lc.getDieExpr().accept(this, arg);
- return null;
- }
-
- @Override
public Void visitListConstructor(ListConstructor lc, Void arg) throws AsterixException {
for (Expression e : lc.getExprList()) {
e.accept(this, arg);
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/CloneAndSubstituteVariablesVisitor.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/CloneAndSubstituteVariablesVisitor.java
index 5742ac6..cbd15a2 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/CloneAndSubstituteVariablesVisitor.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/CloneAndSubstituteVariablesVisitor.java
@@ -17,7 +17,6 @@
import edu.uci.ics.asterix.aql.expression.DataverseDecl;
import edu.uci.ics.asterix.aql.expression.DataverseDropStatement;
import edu.uci.ics.asterix.aql.expression.DeleteStatement;
-import edu.uci.ics.asterix.aql.expression.DieClause;
import edu.uci.ics.asterix.aql.expression.DistinctClause;
import edu.uci.ics.asterix.aql.expression.DropStatement;
import edu.uci.ics.asterix.aql.expression.FLWOGRExpression;
@@ -187,7 +186,7 @@
} else {
// it is a var. from the context
var = context.getRewrittenVar(v.getVar().getId());
- if(var == null){
+ if (var == null) {
var = v.getVar();
}
}
@@ -257,14 +256,6 @@
}
@Override
- public Pair<IAqlExpression, List<VariableSubstitution>> visitDieClause(DieClause lc, List<VariableSubstitution> arg)
- throws AsterixException {
- Pair<IAqlExpression, List<VariableSubstitution>> p1 = lc.getDieExpr().accept(this, arg);
- DieClause c = new DieClause((Expression) p1.first);
- return new Pair<IAqlExpression, List<VariableSubstitution>>(c, arg);
- }
-
- @Override
public Pair<IAqlExpression, List<VariableSubstitution>> visitListConstructor(ListConstructor lc,
List<VariableSubstitution> arg) throws AsterixException {
List<Expression> oldExprList = lc.getExprList();
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/InlineUdfsVisitor.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/InlineUdfsVisitor.java
index f178d88..9834f27 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/InlineUdfsVisitor.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/InlineUdfsVisitor.java
@@ -18,7 +18,6 @@
import edu.uci.ics.asterix.aql.expression.DataverseDecl;
import edu.uci.ics.asterix.aql.expression.DataverseDropStatement;
import edu.uci.ics.asterix.aql.expression.DeleteStatement;
-import edu.uci.ics.asterix.aql.expression.DieClause;
import edu.uci.ics.asterix.aql.expression.DistinctClause;
import edu.uci.ics.asterix.aql.expression.DropStatement;
import edu.uci.ics.asterix.aql.expression.FLWOGRExpression;
@@ -104,15 +103,15 @@
public Boolean visitRecordConstructor(RecordConstructor rc, List<FunctionDecl> arg) throws AsterixException {
boolean changed = false;
for (FieldBinding b : rc.getFbList()) {
- Pair<Boolean, Expression> leftExprInlined = inlineUdfsInExpr(b.getLeftExpr(), arg);
- b.setLeftExpr(leftExprInlined.second);
- changed = changed | leftExprInlined.first;
- Pair<Boolean, Expression> rightExprInlined = inlineUdfsInExpr(b.getRightExpr(), arg);
- b.setRightExpr(rightExprInlined.second);
- changed = changed | rightExprInlined.first;
-
- /*
- if (b.getLeftExpr().accept(this, arg)) {
+ Pair<Boolean, Expression> leftExprInlined = inlineUdfsInExpr(b.getLeftExpr(), arg);
+ b.setLeftExpr(leftExprInlined.second);
+ changed = changed | leftExprInlined.first;
+ Pair<Boolean, Expression> rightExprInlined = inlineUdfsInExpr(b.getRightExpr(), arg);
+ b.setRightExpr(rightExprInlined.second);
+ changed = changed | rightExprInlined.first;
+
+ /*
+ if (b.getLeftExpr().accept(this, arg)) {
changed = true;
}
if (b.getRightExpr().accept(this, arg)) {
@@ -251,13 +250,6 @@
}
@Override
- public Boolean visitDieClause(DieClause lc, List<FunctionDecl> arg) throws AsterixException {
- Pair<Boolean, Expression> p1 = inlineUdfsInExpr(lc.getDieExpr(), arg);
- lc.setDieExpr(p1.second);
- return p1.first;
- }
-
- @Override
public Boolean visitUnaryExpr(UnaryExpr u, List<FunctionDecl> arg) throws AsterixException {
return u.getExpr().accept(this, arg);
}
diff --git a/asterix-aql/src/main/javacc/AQL.jj b/asterix-aql/src/main/javacc/AQL.jj
index be7d954..68e1497 100644
--- a/asterix-aql/src/main/javacc/AQL.jj
+++ b/asterix-aql/src/main/javacc/AQL.jj
@@ -270,7 +270,6 @@
Identifier dataverseName;
Identifier datasetName = null;
Expression condition = null;
- Clause dieClause = null;
Pair<Identifier, Identifier> nameComponents;
}
{
@@ -280,8 +279,8 @@
{
nameComponents = getDotSeparatedPair();
}
- ("where" condition = Expression())? (dieClause = DieClause())? (";")?
- {return new DeleteStatement(var, nameComponents.first, nameComponents.second, condition, dieClause, getVarCounter()); }
+ ("where" condition = Expression())? (";")?
+ {return new DeleteStatement(var, nameComponents.first, nameComponents.second, condition, getVarCounter()); }
}
UpdateStatement UpdateStatement() throws ParseException:
@@ -2174,7 +2173,6 @@
| clause = GroupClause()
| clause = LimitClause()
| clause = DistinctClause()
- | clause = DieClause()
)
{
return clause;
@@ -2408,21 +2406,6 @@
}
}
-DieClause DieClause() throws ParseException:
-{
- DieClause lc = new DieClause();
- Expression expr;
- pushForbiddenScope(getCurrentScope());
-}
-{
- "die" "after" expr = Expression() { lc.setDieExpr(expr); }
- {
- popForbiddenScope();
- return lc;
- }
-}
-
-
QuantifiedExpression QuantifiedExpression()throws ParseException:
{
QuantifiedExpression qc = new QuantifiedExpression();