Removed the Die statement footprint and the corresponding test cases.
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/base/LogicalOperatorDeepCopyVisitor.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/base/LogicalOperatorDeepCopyVisitor.java
index d8477f1..718c0f1 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/base/LogicalOperatorDeepCopyVisitor.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/base/LogicalOperatorDeepCopyVisitor.java
@@ -20,7 +20,6 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AggregateOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AssignOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.DataSourceScanOperator;
-import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.DieOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.DistinctOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.DistributeResultOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.EmptyTupleSourceOperator;
@@ -296,11 +295,6 @@
}
@Override
- public ILogicalOperator visitDieOperator(DieOperator op, ILogicalOperator arg) {
- throw new UnsupportedOperationException();
- }
-
- @Override
public ILogicalOperator visitNestedTupleSourceOperator(NestedTupleSourceOperator op, ILogicalOperator arg)
throws AlgebricksException {
NestedTupleSourceOperator opCopy = new NestedTupleSourceOperator(new MutableObject<ILogicalOperator>(arg));
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/base/RuleCollections.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/base/RuleCollections.java
index f68b0e7..3ad3db4 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/base/RuleCollections.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/base/RuleCollections.java
@@ -81,7 +81,6 @@
import edu.uci.ics.hyracks.algebricks.rewriter.rules.PullSelectOutOfEqJoin;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.PushAssignBelowUnionAllRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.PushAssignDownThroughProductRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.PushDieUpRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.PushLimitDownRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.PushNestedOrderByUnderPreSortedGroupByRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.PushProjectDownRule;
@@ -135,7 +134,6 @@
List<IAlgebraicRewriteRule> condPushDownAndJoinInference = new LinkedList<IAlgebraicRewriteRule>();
condPushDownAndJoinInference.add(new PushSelectDownRule());
- condPushDownAndJoinInference.add(new PushDieUpRule());
condPushDownAndJoinInference.add(new RemoveRedundantListifyRule());
condPushDownAndJoinInference.add(new SimpleUnnestToProductRule());
condPushDownAndJoinInference.add(new ComplexUnnestToProductRule());
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlExpressionToPlanTranslator.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlExpressionToPlanTranslator.java
index caa16d4..7364728 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlExpressionToPlanTranslator.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlExpressionToPlanTranslator.java
@@ -22,7 +22,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;
@@ -124,7 +123,6 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AggregateOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AssignOperator;
-import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.DieOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.DistinctOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.DistributeResultOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.EmptyTupleSourceOperator;
@@ -925,15 +923,6 @@
}
@Override
- public Pair<ILogicalOperator, LogicalVariable> visitDieClause(DieClause lc, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p1 = aqlExprToAlgExpression(lc.getDieExpr(), tupSource);
- DieOperator opDie = new DieOperator(p1.first);
- opDie.getInputs().add(p1.second);
- return new Pair<ILogicalOperator, LogicalVariable>(opDie, null);
- }
-
- @Override
public Pair<ILogicalOperator, LogicalVariable> visitDistinctClause(DistinctClause dc,
Mutable<ILogicalOperator> tupSource) throws AsterixException {
List<Mutable<ILogicalExpression>> exprList = new ArrayList<Mutable<ILogicalExpression>>();
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlPlusExpressionToPlanTranslator.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlPlusExpressionToPlanTranslator.java
index 3440ce8..9f28113 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlPlusExpressionToPlanTranslator.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlPlusExpressionToPlanTranslator.java
@@ -22,7 +22,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;
@@ -123,7 +122,6 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AggregateOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AssignOperator;
-import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.DieOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.DistinctOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.EmptyTupleSourceOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.GroupByOperator;
@@ -192,7 +190,7 @@
}
private final JobId jobId;
- private TranslationContext context;
+ private TranslationContext context;
private String outputDatasetName;
private ICompiledDmlStatement stmt;
private AqlMetadataProvider metadataProvider;
@@ -201,8 +199,6 @@
private MetaScopeILogicalOperator metaScopeOp = new MetaScopeILogicalOperator();
private static LogicalVariable METADATA_DUMMY_VAR = new LogicalVariable(-1);
-
-
public AqlPlusExpressionToPlanTranslator(JobId jobId, AqlMetadataProvider metadataProvider,
Counter currentVarCounter, String outputDatasetName, ICompiledDmlStatement stmt) {
this.jobId = jobId;
@@ -221,8 +217,8 @@
return translate(expr, null);
}
- public ILogicalPlan translate(Query expr, AqlMetadataProvider metadata)
- throws AlgebricksException, AsterixException {
+ public ILogicalPlan translate(Query expr, AqlMetadataProvider metadata) throws AlgebricksException,
+ AsterixException {
IDataFormat format = metadata.getFormat();
if (format == null) {
throw new AlgebricksException("Data format has not been set.");
@@ -877,15 +873,6 @@
}
@Override
- public Pair<ILogicalOperator, LogicalVariable> visitDieClause(DieClause lc, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p1 = aqlExprToAlgExpression(lc.getDieExpr(), tupSource);
- DieOperator opDie = new DieOperator(p1.first);
- opDie.getInputs().add(p1.second);
- return new Pair<ILogicalOperator, LogicalVariable>(opDie, null);
- }
-
- @Override
public Pair<ILogicalOperator, LogicalVariable> visitDistinctClause(DistinctClause dc,
Mutable<ILogicalOperator> tupSource) throws AsterixException {
List<Mutable<ILogicalExpression>> exprList = new ArrayList<Mutable<ILogicalExpression>>();
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/CompiledStatements.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/CompiledStatements.java
index 625fed1..6cf8d28 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/CompiledStatements.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/CompiledStatements.java
@@ -49,527 +49,490 @@
*/
public class CompiledStatements {
- public static interface ICompiledStatement {
+ public static interface ICompiledStatement {
- public Kind getKind();
- }
+ public Kind getKind();
+ }
- public static class CompiledWriteFromQueryResultStatement implements
- ICompiledDmlStatement {
+ public static class CompiledWriteFromQueryResultStatement implements ICompiledDmlStatement {
- private String dataverseName;
- private String datasetName;
- private Query query;
- private int varCounter;
+ private String dataverseName;
+ private String datasetName;
+ private Query query;
+ private int varCounter;
- public CompiledWriteFromQueryResultStatement(String dataverseName,
- String datasetName, Query query, int varCounter) {
- this.dataverseName = dataverseName;
- this.datasetName = datasetName;
- this.query = query;
- this.varCounter = varCounter;
- }
+ public CompiledWriteFromQueryResultStatement(String dataverseName, String datasetName, Query query,
+ int varCounter) {
+ this.dataverseName = dataverseName;
+ this.datasetName = datasetName;
+ this.query = query;
+ this.varCounter = varCounter;
+ }
- public String getDataverseName() {
- return dataverseName;
- }
+ public String getDataverseName() {
+ return dataverseName;
+ }
- public String getDatasetName() {
- return datasetName;
- }
+ public String getDatasetName() {
+ return datasetName;
+ }
- public int getVarCounter() {
- return varCounter;
- }
+ public int getVarCounter() {
+ return varCounter;
+ }
- public Query getQuery() {
- return query;
- }
+ public Query getQuery() {
+ return query;
+ }
- @Override
- public Kind getKind() {
- return Kind.WRITE_FROM_QUERY_RESULT;
- }
+ @Override
+ public Kind getKind() {
+ return Kind.WRITE_FROM_QUERY_RESULT;
+ }
- }
+ }
- public static class CompiledDatasetDropStatement implements
- ICompiledStatement {
- private final String dataverseName;
- private final String datasetName;
+ public static class CompiledDatasetDropStatement implements ICompiledStatement {
+ private final String dataverseName;
+ private final String datasetName;
- public CompiledDatasetDropStatement(String dataverseName,
- String datasetName) {
- this.dataverseName = dataverseName;
- this.datasetName = datasetName;
- }
+ public CompiledDatasetDropStatement(String dataverseName, String datasetName) {
+ this.dataverseName = dataverseName;
+ this.datasetName = datasetName;
+ }
- public String getDataverseName() {
- return dataverseName;
- }
+ public String getDataverseName() {
+ return dataverseName;
+ }
- public String getDatasetName() {
- return datasetName;
- }
+ public String getDatasetName() {
+ return datasetName;
+ }
- @Override
- public Kind getKind() {
- return Kind.DATASET_DROP;
- }
- }
+ @Override
+ public Kind getKind() {
+ return Kind.DATASET_DROP;
+ }
+ }
- // added by yasser
- public static class CompiledCreateDataverseStatement implements
- ICompiledStatement {
- private String dataverseName;
- private String format;
+ // added by yasser
+ public static class CompiledCreateDataverseStatement implements ICompiledStatement {
+ private String dataverseName;
+ private String format;
- public CompiledCreateDataverseStatement(String dataverseName,
- String format) {
- this.dataverseName = dataverseName;
- this.format = format;
- }
+ public CompiledCreateDataverseStatement(String dataverseName, String format) {
+ this.dataverseName = dataverseName;
+ this.format = format;
+ }
- public String getDataverseName() {
- return dataverseName;
- }
+ public String getDataverseName() {
+ return dataverseName;
+ }
- public String getFormat() {
- return format;
- }
+ public String getFormat() {
+ return format;
+ }
- @Override
- public Kind getKind() {
- return Kind.CREATE_DATAVERSE;
- }
- }
+ @Override
+ public Kind getKind() {
+ return Kind.CREATE_DATAVERSE;
+ }
+ }
- public static class CompiledNodeGroupDropStatement implements
- ICompiledStatement {
- private String nodeGroupName;
+ public static class CompiledNodeGroupDropStatement implements ICompiledStatement {
+ private String nodeGroupName;
- public CompiledNodeGroupDropStatement(String nodeGroupName) {
- this.nodeGroupName = nodeGroupName;
- }
+ public CompiledNodeGroupDropStatement(String nodeGroupName) {
+ this.nodeGroupName = nodeGroupName;
+ }
- public String getNodeGroupName() {
- return nodeGroupName;
- }
+ public String getNodeGroupName() {
+ return nodeGroupName;
+ }
- @Override
- public Kind getKind() {
- return Kind.NODEGROUP_DROP;
- }
- }
+ @Override
+ public Kind getKind() {
+ return Kind.NODEGROUP_DROP;
+ }
+ }
- public static class CompiledIndexDropStatement implements
- ICompiledStatement {
- private String dataverseName;
- private String datasetName;
- private String indexName;
+ public static class CompiledIndexDropStatement implements ICompiledStatement {
+ private String dataverseName;
+ private String datasetName;
+ private String indexName;
- public CompiledIndexDropStatement(String dataverseName,
- String datasetName, String indexName) {
- this.dataverseName = dataverseName;
- this.datasetName = datasetName;
- this.indexName = indexName;
- }
+ public CompiledIndexDropStatement(String dataverseName, String datasetName, String indexName) {
+ this.dataverseName = dataverseName;
+ this.datasetName = datasetName;
+ this.indexName = indexName;
+ }
- public String getDataverseName() {
- return dataverseName;
- }
+ public String getDataverseName() {
+ return dataverseName;
+ }
- public String getDatasetName() {
- return datasetName;
- }
+ public String getDatasetName() {
+ return datasetName;
+ }
- public String getIndexName() {
- return indexName;
- }
+ public String getIndexName() {
+ return indexName;
+ }
- @Override
- public Kind getKind() {
- return Kind.INDEX_DROP;
- }
- }
+ @Override
+ public Kind getKind() {
+ return Kind.INDEX_DROP;
+ }
+ }
- public static class CompiledDataverseDropStatement implements
- ICompiledStatement {
- private String dataverseName;
- private boolean ifExists;
+ public static class CompiledDataverseDropStatement implements ICompiledStatement {
+ private String dataverseName;
+ private boolean ifExists;
- public CompiledDataverseDropStatement(String dataverseName,
- boolean ifExists) {
- this.dataverseName = dataverseName;
- this.ifExists = ifExists;
- }
+ public CompiledDataverseDropStatement(String dataverseName, boolean ifExists) {
+ this.dataverseName = dataverseName;
+ this.ifExists = ifExists;
+ }
- public String getDataverseName() {
- return dataverseName;
- }
+ public String getDataverseName() {
+ return dataverseName;
+ }
- public boolean getIfExists() {
- return ifExists;
- }
+ public boolean getIfExists() {
+ return ifExists;
+ }
- @Override
- public Kind getKind() {
- return Kind.DATAVERSE_DROP;
- }
- }
+ @Override
+ public Kind getKind() {
+ return Kind.DATAVERSE_DROP;
+ }
+ }
- public static class CompiledTypeDropStatement implements ICompiledStatement {
- private String typeName;
+ public static class CompiledTypeDropStatement implements ICompiledStatement {
+ private String typeName;
- public CompiledTypeDropStatement(String nodeGroupName) {
- this.typeName = nodeGroupName;
- }
+ public CompiledTypeDropStatement(String nodeGroupName) {
+ this.typeName = nodeGroupName;
+ }
- public String getTypeName() {
- return typeName;
- }
+ public String getTypeName() {
+ return typeName;
+ }
- @Override
- public Kind getKind() {
- return Kind.TYPE_DROP;
- }
- }
+ @Override
+ public Kind getKind() {
+ return Kind.TYPE_DROP;
+ }
+ }
- public static interface ICompiledDmlStatement extends ICompiledStatement {
+ public static interface ICompiledDmlStatement extends ICompiledStatement {
- public String getDataverseName();
+ public String getDataverseName();
- public String getDatasetName();
- }
+ public String getDatasetName();
+ }
- public static class CompiledCreateIndexStatement implements
- ICompiledDmlStatement {
- private final String indexName;
- private final String dataverseName;
- private final String datasetName;
- private final List<String> keyFields;
- private final IndexType indexType;
+ public static class CompiledCreateIndexStatement implements ICompiledDmlStatement {
+ private final String indexName;
+ private final String dataverseName;
+ private final String datasetName;
+ private final List<String> keyFields;
+ private final IndexType indexType;
- // Specific to NGram index.
- private final int gramLength;
+ // Specific to NGram index.
+ private final int gramLength;
- public CompiledCreateIndexStatement(String indexName,
- String dataverseName, String datasetName,
- List<String> keyFields, int gramLength, IndexType indexType) {
- this.indexName = indexName;
- this.dataverseName = dataverseName;
- this.datasetName = datasetName;
- this.keyFields = keyFields;
- this.gramLength = gramLength;
- this.indexType = indexType;
- }
+ public CompiledCreateIndexStatement(String indexName, String dataverseName, String datasetName,
+ List<String> keyFields, int gramLength, IndexType indexType) {
+ this.indexName = indexName;
+ this.dataverseName = dataverseName;
+ this.datasetName = datasetName;
+ this.keyFields = keyFields;
+ this.gramLength = gramLength;
+ this.indexType = indexType;
+ }
- public String getDatasetName() {
- return datasetName;
- }
+ public String getDatasetName() {
+ return datasetName;
+ }
- public String getDataverseName() {
- return dataverseName;
- }
+ public String getDataverseName() {
+ return dataverseName;
+ }
- public String getIndexName() {
- return indexName;
- }
+ public String getIndexName() {
+ return indexName;
+ }
- public List<String> getKeyFields() {
- return keyFields;
- }
+ public List<String> getKeyFields() {
+ return keyFields;
+ }
- public IndexType getIndexType() {
- return indexType;
- }
+ public IndexType getIndexType() {
+ return indexType;
+ }
- public int getGramLength() {
- return gramLength;
- }
+ public int getGramLength() {
+ return gramLength;
+ }
- @Override
- public Kind getKind() {
- return Kind.CREATE_INDEX;
- }
- }
+ @Override
+ public Kind getKind() {
+ return Kind.CREATE_INDEX;
+ }
+ }
- public static class CompiledLoadFromFileStatement implements
- ICompiledDmlStatement {
- private String dataverseName;
- private String datasetName;
- private boolean alreadySorted;
- private String adapter;
- private Map<String, String> properties;
+ public static class CompiledLoadFromFileStatement implements ICompiledDmlStatement {
+ private String dataverseName;
+ private String datasetName;
+ private boolean alreadySorted;
+ private String adapter;
+ private Map<String, String> properties;
- public CompiledLoadFromFileStatement(String dataverseName,
- String datasetName, String adapter,
- Map<String, String> properties, boolean alreadySorted) {
- this.dataverseName = dataverseName;
- this.datasetName = datasetName;
- this.alreadySorted = alreadySorted;
- this.adapter = adapter;
- this.properties = properties;
- }
+ public CompiledLoadFromFileStatement(String dataverseName, String datasetName, String adapter,
+ Map<String, String> properties, boolean alreadySorted) {
+ this.dataverseName = dataverseName;
+ this.datasetName = datasetName;
+ this.alreadySorted = alreadySorted;
+ this.adapter = adapter;
+ this.properties = properties;
+ }
- public String getDataverseName() {
- return dataverseName;
- }
-
- public String getDatasetName() {
- return datasetName;
- }
+ public String getDataverseName() {
+ return dataverseName;
+ }
- public boolean alreadySorted() {
- return alreadySorted;
- }
+ public String getDatasetName() {
+ return datasetName;
+ }
- public String getAdapter() {
- return adapter;
- }
+ public boolean alreadySorted() {
+ return alreadySorted;
+ }
- public Map<String, String> getProperties() {
- return properties;
- }
+ public String getAdapter() {
+ return adapter;
+ }
- @Override
- public Kind getKind() {
- return Kind.LOAD_FROM_FILE;
- }
- }
+ public Map<String, String> getProperties() {
+ return properties;
+ }
- public static class CompiledInsertStatement implements
- ICompiledDmlStatement {
- private final String dataverseName;
- private final String datasetName;
- private final Query query;
- private final int varCounter;
+ @Override
+ public Kind getKind() {
+ return Kind.LOAD_FROM_FILE;
+ }
+ }
- public CompiledInsertStatement(String dataverseName,
- String datasetName, Query query, int varCounter) {
- this.dataverseName = dataverseName;
- this.datasetName = datasetName;
- this.query = query;
- this.varCounter = varCounter;
- }
+ public static class CompiledInsertStatement implements ICompiledDmlStatement {
+ private final String dataverseName;
+ private final String datasetName;
+ private final Query query;
+ private final int varCounter;
- public String getDataverseName() {
- return dataverseName;
- }
+ public CompiledInsertStatement(String dataverseName, String datasetName, Query query, int varCounter) {
+ this.dataverseName = dataverseName;
+ this.datasetName = datasetName;
+ this.query = query;
+ this.varCounter = varCounter;
+ }
- public String getDatasetName() {
- return datasetName;
- }
+ public String getDataverseName() {
+ return dataverseName;
+ }
- public int getVarCounter() {
- return varCounter;
- }
+ public String getDatasetName() {
+ return datasetName;
+ }
- public Query getQuery() {
- return query;
- }
+ public int getVarCounter() {
+ return varCounter;
+ }
- @Override
- public Kind getKind() {
- return Kind.INSERT;
- }
- }
+ public Query getQuery() {
+ return query;
+ }
- public static class CompiledBeginFeedStatement implements
- ICompiledDmlStatement {
- private String dataverseName;
- private String datasetName;
- private Query query;
- private int varCounter;
+ @Override
+ public Kind getKind() {
+ return Kind.INSERT;
+ }
+ }
- public CompiledBeginFeedStatement(String dataverseName,
- String datasetName, Query query, int varCounter) {
- this.dataverseName = dataverseName;
- this.datasetName = datasetName;
- this.query = query;
- this.varCounter = varCounter;
- }
+ public static class CompiledBeginFeedStatement implements ICompiledDmlStatement {
+ private String dataverseName;
+ private String datasetName;
+ private Query query;
+ private int varCounter;
- @Override
- public String getDataverseName() {
- return dataverseName;
- }
+ public CompiledBeginFeedStatement(String dataverseName, String datasetName, Query query, int varCounter) {
+ this.dataverseName = dataverseName;
+ this.datasetName = datasetName;
+ this.query = query;
+ this.varCounter = varCounter;
+ }
- @Override
- public String getDatasetName() {
- return datasetName;
- }
+ @Override
+ public String getDataverseName() {
+ return dataverseName;
+ }
- public int getVarCounter() {
- return varCounter;
- }
+ @Override
+ public String getDatasetName() {
+ return datasetName;
+ }
- public Query getQuery() {
- return query;
- }
+ public int getVarCounter() {
+ return varCounter;
+ }
- public void setQuery(Query query) {
- this.query = query;
- }
+ public Query getQuery() {
+ return query;
+ }
- @Override
- public Kind getKind() {
- return Kind.BEGIN_FEED;
- }
- }
+ public void setQuery(Query query) {
+ this.query = query;
+ }
- public static class CompiledControlFeedStatement implements
- ICompiledDmlStatement {
- private String dataverseName;
- private String datasetName;
- private OperationType operationType;
- private Query query;
- private int varCounter;
- private Map<String, String> alteredParams;
+ @Override
+ public Kind getKind() {
+ return Kind.BEGIN_FEED;
+ }
+ }
- public CompiledControlFeedStatement(OperationType operationType,
- String dataverseName, String datasetName,
- Map<String, String> alteredParams) {
- this.dataverseName = dataverseName;
- this.datasetName = datasetName;
- this.operationType = operationType;
- this.alteredParams = alteredParams;
- }
+ public static class CompiledControlFeedStatement implements ICompiledDmlStatement {
+ private String dataverseName;
+ private String datasetName;
+ private OperationType operationType;
+ private Query query;
+ private int varCounter;
+ private Map<String, String> alteredParams;
- @Override
- public String getDataverseName() {
- return dataverseName;
- }
+ public CompiledControlFeedStatement(OperationType operationType, String dataverseName, String datasetName,
+ Map<String, String> alteredParams) {
+ this.dataverseName = dataverseName;
+ this.datasetName = datasetName;
+ this.operationType = operationType;
+ this.alteredParams = alteredParams;
+ }
- @Override
- public String getDatasetName() {
- return datasetName;
- }
+ @Override
+ public String getDataverseName() {
+ return dataverseName;
+ }
- public OperationType getOperationType() {
- return operationType;
- }
+ @Override
+ public String getDatasetName() {
+ return datasetName;
+ }
- public int getVarCounter() {
- return varCounter;
- }
+ public OperationType getOperationType() {
+ return operationType;
+ }
- public Query getQuery() {
- return query;
- }
+ public int getVarCounter() {
+ return varCounter;
+ }
- @Override
- public Kind getKind() {
- return Kind.CONTROL_FEED;
- }
+ public Query getQuery() {
+ return query;
+ }
- public Map<String, String> getProperties() {
- return alteredParams;
- }
+ @Override
+ public Kind getKind() {
+ return Kind.CONTROL_FEED;
+ }
- public void setProperties(Map<String, String> properties) {
- this.alteredParams = properties;
- }
- }
+ public Map<String, String> getProperties() {
+ return alteredParams;
+ }
- public static class CompiledDeleteStatement implements
- ICompiledDmlStatement {
- private VariableExpr var;
- private String dataverseName;
- private String datasetName;
- private Expression condition;
- private Clause dieClause;
- private int varCounter;
- private AqlMetadataProvider metadataProvider;
+ public void setProperties(Map<String, String> properties) {
+ this.alteredParams = properties;
+ }
+ }
- public CompiledDeleteStatement(VariableExpr var, String dataverseName,
- String datasetName, Expression condition, Clause dieClause,
- int varCounter, AqlMetadataProvider metadataProvider) {
- this.var = var;
- this.dataverseName = dataverseName;
- this.datasetName = datasetName;
- this.condition = condition;
- this.dieClause = dieClause;
- this.varCounter = varCounter;
- this.metadataProvider = metadataProvider;
- }
+ public static class CompiledDeleteStatement implements ICompiledDmlStatement {
+ private VariableExpr var;
+ private String dataverseName;
+ private String datasetName;
+ private Expression condition;
+ private int varCounter;
+ private AqlMetadataProvider metadataProvider;
- @Override
- public String getDatasetName() {
- return datasetName;
- }
+ public CompiledDeleteStatement(VariableExpr var, String dataverseName, String datasetName,
+ Expression condition, int varCounter, AqlMetadataProvider metadataProvider) {
+ this.var = var;
+ this.dataverseName = dataverseName;
+ this.datasetName = datasetName;
+ this.condition = condition;
+ this.varCounter = varCounter;
+ this.metadataProvider = metadataProvider;
+ }
- @Override
- public String getDataverseName() {
- return dataverseName;
- }
+ @Override
+ public String getDatasetName() {
+ return datasetName;
+ }
- public int getVarCounter() {
- return varCounter;
- }
+ @Override
+ public String getDataverseName() {
+ return dataverseName;
+ }
- public Expression getCondition() {
- return condition;
- }
+ public int getVarCounter() {
+ return varCounter;
+ }
- public Clause getDieClause() {
- return dieClause;
- }
+ public Expression getCondition() {
+ return condition;
+ }
- public Query getQuery() throws AlgebricksException {
+ public Query getQuery() throws AlgebricksException {
- List<Expression> arguments = new ArrayList<Expression>();
- String arg = dataverseName == null ? datasetName : dataverseName
- + "." + datasetName;
- LiteralExpr argumentLiteral = new LiteralExpr(
- new StringLiteral(arg));
- arguments.add(argumentLiteral);
+ List<Expression> arguments = new ArrayList<Expression>();
+ String arg = dataverseName == null ? datasetName : dataverseName + "." + datasetName;
+ LiteralExpr argumentLiteral = new LiteralExpr(new StringLiteral(arg));
+ arguments.add(argumentLiteral);
- CallExpr callExpression = new CallExpr(new FunctionSignature(
- FunctionConstants.ASTERIX_NS, "dataset", 1), arguments);
- List<Clause> clauseList = new ArrayList<Clause>();
- Clause forClause = new ForClause(var, callExpression);
- clauseList.add(forClause);
- Clause whereClause = null;
- if (condition != null) {
- whereClause = new WhereClause(condition);
- clauseList.add(whereClause);
- }
- if (dieClause != null) {
- clauseList.add(dieClause);
- }
+ CallExpr callExpression = new CallExpr(new FunctionSignature(FunctionConstants.ASTERIX_NS, "dataset", 1),
+ arguments);
+ List<Clause> clauseList = new ArrayList<Clause>();
+ Clause forClause = new ForClause(var, callExpression);
+ clauseList.add(forClause);
+ Clause whereClause = null;
+ if (condition != null) {
+ whereClause = new WhereClause(condition);
+ clauseList.add(whereClause);
+ }
- Dataset dataset = metadataProvider.findDataset(dataverseName,
- datasetName);
- if (dataset == null) {
- throw new AlgebricksException("Unknown dataset " + datasetName);
- }
- String itemTypeName = dataset.getItemTypeName();
- IAType itemType = metadataProvider.findType(
- dataset.getDataverseName(), itemTypeName);
- ARecordType recType = (ARecordType) itemType;
- String[] fieldNames = recType.getFieldNames();
- List<FieldBinding> fieldBindings = new ArrayList<FieldBinding>();
- for (int i = 0; i < fieldNames.length; i++) {
- FieldAccessor fa = new FieldAccessor(var, new Identifier(
- fieldNames[i]));
- FieldBinding fb = new FieldBinding(new LiteralExpr(
- new StringLiteral(fieldNames[i])), fa);
- fieldBindings.add(fb);
- }
- RecordConstructor rc = new RecordConstructor(fieldBindings);
+ Dataset dataset = metadataProvider.findDataset(dataverseName, datasetName);
+ if (dataset == null) {
+ throw new AlgebricksException("Unknown dataset " + datasetName);
+ }
+ String itemTypeName = dataset.getItemTypeName();
+ IAType itemType = metadataProvider.findType(dataset.getDataverseName(), itemTypeName);
+ ARecordType recType = (ARecordType) itemType;
+ String[] fieldNames = recType.getFieldNames();
+ List<FieldBinding> fieldBindings = new ArrayList<FieldBinding>();
+ for (int i = 0; i < fieldNames.length; i++) {
+ FieldAccessor fa = new FieldAccessor(var, new Identifier(fieldNames[i]));
+ FieldBinding fb = new FieldBinding(new LiteralExpr(new StringLiteral(fieldNames[i])), fa);
+ fieldBindings.add(fb);
+ }
+ RecordConstructor rc = new RecordConstructor(fieldBindings);
- FLWOGRExpression flowgr = new FLWOGRExpression(clauseList, rc);
- Query query = new Query();
- query.setBody(flowgr);
- return query;
- }
+ FLWOGRExpression flowgr = new FLWOGRExpression(clauseList, rc);
+ Query query = new Query();
+ query.setBody(flowgr);
+ return query;
+ }
- @Override
- public Kind getKind() {
- return Kind.DELETE;
- }
+ @Override
+ public Kind getKind() {
+ return Kind.DELETE;
+ }
- }
+ }
}
diff --git a/asterix-app/pom.xml b/asterix-app/pom.xml
index 48c4ee5..545adb2 100644
--- a/asterix-app/pom.xml
+++ b/asterix-app/pom.xml
@@ -176,12 +176,6 @@
<scope>compile</scope>
</dependency>
<dependency>
- <groupId>com.kenai.nbpwr</groupId>
- <artifactId>org-apache-commons-io</artifactId>
- <version>1.3.1-201002241208</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>0.20.2</version>
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java b/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java
index 41dde5d..3474a53 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java
@@ -1232,8 +1232,8 @@
String dataverseName = stmtDelete.getDataverseName() == null ? activeDefaultDataverse == null ? null
: activeDefaultDataverse.getDataverseName() : stmtDelete.getDataverseName().getValue();
CompiledDeleteStatement clfrqs = new CompiledDeleteStatement(stmtDelete.getVariableExpr(), dataverseName,
- stmtDelete.getDatasetName().getValue(), stmtDelete.getCondition(), stmtDelete.getDieClause(),
- stmtDelete.getVarCounter(), metadataProvider);
+ stmtDelete.getDatasetName().getValue(), stmtDelete.getCondition(), stmtDelete.getVarCounter(),
+ metadataProvider);
JobSpecification compiled = rewriteCompileQuery(metadataProvider, clfrqs.getQuery(), clfrqs);
MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree.aql b/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree.aql
deleted file mode 100644
index 85616e4..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree.aql
+++ /dev/null
@@ -1,30 +0,0 @@
-drop dataverse test if exists;
-
-create dataverse test;
-use dataverse test;
-
-create type MyRecord as closed {
- id: int32,
- tweetid: int64,
- loc: point,
- time: datetime,
- text: string
-}
-
-create dataset MyData(MyRecord)
- primary key id;
-
-create index rtree_index on MyData(loc) type rtree;
-
-load dataset MyData
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/twitter/smalltweets.txt"),("format"="adm")) pre-sorted;
-
-delete $l from dataset MyData where spatial-intersect($l.loc, create-rectangle(create-point(0.0,-100.0), create-point(55.5,50.0))) die after 1000;
-
-write output to nc1:"rttest/failure_delete-rtree.adm";
-
-for $o in dataset('MyData')
-where spatial-intersect($o.loc, create-rectangle(create-point(0.0,-100.0), create-point(55.5,50.0)))
-order by $o.id
-return {"id":$o.id}
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.1.ddl.aql
deleted file mode 100644
index 381ad3f..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.1.ddl.aql
+++ /dev/null
@@ -1,19 +0,0 @@
-drop dataverse test if exists;
-
-create dataverse test;
-
-use dataverse test;
-
-create type MyRecord as closed {
- id: int32,
- tweetid: int64,
- loc: point,
- time: datetime,
- text: string
-}
-
-create dataset MyData(MyRecord)
- primary key id;
-
-create index rtree_index_loc on MyData(loc) type rtree;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.2.update.aql
deleted file mode 100644
index 3556905..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.2.update.aql
+++ /dev/null
@@ -1,8 +0,0 @@
-use dataverse test;
-
-load dataset MyData
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/twitter/smalltweets.txt"),("format"="adm")) pre-sorted;
-
-delete $l from dataset MyData where $l.id>=50 die after 1500;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.3.query.aql
deleted file mode 100644
index b33019b..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.3.query.aql
+++ /dev/null
@@ -1,5 +0,0 @@
-use dataverse test;
-
-for $o in dataset('MyData')
-order by $o.id
-return {"id":$o.id}
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/delete.aql b/asterix-app/src/test/resources/runtimets/queries/failure/delete.aql
deleted file mode 100644
index 125fd99..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/delete.aql
+++ /dev/null
@@ -1,38 +0,0 @@
-drop dataverse test if exists;
-
-create dataverse test;
-use dataverse test;
-
-create type LineItemType as closed {
- l_orderkey: int32,
- l_partkey: int32,
- l_suppkey: int32,
- l_linenumber: int32,
- l_quantity: int32,
- l_extendedprice: double,
- l_discount: double,
- l_tax: double,
- l_returnflag: string,
- l_linestatus: string,
- l_shipdate: string,
- l_commitdate: string,
- l_receiptdate: string,
- l_shipinstruct: string,
- l_shipmode: string,
- l_comment: string
-}
-
-create dataset LineItem(LineItemType)
- primary key l_orderkey, l_linenumber;
-
-load dataset LineItem
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
-
-delete $l from dataset LineItem where $l.l_orderkey>=10 die after 1000;
-
-write output to nc1:"rttest/failure_delete.adm";
-for $c in dataset('LineItem')
-where $c.l_orderkey>=10
-order by $c.l_orderkey, $c.l_linenumber
-return $c
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/delete/delete.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/failure/delete/delete.1.ddl.aql
deleted file mode 100644
index ea29045..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/delete/delete.1.ddl.aql
+++ /dev/null
@@ -1,28 +0,0 @@
-drop dataverse test if exists;
-
-create dataverse test;
-
-use dataverse test;
-
-create type LineItemType as closed {
- l_orderkey: int32,
- l_partkey: int32,
- l_suppkey: int32,
- l_linenumber: int32,
- l_quantity: int32,
- l_extendedprice: double,
- l_discount: double,
- l_tax: double,
- l_returnflag: string,
- l_linestatus: string,
- l_shipdate: string,
- l_commitdate: string,
- l_receiptdate: string,
- l_shipinstruct: string,
- l_shipmode: string,
- l_comment: string
-}
-
-create dataset LineItem(LineItemType)
- primary key l_orderkey, l_linenumber;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/delete/delete.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/failure/delete/delete.2.update.aql
deleted file mode 100644
index ac2bd60..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/delete/delete.2.update.aql
+++ /dev/null
@@ -1,8 +0,0 @@
-use dataverse test;
-
-load dataset LineItem
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
-
-delete $l from dataset LineItem where $l.l_orderkey>=10 die after 1500;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/delete/delete.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/failure/delete/delete.3.query.aql
deleted file mode 100644
index 9375d30..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/delete/delete.3.query.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-use dataverse test;
-
-for $c in dataset('LineItem')
-where $c.l_orderkey>=10
-order by $c.l_orderkey, $c.l_linenumber
-return $c
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.1.ddl.aql
deleted file mode 100644
index 0cb052d..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.1.ddl.aql
+++ /dev/null
@@ -1,25 +0,0 @@
-drop dataverse test if exists;
-
-create dataverse test;
-
-use dataverse test;
-
-create type MyRecord as closed {
- id: int32,
- tweetid: int64,
- loc: point,
- time: datetime,
- text: string
-}
-
-create type MyMiniRecord as closed {
- id: int32,
- loc: point
-}
-
-create dataset MyData(MyRecord)
- primary key id;
-
-create dataset MyMiniData(MyMiniRecord)
- primary key id;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.2.update.aql
deleted file mode 100644
index bffd599..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.2.update.aql
+++ /dev/null
@@ -1,11 +0,0 @@
-use dataverse test;
-
-load dataset MyData
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/twitter/smalltweets.txt"),("format"="adm")) pre-sorted;
-
-
-load dataset MyMiniData
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/spatial/spatialData0.json"),("format"="adm")) pre-sorted;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.3.ddl.aql
deleted file mode 100644
index 3626933..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.3.ddl.aql
+++ /dev/null
@@ -1,5 +0,0 @@
-use dataverse test;
-
-create index rtree_index_loc_0 on MyData(loc) type rtree;
-create index rtree_index_loc on MyMiniData(loc) type rtree;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.4.update.aql
deleted file mode 100644
index 5874119..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.4.update.aql
+++ /dev/null
@@ -1,23 +0,0 @@
-use dataverse test;
-
-insert into dataset MyMiniData
-(
- for $m in dataset('MyData')
- where $m.id<1000
- return {
- "id": $m.id,
- "loc": $m.loc
- }
-);
-
-insert into dataset MyMiniData
-(
- for $m in dataset('MyData')
- where $m.id>=1000
- die after 1000
- return {
- "id": $m.id,
- "loc": $m.loc
- }
-);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.5.query.aql
deleted file mode 100644
index 6c75ca2..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.5.query.aql
+++ /dev/null
@@ -1,5 +0,0 @@
-use dataverse test;
-
-for $o in dataset('MyMiniData')
-order by $o.id
-return {"id":$o.id}
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/insert/insert.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/failure/insert/insert.1.ddl.aql
deleted file mode 100644
index 7f5844e..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/insert/insert.1.ddl.aql
+++ /dev/null
@@ -1,37 +0,0 @@
-drop dataverse test if exists;
-
-create dataverse test;
-
-use dataverse test;
-
-create type LineItemType as closed {
- l_orderkey: int32,
- l_partkey: int32,
- l_suppkey: int32,
- l_linenumber: int32,
- l_quantity: double,
- l_extendedprice: double,
- l_discount: double,
- l_tax: double,
- l_returnflag: string,
- l_linestatus: string,
- l_shipdate: string,
- l_commitdate: string,
- l_receiptdate: string,
- l_shipinstruct: string,
- l_shipmode: string,
- l_comment: string
-}
-
-create type LineIDType as closed {
- l_orderkey: int32,
- l_linenumber: int32,
- l_suppkey: int32
-}
-
-create dataset LineItem(LineItemType)
- primary key l_orderkey, l_linenumber;
-
-create dataset LineID(LineIDType)
- primary key l_orderkey, l_linenumber;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/insert/insert.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/failure/insert/insert.2.update.aql
deleted file mode 100644
index a1bfc0d..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/insert/insert.2.update.aql
+++ /dev/null
@@ -1,32 +0,0 @@
-use dataverse test;
-
-load dataset LineItem
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
-
-load dataset LineID
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/tpch0.001/lineitem_0.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
-
-insert into dataset LineID (
-for $l in dataset('LineItem')
- where $l.l_orderkey<1000
- return {
- "l_orderkey": $l.l_orderkey,
- "l_linenumber": $l.l_linenumber,
- "l_suppkey": $l.l_partkey
- }
-);
-
-insert into dataset LineID (
-for $l in dataset('LineItem')
- where $l.l_orderkey>=1000
- die after 1000
- return {
- "l_orderkey": $l.l_orderkey,
- "l_linenumber": $l.l_linenumber,
- "l_suppkey": $l.l_partkey
- }
-);
-
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/insert/insert.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/failure/insert/insert.3.query.aql
deleted file mode 100644
index 4a3e056..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/insert/insert.3.query.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-use dataverse test;
-
-for $c in dataset('LineID')
-order by $c.l_orderkey, $c.l_linenumber
-return $c
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete-rtree.aql b/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete-rtree.aql
deleted file mode 100644
index a8d7d37..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete-rtree.aql
+++ /dev/null
@@ -1,8 +0,0 @@
-use dataverse test;
-
-write output to nc1:"rttest/failure_verify_delete-rtree.adm";
-
-for $o in dataset('MyData')
-where spatial-intersect($o.loc, create-rectangle(create-point(0.0,-100.0), create-point(55.5,50.0)))
-order by $o.id
-return {"id":$o.id}
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete-rtree/verify_delete-rtree.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete-rtree/verify_delete-rtree.1.ddl.aql
deleted file mode 100644
index e69de29..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete-rtree/verify_delete-rtree.1.ddl.aql
+++ /dev/null
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete-rtree/verify_delete-rtree.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete-rtree/verify_delete-rtree.2.update.aql
deleted file mode 100644
index e69de29..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete-rtree/verify_delete-rtree.2.update.aql
+++ /dev/null
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete-rtree/verify_delete-rtree.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete-rtree/verify_delete-rtree.3.query.aql
deleted file mode 100644
index b33019b..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete-rtree/verify_delete-rtree.3.query.aql
+++ /dev/null
@@ -1,5 +0,0 @@
-use dataverse test;
-
-for $o in dataset('MyData')
-order by $o.id
-return {"id":$o.id}
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete/verify_delete.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete/verify_delete.1.ddl.aql
deleted file mode 100644
index e69de29..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete/verify_delete.1.ddl.aql
+++ /dev/null
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete/verify_delete.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete/verify_delete.2.update.aql
deleted file mode 100644
index e69de29..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete/verify_delete.2.update.aql
+++ /dev/null
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete/verify_delete.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete/verify_delete.3.query.aql
deleted file mode 100644
index 2a0f3e4..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete/verify_delete.3.query.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-use dataverse test;
-
-for $c in dataset('LineItem')
-where $c.l_orderkey>=10
-order by $c.l_orderkey, $c.l_linenumber
-return $c
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert-rtree/verify_insert-rtree.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert-rtree/verify_insert-rtree.1.ddl.aql
deleted file mode 100644
index e69de29..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert-rtree/verify_insert-rtree.1.ddl.aql
+++ /dev/null
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert-rtree/verify_insert-rtree.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert-rtree/verify_insert-rtree.2.update.aql
deleted file mode 100644
index e69de29..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert-rtree/verify_insert-rtree.2.update.aql
+++ /dev/null
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert-rtree/verify_insert-rtree.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert-rtree/verify_insert-rtree.3.query.aql
deleted file mode 100644
index 6c75ca2..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert-rtree/verify_insert-rtree.3.query.aql
+++ /dev/null
@@ -1,5 +0,0 @@
-use dataverse test;
-
-for $o in dataset('MyMiniData')
-order by $o.id
-return {"id":$o.id}
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert/verify_insert.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert/verify_insert.1.ddl.aql
deleted file mode 100644
index e69de29..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert/verify_insert.1.ddl.aql
+++ /dev/null
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert/verify_insert.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert/verify_insert.2.update.aql
deleted file mode 100644
index e69de29..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert/verify_insert.2.update.aql
+++ /dev/null
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert/verify_insert.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert/verify_insert.3.query.aql
deleted file mode 100644
index 4cb52c5..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert/verify_insert.3.query.aql
+++ /dev/null
@@ -1,5 +0,0 @@
-use dataverse test;
-
-for $c in dataset('LineID')
-order by $c.l_orderkey, $c.l_linenumber
-return $c
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index dd29a7b..278d04a 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -1034,42 +1034,6 @@
</test-case>
</test-group>
<test-group name="failure">
- <test-case FilePath="failure">
- <compilation-unit name="delete-rtree">
- <output-dir compare="Text">delete-rtree</output-dir>
- <expected-error>edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException</expected-error>
- </compilation-unit>
- <compilation-unit name="verify_delete-rtree">
- <output-dir compare="Text">delete-rtree</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="failure">
- <compilation-unit name="delete">
- <output-dir compare="Text">delete</output-dir>
- <expected-error>edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException</expected-error>
- </compilation-unit>
- <compilation-unit name="verify_delete">
- <output-dir compare="Text">delete</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="failure">
- <compilation-unit name="insert-rtree">
- <output-dir compare="Text">insert-rtree</output-dir>
- <expected-error>edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException</expected-error>
- </compilation-unit>
- <compilation-unit name="verify_insert-rtree">
- <output-dir compare="Text">insert-rtree</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="failure">
- <compilation-unit name="insert">
- <output-dir compare="Text">insert</output-dir>
- <expected-error>edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException</expected-error>
- </compilation-unit>
- <compilation-unit name="verify_insert">
- <output-dir compare="Text">insert</output-dir>
- </compilation-unit>
- </test-case>
<!--
<test-case FilePath="failure">
<compilation-unit name="q1_pricing_summary_report_failure">
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();