merged asterix_stabilization r620:1109
git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_stabilization_temporal_functionality@1113 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-algebra/pom.xml b/asterix-algebra/pom.xml
index ac2207c..f950800 100644
--- a/asterix-algebra/pom.xml
+++ b/asterix-algebra/pom.xml
@@ -61,7 +61,7 @@
<dependency>
<groupId>edu.uci.ics.hyracks</groupId>
<artifactId>hyracks-algebricks-compiler</artifactId>
- <version>0.2.1-SNAPSHOT</version>
+ <version>0.2.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/base/LogicalExpressionDeepCopyVisitor.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/base/LogicalExpressionDeepCopyVisitor.java
index 054ca96..95e71ff 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/base/LogicalExpressionDeepCopyVisitor.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/base/LogicalExpressionDeepCopyVisitor.java
@@ -1,7 +1,6 @@
package edu.uci.ics.asterix.algebra.base;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -24,11 +23,13 @@
public class LogicalExpressionDeepCopyVisitor implements ILogicalExpressionVisitor<ILogicalExpression, Void> {
private final Counter counter;
- private final HashMap<LogicalVariable, LogicalVariable> variableMapping;
+ private final Map<LogicalVariable, LogicalVariable> inVarMapping;
+ private final Map<LogicalVariable, LogicalVariable> outVarMapping;
- public LogicalExpressionDeepCopyVisitor(Counter counter, HashMap<LogicalVariable, LogicalVariable> variableMapping) {
+ public LogicalExpressionDeepCopyVisitor(Counter counter, Map<LogicalVariable, LogicalVariable> inVarMapping, Map<LogicalVariable, LogicalVariable> variableMapping) {
this.counter = counter;
- this.variableMapping = variableMapping;
+ this.inVarMapping = inVarMapping;
+ this.outVarMapping = variableMapping;
}
public ILogicalExpression deepCopy(ILogicalExpression expr) throws AlgebricksException {
@@ -102,11 +103,16 @@
public ILogicalExpression visitVariableReferenceExpression(VariableReferenceExpression expr, Void arg)
throws AlgebricksException {
LogicalVariable var = expr.getVariableReference();
- LogicalVariable varCopy = variableMapping.get(var);
+ LogicalVariable givenVarReplacement = inVarMapping.get(var);
+ if (givenVarReplacement != null) {
+ outVarMapping.put(var, givenVarReplacement);
+ return new VariableReferenceExpression(givenVarReplacement);
+ }
+ LogicalVariable varCopy = outVarMapping.get(var);
if (varCopy == null) {
counter.inc();
varCopy = new LogicalVariable(counter.get());
- variableMapping.put(var, varCopy);
+ outVarMapping.put(var, varCopy);
}
return new VariableReferenceExpression(varCopy);
}
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 a573df3..4af1424 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
@@ -1,6 +1,7 @@
package edu.uci.ics.asterix.algebra.base;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -54,11 +55,29 @@
private final Counter counter;
private final LogicalExpressionDeepCopyVisitor exprDeepCopyVisitor;
- private final HashMap<LogicalVariable, LogicalVariable> variableMapping = new HashMap<LogicalVariable, LogicalVariable>();
+ // Key: Variable in the original plan. Value: New variable replacing the original one in the copied plan.
+ private final Map<LogicalVariable, LogicalVariable> outVarMapping = new HashMap<LogicalVariable, LogicalVariable>();
+ // Key: Variable in the original plan. Value: Variable with which to replace original variable in the plan copy.
+ private final Map<LogicalVariable, LogicalVariable> inVarMapping;
+
public LogicalOperatorDeepCopyVisitor(Counter counter) {
this.counter = counter;
- exprDeepCopyVisitor = new LogicalExpressionDeepCopyVisitor(counter, variableMapping);
+ this.inVarMapping = Collections.emptyMap();
+ exprDeepCopyVisitor = new LogicalExpressionDeepCopyVisitor(counter, inVarMapping, outVarMapping);
+ }
+
+ /**
+ * @param counter
+ * Starting variable counter.
+ * @param inVarMapping
+ * Variable mapping keyed by variables in the original plan.
+ * Those variables are replaced by their corresponding value in the map in the copied plan.
+ */
+ public LogicalOperatorDeepCopyVisitor(Counter counter, Map<LogicalVariable, LogicalVariable> inVarMapping) {
+ this.counter = counter;
+ this.inVarMapping = inVarMapping;
+ exprDeepCopyVisitor = new LogicalExpressionDeepCopyVisitor(counter, inVarMapping, outVarMapping);
}
private void copyAnnotations(ILogicalOperator src, ILogicalOperator dest) {
@@ -132,11 +151,16 @@
if (var == null) {
return null;
}
- LogicalVariable varCopy = variableMapping.get(var);
+ LogicalVariable givenVarReplacement = inVarMapping.get(var);
+ if (givenVarReplacement != null) {
+ outVarMapping.put(var, givenVarReplacement);
+ return givenVarReplacement;
+ }
+ LogicalVariable varCopy = outVarMapping.get(var);
if (varCopy == null) {
counter.inc();
varCopy = new LogicalVariable(counter.get());
- variableMapping.put(var, varCopy);
+ outVarMapping.put(var, varCopy);
}
return varCopy;
}
@@ -162,16 +186,16 @@
}
public void reset() {
- variableMapping.clear();
+ outVarMapping.clear();
}
public void updatePrimaryKeys(IOptimizationContext context) {
- for (Map.Entry<LogicalVariable, LogicalVariable> entry : variableMapping.entrySet()) {
+ for (Map.Entry<LogicalVariable, LogicalVariable> entry : outVarMapping.entrySet()) {
List<LogicalVariable> primaryKey = context.findPrimaryKey(entry.getKey());
if (primaryKey != null) {
List<LogicalVariable> head = new ArrayList<LogicalVariable>();
for (LogicalVariable variable : primaryKey) {
- head.add(variableMapping.get(variable));
+ head.add(outVarMapping.get(variable));
}
List<LogicalVariable> tail = new ArrayList<LogicalVariable>(1);
tail.add(entry.getValue());
@@ -181,7 +205,7 @@
}
public LogicalVariable varCopy(LogicalVariable var) throws AlgebricksException {
- return variableMapping.get(var);
+ return outVarMapping.get(var);
}
@Override
@@ -191,6 +215,7 @@
exprDeepCopyVisitor.deepCopyExpressionReferenceList(op.getExpressions()));
deepCopyInputs(op, opCopy, arg);
copyAnnotations(op, opCopy);
+ opCopy.setExecutionMode(op.getExecutionMode());
return opCopy;
}
@@ -200,6 +225,7 @@
exprDeepCopyVisitor.deepCopyExpressionReferenceList(op.getExpressions()));
deepCopyInputs(op, opCopy, arg);
copyAnnotations(op, opCopy);
+ opCopy.setExecutionMode(op.getExecutionMode());
return opCopy;
}
@@ -210,6 +236,7 @@
op.getDataSource());
deepCopyInputs(op, opCopy, arg);
copyAnnotations(op, opCopy);
+ opCopy.setExecutionMode(op.getExecutionMode());
return opCopy;
}
@@ -220,7 +247,9 @@
@Override
public ILogicalOperator visitEmptyTupleSourceOperator(EmptyTupleSourceOperator op, ILogicalOperator arg) {
- return new EmptyTupleSourceOperator();
+ EmptyTupleSourceOperator opCopy = new EmptyTupleSourceOperator();
+ opCopy.setExecutionMode(op.getExecutionMode());
+ return opCopy;
}
@Override
@@ -240,6 +269,7 @@
deepCopyPlanList(op.getNestedPlans(), nestedPlansCopy, opCopy);
deepCopyInputs(op, opCopy, arg);
copyAnnotations(op, opCopy);
+ opCopy.setExecutionMode(op.getExecutionMode());
return opCopy;
}
@@ -250,6 +280,7 @@
.getCondition()), deepCopyOperatorReference(op.getInputs().get(0), null), deepCopyOperatorReference(op
.getInputs().get(1), null));
copyAnnotations(op, opCopy);
+ opCopy.setExecutionMode(op.getExecutionMode());
return opCopy;
}
@@ -274,6 +305,7 @@
NestedTupleSourceOperator opCopy = new NestedTupleSourceOperator(new MutableObject<ILogicalOperator>(arg));
deepCopyInputs(op, opCopy, arg);
copyAnnotations(op, opCopy);
+ opCopy.setExecutionMode(op.getExecutionMode());
return opCopy;
}
@@ -282,6 +314,7 @@
OrderOperator opCopy = new OrderOperator(deepCopyOrderExpressionReferencePairList(op.getOrderExpressions()));
deepCopyInputs(op, opCopy, arg);
copyAnnotations(op, opCopy);
+ opCopy.setExecutionMode(op.getExecutionMode());
return opCopy;
}
@@ -295,6 +328,7 @@
ProjectOperator opCopy = new ProjectOperator(deepCopyVariableList(op.getVariables()));
deepCopyInputs(op, opCopy, arg);
copyAnnotations(op, opCopy);
+ opCopy.setExecutionMode(op.getExecutionMode());
return opCopy;
}
@@ -319,6 +353,7 @@
SelectOperator opCopy = new SelectOperator(exprDeepCopyVisitor.deepCopyExpressionReference(op.getCondition()));
deepCopyInputs(op, opCopy, arg);
copyAnnotations(op, opCopy);
+ opCopy.setExecutionMode(op.getExecutionMode());
return opCopy;
}
@@ -330,6 +365,7 @@
deepCopyPlanList(op.getNestedPlans(), nestedPlansCopy, opCopy);
deepCopyInputs(op, opCopy, arg);
copyAnnotations(op, opCopy);
+ opCopy.setExecutionMode(op.getExecutionMode());
return opCopy;
}
@@ -350,6 +386,7 @@
deepCopyVariable(op.getPositionalVariable()), op.getPositionalVariableType());
deepCopyInputs(op, opCopy, arg);
copyAnnotations(op, opCopy);
+ opCopy.setExecutionMode(op.getExecutionMode());
return opCopy;
}
@@ -383,4 +420,8 @@
throws AlgebricksException {
throw new UnsupportedOperationException();
}
+
+ public Map<LogicalVariable, LogicalVariable> getVariableMapping() {
+ return outVarMapping;
+ }
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/BTreeSearchPOperator.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/BTreeSearchPOperator.java
index dad8d0a..09a4c6b 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/BTreeSearchPOperator.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/BTreeSearchPOperator.java
@@ -3,7 +3,6 @@
import java.util.ArrayList;
import java.util.List;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
import edu.uci.ics.asterix.metadata.declared.AqlSourceId;
import edu.uci.ics.asterix.metadata.entities.Dataset;
@@ -11,6 +10,7 @@
import edu.uci.ics.asterix.optimizer.rules.am.BTreeJobGenParams;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.utils.ListSet;
import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.IHyracksJobBuilder;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
@@ -23,8 +23,18 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IDataSourceIndex;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.IOperatorSchema;
+import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.OrderOperator.IOrder.OrderKind;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.UnnestMapOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.visitors.VariableUtilities;
+import edu.uci.ics.hyracks.algebricks.core.algebra.properties.BroadcastPartitioningProperty;
+import edu.uci.ics.hyracks.algebricks.core.algebra.properties.ILocalStructuralProperty;
+import edu.uci.ics.hyracks.algebricks.core.algebra.properties.IPartitioningRequirementsCoordinator;
+import edu.uci.ics.hyracks.algebricks.core.algebra.properties.IPhysicalPropertiesVector;
+import edu.uci.ics.hyracks.algebricks.core.algebra.properties.LocalOrderProperty;
+import edu.uci.ics.hyracks.algebricks.core.algebra.properties.OrderColumn;
+import edu.uci.ics.hyracks.algebricks.core.algebra.properties.PhysicalRequirements;
+import edu.uci.ics.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector;
+import edu.uci.ics.hyracks.algebricks.core.algebra.properties.UnorderedPartitionedProperty;
import edu.uci.ics.hyracks.algebricks.core.jobgen.impl.JobGenContext;
import edu.uci.ics.hyracks.api.dataflow.IOperatorDescriptor;
@@ -33,8 +43,16 @@
*/
public class BTreeSearchPOperator extends IndexSearchPOperator {
- public BTreeSearchPOperator(IDataSourceIndex<String, AqlSourceId> idx, boolean requiresBroadcast) {
+ private final List<LogicalVariable> lowKeyVarList;
+ private final List<LogicalVariable> highKeyVarList;
+ private boolean isPrimaryIndex;
+
+ public BTreeSearchPOperator(IDataSourceIndex<String, AqlSourceId> idx, boolean requiresBroadcast,
+ boolean isPrimaryIndex, List<LogicalVariable> lowKeyVarList, List<LogicalVariable> highKeyVarList) {
super(idx, requiresBroadcast);
+ this.isPrimaryIndex = isPrimaryIndex;
+ this.lowKeyVarList = lowKeyVarList;
+ this.highKeyVarList = highKeyVarList;
}
@Override
@@ -61,22 +79,48 @@
int[] lowKeyIndexes = getKeyIndexes(jobGenParams.getLowKeyVarList(), inputSchemas);
int[] highKeyIndexes = getKeyIndexes(jobGenParams.getHighKeyVarList(), inputSchemas);
AqlMetadataProvider metadataProvider = (AqlMetadataProvider) context.getMetadataProvider();
- AqlCompiledMetadataDeclarations metadata = metadataProvider.getMetadataDeclarations();
- Dataset dataset = metadata.findDataset(jobGenParams.getDatasetName());
+ Dataset dataset = metadataProvider.findDataset(jobGenParams.getDataverseName(), jobGenParams.getDatasetName());
IVariableTypeEnvironment typeEnv = context.getTypeEnvironment(op);
List<LogicalVariable> outputVars = unnestMap.getVariables();
if (jobGenParams.getRetainInput()) {
outputVars = new ArrayList<LogicalVariable>();
VariableUtilities.getLiveVariables(unnestMap, outputVars);
}
- Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> btreeSearch = AqlMetadataProvider.buildBtreeRuntime(
- builder.getJobSpec(), outputVars, opSchema, typeEnv, metadata, context, jobGenParams.getRetainInput(),
- jobGenParams.getDatasetName(), dataset, jobGenParams.getIndexName(), lowKeyIndexes, highKeyIndexes,
- jobGenParams.isLowKeyInclusive(), jobGenParams.isHighKeyInclusive());
+ Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> btreeSearch = metadataProvider.buildBtreeRuntime(
+ builder.getJobSpec(), outputVars, opSchema, typeEnv, context, jobGenParams.getRetainInput(),
+ dataset, jobGenParams.getIndexName(), lowKeyIndexes, highKeyIndexes, jobGenParams.isLowKeyInclusive(),
+ jobGenParams.isHighKeyInclusive());
builder.contributeHyracksOperator(unnestMap, btreeSearch.first);
builder.contributeAlgebricksPartitionConstraint(btreeSearch.first, btreeSearch.second);
ILogicalOperator srcExchange = unnestMap.getInputs().get(0).getValue();
builder.contributeGraphEdge(srcExchange, 0, unnestMap, 0);
}
+
+ public PhysicalRequirements getRequiredPropertiesForChildren(ILogicalOperator op,
+ IPhysicalPropertiesVector reqdByParent) {
+ if (requiresBroadcast) {
+ if (isPrimaryIndex) {
+ // For primary indexes, we require re-partitioning on the primary key, and not a broadcast.
+ // Also, add a local sorting property to enforce a sort before the primary-index operator.
+ StructuralPropertiesVector[] pv = new StructuralPropertiesVector[1];
+ ListSet<LogicalVariable> searchKeyVars = new ListSet<LogicalVariable>();
+ searchKeyVars.addAll(lowKeyVarList);
+ searchKeyVars.addAll(highKeyVarList);
+ List<ILocalStructuralProperty> propsLocal = new ArrayList<ILocalStructuralProperty>();
+ for (LogicalVariable orderVar : searchKeyVars) {
+ propsLocal.add(new LocalOrderProperty(new OrderColumn(orderVar, OrderKind.ASC)));
+ }
+ pv[0] = new StructuralPropertiesVector(new UnorderedPartitionedProperty(searchKeyVars, null),
+ propsLocal);
+ return new PhysicalRequirements(pv, IPartitioningRequirementsCoordinator.NO_COORDINATION);
+ } else {
+ StructuralPropertiesVector[] pv = new StructuralPropertiesVector[1];
+ pv[0] = new StructuralPropertiesVector(new BroadcastPartitioningProperty(null), null);
+ return new PhysicalRequirements(pv, IPartitioningRequirementsCoordinator.NO_COORDINATION);
+ }
+ } else {
+ return super.getRequiredPropertiesForChildren(op, reqdByParent);
+ }
+ }
}
\ No newline at end of file
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/IndexSearchPOperator.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/IndexSearchPOperator.java
index 65225ca..f6c926b 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/IndexSearchPOperator.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/IndexSearchPOperator.java
@@ -23,8 +23,8 @@
*/
public abstract class IndexSearchPOperator extends AbstractScanPOperator {
- private final IDataSourceIndex<String, AqlSourceId> idx;
- private final boolean requiresBroadcast;
+ protected final IDataSourceIndex<String, AqlSourceId> idx;
+ protected final boolean requiresBroadcast;
public IndexSearchPOperator(IDataSourceIndex<String, AqlSourceId> idx, boolean requiresBroadcast) {
this.idx = idx;
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/InvertedIndexPOperator.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/InvertedIndexPOperator.java
index ae2559b..510aa4c 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/InvertedIndexPOperator.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/InvertedIndexPOperator.java
@@ -4,7 +4,8 @@
import java.util.List;
import edu.uci.ics.asterix.common.dataflow.IAsterixApplicationContextInfo;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
+import edu.uci.ics.asterix.metadata.MetadataException;
+import edu.uci.ics.asterix.metadata.MetadataManager;
import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
import edu.uci.ics.asterix.metadata.declared.AqlSourceId;
import edu.uci.ics.asterix.metadata.entities.Dataset;
@@ -50,7 +51,8 @@
import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.IBinaryTokenizerFactory;
/**
- * Contributes the runtime operator for an unnest-map representing an inverted-index search.
+ * Contributes the runtime operator for an unnest-map representing an
+ * inverted-index search.
*/
public class InvertedIndexPOperator extends IndexSearchPOperator {
public InvertedIndexPOperator(IDataSourceIndex<String, AqlSourceId> idx, boolean requiresBroadcast) {
@@ -79,13 +81,18 @@
jobGenParams.readFromFuncArgs(unnestFuncExpr.getArguments());
AqlMetadataProvider metadataProvider = (AqlMetadataProvider) context.getMetadataProvider();
- AqlCompiledMetadataDeclarations metadata = metadataProvider.getMetadataDeclarations();
- Dataset dataset = metadata.findDataset(jobGenParams.getDatasetName());
+ Dataset dataset;
+ try {
+ dataset = MetadataManager.INSTANCE.getDataset(metadataProvider.getMetadataTxnContext(),
+ jobGenParams.getDataverseName(), jobGenParams.getDatasetName());
+ } catch (MetadataException e) {
+ throw new AlgebricksException(e);
+ }
int[] keyIndexes = getKeyIndexes(jobGenParams.getKeyVarList(), inputSchemas);
// Build runtime.
- Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> invIndexSearch = buildInvertedIndexRuntime(metadata,
- context, builder.getJobSpec(), unnestMapOp, opSchema, jobGenParams.getRetainInput(),
+ Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> invIndexSearch = buildInvertedIndexRuntime(
+ metadataProvider, context, builder.getJobSpec(), unnestMapOp, opSchema, jobGenParams.getRetainInput(),
jobGenParams.getDatasetName(), dataset, jobGenParams.getIndexName(), jobGenParams.getSearchKeyType(),
keyIndexes, jobGenParams.getSearchModifierType(), jobGenParams.getSimilarityThreshold());
// Contribute operator in hyracks job.
@@ -95,82 +102,93 @@
builder.contributeGraphEdge(srcExchange, 0, unnestMapOp, 0);
}
- public static Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> buildInvertedIndexRuntime(
- AqlCompiledMetadataDeclarations metadata, JobGenContext context, JobSpecification jobSpec,
+ public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> buildInvertedIndexRuntime(
+ AqlMetadataProvider metadataProvider, JobGenContext context, JobSpecification jobSpec,
UnnestMapOperator unnestMap, IOperatorSchema opSchema, boolean retainInput, String datasetName,
Dataset dataset, String indexName, ATypeTag searchKeyType, int[] keyFields,
SearchModifierType searchModifierType, IAlgebricksConstantValue similarityThreshold)
throws AlgebricksException {
- IAObject simThresh = ((AsterixConstantValue) similarityThreshold).getObject();
- String itemTypeName = dataset.getItemTypeName();
- IAType itemType = metadata.findType(itemTypeName);
- int numPrimaryKeys = DatasetUtils.getPartitioningKeys(dataset).size();
- Index secondaryIndex = metadata.getIndex(dataset.getDataverseName(), dataset.getDatasetName(), indexName);
- if (secondaryIndex == null) {
- throw new AlgebricksException("Code generation error: no index " + indexName + " for dataset "
- + datasetName);
- }
- List<String> secondaryKeyFields = secondaryIndex.getKeyFieldNames();
- int numSecondaryKeys = secondaryKeyFields.size();
- if (numSecondaryKeys != 1) {
- throw new AlgebricksException(
- "Cannot use "
- + numSecondaryKeys
- + " fields as a key for an inverted index. There can be only one field as a key for the inverted index index.");
- }
- if (itemType.getTypeTag() != ATypeTag.RECORD) {
- throw new AlgebricksException("Only record types can be indexed.");
- }
- ARecordType recordType = (ARecordType) itemType;
- Pair<IAType, Boolean> keyPairType = Index.getNonNullableKeyFieldType(secondaryKeyFields.get(0), recordType);
- IAType secondaryKeyType = keyPairType.first;
- if (secondaryKeyType == null) {
- throw new AlgebricksException("Could not find field " + secondaryKeyFields.get(0) + " in the schema.");
- }
+ try {
+ IAObject simThresh = ((AsterixConstantValue) similarityThreshold).getObject();
+ IAType itemType = MetadataManager.INSTANCE.getDatatype(metadataProvider.getMetadataTxnContext(),
+ dataset.getDataverseName(), dataset.getItemTypeName()).getDatatype();
+ int numPrimaryKeys = DatasetUtils.getPartitioningKeys(dataset).size();
+ Index secondaryIndex = MetadataManager.INSTANCE.getIndex(metadataProvider.getMetadataTxnContext(),
+ dataset.getDataverseName(), dataset.getDatasetName(), indexName);
+ if (secondaryIndex == null) {
+ throw new AlgebricksException("Code generation error: no index " + indexName + " for dataset "
+ + datasetName);
+ }
+ List<String> secondaryKeyFields = secondaryIndex.getKeyFieldNames();
+ int numSecondaryKeys = secondaryKeyFields.size();
+ if (numSecondaryKeys != 1) {
+ throw new AlgebricksException(
+ "Cannot use "
+ + numSecondaryKeys
+ + " fields as a key for an inverted index. There can be only one field as a key for the inverted index index.");
+ }
+ if (itemType.getTypeTag() != ATypeTag.RECORD) {
+ throw new AlgebricksException("Only record types can be indexed.");
+ }
+ ARecordType recordType = (ARecordType) itemType;
+ Pair<IAType, Boolean> keyPairType = Index.getNonNullableKeyFieldType(secondaryKeyFields.get(0), recordType);
+ IAType secondaryKeyType = keyPairType.first;
+ if (secondaryKeyType == null) {
+ throw new AlgebricksException("Could not find field " + secondaryKeyFields.get(0) + " in the schema.");
+ }
- // TODO: For now we assume the type of the generated tokens is the same as the indexed field.
- // We need a better way of expressing this because tokens may be hashed, or an inverted-index may index a list type, etc.
- ITypeTraits[] tokenTypeTraits = new ITypeTraits[numSecondaryKeys];
- IBinaryComparatorFactory[] tokenComparatorFactories = new IBinaryComparatorFactory[numSecondaryKeys];
- for (int i = 0; i < numSecondaryKeys; i++) {
- tokenComparatorFactories[i] = InvertedIndexAccessMethod.getTokenBinaryComparatorFactory(secondaryKeyType);
- tokenTypeTraits[i] = InvertedIndexAccessMethod.getTokenTypeTrait(secondaryKeyType);
+ // TODO: For now we assume the type of the generated tokens is the
+ // same
+ // as the indexed field.
+ // We need a better way of expressing this because tokens may be
+ // hashed,
+ // or an inverted-index may index a list type, etc.
+ ITypeTraits[] tokenTypeTraits = new ITypeTraits[numSecondaryKeys];
+ IBinaryComparatorFactory[] tokenComparatorFactories = new IBinaryComparatorFactory[numSecondaryKeys];
+ for (int i = 0; i < numSecondaryKeys; i++) {
+ tokenComparatorFactories[i] = InvertedIndexAccessMethod
+ .getTokenBinaryComparatorFactory(secondaryKeyType);
+ tokenTypeTraits[i] = InvertedIndexAccessMethod.getTokenTypeTrait(secondaryKeyType);
+ }
+
+ IVariableTypeEnvironment typeEnv = context.getTypeEnvironment(unnestMap);
+ List<LogicalVariable> outputVars = unnestMap.getVariables();
+ if (retainInput) {
+ outputVars = new ArrayList<LogicalVariable>();
+ VariableUtilities.getLiveVariables(unnestMap, outputVars);
+ }
+ RecordDescriptor outputRecDesc = JobGenHelper.mkRecordDescriptor(typeEnv, opSchema, context);
+
+ int start = outputRecDesc.getFieldCount() - numPrimaryKeys;
+ IBinaryComparatorFactory[] invListsComparatorFactories = JobGenHelper
+ .variablesToAscBinaryComparatorFactories(outputVars, start, numPrimaryKeys, typeEnv, context);
+ ITypeTraits[] invListsTypeTraits = JobGenHelper.variablesToTypeTraits(outputVars, start, numPrimaryKeys,
+ typeEnv, context);
+
+ IAsterixApplicationContextInfo appContext = (IAsterixApplicationContextInfo) context.getAppContext();
+ Pair<IFileSplitProvider, AlgebricksPartitionConstraint> secondarySplitsAndConstraint = metadataProvider
+ .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(dataset.getDataverseName(),
+ datasetName, indexName);
+ Pair<IFileSplitProvider, IFileSplitProvider> fileSplitProviders = metadataProvider
+ .getInvertedIndexFileSplitProviders(secondarySplitsAndConstraint.first);
+
+ // TODO: Here we assume there is only one search key field.
+ int queryField = keyFields[0];
+ // Get tokenizer and search modifier factories.
+ IInvertedIndexSearchModifierFactory searchModifierFactory = InvertedIndexAccessMethod
+ .getSearchModifierFactory(searchModifierType, simThresh, secondaryIndex);
+ IBinaryTokenizerFactory queryTokenizerFactory = InvertedIndexAccessMethod.getBinaryTokenizerFactory(
+ searchModifierType, searchKeyType, secondaryIndex);
+ InvertedIndexSearchOperatorDescriptor invIndexSearchOp = new InvertedIndexSearchOperatorDescriptor(jobSpec,
+ queryField, appContext.getStorageManagerInterface(), fileSplitProviders.first,
+ fileSplitProviders.second, appContext.getIndexRegistryProvider(), tokenTypeTraits,
+ tokenComparatorFactories, invListsTypeTraits, invListsComparatorFactories,
+ new BTreeDataflowHelperFactory(), queryTokenizerFactory, searchModifierFactory, outputRecDesc,
+ retainInput, NoOpOperationCallbackProvider.INSTANCE);
+ return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(invIndexSearchOp,
+ secondarySplitsAndConstraint.second);
+ } catch (MetadataException e) {
+ throw new AlgebricksException(e);
}
-
- IVariableTypeEnvironment typeEnv = context.getTypeEnvironment(unnestMap);
- List<LogicalVariable> outputVars = unnestMap.getVariables();
- if (retainInput) {
- outputVars = new ArrayList<LogicalVariable>();
- VariableUtilities.getLiveVariables(unnestMap, outputVars);
- }
- RecordDescriptor outputRecDesc = JobGenHelper.mkRecordDescriptor(typeEnv, opSchema, context);
-
- int start = outputRecDesc.getFieldCount() - numPrimaryKeys;
- IBinaryComparatorFactory[] invListsComparatorFactories = JobGenHelper.variablesToAscBinaryComparatorFactories(
- outputVars, start, numPrimaryKeys, typeEnv, context);
- ITypeTraits[] invListsTypeTraits = JobGenHelper.variablesToTypeTraits(outputVars, start, numPrimaryKeys,
- typeEnv, context);
-
- IAsterixApplicationContextInfo appContext = (IAsterixApplicationContextInfo) context.getAppContext();
- Pair<IFileSplitProvider, AlgebricksPartitionConstraint> secondarySplitsAndConstraint = metadata
- .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(datasetName, indexName);
- Pair<IFileSplitProvider, IFileSplitProvider> fileSplitProviders = metadata
- .getInvertedIndexFileSplitProviders(secondarySplitsAndConstraint.first);
-
- // TODO: Here we assume there is only one search key field.
- int queryField = keyFields[0];
- // Get tokenizer and search modifier factories.
- IInvertedIndexSearchModifierFactory searchModifierFactory = InvertedIndexAccessMethod.getSearchModifierFactory(
- searchModifierType, simThresh, secondaryIndex);
- IBinaryTokenizerFactory queryTokenizerFactory = InvertedIndexAccessMethod.getBinaryTokenizerFactory(
- searchModifierType, searchKeyType, secondaryIndex);
- InvertedIndexSearchOperatorDescriptor invIndexSearchOp = new InvertedIndexSearchOperatorDescriptor(jobSpec,
- queryField, appContext.getStorageManagerInterface(), fileSplitProviders.first,
- fileSplitProviders.second, appContext.getIndexRegistryProvider(), tokenTypeTraits,
- tokenComparatorFactories, invListsTypeTraits, invListsComparatorFactories,
- new BTreeDataflowHelperFactory(), queryTokenizerFactory, searchModifierFactory, outputRecDesc,
- retainInput, NoOpOperationCallbackProvider.INSTANCE);
- return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(invIndexSearchOp,
- secondarySplitsAndConstraint.second);
}
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/RTreeSearchPOperator.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/RTreeSearchPOperator.java
index 27a477c..ab66457 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/RTreeSearchPOperator.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/RTreeSearchPOperator.java
@@ -1,6 +1,8 @@
package edu.uci.ics.asterix.algebra.operators.physical;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
+import java.util.ArrayList;
+import java.util.List;
+
import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
import edu.uci.ics.asterix.metadata.declared.AqlSourceId;
import edu.uci.ics.asterix.metadata.entities.Dataset;
@@ -13,17 +15,21 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalExpressionTag;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalVariable;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.PhysicalOperatorTag;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IDataSourceIndex;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.IOperatorSchema;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.UnnestMapOperator;
+import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.visitors.VariableUtilities;
import edu.uci.ics.hyracks.algebricks.core.jobgen.impl.JobGenContext;
import edu.uci.ics.hyracks.api.dataflow.IOperatorDescriptor;
/**
- * Contributes the runtime operator for an unnest-map representing a RTree search.
+ * Contributes the runtime operator for an unnest-map representing a RTree
+ * search.
*/
public class RTreeSearchPOperator extends IndexSearchPOperator {
@@ -50,23 +56,24 @@
if (!funcIdent.equals(AsterixBuiltinFunctions.INDEX_SEARCH)) {
return;
}
-
RTreeJobGenParams jobGenParams = new RTreeJobGenParams();
jobGenParams.readFromFuncArgs(unnestFuncExpr.getArguments());
-
int[] keyIndexes = getKeyIndexes(jobGenParams.getKeyVarList(), inputSchemas);
AqlMetadataProvider mp = (AqlMetadataProvider) context.getMetadataProvider();
- AqlCompiledMetadataDeclarations metadata = mp.getMetadataDeclarations();
- Dataset dataset = metadata.findDataset(jobGenParams.getDatasetName());
- if (dataset == null) {
- throw new AlgebricksException("Unknown dataset " + jobGenParams.getDatasetName());
+ Dataset dataset = mp.findDataset(jobGenParams.getDataverseName(), jobGenParams.getDatasetName());
+ IVariableTypeEnvironment typeEnv = context.getTypeEnvironment(unnestMap);
+ List<LogicalVariable> outputVars = unnestMap.getVariables();
+ if (jobGenParams.getRetainInput()) {
+ outputVars = new ArrayList<LogicalVariable>();
+ VariableUtilities.getLiveVariables(unnestMap, outputVars);
}
- Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> rtreeSearch = AqlMetadataProvider.buildRtreeRuntime(
- metadata, context, builder.getJobSpec(), jobGenParams.getDatasetName(), dataset,
+ Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> rtreeSearch = mp.buildRtreeRuntime(
+ builder.getJobSpec(), outputVars, opSchema, typeEnv, context, jobGenParams.getRetainInput(), dataset,
jobGenParams.getIndexName(), keyIndexes);
builder.contributeHyracksOperator(unnestMap, rtreeSearch.first);
builder.contributeAlgebricksPartitionConstraint(rtreeSearch.first, rtreeSearch.second);
ILogicalOperator srcExchange = unnestMap.getInputs().get(0).getValue();
builder.contributeGraphEdge(srcExchange, 0, unnestMap, 0);
}
+
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/jobgen/AqlLogicalExpressionJobGen.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/jobgen/AqlLogicalExpressionJobGen.java
index 9717d6a..dd8791f 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/jobgen/AqlLogicalExpressionJobGen.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/jobgen/AqlLogicalExpressionJobGen.java
@@ -4,28 +4,21 @@
import org.apache.commons.lang3.mutable.Mutable;
+import edu.uci.ics.asterix.common.functions.FunctionDescriptorTag;
import edu.uci.ics.asterix.formats.base.IDataFormat;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
-import edu.uci.ics.asterix.runtime.base.IAggregateFunctionDynamicDescriptor;
-import edu.uci.ics.asterix.runtime.base.IRunningAggregateFunctionDynamicDescriptor;
-import edu.uci.ics.asterix.runtime.base.IScalarFunctionDynamicDescriptor;
-import edu.uci.ics.asterix.runtime.base.ISerializableAggregateFunctionDynamicDescriptor;
-import edu.uci.ics.asterix.runtime.base.IUnnestingFunctionDynamicDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.comparisons.ComparisonEvalFactory;
import edu.uci.ics.asterix.runtime.formats.FormatUtils;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalVariable;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression.FunctionKind;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AggregateFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ConstantExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ILogicalExpressionJobGen;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.StatefulFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.UnnestingFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression;
@@ -53,79 +46,25 @@
IVariableTypeEnvironment env, IOperatorSchema[] inputSchemas, JobGenContext context)
throws AlgebricksException {
ICopyEvaluatorFactory[] args = codegenArguments(expr, env, inputSchemas, context);
- IFunctionDescriptor fd;
- AqlMetadataProvider mp = (AqlMetadataProvider) context.getMetadataProvider();
- AqlCompiledMetadataDeclarations compiledDecls = mp.getMetadataDeclarations();
- try {
- fd = compiledDecls.getFormat().resolveFunction(expr, env);
- } catch (AlgebricksException e) {
- throw new AlgebricksException(e);
- }
+ IFunctionDescriptor fd = getFunctionDescriptor(expr, env, context);
switch (fd.getFunctionDescriptorTag()) {
- case SCALAR: {
- throw new AlgebricksException(
- "Trying to create an aggregate from a scalar evaluator function descriptor. (fi="
- + expr.getFunctionIdentifier() + ")");
- }
- case AGGREGATE: {
- IAggregateFunctionDynamicDescriptor afdd = (IAggregateFunctionDynamicDescriptor) fd;
- return afdd.createAggregateFunctionFactory(args);
- }
- case SERIALAGGREGATE: {
- // temporal hack
+ case SERIALAGGREGATE:
return null;
- }
- case RUNNINGAGGREGATE: {
- throw new AlgebricksException(
- "Trying to create an aggregate from a running aggregate function descriptor.");
- }
- case UNNEST: {
- throw new AlgebricksException(
- "Trying to create an aggregate from an unnesting aggregate function descriptor.");
- }
-
- default: {
- throw new IllegalStateException(fd.getFunctionDescriptorTag().toString());
- }
+ case AGGREGATE:
+ return fd.createAggregateFunctionFactory(args);
+ default:
+ throw new IllegalStateException("Invalid function descriptor " + fd.getFunctionDescriptorTag()
+ + " expected " + FunctionDescriptorTag.SERIALAGGREGATE + " or "
+ + FunctionDescriptorTag.AGGREGATE);
}
-
}
@Override
- public ICopyRunningAggregateFunctionFactory createRunningAggregateFunctionFactory(StatefulFunctionCallExpression expr,
- IVariableTypeEnvironment env, IOperatorSchema[] inputSchemas, JobGenContext context)
- throws AlgebricksException {
+ public ICopyRunningAggregateFunctionFactory createRunningAggregateFunctionFactory(
+ StatefulFunctionCallExpression expr, IVariableTypeEnvironment env, IOperatorSchema[] inputSchemas,
+ JobGenContext context) throws AlgebricksException {
ICopyEvaluatorFactory[] args = codegenArguments(expr, env, inputSchemas, context);
- IFunctionDescriptor fd;
- AqlMetadataProvider mp = (AqlMetadataProvider) context.getMetadataProvider();
- AqlCompiledMetadataDeclarations compiledDecls = mp.getMetadataDeclarations();
- try {
- fd = compiledDecls.getFormat().resolveFunction(expr, env);
- } catch (AlgebricksException e) {
- throw new AlgebricksException(e);
- }
- switch (fd.getFunctionDescriptorTag()) {
- case SCALAR: {
- throw new AlgebricksException(
- "Trying to create a running aggregate from a scalar evaluator function descriptor. (fi="
- + expr.getFunctionIdentifier() + ")");
- }
- case AGGREGATE: {
- throw new AlgebricksException(
- "Trying to create a running aggregate from an aggregate function descriptor.");
- }
- case UNNEST: {
- throw new AlgebricksException(
- "Trying to create a running aggregate from an unnesting function descriptor.");
- }
- case RUNNINGAGGREGATE: {
- IRunningAggregateFunctionDynamicDescriptor rafdd = (IRunningAggregateFunctionDynamicDescriptor) fd;
- return rafdd.createRunningAggregateFunctionFactory(args);
- }
- default: {
- throw new IllegalStateException();
- }
- }
+ return getFunctionDescriptor(expr, env, context).createRunningAggregateFunctionFactory(args);
}
@Override
@@ -133,52 +72,33 @@
IVariableTypeEnvironment env, IOperatorSchema[] inputSchemas, JobGenContext context)
throws AlgebricksException {
ICopyEvaluatorFactory[] args = codegenArguments(expr, env, inputSchemas, context);
- IFunctionDescriptor fd;
- AqlMetadataProvider mp = (AqlMetadataProvider) context.getMetadataProvider();
- AqlCompiledMetadataDeclarations compiledDecls = mp.getMetadataDeclarations();
- try {
- fd = compiledDecls.getFormat().resolveFunction(expr, env);
- } catch (AlgebricksException e) {
- throw new AlgebricksException(e);
- }
- switch (fd.getFunctionDescriptorTag()) {
- case UNNEST: {
- IUnnestingFunctionDynamicDescriptor ufdd = (IUnnestingFunctionDynamicDescriptor) fd;
- return ufdd.createUnnestingFunctionFactory(args);
- }
- default: {
- throw new AlgebricksException("Trying to create an unnesting function descriptor from a "
- + fd.getFunctionDescriptorTag() + ". (fid=" + expr.getFunctionIdentifier() + ")");
- }
- }
+ return getFunctionDescriptor(expr, env, context).createUnnestingFunctionFactory(args);
}
@Override
public ICopyEvaluatorFactory createEvaluatorFactory(ILogicalExpression expr, IVariableTypeEnvironment env,
IOperatorSchema[] inputSchemas, JobGenContext context) throws AlgebricksException {
+ ICopyEvaluatorFactory copyEvaluatorFactory = null;
switch (expr.getExpressionTag()) {
case VARIABLE: {
VariableReferenceExpression v = (VariableReferenceExpression) expr;
- return createVariableEvaluatorFactory(v, inputSchemas, context);
+ copyEvaluatorFactory = createVariableEvaluatorFactory(v, inputSchemas, context);
+ return copyEvaluatorFactory;
}
case CONSTANT: {
ConstantExpression c = (ConstantExpression) expr;
- return createConstantEvaluatorFactory(c, inputSchemas, context);
+ copyEvaluatorFactory = createConstantEvaluatorFactory(c, inputSchemas, context);
+ return copyEvaluatorFactory;
}
case FUNCTION_CALL: {
- AbstractFunctionCallExpression fun = (AbstractFunctionCallExpression) expr;
- if (fun.getKind() == FunctionKind.SCALAR) {
- ScalarFunctionCallExpression scalar = (ScalarFunctionCallExpression) fun;
- return createScalarFunctionEvaluatorFactory(scalar, env, inputSchemas, context);
- } else {
- throw new AlgebricksException("Cannot create evaluator for function " + fun + " of kind "
- + fun.getKind());
- }
+ copyEvaluatorFactory = createScalarFunctionEvaluatorFactory((AbstractFunctionCallExpression) expr, env,
+ inputSchemas, context);
+ return copyEvaluatorFactory;
}
- default: {
+ default:
throw new IllegalStateException();
- }
}
+
}
private ICopyEvaluatorFactory createVariableEvaluatorFactory(VariableReferenceExpression expr,
@@ -203,33 +123,17 @@
return new ComparisonEvalFactory(args[0], args[1], ck);
}
- IFunctionDescriptor fd;
-
+ IFunctionDescriptor fd = null;
AqlMetadataProvider mp = (AqlMetadataProvider) context.getMetadataProvider();
- IDataFormat format = mp == null ? FormatUtils.getDefaultFormat() : mp.getMetadataDeclarations().getFormat();
- try {
- fd = format.resolveFunction(expr, env);
- } catch (AlgebricksException e) {
- throw new AlgebricksException(e);
- }
-
- switch (fd.getFunctionDescriptorTag()) {
- case SCALAR: {
- IScalarFunctionDynamicDescriptor sfdd = (IScalarFunctionDynamicDescriptor) fd;
- return sfdd.createEvaluatorFactory(args);
- }
- default: {
- throw new AlgebricksException("Trying to create a scalar function descriptor from a "
- + fd.getFunctionDescriptorTag() + ". (fid=" + fi + ")");
- }
- }
-
+ IDataFormat format = FormatUtils.getDefaultFormat();
+ fd = format.resolveFunction(expr, env);
+ return fd.createEvaluatorFactory(args);
}
- private ICopyEvaluatorFactory createConstantEvaluatorFactory(ConstantExpression expr, IOperatorSchema[] inputSchemas,
- JobGenContext context) throws AlgebricksException {
+ private ICopyEvaluatorFactory createConstantEvaluatorFactory(ConstantExpression expr,
+ IOperatorSchema[] inputSchemas, JobGenContext context) throws AlgebricksException {
AqlMetadataProvider mp = (AqlMetadataProvider) context.getMetadataProvider();
- IDataFormat format = mp == null ? FormatUtils.getDefaultFormat() : mp.getMetadataDeclarations().getFormat();
+ IDataFormat format = FormatUtils.getDefaultFormat();
return format.getConstantEvalFactory(expr.getValue());
}
@@ -250,27 +154,15 @@
AggregateFunctionCallExpression expr, IVariableTypeEnvironment env, IOperatorSchema[] inputSchemas,
JobGenContext context) throws AlgebricksException {
ICopyEvaluatorFactory[] args = codegenArguments(expr, env, inputSchemas, context);
- IFunctionDescriptor fd;
- AqlMetadataProvider mp = (AqlMetadataProvider) context.getMetadataProvider();
- AqlCompiledMetadataDeclarations compiledDecls = mp.getMetadataDeclarations();
- try {
- fd = compiledDecls.getFormat().resolveFunction(expr, env);
- } catch (AlgebricksException e) {
- throw new AlgebricksException(e);
- }
+ IFunctionDescriptor fd = getFunctionDescriptor(expr, env, context);
+
switch (fd.getFunctionDescriptorTag()) {
- case SCALAR: {
- throw new AlgebricksException(
- "Trying to create an aggregate from a scalar evaluator function descriptor. (fi="
- + expr.getFunctionIdentifier() + ")");
- }
case AGGREGATE: {
if (AsterixBuiltinFunctions.isAggregateFunctionSerializable(fd.getIdentifier())) {
AggregateFunctionCallExpression serialAggExpr = AsterixBuiltinFunctions
.makeSerializableAggregateFunctionExpression(fd.getIdentifier(), expr.getArguments());
- ISerializableAggregateFunctionDynamicDescriptor afdd = (ISerializableAggregateFunctionDynamicDescriptor) compiledDecls
- .getFormat().resolveFunction(serialAggExpr, env);
- return afdd.createAggregateFunctionFactory(args);
+ IFunctionDescriptor afdd = getFunctionDescriptor(serialAggExpr, env, context);
+ return afdd.createSerializableAggregateFunctionFactory(args);
} else {
throw new AlgebricksException(
"Trying to create a serializable aggregate from a non-serializable aggregate function descriptor. (fi="
@@ -278,22 +170,22 @@
}
}
case SERIALAGGREGATE: {
- ISerializableAggregateFunctionDynamicDescriptor afdd = (ISerializableAggregateFunctionDynamicDescriptor) fd;
- return afdd.createAggregateFunctionFactory(args);
- }
- case RUNNINGAGGREGATE: {
- throw new AlgebricksException(
- "Trying to create an aggregate from a running aggregate function descriptor.");
- }
- case UNNEST: {
- throw new AlgebricksException(
- "Trying to create an aggregate from an unnesting aggregate function descriptor.");
+ return fd.createSerializableAggregateFunctionFactory(args);
}
- default: {
- throw new IllegalStateException();
- }
+ default:
+ throw new IllegalStateException("Invalid function descriptor " + fd.getFunctionDescriptorTag()
+ + " expected " + FunctionDescriptorTag.SERIALAGGREGATE + " or "
+ + FunctionDescriptorTag.AGGREGATE);
}
}
+ private IFunctionDescriptor getFunctionDescriptor(AbstractFunctionCallExpression expr,
+ IVariableTypeEnvironment env, JobGenContext context) throws AlgebricksException {
+ IFunctionDescriptor fd;
+ AqlMetadataProvider mp = (AqlMetadataProvider) context.getMetadataProvider();
+ fd = FormatUtils.getDefaultFormat().resolveFunction(expr, env);
+ return fd;
+ }
+
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/base/AnalysisUtil.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/base/AnalysisUtil.java
index 94a00cb..644996a 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/base/AnalysisUtil.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/base/AnalysisUtil.java
@@ -8,6 +8,7 @@
import edu.uci.ics.asterix.metadata.declared.AqlSourceId;
import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalExpressionTag;
@@ -106,9 +107,9 @@
return false;
}
- public static String getDatasetName(DataSourceScanOperator op) throws AlgebricksException {
+ public static Pair<String, String> getDatasetInfo(DataSourceScanOperator op) throws AlgebricksException {
AqlSourceId srcId = (AqlSourceId) op.getDataSource().getId();
- return srcId.getDatasetName();
+ return new Pair<String, String>(srcId.getDataverseName(), srcId.getDatasetName());
}
private static List<FunctionIdentifier> fieldAccessFunctions = new ArrayList<FunctionIdentifier>();
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/base/FuzzyUtils.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/base/FuzzyUtils.java
index 0c274b9..baf16c2 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/base/FuzzyUtils.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/base/FuzzyUtils.java
@@ -5,7 +5,7 @@
import org.apache.commons.lang3.mutable.Mutable;
import edu.uci.ics.asterix.aql.util.FunctionUtils;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
+import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
import edu.uci.ics.asterix.om.base.AFloat;
import edu.uci.ics.asterix.om.base.AInt32;
import edu.uci.ics.asterix.om.base.IAObject;
@@ -35,13 +35,14 @@
return AsterixBuiltinFunctions.COUNTHASHED_WORD_TOKENS;
case UNORDEREDLIST:
case ORDEREDLIST:
+ case ANY:
return null;
default:
throw new NotImplementedException("No tokenizer for type " + inputTag);
}
}
- public static IAObject getSimThreshold(AqlCompiledMetadataDeclarations metadata, String simFuncName) {
+ public static IAObject getSimThreshold(AqlMetadataProvider metadata, String simFuncName) {
String simThresholValue = metadata.getPropertyValue(SIM_THRESHOLD_PROP_NAME);
IAObject ret = null;
if (simFuncName.equals(JACCARD_FUNCTION_NAME)) {
@@ -83,7 +84,7 @@
return null;
}
- public static float getSimThreshold(AqlCompiledMetadataDeclarations metadata) {
+ public static float getSimThreshold(AqlMetadataProvider metadata) {
float simThreshold = JACCARD_DEFAULT_SIM_THRESHOLD;
String simThresholValue = metadata.getPropertyValue(SIM_THRESHOLD_PROP_NAME);
if (simThresholValue != null) {
@@ -93,7 +94,7 @@
}
// TODO: The default function depend on the input types.
- public static String getSimFunction(AqlCompiledMetadataDeclarations metadata) {
+ public static String getSimFunction(AqlMetadataProvider metadata) {
String simFunction = metadata.getPropertyValue(SIM_FUNCTION_PROP_NAME);
if (simFunction == null) {
simFunction = DEFAULT_SIM_FUNCTION;
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 76039ab..f63cc0c 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
@@ -28,18 +28,22 @@
import edu.uci.ics.asterix.optimizer.rules.FuzzyEqRule;
import edu.uci.ics.asterix.optimizer.rules.FuzzyJoinRule;
import edu.uci.ics.asterix.optimizer.rules.IfElseToSwitchCaseFunctionRule;
-import edu.uci.ics.asterix.optimizer.rules.InlineAssignIntoAggregateRule;
+import edu.uci.ics.asterix.optimizer.rules.InlineUnnestFunctionRule;
import edu.uci.ics.asterix.optimizer.rules.IntroduceDynamicTypeCastRule;
+import edu.uci.ics.asterix.optimizer.rules.IntroduceEnforcedListTypeRule;
import edu.uci.ics.asterix.optimizer.rules.IntroduceSecondaryIndexInsertDeleteRule;
import edu.uci.ics.asterix.optimizer.rules.IntroduceStaticTypeCastRule;
import edu.uci.ics.asterix.optimizer.rules.LoadRecordFieldsRule;
import edu.uci.ics.asterix.optimizer.rules.NestGroupByRule;
import edu.uci.ics.asterix.optimizer.rules.PullPositionalVariableFromUnnestRule;
+import edu.uci.ics.asterix.optimizer.rules.PushAggFuncIntoStandaloneAggregateRule;
import edu.uci.ics.asterix.optimizer.rules.PushAggregateIntoGroupbyRule;
import edu.uci.ics.asterix.optimizer.rules.PushFieldAccessRule;
import edu.uci.ics.asterix.optimizer.rules.PushGroupByThroughProduct;
import edu.uci.ics.asterix.optimizer.rules.PushProperJoinThroughProduct;
+import edu.uci.ics.asterix.optimizer.rules.PushSimilarityFunctionsBelowJoin;
import edu.uci.ics.asterix.optimizer.rules.RemoveRedundantListifyRule;
+import edu.uci.ics.asterix.optimizer.rules.RemoveUnusedOneToOneEquiJoinRule;
import edu.uci.ics.asterix.optimizer.rules.SetAsterixPhysicalOperatorsRule;
import edu.uci.ics.asterix.optimizer.rules.SetClosedRecordConstructorsRule;
import edu.uci.ics.asterix.optimizer.rules.SimilarityCheckRule;
@@ -55,19 +59,24 @@
import edu.uci.ics.hyracks.algebricks.rewriter.rules.ConsolidateSelectsRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.EliminateSubplanRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.EnforceStructuralPropertiesRule;
+import edu.uci.ics.hyracks.algebricks.rewriter.rules.ExtractCommonExpressionsRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.ExtractCommonOperatorsRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.ExtractGbyExpressionsRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.FactorRedundantGroupAndDecorVarsRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.InferTypesRule;
+import edu.uci.ics.hyracks.algebricks.rewriter.rules.InlineAssignIntoAggregateRule;
+import edu.uci.ics.hyracks.algebricks.rewriter.rules.InlineSingleReferenceVariablesRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.InsertOuterJoinRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.InsertProjectBeforeUnionRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.IntroHashPartitionMergeExchange;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.IntroJoinInsideSubplanRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.IntroduceCombinerRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.IntroduceGroupByForStandaloneAggregRule;
+import edu.uci.ics.hyracks.algebricks.rewriter.rules.IntroduceAggregateCombinerRule;
+import edu.uci.ics.hyracks.algebricks.rewriter.rules.IntroduceGroupByCombinerRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.IntroduceGroupByForSubplanRule;
+import edu.uci.ics.hyracks.algebricks.rewriter.rules.IntroduceProjectsRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.IsolateHyracksOperatorsRule;
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;
@@ -77,6 +86,8 @@
import edu.uci.ics.hyracks.algebricks.rewriter.rules.PushSelectIntoJoinRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.PushSubplanWithAggregateDownThroughProductRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.ReinferAllTypesRule;
+import edu.uci.ics.hyracks.algebricks.rewriter.rules.RemoveRedundantGroupByDecorVars;
+import edu.uci.ics.hyracks.algebricks.rewriter.rules.RemoveRedundantVariablesRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.RemoveUnusedAssignAndAggregateRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.SetAlgebricksPhysicalOperatorsRule;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.SetExecutionModeRule;
@@ -87,6 +98,7 @@
public final static List<IAlgebraicRewriteRule> buildTypeInferenceRuleCollection() {
List<IAlgebraicRewriteRule> typeInfer = new LinkedList<IAlgebraicRewriteRule>();
+ typeInfer.add(new InlineUnnestFunctionRule());
typeInfer.add(new InferTypesRule());
return typeInfer;
}
@@ -94,17 +106,19 @@
public final static List<IAlgebraicRewriteRule> buildNormalizationRuleCollection() {
List<IAlgebraicRewriteRule> normalization = new LinkedList<IAlgebraicRewriteRule>();
normalization.add(new EliminateSubplanRule());
- normalization.add(new IntroduceGroupByForStandaloneAggregRule());
+ normalization.add(new PushAggFuncIntoStandaloneAggregateRule());
normalization.add(new BreakSelectIntoConjunctsRule());
normalization.add(new ExtractGbyExpressionsRule());
normalization.add(new ExtractDistinctByExpressionsRule());
normalization.add(new ExtractOrderExpressionsRule());
+ normalization.add(new ExtractCommonExpressionsRule());
// IntroduceStaticTypeCastRule should go before
// IntroduceDynamicTypeCastRule to
// avoid unnecessary dynamic casting
normalization.add(new IntroduceStaticTypeCastRule());
normalization.add(new IntroduceDynamicTypeCastRule());
+ normalization.add(new IntroduceEnforcedListTypeRule());
normalization.add(new ConstantFoldingRule());
normalization.add(new UnnestToDataScanRule());
normalization.add(new IfElseToSwitchCaseFunctionRule());
@@ -129,8 +143,11 @@
condPushDownAndJoinInference.add(new IntroduceGroupByForSubplanRule());
condPushDownAndJoinInference.add(new SubplanOutOfGroupRule());
condPushDownAndJoinInference.add(new InsertOuterJoinRule());
+
+ condPushDownAndJoinInference.add(new RemoveRedundantVariablesRule());
condPushDownAndJoinInference.add(new AsterixInlineVariablesRule());
condPushDownAndJoinInference.add(new RemoveUnusedAssignAndAggregateRule());
+
condPushDownAndJoinInference.add(new FactorRedundantGroupAndDecorVarsRule());
condPushDownAndJoinInference.add(new PushAggregateIntoGroupbyRule());
condPushDownAndJoinInference.add(new EliminateSubplanRule());
@@ -147,8 +164,8 @@
fieldLoads.add(new PushFieldAccessRule());
// fieldLoads.add(new ByNameToByHandleFieldAccessRule()); -- disabled
fieldLoads.add(new ByNameToByIndexFieldAccessRule());
+ fieldLoads.add(new RemoveRedundantVariablesRule());
fieldLoads.add(new AsterixInlineVariablesRule());
- // fieldLoads.add(new InlineRecordAccessRule());
fieldLoads.add(new RemoveUnusedAssignAndAggregateRule());
fieldLoads.add(new ConstantFoldingRule());
fieldLoads.add(new FeedScanCollectionToUnnest());
@@ -168,20 +185,34 @@
consolidation.add(new ConsolidateSelectsRule());
consolidation.add(new ConsolidateAssignsRule());
consolidation.add(new InlineAssignIntoAggregateRule());
- consolidation.add(new IntroduceCombinerRule());
+ consolidation.add(new IntroduceGroupByCombinerRule());
+ consolidation.add(new IntroduceAggregateCombinerRule());
consolidation.add(new CountVarToCountOneRule());
- consolidation.add(new IntroduceSelectAccessMethodRule());
- consolidation.add(new IntroduceJoinAccessMethodRule());
consolidation.add(new RemoveUnusedAssignAndAggregateRule());
- consolidation.add(new IntroduceSecondaryIndexInsertDeleteRule());
+ consolidation.add(new RemoveRedundantGroupByDecorVars());
return consolidation;
}
- public final static List<IAlgebraicRewriteRule> buildOpPushDownRuleCollection() {
- List<IAlgebraicRewriteRule> opPushDown = new LinkedList<IAlgebraicRewriteRule>();
- opPushDown.add(new PushProjectDownRule());
- opPushDown.add(new PushSelectDownRule());
- return opPushDown;
+ public final static List<IAlgebraicRewriteRule> buildAccessMethodRuleCollection() {
+ List<IAlgebraicRewriteRule> accessMethod = new LinkedList<IAlgebraicRewriteRule>();
+ accessMethod.add(new IntroduceSelectAccessMethodRule());
+ accessMethod.add(new IntroduceJoinAccessMethodRule());
+ accessMethod.add(new IntroduceSecondaryIndexInsertDeleteRule());
+ accessMethod.add(new RemoveUnusedOneToOneEquiJoinRule());
+ accessMethod.add(new PushSimilarityFunctionsBelowJoin());
+ accessMethod.add(new RemoveUnusedAssignAndAggregateRule());
+ return accessMethod;
+ }
+
+ public final static List<IAlgebraicRewriteRule> buildPlanCleanupRuleCollection() {
+ List<IAlgebraicRewriteRule> planCleanupRules = new LinkedList<IAlgebraicRewriteRule>();
+ planCleanupRules.add(new PushAssignBelowUnionAllRule());
+ planCleanupRules.add(new ExtractCommonExpressionsRule());
+ planCleanupRules.add(new RemoveRedundantVariablesRule());
+ planCleanupRules.add(new PushProjectDownRule());
+ planCleanupRules.add(new PushSelectDownRule());
+ planCleanupRules.add(new RemoveUnusedAssignAndAggregateRule());
+ return planCleanupRules;
}
public final static List<IAlgebraicRewriteRule> buildDataExchangeRuleCollection() {
@@ -201,6 +232,11 @@
physicalRewritesAllLevels.add(new PullPositionalVariableFromUnnestRule());
physicalRewritesAllLevels.add(new PushProjectDownRule());
physicalRewritesAllLevels.add(new InsertProjectBeforeUnionRule());
+ physicalRewritesAllLevels.add(new InlineSingleReferenceVariablesRule());
+ physicalRewritesAllLevels.add(new RemoveUnusedAssignAndAggregateRule());
+ physicalRewritesAllLevels.add(new ConsolidateAssignsRule());
+ // After adding projects, we may need need to set physical operators again.
+ physicalRewritesAllLevels.add(new SetAlgebricksPhysicalOperatorsRule());
return physicalRewritesAllLevels;
}
@@ -208,6 +244,9 @@
List<IAlgebraicRewriteRule> physicalRewritesTopLevel = new LinkedList<IAlgebraicRewriteRule>();
physicalRewritesTopLevel.add(new PushNestedOrderByUnderPreSortedGroupByRule());
physicalRewritesTopLevel.add(new PushLimitDownRule());
+ physicalRewritesTopLevel.add(new IntroduceProjectsRule());
+ physicalRewritesTopLevel.add(new SetAlgebricksPhysicalOperatorsRule());
+ physicalRewritesTopLevel.add(new SetExecutionModeRule());
return physicalRewritesTopLevel;
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/AsterixInlineVariablesRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/AsterixInlineVariablesRule.java
index 302d0d7..772a1f9 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/AsterixInlineVariablesRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/AsterixInlineVariablesRule.java
@@ -14,354 +14,18 @@
*/
package edu.uci.ics.asterix.optimizer.rules;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.apache.commons.lang3.mutable.Mutable;
-
import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.EquivalenceClass;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalOperator;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalPlan;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.IOptimizationContext;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalExpressionTag;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalOperatorTag;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalVariable;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractLogicalExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ConstantExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator;
-import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractOperatorWithNestedPlans;
-import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AssignOperator;
-import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.GroupByOperator;
-import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.ProjectOperator;
-import edu.uci.ics.hyracks.algebricks.core.algebra.visitors.ILogicalExpressionReferenceTransform;
-import edu.uci.ics.hyracks.algebricks.core.config.AlgebricksConfig;
-import edu.uci.ics.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule;
+import edu.uci.ics.hyracks.algebricks.rewriter.rules.InlineVariablesRule;
-public class AsterixInlineVariablesRule implements IAlgebraicRewriteRule {
-
- @Override
- public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context) {
- return false;
- }
-
- @Override
- /**
- *
- * Does one big DFS sweep over the plan.
- *
- */
- public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
- if (context.checkIfInDontApplySet(this, opRef.getValue())) {
- return false;
- }
- VariableSubstitutionVisitor substVisitor = new VariableSubstitutionVisitor(false);
- VariableSubstitutionVisitor substVisitorForWrites = new VariableSubstitutionVisitor(true);
- substVisitor.setContext(context);
- substVisitorForWrites.setContext(context);
- Pair<Boolean, Boolean> bb = collectEqClassesAndRemoveRedundantOps(opRef, context, true,
- new LinkedList<EquivalenceClass>(), substVisitor, substVisitorForWrites);
- return bb.first;
- }
-
- private Pair<Boolean, Boolean> collectEqClassesAndRemoveRedundantOps(Mutable<ILogicalOperator> opRef,
- IOptimizationContext context, boolean first, List<EquivalenceClass> equivClasses,
- VariableSubstitutionVisitor substVisitor, VariableSubstitutionVisitor substVisitorForWrites)
- throws AlgebricksException {
- AbstractLogicalOperator op = (AbstractLogicalOperator) opRef.getValue();
- if (context.checkIfInDontApplySet(this, opRef.getValue())) {
- new Pair<Boolean, Boolean>(false, false);
- }
- if (op.getOperatorTag() == LogicalOperatorTag.UNNEST_MAP) {
- return new Pair<Boolean, Boolean>(false, false);
- }
- boolean modified = false;
- boolean ecChange = false;
- int cnt = 0;
- for (Mutable<ILogicalOperator> i : op.getInputs()) {
- boolean isOuterInputBranch = op.getOperatorTag() == LogicalOperatorTag.LEFTOUTERJOIN && cnt == 1;
- List<EquivalenceClass> eqc = isOuterInputBranch ? new LinkedList<EquivalenceClass>() : equivClasses;
-
- Pair<Boolean, Boolean> bb = (collectEqClassesAndRemoveRedundantOps(i, context, false, eqc, substVisitor,
- substVisitorForWrites));
-
- if (bb.first) {
- modified = true;
- }
- if (bb.second) {
- ecChange = true;
- }
-
- if (isOuterInputBranch) {
- if (AlgebricksConfig.DEBUG) {
- AlgebricksConfig.ALGEBRICKS_LOGGER.finest("--- Equivalence classes for inner branch of outer op.: "
- + eqc + "\n");
- }
- for (EquivalenceClass ec : eqc) {
- if (!ec.representativeIsConst()) {
- equivClasses.add(ec);
- }
- }
- }
-
- ++cnt;
- }
- if (op.hasNestedPlans()) {
- AbstractOperatorWithNestedPlans n = (AbstractOperatorWithNestedPlans) op;
- List<EquivalenceClass> eqc = equivClasses;
- if (n.getOperatorTag() == LogicalOperatorTag.SUBPLAN) {
- eqc = new LinkedList<EquivalenceClass>();
- } else {
- eqc = equivClasses;
- }
- for (ILogicalPlan p : n.getNestedPlans()) {
- for (Mutable<ILogicalOperator> r : p.getRoots()) {
- Pair<Boolean, Boolean> bb = collectEqClassesAndRemoveRedundantOps(r, context, false, eqc,
- substVisitor, substVisitorForWrites);
- if (bb.first) {
- modified = true;
- }
- if (bb.second) {
- ecChange = true;
- }
- }
- }
- }
- // we assume a variable is assigned a value only once
- if (op.getOperatorTag() == LogicalOperatorTag.ASSIGN) {
- AssignOperator a = (AssignOperator) op;
- ILogicalExpression rhs = a.getExpressions().get(0).getValue();
- if (rhs.getExpressionTag() == LogicalExpressionTag.VARIABLE) {
- LogicalVariable varLeft = a.getVariables().get(0);
- VariableReferenceExpression varRef = (VariableReferenceExpression) rhs;
- LogicalVariable varRight = varRef.getVariableReference();
-
- EquivalenceClass ecRight = findEquivClass(varRight, equivClasses);
- if (ecRight != null) {
- ecRight.addMember(varLeft);
- } else {
- List<LogicalVariable> m = new LinkedList<LogicalVariable>();
- m.add(varRight);
- m.add(varLeft);
- EquivalenceClass ec = new EquivalenceClass(m, varRight);
- equivClasses.add(ec);
- if (AlgebricksConfig.DEBUG) {
- AlgebricksConfig.ALGEBRICKS_LOGGER.finest("--- New equivalence class: " + ec + "\n");
- }
- }
- ecChange = true;
- } else if (((AbstractLogicalExpression) rhs).getExpressionTag() == LogicalExpressionTag.CONSTANT) {
- LogicalVariable varLeft = a.getVariables().get(0);
- List<LogicalVariable> m = new LinkedList<LogicalVariable>();
- m.add(varLeft);
- EquivalenceClass ec = new EquivalenceClass(m, (ConstantExpression) rhs);
- // equivClassesForParent.add(ec);
- equivClasses.add(ec);
- ecChange = true;
- }
- } else if (op.getOperatorTag() == LogicalOperatorTag.GROUP && !(context.checkIfInDontApplySet(this, op))) {
- GroupByOperator group = (GroupByOperator) op;
- Pair<Boolean, Boolean> r1 = processVarExprPairs(group.getGroupByList(), equivClasses);
- Pair<Boolean, Boolean> r2 = processVarExprPairs(group.getDecorList(), equivClasses);
- modified = modified || r1.first || r2.first;
- ecChange = r1.second || r2.second;
- }
- if (op.getOperatorTag() == LogicalOperatorTag.PROJECT) {
- assignVarsNeededByProject((ProjectOperator) op, equivClasses, context);
- } else {
- boolean assignRecord = false;
- if (op.getOperatorTag() == LogicalOperatorTag.ASSIGN) {
- AssignOperator assignOp = (AssignOperator) op;
- List<Mutable<ILogicalExpression>> exprRefs = assignOp.getExpressions();
- for (Mutable<ILogicalExpression> exprRef : exprRefs) {
- ILogicalExpression expr = exprRef.getValue();
- if (expr.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
- ScalarFunctionCallExpression funExpr = (ScalarFunctionCallExpression) expr;
- if (funExpr.getFunctionIdentifier().equals(AsterixBuiltinFunctions.OPEN_RECORD_CONSTRUCTOR)
- || funExpr.getFunctionIdentifier().equals(AsterixBuiltinFunctions.CLOSED_RECORD_CONSTRUCTOR)) {
- assignRecord = true;
- break;
- }
-
- }
- }
- }
-
- if (op.getOperatorTag() == LogicalOperatorTag.WRITE
- || op.getOperatorTag() == LogicalOperatorTag.INSERT_DELETE
- || op.getOperatorTag() == LogicalOperatorTag.INDEX_INSERT_DELETE
- || op.getOperatorTag() == LogicalOperatorTag.WRITE_RESULT || assignRecord) {
- substVisitorForWrites.setEquivalenceClasses(equivClasses);
- if (op.acceptExpressionTransform(substVisitorForWrites)) {
- modified = true;
- }
- } else {
- substVisitor.setEquivalenceClasses(equivClasses);
- if (op.acceptExpressionTransform(substVisitor)) {
- modified = true;
- if (op.getOperatorTag() == LogicalOperatorTag.GROUP) {
- GroupByOperator group = (GroupByOperator) op;
- for (Pair<LogicalVariable, Mutable<ILogicalExpression>> gp : group.getGroupByList()) {
- if (gp.first != null
- && gp.second.getValue().getExpressionTag() == LogicalExpressionTag.VARIABLE) {
- LogicalVariable gv = ((VariableReferenceExpression) gp.second.getValue())
- .getVariableReference();
- Iterator<Pair<LogicalVariable, Mutable<ILogicalExpression>>> iter = group.getDecorList()
- .iterator();
- while (iter.hasNext()) {
- Pair<LogicalVariable, Mutable<ILogicalExpression>> dp = iter.next();
- if (dp.first == null
- && dp.second.getValue().getExpressionTag() == LogicalExpressionTag.VARIABLE) {
- LogicalVariable dv = ((VariableReferenceExpression) dp.second.getValue())
- .getVariableReference();
- if (dv == gv) {
- // The decor variable is redundant,
- // since it is
- // propagated as a grouping
- // variable.
- EquivalenceClass ec1 = findEquivClass(gv, equivClasses);
- if (ec1 != null) {
- ec1.addMember(gp.first);
- ec1.setVariableRepresentative(gp.first);
- } else {
- List<LogicalVariable> varList = new ArrayList<LogicalVariable>();
- varList.add(gp.first);
- varList.add(gv);
- ec1 = new EquivalenceClass(varList, gp.first);
- }
- iter.remove();
- break;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return new Pair<Boolean, Boolean>(modified, ecChange);
- }
-
- private Pair<Boolean, Boolean> processVarExprPairs(List<Pair<LogicalVariable, Mutable<ILogicalExpression>>> vePairs,
- List<EquivalenceClass> equivClasses) {
- boolean ecFromGroup = false;
- boolean modified = false;
- for (Pair<LogicalVariable, Mutable<ILogicalExpression>> p : vePairs) {
- ILogicalExpression expr = p.second.getValue();
- if (p.first != null && expr.getExpressionTag() == LogicalExpressionTag.VARIABLE) {
- VariableReferenceExpression varRef = (VariableReferenceExpression) expr;
- LogicalVariable rhsVar = varRef.getVariableReference();
- ecFromGroup = true;
- EquivalenceClass ecRight = findEquivClass(rhsVar, equivClasses);
- if (ecRight != null) {
- LogicalVariable replacingVar = ecRight.getVariableRepresentative();
- if (replacingVar != null && replacingVar != rhsVar) {
- varRef.setVariable(replacingVar);
- modified = true;
- }
- }
- }
- }
- return new Pair<Boolean, Boolean>(modified, ecFromGroup);
- }
-
- // Instead of doing this, we could make Projection to be more expressive and
- // also take constants (or even expression), at the expense of a more
- // complex project push down.
- private void assignVarsNeededByProject(ProjectOperator op, List<EquivalenceClass> equivClasses,
- IOptimizationContext context) throws AlgebricksException {
- List<LogicalVariable> prVars = op.getVariables();
- int sz = prVars.size();
- for (int i = 0; i < sz; i++) {
- EquivalenceClass ec = findEquivClass(prVars.get(i), equivClasses);
- if (ec != null) {
- if (!ec.representativeIsConst()) {
- prVars.set(i, ec.getVariableRepresentative());
- }
- }
- }
- }
-
- private final static EquivalenceClass findEquivClass(LogicalVariable var, List<EquivalenceClass> equivClasses) {
- for (EquivalenceClass ec : equivClasses) {
- if (ec.contains(var)) {
- return ec;
- }
- }
- return null;
- }
-
- private class VariableSubstitutionVisitor implements ILogicalExpressionReferenceTransform {
- private List<EquivalenceClass> equivClasses;
- private IOptimizationContext context;
- private final boolean doNotSubstWithConst;
-
- public VariableSubstitutionVisitor(boolean doNotSubstWithConst) {
- this.doNotSubstWithConst = doNotSubstWithConst;
- }
-
- public void setContext(IOptimizationContext context) {
- this.context = context;
- }
-
- public void setEquivalenceClasses(List<EquivalenceClass> equivClasses) {
- this.equivClasses = equivClasses;
- }
-
- @Override
- public boolean transform(Mutable<ILogicalExpression> exprRef) {
- ILogicalExpression e = exprRef.getValue();
- switch (((AbstractLogicalExpression) e).getExpressionTag()) {
- case VARIABLE: {
- // look for a required substitution
- LogicalVariable var = ((VariableReferenceExpression) e).getVariableReference();
- if (context.shouldNotBeInlined(var)) {
- return false;
- }
- EquivalenceClass ec = findEquivClass(var, equivClasses);
- if (ec == null) {
- return false;
- }
- if (ec.representativeIsConst()) {
- if (doNotSubstWithConst) {
- return false;
- }
- exprRef.setValue(ec.getConstRepresentative());
- return true;
- } else {
- LogicalVariable r = ec.getVariableRepresentative();
- if (!r.equals(var)) {
- exprRef.setValue(new VariableReferenceExpression(r));
- return true;
- } else {
- return false;
- }
- }
- }
- case FUNCTION_CALL: {
- AbstractFunctionCallExpression fce = (AbstractFunctionCallExpression) e;
- boolean m = false;
- for (Mutable<ILogicalExpression> arg : fce.getArguments()) {
- if (transform(arg)) {
- m = true;
- }
- }
- return m;
- }
- default: {
- return false;
- }
- }
- }
-
+public class AsterixInlineVariablesRule extends InlineVariablesRule {
+
+ public AsterixInlineVariablesRule() {
+ // Do not inline field accesses because doing so would interfere with our access method rewrites.
+ // TODO: For now we must also exclude record constructor functions to avoid breaking our type casting rules
+ // IntroduceStaticTypeCastRule and IntroduceDynamicTypeCastRule.
+ doNotInlineFuncs.add(AsterixBuiltinFunctions.FIELD_ACCESS_BY_NAME);
+ doNotInlineFuncs.add(AsterixBuiltinFunctions.FIELD_ACCESS_BY_INDEX);
+ doNotInlineFuncs.add(AsterixBuiltinFunctions.CLOSED_RECORD_CONSTRUCTOR);
+ doNotInlineFuncs.add(AsterixBuiltinFunctions.OPEN_RECORD_CONSTRUCTOR);
}
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ConstantFoldingRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ConstantFoldingRule.java
index c1d0fea..47e957b 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ConstantFoldingRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ConstantFoldingRule.java
@@ -37,7 +37,10 @@
import edu.uci.ics.asterix.om.base.IAObject;
import edu.uci.ics.asterix.om.constants.AsterixConstantValue;
import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
+import edu.uci.ics.asterix.om.typecomputer.base.TypeComputerUtilities;
import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.AbstractCollectionType;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
@@ -163,11 +166,23 @@
if (!checkArgs(expr)) {
return new Pair<Boolean, ILogicalExpression>(changed, expr);
}
- // TODO: currently ARecord is always a closed record
+ //Current ARecord SerDe assumes a closed record, so we do not constant fold open record constructors
if (expr.getFunctionIdentifier().equals(AsterixBuiltinFunctions.OPEN_RECORD_CONSTRUCTOR)
|| expr.getFunctionIdentifier().equals(AsterixBuiltinFunctions.CAST_RECORD)) {
return new Pair<Boolean, ILogicalExpression>(false, null);
}
+ //Current List SerDe assumes a strongly typed list, so we do not constant fold the list constructors if they are not strongly typed
+ if (expr.getFunctionIdentifier().equals(AsterixBuiltinFunctions.UNORDERED_LIST_CONSTRUCTOR)
+ || expr.getFunctionIdentifier().equals(AsterixBuiltinFunctions.ORDERED_LIST_CONSTRUCTOR)) {
+ AbstractCollectionType listType = (AbstractCollectionType) TypeComputerUtilities.getRequiredType(expr);
+ if (listType != null
+ && (listType.getItemType().getTypeTag() == ATypeTag.ANY || listType.getItemType() instanceof AbstractCollectionType)) {
+ //case1: listType == null, could be a nested list inside a list<ANY>
+ //case2: itemType = ANY
+ //case3: itemType = a nested list
+ return new Pair<Boolean, ILogicalExpression>(false, null);
+ }
+ }
if (expr.getFunctionIdentifier().equals(AsterixBuiltinFunctions.FIELD_ACCESS_BY_NAME)) {
ARecordType rt = (ARecordType) _emptyTypeEnv.getType(expr.getArguments().get(0).getValue());
String str = ((AString) ((AsterixConstantValue) ((ConstantExpression) expr.getArguments().get(1)
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/FuzzyEqRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/FuzzyEqRule.java
index c770e9f..345f68a 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/FuzzyEqRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/FuzzyEqRule.java
@@ -7,7 +7,6 @@
import org.apache.commons.lang3.mutable.MutableObject;
import edu.uci.ics.asterix.aql.util.FunctionUtils;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
import edu.uci.ics.asterix.om.base.IAObject;
import edu.uci.ics.asterix.om.constants.AsterixConstantValue;
@@ -56,11 +55,10 @@
return false;
}
- AqlCompiledMetadataDeclarations aqlMetadata = ((AqlMetadataProvider) context.getMetadataProvider())
- .getMetadataDeclarations();
+ AqlMetadataProvider metadataProvider = ((AqlMetadataProvider) context.getMetadataProvider());
IVariableTypeEnvironment env = context.getOutputTypeEnvironment(op);
- if (expandFuzzyEq(expRef, context, env, aqlMetadata)) {
+ if (expandFuzzyEq(expRef, context, env, metadataProvider)) {
context.computeAndSetTypeEnvironmentForOperator(op);
return true;
}
@@ -68,7 +66,7 @@
}
private boolean expandFuzzyEq(Mutable<ILogicalExpression> expRef, IOptimizationContext context,
- IVariableTypeEnvironment env, AqlCompiledMetadataDeclarations aqlMetadata) throws AlgebricksException {
+ IVariableTypeEnvironment env, AqlMetadataProvider metadataProvider) throws AlgebricksException {
ILogicalExpression exp = expRef.getValue();
if (exp.getExpressionTag() != LogicalExpressionTag.FUNCTION_CALL) {
@@ -85,7 +83,7 @@
// We change the behavior of this rule for the specific cases of const-var, or for edit-distance functions.
boolean useExprAsIs = false;
- String simFuncName = FuzzyUtils.getSimFunction(aqlMetadata);
+ String simFuncName = FuzzyUtils.getSimFunction(metadataProvider);
ArrayList<Mutable<ILogicalExpression>> similarityArgs = new ArrayList<Mutable<ILogicalExpression>>();
List<ATypeTag> inputExprTypes = new ArrayList<ATypeTag>();
for (int i = 0; i < 2; i++) {
@@ -101,9 +99,16 @@
inputExprTypes.add(t.getTypeTag());
} else if (inputExp.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
// Hack to make sure that we will add the func call as is, without wrapping a tokenizer around.
- inputTypeTag = ATypeTag.UNORDEREDLIST;
+ IAType type = (IAType) context.getExpressionTypeComputer().getType(inputExp, metadataProvider, env);
+ inputTypeTag = type.getTypeTag();
+ // Only auto-tokenize strings.
+ if (inputTypeTag == ATypeTag.STRING) {
+ // Strings will be auto-tokenized.
+ inputTypeTag = ATypeTag.UNORDEREDLIST;
+ } else {
+ useExprAsIs = true;
+ }
inputExprTypes.add(inputTypeTag);
- useExprAsIs = true;
} else if (inputExp.getExpressionTag() == LogicalExpressionTag.CONSTANT) {
ConstantExpression inputConst = (ConstantExpression) inputExp;
AsterixConstantValue constVal = (AsterixConstantValue) inputConst.getValue();
@@ -140,9 +145,11 @@
FunctionIdentifier simFunctionIdentifier = FuzzyUtils.getFunctionIdentifier(simFuncName);
ScalarFunctionCallExpression similarityExp = new ScalarFunctionCallExpression(
FunctionUtils.getFunctionInfo(simFunctionIdentifier), similarityArgs);
+ // Add annotations from the original fuzzy-eq function.
+ similarityExp.getAnnotations().putAll(funcExp.getAnnotations());
ArrayList<Mutable<ILogicalExpression>> cmpArgs = new ArrayList<Mutable<ILogicalExpression>>();
cmpArgs.add(new MutableObject<ILogicalExpression>(similarityExp));
- IAObject simThreshold = FuzzyUtils.getSimThreshold(aqlMetadata, simFuncName);
+ IAObject simThreshold = FuzzyUtils.getSimThreshold(metadataProvider, simFuncName);
cmpArgs.add(new MutableObject<ILogicalExpression>(new ConstantExpression(new AsterixConstantValue(
simThreshold))));
ScalarFunctionCallExpression cmpExpr = FuzzyUtils.getComparisonExpr(simFuncName, cmpArgs);
@@ -150,7 +157,7 @@
return true;
} else if (fi.equals(AlgebricksBuiltinFunctions.AND) || fi.equals(AlgebricksBuiltinFunctions.OR)) {
for (int i = 0; i < 2; i++) {
- if (expandFuzzyEq(funcExp.getArguments().get(i), context, env, aqlMetadata)) {
+ if (expandFuzzyEq(funcExp.getArguments().get(i), context, env, metadataProvider)) {
expanded = true;
}
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/FuzzyJoinRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/FuzzyJoinRule.java
index d5131a9..8936425 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/FuzzyJoinRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/FuzzyJoinRule.java
@@ -15,7 +15,6 @@
import edu.uci.ics.asterix.aqlplus.parser.AQLPlusParser;
import edu.uci.ics.asterix.aqlplus.parser.ParseException;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.types.IAType;
@@ -33,6 +32,7 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalVariable;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ConstantExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IndexedNLJoinExpressionAnnotation;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.AlgebricksBuiltinFunctions;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
@@ -46,6 +46,11 @@
public class FuzzyJoinRule implements IAlgebraicRewriteRule {
+ private static HashSet<FunctionIdentifier> simFuncs = new HashSet<FunctionIdentifier>();
+ static {
+ simFuncs.add(AsterixBuiltinFunctions.SIMILARITY_JACCARD_CHECK);
+ }
+
private static final String AQLPLUS = ""
//
// -- - Stage 3 - --
@@ -125,7 +130,8 @@
private Collection<LogicalVariable> liveVars = new HashSet<LogicalVariable>();
@Override
- public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
+ public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
+ throws AlgebricksException {
AbstractLogicalOperator op = (AbstractLogicalOperator) opRef.getValue();
// current opperator is join
if (op.getOperatorTag() != LogicalOperatorTag.INNERJOIN
@@ -133,20 +139,30 @@
return false;
}
- // find fuzzy join condition
+ // Find GET_ITEM function.
AbstractBinaryJoinOperator joinOp = (AbstractBinaryJoinOperator) op;
Mutable<ILogicalExpression> expRef = joinOp.getCondition();
- Mutable<ILogicalExpression> fuzzyExpRef = getSimilarityExpression(expRef);
- if (fuzzyExpRef == null) {
+ Mutable<ILogicalExpression> getItemExprRef = getSimilarityExpression(expRef);
+ if (getItemExprRef == null) {
+ return false;
+ }
+ // Check if the GET_ITEM function is on one of the supported similarity-check functions.
+ AbstractFunctionCallExpression getItemFuncExpr = (AbstractFunctionCallExpression) getItemExprRef.getValue();
+ Mutable<ILogicalExpression> argRef = getItemFuncExpr.getArguments().get(0);
+ AbstractFunctionCallExpression simFuncExpr = (AbstractFunctionCallExpression) argRef.getValue();
+ if (!simFuncs.contains(simFuncExpr.getFunctionIdentifier())) {
+ return false;
+ }
+ // Skip this rule based on annotations.
+ if (simFuncExpr.getAnnotations().containsKey(IndexedNLJoinExpressionAnnotation.INSTANCE)) {
return false;
}
- AbstractFunctionCallExpression funcExp = (AbstractFunctionCallExpression) fuzzyExpRef.getValue();
List<Mutable<ILogicalOperator>> inputOps = joinOp.getInputs();
ILogicalOperator leftInputOp = inputOps.get(0).getValue();
ILogicalOperator rightInputOp = inputOps.get(1).getValue();
- List<Mutable<ILogicalExpression>> inputExps = funcExp.getArguments();
+ List<Mutable<ILogicalExpression>> inputExps = simFuncExpr.getArguments();
ILogicalExpression inputExp0 = inputExps.get(0).getValue();
ILogicalExpression inputExp1 = inputExps.get(1).getValue();
@@ -175,6 +191,10 @@
List<LogicalVariable> leftInputPKs = context.findPrimaryKey(leftInputVar);
List<LogicalVariable> rightInputPKs = context.findPrimaryKey(rightInputVar);
+ // Bail if primary keys could not be inferred.
+ if (leftInputPKs == null || rightInputPKs == null) {
+ return false;
+ }
// primary key has only one variable
if (leftInputPKs.size() != 1 || rightInputPKs.size() != 1) {
return false;
@@ -190,8 +210,7 @@
//
// -- - FIRE - --
//
- AqlCompiledMetadataDeclarations metadata = ((AqlMetadataProvider) context.getMetadataProvider())
- .getMetadataDeclarations();
+ AqlMetadataProvider metadataProvider = ((AqlMetadataProvider) context.getMetadataProvider());
FunctionIdentifier funcId = FuzzyUtils.getTokenizer(leftType.getTypeTag());
String tokenizer;
if (funcId == null) {
@@ -200,8 +219,8 @@
tokenizer = funcId.getName();
}
- float simThreshold = FuzzyUtils.getSimThreshold(metadata);
- String simFunction = FuzzyUtils.getSimFunction(metadata);
+ float simThreshold = FuzzyUtils.getSimThreshold(metadataProvider);
+ String simFunction = FuzzyUtils.getSimFunction(metadataProvider);
// finalize AQL+ query
String prepareJoin;
@@ -247,9 +266,8 @@
}
// The translator will compile metadata internally. Run this compilation
// under the same transaction id as the "outer" compilation.
- AqlMetadataProvider mp = (AqlMetadataProvider) context.getMetadataProvider();
- AqlPlusExpressionToPlanTranslator translator = new AqlPlusExpressionToPlanTranslator(mp.getTxnId(),
- metadata.getMetadataTransactionContext(), counter, null);
+ AqlPlusExpressionToPlanTranslator translator = new AqlPlusExpressionToPlanTranslator(
+ metadataProvider.getJobTxnId(), metadataProvider, counter, null, null);
LogicalOperatorDeepCopyVisitor deepCopyVisitor = new LogicalOperatorDeepCopyVisitor(counter);
@@ -315,9 +333,9 @@
ILogicalOperator outputOp = plan.getRoots().get(0).getValue();
SelectOperator extraSelect = null;
- if (fuzzyExpRef != expRef) {
+ if (getItemExprRef != expRef) {
// more than one join condition
- fuzzyExpRef.setValue(ConstantExpression.TRUE);
+ getItemExprRef.setValue(ConstantExpression.TRUE);
switch (joinOp.getJoinKind()) {
case INNER: {
extraSelect = new SelectOperator(expRef);
@@ -343,19 +361,19 @@
return true;
}
- /*
- * look for FUZZY_EQ function call
+ /**
+ * Look for GET_ITEM function call.
*/
private Mutable<ILogicalExpression> getSimilarityExpression(Mutable<ILogicalExpression> expRef) {
ILogicalExpression exp = expRef.getValue();
if (exp.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
- AbstractFunctionCallExpression funcExp = (AbstractFunctionCallExpression) exp;
- if (funcExp.getFunctionIdentifier().equals(AsterixBuiltinFunctions.FUZZY_EQ)) {
+ AbstractFunctionCallExpression funcExpr = (AbstractFunctionCallExpression) exp;
+ if (funcExpr.getFunctionIdentifier().equals(AsterixBuiltinFunctions.GET_ITEM)) {
return expRef;
- } else if (funcExp.getFunctionIdentifier().equals(AlgebricksBuiltinFunctions.AND)
- || funcExp.getFunctionIdentifier().equals(AlgebricksBuiltinFunctions.OR)) {
+ }
+ if (funcExpr.getFunctionIdentifier().equals(AlgebricksBuiltinFunctions.AND)) {
for (int i = 0; i < 2; i++) {
- Mutable<ILogicalExpression> expRefRet = getSimilarityExpression(funcExp.getArguments().get(i));
+ Mutable<ILogicalExpression> expRefRet = getSimilarityExpression(funcExpr.getArguments().get(i));
if (expRefRet != null) {
return expRefRet;
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/InlineAssignIntoAggregateRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/InlineAssignIntoAggregateRule.java
deleted file mode 100644
index 5f98a1b..0000000
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/InlineAssignIntoAggregateRule.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package edu.uci.ics.asterix.optimizer.rules;
-
-import java.util.List;
-
-import org.apache.commons.lang3.mutable.Mutable;
-
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalOperator;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalPlan;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.IOptimizationContext;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalOperatorTag;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalVariable;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ConstantExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression;
-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.GroupByOperator;
-import edu.uci.ics.hyracks.algebricks.core.algebra.visitors.AbstractConstVarFunVisitor;
-import edu.uci.ics.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule;
-
-
-
-public class InlineAssignIntoAggregateRule implements IAlgebraicRewriteRule {
-
- @Override
- public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext context) {
- return false;
- }
-
- @Override
- public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
- AbstractLogicalOperator op = (AbstractLogicalOperator) opRef.getValue();
- if (op.getOperatorTag() != LogicalOperatorTag.GROUP) {
- return false;
- }
- boolean changed = false;
- GroupByOperator gbyOp = (GroupByOperator) op;
- for (ILogicalPlan p : gbyOp.getNestedPlans()) {
- for (Mutable<ILogicalOperator> r : p.getRoots()) {
- if (inlined(r)) {
- changed = true;
- }
- }
- }
- return changed;
- }
-
- private boolean inlined(Mutable<ILogicalOperator> r) throws AlgebricksException {
- AbstractLogicalOperator op1 = (AbstractLogicalOperator) r.getValue();
- if (op1.getOperatorTag() != LogicalOperatorTag.AGGREGATE) {
- return false;
- }
- AbstractLogicalOperator op2 = (AbstractLogicalOperator) op1.getInputs().get(0).getValue();
- if (op2.getOperatorTag() != LogicalOperatorTag.ASSIGN) {
- return false;
- }
- AggregateOperator agg = (AggregateOperator) op1;
- AssignOperator assign = (AssignOperator) op2;
- VarExprSubstitution ves = new VarExprSubstitution(assign.getVariables(), assign.getExpressions());
- for (Mutable<ILogicalExpression> exprRef : agg.getExpressions()) {
- ILogicalExpression expr = exprRef.getValue();
- Pair<Boolean, ILogicalExpression> p = expr.accept(ves, null);
- if (p.first == true) {
- exprRef.setValue(p.second);
- }
- // AbstractLogicalExpression ale = (AbstractLogicalExpression) expr;
- // ale.accept(ves, null);
- }
- List<Mutable<ILogicalOperator>> op1InpList = op1.getInputs();
- op1InpList.clear();
- op1InpList.add(op2.getInputs().get(0));
- return true;
- }
-
- private class VarExprSubstitution extends AbstractConstVarFunVisitor<Pair<Boolean, ILogicalExpression>, Void> {
-
- private List<LogicalVariable> variables;
- private List<Mutable<ILogicalExpression>> expressions;
-
- public VarExprSubstitution(List<LogicalVariable> variables, List<Mutable<ILogicalExpression>> expressions) {
- this.variables = variables;
- this.expressions = expressions;
- }
-
- @Override
- public Pair<Boolean, ILogicalExpression> visitConstantExpression(ConstantExpression expr, Void arg) {
- return new Pair<Boolean, ILogicalExpression>(false, expr);
- }
-
- @Override
- public Pair<Boolean, ILogicalExpression> visitFunctionCallExpression(AbstractFunctionCallExpression expr,
- Void arg) throws AlgebricksException {
- boolean changed = false;
- for (Mutable<ILogicalExpression> eRef : expr.getArguments()) {
- ILogicalExpression e = eRef.getValue();
- Pair<Boolean, ILogicalExpression> p = e.accept(this, arg);
- if (p.first) {
- eRef.setValue(p.second);
- changed = true;
- }
- }
- return new Pair<Boolean, ILogicalExpression>(changed, expr);
- }
-
- @Override
- public Pair<Boolean, ILogicalExpression> visitVariableReferenceExpression(VariableReferenceExpression expr,
- Void arg) {
- LogicalVariable v = expr.getVariableReference();
- int idx = variables.indexOf(v);
- if (idx < 0) {
- return new Pair<Boolean, ILogicalExpression>(false, expr);
- } else {
- return new Pair<Boolean, ILogicalExpression>(true, expressions.get(idx).getValue());
- }
-
- }
-
- }
-}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/InlineUnnestFunctionRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/InlineUnnestFunctionRule.java
new file mode 100644
index 0000000..3e57ded
--- /dev/null
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/InlineUnnestFunctionRule.java
@@ -0,0 +1,174 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.optimizer.rules;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang3.mutable.Mutable;
+import org.apache.commons.lang3.mutable.MutableObject;
+
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalOperator;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.IOptimizationContext;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalExpressionTag;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalOperatorTag;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalVariable;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator;
+import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AssignOperator;
+import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.UnnestOperator;
+import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.visitors.VariableUtilities;
+import edu.uci.ics.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule;
+
+/**
+ * This rule is to inline unnest functions that are hold by variables.
+ * This rule is to fix issue 201.
+ */
+public class InlineUnnestFunctionRule implements IAlgebraicRewriteRule {
+
+ @Override
+ public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
+ return false;
+ }
+
+ @Override
+ public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
+ throws AlgebricksException {
+ AbstractLogicalOperator op1 = (AbstractLogicalOperator) opRef.getValue();
+ if (context.checkIfInDontApplySet(this, op1))
+ return false;
+ context.addToDontApplySet(this, op1);
+ if (op1.getOperatorTag() != LogicalOperatorTag.UNNEST)
+ return false;
+ UnnestOperator unnestOperator = (UnnestOperator) op1;
+ AbstractFunctionCallExpression expr = (AbstractFunctionCallExpression) unnestOperator.getExpressionRef()
+ .getValue();
+ //we only inline for the scan-collection function
+ if (expr.getFunctionIdentifier() != AsterixBuiltinFunctions.SCAN_COLLECTION)
+ return false;
+
+ // inline all variables from an unnesting function call
+ AbstractFunctionCallExpression funcExpr = (AbstractFunctionCallExpression) expr;
+ List<Mutable<ILogicalExpression>> args = funcExpr.getArguments();
+ for (int i = 0; i < args.size(); i++) {
+ ILogicalExpression argExpr = args.get(i).getValue();
+ if (argExpr.getExpressionTag() == LogicalExpressionTag.VARIABLE) {
+ VariableReferenceExpression varExpr = (VariableReferenceExpression) argExpr;
+ inlineVariable(varExpr.getVariableReference(), unnestOperator);
+ }
+ }
+ return true;
+ }
+
+ /**
+ * This method is to inline one variable
+ *
+ * @param usedVar
+ * A variable that is used by the scan-collection function in the unnest operator
+ * @param unnestOp
+ * The unnest operator.
+ * @throws AlgebricksException
+ */
+ private void inlineVariable(LogicalVariable usedVar, UnnestOperator unnestOp) throws AlgebricksException {
+ AbstractFunctionCallExpression expr = (AbstractFunctionCallExpression) unnestOp.getExpressionRef().getValue();
+ List<Pair<AbstractFunctionCallExpression, Integer>> parentAndIndexList = new ArrayList<Pair<AbstractFunctionCallExpression, Integer>>();
+ getParentFunctionExpression(usedVar, expr, parentAndIndexList);
+ ILogicalExpression usedVarOrginExpr = findUsedVarOrigin(usedVar, unnestOp, (AbstractLogicalOperator) unnestOp
+ .getInputs().get(0).getValue());
+ if (usedVarOrginExpr != null) {
+ for (Pair<AbstractFunctionCallExpression, Integer> parentAndIndex : parentAndIndexList) {
+ //we only rewrite the top scan-collection function
+ if (parentAndIndex.first.getFunctionIdentifier() == AsterixBuiltinFunctions.SCAN_COLLECTION
+ && parentAndIndex.first == expr) {
+ unnestOp.getExpressionRef().setValue(usedVarOrginExpr);
+ }
+ }
+ }
+ }
+
+ private void getParentFunctionExpression(LogicalVariable usedVar, ILogicalExpression expr,
+ List<Pair<AbstractFunctionCallExpression, Integer>> parentAndIndexList) {
+ AbstractFunctionCallExpression funcExpr = (AbstractFunctionCallExpression) expr;
+ List<Mutable<ILogicalExpression>> args = funcExpr.getArguments();
+ for (int i = 0; i < args.size(); i++) {
+ ILogicalExpression argExpr = args.get(i).getValue();
+ if (argExpr.getExpressionTag() == LogicalExpressionTag.VARIABLE) {
+ VariableReferenceExpression varExpr = (VariableReferenceExpression) argExpr;
+ if (varExpr.getVariableReference().equals(usedVar))
+ parentAndIndexList.add(new Pair<AbstractFunctionCallExpression, Integer>(funcExpr, i));
+ }
+ if (argExpr.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
+ getParentFunctionExpression(usedVar, argExpr, parentAndIndexList);
+ }
+ }
+ }
+
+ private ILogicalExpression findUsedVarOrigin(LogicalVariable usedVar, AbstractLogicalOperator parentOp,
+ AbstractLogicalOperator currentOp) throws AlgebricksException {
+ ILogicalExpression ret = null;
+ if (currentOp.getOperatorTag() == LogicalOperatorTag.ASSIGN) {
+ List<LogicalVariable> producedVars = new ArrayList<LogicalVariable>();
+ VariableUtilities.getProducedVariables(currentOp, producedVars);
+ if (producedVars.contains(usedVar)) {
+ AssignOperator assignOp = (AssignOperator) currentOp;
+ int index = assignOp.getVariables().indexOf(usedVar);
+ ILogicalExpression returnedExpr = assignOp.getExpressions().get(index).getValue();
+ if (returnedExpr.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
+ AbstractFunctionCallExpression funcExpr = (AbstractFunctionCallExpression) returnedExpr;
+ if (AsterixBuiltinFunctions.isBuiltinUnnestingFunction(funcExpr.getFunctionIdentifier())) {
+ // we only inline for unnest functions
+ removeUnecessaryAssign(parentOp, currentOp, assignOp, index);
+ ret = returnedExpr;
+ }
+ } else if (returnedExpr.getExpressionTag() == LogicalExpressionTag.VARIABLE) {
+ //recusively inline
+ VariableReferenceExpression varExpr = (VariableReferenceExpression) returnedExpr;
+ LogicalVariable var = varExpr.getVariableReference();
+ ILogicalExpression finalExpr = findUsedVarOrigin(var, currentOp,
+ (AbstractLogicalOperator) currentOp.getInputs().get(0).getValue());
+ if (finalExpr != null) {
+ removeUnecessaryAssign(parentOp, currentOp, assignOp, index);
+ ret = finalExpr;
+ }
+ }
+ }
+ } else {
+ for (Mutable<ILogicalOperator> child : currentOp.getInputs()) {
+ ILogicalExpression expr = findUsedVarOrigin(usedVar, currentOp,
+ (AbstractLogicalOperator) child.getValue());
+ if (expr != null) {
+ ret = expr;
+ }
+ }
+ }
+ return ret;
+ }
+
+ private void removeUnecessaryAssign(AbstractLogicalOperator parentOp, AbstractLogicalOperator currentOp,
+ AssignOperator assignOp, int index) {
+ assignOp.getVariables().remove(index);
+ assignOp.getExpressions().remove(index);
+ if (assignOp.getVariables().size() == 0) {
+ int opIndex = parentOp.getInputs().indexOf(new MutableObject<ILogicalOperator>(currentOp));
+ parentOp.getInputs().get(opIndex).setValue(assignOp.getInputs().get(0).getValue());
+ }
+ }
+}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceDynamicTypeCastRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceDynamicTypeCastRule.java
index c41d908..2dce5f6 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceDynamicTypeCastRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceDynamicTypeCastRule.java
@@ -48,22 +48,18 @@
* recursive way. It enables: 1. bag-based fields in a record, 2. bidirectional
* cast of a open field and a matched closed field, and 3. put in null fields
* when necessary.
- *
* Here is an example: A record { "hobby": {{"music", "coding"}}, "id": "001",
* "name": "Person Three"} which confirms to closed type ( id: string, name:
* string, hobby: {{string}}? ) can be cast to an open type (id: string ), or
* vice versa.
- *
* However, if the input record is a variable, then we don't know its exact
* field layout at compile time. For example, records conforming to the same
* type can have different field orderings and different open parts. That's why
* we need dynamic type casting.
- *
* Note that as we can see in the example, the ordering of fields of a record is
* not required. Since the open/closed part of a record has completely different
* underlying memory/storage layout, a cast-record function will change the
* layout as specified at runtime.
- *
* Implementation wise, this rule checks the target dataset type and the input
* record type, and if the types are different, then it plugs in an assign with
* a cast-record function, and projects away the original (uncast) field.
@@ -80,9 +76,7 @@
throws AlgebricksException {
/**
* pattern match: sink insert assign
- *
* resulting plan: sink-insert-project-assign
- *
*/
AbstractLogicalOperator op1 = (AbstractLogicalOperator) opRef.getValue();
if (op1.getOperatorTag() != LogicalOperatorTag.SINK)
@@ -90,6 +84,9 @@
AbstractLogicalOperator op2 = (AbstractLogicalOperator) op1.getInputs().get(0).getValue();
if (op2.getOperatorTag() != LogicalOperatorTag.INSERT_DELETE)
return false;
+ InsertDeleteOperator insertDeleteOp = (InsertDeleteOperator) op2;
+ if (insertDeleteOp.getOperation() == InsertDeleteOperator.Kind.DELETE)
+ return false;
AbstractLogicalOperator op3 = (AbstractLogicalOperator) op2.getInputs().get(0).getValue();
if (op3.getOperatorTag() != LogicalOperatorTag.ASSIGN)
return false;
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceEnforcedListTypeRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceEnforcedListTypeRule.java
new file mode 100644
index 0000000..2e8d530
--- /dev/null
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceEnforcedListTypeRule.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.optimizer.rules;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.commons.lang3.mutable.Mutable;
+
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.optimizer.rules.typecast.StaticTypeCastUtil;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalOperator;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.IOptimizationContext;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalExpressionTag;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalOperatorTag;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
+import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractAssignOperator;
+import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator;
+import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractUnnestOperator;
+import edu.uci.ics.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule;
+
+/**
+ * This class is to enforce types for function expressions which contain list constructor function calls.
+ * The List constructor is very special because a nested list is of type List<ANY>.
+ * However, the bottom-up type inference (InferTypeRule in algebricks) did not infer that so we need this method to enforce the type.
+ * We do not want to break the generality of algebricks so this method is called in an ASTERIX rule: @ IntroduceEnforcedListTypeRule} .
+ */
+public class IntroduceEnforcedListTypeRule implements IAlgebraicRewriteRule {
+
+ @Override
+ public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
+ return false;
+ }
+
+ @Override
+ public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
+ throws AlgebricksException {
+ if (context.checkIfInDontApplySet(this, opRef.getValue()))
+ return false;
+ AbstractLogicalOperator op1 = (AbstractLogicalOperator) opRef.getValue();
+ context.addToDontApplySet(this, opRef.getValue());
+ boolean changed = false;
+
+ /**
+ * rewrite list constructor types for list constructor functions
+ */
+ if (op1.getOperatorTag() == LogicalOperatorTag.ASSIGN) {
+ AbstractAssignOperator assignOp = (AbstractAssignOperator) op1;
+ List<Mutable<ILogicalExpression>> expressions = assignOp.getExpressions();
+ IVariableTypeEnvironment env = assignOp.computeOutputTypeEnvironment(context);
+ changed = rewriteExpressions(expressions, env);
+ }
+ if (op1.getOperatorTag() == LogicalOperatorTag.UNNEST) {
+ AbstractUnnestOperator unnestOp = (AbstractUnnestOperator) op1;
+ List<Mutable<ILogicalExpression>> expressions = Collections.singletonList(unnestOp.getExpressionRef());
+ IVariableTypeEnvironment env = unnestOp.computeOutputTypeEnvironment(context);
+ changed = rewriteExpressions(expressions, env);
+ }
+ return changed;
+ }
+
+ private boolean rewriteExpressions(List<Mutable<ILogicalExpression>> expressions, IVariableTypeEnvironment env)
+ throws AlgebricksException {
+ boolean changed = false;
+ for (Mutable<ILogicalExpression> exprRef : expressions) {
+ ILogicalExpression expr = exprRef.getValue();
+ if (expr.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
+ AbstractFunctionCallExpression argFuncExpr = (AbstractFunctionCallExpression) expr;
+ IAType exprType = (IAType) env.getType(argFuncExpr);
+ changed = changed || StaticTypeCastUtil.rewriteListExpr(argFuncExpr, exprType, exprType, env);
+ }
+ }
+ return changed;
+ }
+
+}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceSecondaryIndexInsertDeleteRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceSecondaryIndexInsertDeleteRule.java
index a9de14f..3310f4d 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceSecondaryIndexInsertDeleteRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceSecondaryIndexInsertDeleteRule.java
@@ -9,7 +9,6 @@
import edu.uci.ics.asterix.aql.util.FunctionUtils;
import edu.uci.ics.asterix.common.config.DatasetConfig.DatasetType;
import edu.uci.ics.asterix.common.config.DatasetConfig.IndexType;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
import edu.uci.ics.asterix.metadata.declared.AqlDataSource;
import edu.uci.ics.asterix.metadata.declared.AqlIndex;
import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
@@ -89,11 +88,11 @@
InsertDeleteOperator insertOp = (InsertDeleteOperator) op1;
AqlDataSource datasetSource = (AqlDataSource) insertOp.getDataSource();
AqlMetadataProvider mp = (AqlMetadataProvider) context.getMetadataProvider();
- AqlCompiledMetadataDeclarations metadata = mp.getMetadataDeclarations();
+ String dataverseName = datasetSource.getId().getDataverseName();
String datasetName = datasetSource.getId().getDatasetName();
- Dataset dataset = metadata.findDataset(datasetName);
+ Dataset dataset = mp.findDataset(dataverseName, datasetName);
if (dataset == null) {
- throw new AlgebricksException("Unknown dataset " + datasetName);
+ throw new AlgebricksException("Unknown dataset " + datasetName + " in dataverse " + dataverseName);
}
if (dataset.getDatasetType() == DatasetType.EXTERNAL) {
return false;
@@ -103,12 +102,12 @@
VariableUtilities.getUsedVariables(op1, projectVars);
// Create operators for secondary index insert/delete.
String itemTypeName = dataset.getItemTypeName();
- IAType itemType = metadata.findType(itemTypeName);
+ IAType itemType = mp.findType(dataset.getDataverseName(), itemTypeName);
if (itemType.getTypeTag() != ATypeTag.RECORD) {
throw new AlgebricksException("Only record types can be indexed.");
}
ARecordType recType = (ARecordType) itemType;
- List<Index> indexes = metadata.getDatasetIndexes(dataset.getDataverseName(), dataset.getDatasetName());
+ List<Index> indexes = mp.getDatasetIndexes(dataset.getDataverseName(), dataset.getDatasetName());
ILogicalOperator currentTop = op1;
boolean hasSecondaryIndex = false;
for (Index index : indexes) {
@@ -154,7 +153,7 @@
}
Mutable<ILogicalExpression> filterExpression = createFilterExpression(secondaryKeyVars,
context.getOutputTypeEnvironment(assign), false);
- AqlIndex dataSourceIndex = new AqlIndex(index, metadata, datasetName);
+ AqlIndex dataSourceIndex = new AqlIndex(index, dataverseName, datasetName, mp);
IndexInsertDeleteOperator indexUpdate = new IndexInsertDeleteOperator(dataSourceIndex,
insertOp.getPrimaryKeyExpressions(), secondaryExpressions, filterExpression,
insertOp.getOperation());
@@ -196,7 +195,7 @@
boolean forceFilter = keyPairType.second;
Mutable<ILogicalExpression> filterExpression = createFilterExpression(keyVarList,
context.getOutputTypeEnvironment(assignCoordinates), forceFilter);
- AqlIndex dataSourceIndex = new AqlIndex(index, metadata, datasetName);
+ AqlIndex dataSourceIndex = new AqlIndex(index, dataverseName, datasetName, mp);
IndexInsertDeleteOperator indexUpdate = new IndexInsertDeleteOperator(dataSourceIndex,
insertOp.getPrimaryKeyExpressions(), secondaryExpressions, filterExpression,
insertOp.getOperation());
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceStaticTypeCastRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceStaticTypeCastRule.java
index 7dc35fe..3aae2dd 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceStaticTypeCastRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceStaticTypeCastRule.java
@@ -16,26 +16,14 @@
package edu.uci.ics.asterix.optimizer.rules;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
import org.apache.commons.lang3.mutable.Mutable;
-import org.apache.commons.lang3.mutable.MutableObject;
import edu.uci.ics.asterix.metadata.declared.AqlDataSource;
-import edu.uci.ics.asterix.om.base.ANull;
-import edu.uci.ics.asterix.om.base.AString;
-import edu.uci.ics.asterix.om.constants.AsterixConstantValue;
-import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.typecomputer.base.TypeComputerUtilities;
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.AUnionType;
-import edu.uci.ics.asterix.om.types.AbstractCollectionType;
-import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
-import edu.uci.ics.asterix.runtime.pointables.base.DefaultOpenFieldType;
+import edu.uci.ics.asterix.optimizer.rules.typecast.StaticTypeCastUtil;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalOperator;
@@ -44,9 +32,7 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalOperatorTag;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalVariable;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ConstantExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AssignOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.InsertDeleteOperator;
@@ -58,22 +44,17 @@
* recursive way. It enables: 1. bag-based fields in a record, 2. bidirectional
* cast of a open field and a matched closed field, and 3. put in null fields
* when necessary. It should be fired before the constant folding rule.
- *
* This rule is not responsible for type casting between primitive types.
- *
* Here is an example: A record { "hobby": {{"music", "coding"}}, "id": "001",
* "name": "Person Three"} which confirms to closed type ( id: string, name:
* string, hobby: {{string}}? ) can be cast to an open type (id: string ), or
* vice versa.
- *
* Implementation wise: first, we match the record's type and its target dataset
* type to see if it is "cast-able"; second, if the types are cast-able, we
* embed the required type into the original producer expression. If the types
* are not cast-able, we throw a compile time exception.
- *
* Then, at runtime (not in this rule), the corresponding record/list
* constructors know what to do by checking the required output type.
- *
* TODO: right now record/list constructor of the cast result is not done in the
* ConstantFoldingRule and has to go to the runtime, because the
* ConstantFoldingRule uses ARecordSerializerDeserializer which seems to have
@@ -96,28 +77,31 @@
if (context.checkIfInDontApplySet(this, opRef.getValue()))
return false;
context.addToDontApplySet(this, opRef.getValue());
+
AbstractLogicalOperator op1 = (AbstractLogicalOperator) opRef.getValue();
+ List<LogicalVariable> producedVariables = new ArrayList<LogicalVariable>();
+ LogicalVariable oldRecordVariable;
+
if (op1.getOperatorTag() != LogicalOperatorTag.SINK)
return false;
AbstractLogicalOperator op2 = (AbstractLogicalOperator) op1.getInputs().get(0).getValue();
if (op2.getOperatorTag() != LogicalOperatorTag.INSERT_DELETE)
return false;
- AbstractLogicalOperator op3 = (AbstractLogicalOperator) op2.getInputs().get(0).getValue();
- if (op3.getOperatorTag() != LogicalOperatorTag.ASSIGN)
+ InsertDeleteOperator insertDeleteOp = (InsertDeleteOperator) op2;
+ if (insertDeleteOp.getOperation() == InsertDeleteOperator.Kind.DELETE)
return false;
-
+ AbstractLogicalOperator assignOp = (AbstractLogicalOperator) op2.getInputs().get(0).getValue();
+ if (assignOp.getOperatorTag() != LogicalOperatorTag.ASSIGN)
+ return false;
/**
* get required record type
*/
InsertDeleteOperator insertDeleteOperator = (InsertDeleteOperator) op2;
- AssignOperator topAssignOperator = (AssignOperator) op3;
AqlDataSource dataSource = (AqlDataSource) insertDeleteOperator.getDataSource();
IAType[] schemaTypes = (IAType[]) dataSource.getSchemaTypes();
- ARecordType requiredRecordType = (ARecordType) schemaTypes[schemaTypes.length - 1];
+ IAType requiredRecordType = schemaTypes[schemaTypes.length - 1];
- /**
- * get input record type to the insert operator
- */
+ AssignOperator topAssignOperator = (AssignOperator) assignOp;
List<LogicalVariable> usedVariables = new ArrayList<LogicalVariable>();
VariableUtilities.getUsedVariables(topAssignOperator, usedVariables);
@@ -126,14 +110,12 @@
// empty
if (usedVariables.size() == 0)
return false;
- LogicalVariable oldRecordVariable = usedVariables.get(0);
+ oldRecordVariable = usedVariables.get(0);
LogicalVariable inputRecordVar = usedVariables.get(0);
IVariableTypeEnvironment env = topAssignOperator.computeOutputTypeEnvironment(context);
- ARecordType inputRecordType = (ARecordType) env.getVarType(inputRecordVar);
+ IAType inputRecordType = (IAType) env.getVarType(inputRecordVar);
- AbstractLogicalOperator currentOperator = topAssignOperator;
- List<LogicalVariable> producedVariables = new ArrayList<LogicalVariable>();
-
+ AbstractLogicalOperator currentOperator = assignOp;
/**
* find the assign operator for the "input record" to the insert_delete
* operator
@@ -153,13 +135,15 @@
List<Mutable<ILogicalExpression>> expressionRefs = originalAssign.getExpressions();
ILogicalExpression expr = expressionRefs.get(position).getValue();
if (expr.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
- ScalarFunctionCallExpression funcExpr = (ScalarFunctionCallExpression) expr;
+ AbstractFunctionCallExpression funcExpr = (AbstractFunctionCallExpression) expr;
// that expression has been rewritten, and it will not
// fail but just return false
- if (TypeComputerUtilities.getRequiredType(funcExpr) != null)
+ if (TypeComputerUtilities.getRequiredType(funcExpr) != null) {
+ context.computeAndSetTypeEnvironmentForOperator(assignOp);
return false;
- IVariableTypeEnvironment assignEnv = topAssignOperator.computeOutputTypeEnvironment(context);
- rewriteFuncExpr(funcExpr, requiredRecordType, inputRecordType, assignEnv);
+ }
+ IVariableTypeEnvironment assignEnv = assignOp.computeOutputTypeEnvironment(context);
+ StaticTypeCastUtil.rewriteFuncExpr(funcExpr, requiredRecordType, inputRecordType, assignEnv);
}
context.computeAndSetTypeEnvironmentForOperator(originalAssign);
}
@@ -172,249 +156,4 @@
return true;
}
- private void rewriteFuncExpr(ScalarFunctionCallExpression funcExpr, IAType reqType, IAType inputType,
- IVariableTypeEnvironment env) throws AlgebricksException {
- if (funcExpr.getFunctionIdentifier() == AsterixBuiltinFunctions.UNORDERED_LIST_CONSTRUCTOR) {
- rewriteListFuncExpr(funcExpr, (AbstractCollectionType) reqType, (AbstractCollectionType) inputType, env);
- } else if (funcExpr.getFunctionIdentifier() == AsterixBuiltinFunctions.ORDERED_LIST_CONSTRUCTOR) {
- rewriteListFuncExpr(funcExpr, (AbstractCollectionType) reqType, (AbstractCollectionType) inputType, env);
- } else if (reqType.getTypeTag().equals(ATypeTag.RECORD)) {
- rewriteRecordFuncExpr(funcExpr, (ARecordType) reqType, (ARecordType) inputType, env);
- }
- }
-
- /**
- * only called when funcExpr is record constructor
- *
- * @param funcExpr
- * record constructor function expression
- * @param requiredListType
- * required record type
- * @param inputRecordType
- * @param env
- * type environment
- * @throws AlgebricksException
- */
- private void rewriteRecordFuncExpr(ScalarFunctionCallExpression funcExpr, ARecordType requiredRecordType,
- ARecordType inputRecordType, IVariableTypeEnvironment env) throws AlgebricksException {
- // if already rewritten, the required type is not null
- if (TypeComputerUtilities.getRequiredType(funcExpr) != null)
- return;
- TypeComputerUtilities.setRequiredAndInputTypes(funcExpr, requiredRecordType, inputRecordType);
- staticRecordTypeCast(funcExpr, requiredRecordType, inputRecordType, env);
- }
-
- /**
- * only called when funcExpr is list constructor
- *
- * @param funcExpr
- * list constructor function expression
- * @param requiredListType
- * required list type
- * @param inputListType
- * @param env
- * type environment
- * @throws AlgebricksException
- */
- private void rewriteListFuncExpr(ScalarFunctionCallExpression funcExpr, AbstractCollectionType requiredListType,
- AbstractCollectionType inputListType, IVariableTypeEnvironment env) throws AlgebricksException {
- if (TypeComputerUtilities.getRequiredType(funcExpr) != null)
- return;
-
- TypeComputerUtilities.setRequiredAndInputTypes(funcExpr, requiredListType, inputListType);
- List<Mutable<ILogicalExpression>> args = funcExpr.getArguments();
-
- IAType itemType = requiredListType.getItemType();
- if (itemType == null || itemType.getTypeTag().equals(ATypeTag.ANY))
- return;
- IAType inputItemType = inputListType.getItemType();
- for (int j = 0; j < args.size(); j++) {
- ILogicalExpression arg = args.get(j).getValue();
- if (arg.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
- ScalarFunctionCallExpression argFunc = (ScalarFunctionCallExpression) arg;
- IAType currentItemType = (IAType) env.getType(argFunc);
- if (inputItemType == null || inputItemType == BuiltinType.ANY) {
- currentItemType = (IAType) env.getType(argFunc);
- rewriteFuncExpr(argFunc, itemType, currentItemType, env);
- } else {
- rewriteFuncExpr(argFunc, itemType, inputItemType, env);
- }
- }
- }
- }
-
- private void staticRecordTypeCast(ScalarFunctionCallExpression func, ARecordType reqType, ARecordType inputType,
- IVariableTypeEnvironment env) throws AlgebricksException {
- IAType[] reqFieldTypes = reqType.getFieldTypes();
- String[] reqFieldNames = reqType.getFieldNames();
- IAType[] inputFieldTypes = inputType.getFieldTypes();
- String[] inputFieldNames = inputType.getFieldNames();
-
- int[] fieldPermutation = new int[reqFieldTypes.length];
- boolean[] nullFields = new boolean[reqFieldTypes.length];
- boolean[] openFields = new boolean[inputFieldTypes.length];
-
- Arrays.fill(nullFields, false);
- Arrays.fill(openFields, true);
- Arrays.fill(fieldPermutation, -1);
-
- // forward match: match from actual to required
- boolean matched = false;
- for (int i = 0; i < inputFieldNames.length; i++) {
- String fieldName = inputFieldNames[i];
- IAType fieldType = inputFieldTypes[i];
-
- if (2 * i + 1 > func.getArguments().size())
- throw new AlgebricksException("expression index out of bound");
-
- // 2*i+1 is the index of field value expression
- ILogicalExpression arg = func.getArguments().get(2 * i + 1).getValue();
- matched = false;
- for (int j = 0; j < reqFieldNames.length; j++) {
- String reqFieldName = reqFieldNames[j];
- IAType reqFieldType = reqFieldTypes[j];
- if (fieldName.equals(reqFieldName)) {
- if (fieldType.equals(reqFieldType)) {
- fieldPermutation[j] = i;
- openFields[i] = false;
- matched = true;
-
- if (arg.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
- ScalarFunctionCallExpression scalarFunc = (ScalarFunctionCallExpression) arg;
- rewriteFuncExpr(scalarFunc, reqFieldType, fieldType, env);
- }
- break;
- }
-
- // match the optional field
- if (reqFieldType.getTypeTag() == ATypeTag.UNION
- && NonTaggedFormatUtil.isOptionalField((AUnionType) reqFieldType)) {
- IAType itemType = ((AUnionType) reqFieldType).getUnionList().get(
- NonTaggedFormatUtil.OPTIONAL_TYPE_INDEX_IN_UNION_LIST);
- reqFieldType = itemType;
- if (fieldType.equals(BuiltinType.ANULL) || fieldType.equals(itemType)) {
- fieldPermutation[j] = i;
- openFields[i] = false;
- matched = true;
-
- // rewrite record expr
- if (arg.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
- ScalarFunctionCallExpression scalarFunc = (ScalarFunctionCallExpression) arg;
- rewriteFuncExpr(scalarFunc, reqFieldType, fieldType, env);
- }
- break;
- }
- }
-
- // match the record field: need cast
- if (arg.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
- ScalarFunctionCallExpression scalarFunc = (ScalarFunctionCallExpression) arg;
- rewriteFuncExpr(scalarFunc, reqFieldType, fieldType, env);
- fieldPermutation[j] = i;
- openFields[i] = false;
- matched = true;
- break;
- }
- }
- }
- // the input has extra fields
- if (!matched && !reqType.isOpen())
- throw new AlgebricksException("static type mismatch: including an extra closed field " + fieldName);
- }
-
- // backward match: match from required to actual
- for (int i = 0; i < reqFieldNames.length; i++) {
- String reqFieldName = reqFieldNames[i];
- IAType reqFieldType = reqFieldTypes[i];
- matched = false;
- for (int j = 0; j < inputFieldNames.length; j++) {
- String fieldName = inputFieldNames[j];
- IAType fieldType = inputFieldTypes[j];
- if (!fieldName.equals(reqFieldName))
- continue;
- // should check open field here
- // because number of entries in fieldPermuations is the
- // number of required schema fields
- // here we want to check if an input field is matched
- // the entry index of fieldPermuatons is req field index
- if (!openFields[j]) {
- matched = true;
- break;
- }
-
- // match the optional field
- if (reqFieldType.getTypeTag() == ATypeTag.UNION
- && NonTaggedFormatUtil.isOptionalField((AUnionType) reqFieldType)) {
- IAType itemType = ((AUnionType) reqFieldType).getUnionList().get(
- NonTaggedFormatUtil.OPTIONAL_TYPE_INDEX_IN_UNION_LIST);
- if (fieldType.equals(BuiltinType.ANULL) || fieldType.equals(itemType)) {
- matched = true;
- break;
- }
- }
- }
- if (matched)
- continue;
-
- if (reqFieldType.getTypeTag() == ATypeTag.UNION
- && NonTaggedFormatUtil.isOptionalField((AUnionType) reqFieldType)) {
- // add a null field
- nullFields[i] = true;
- } else {
- // no matched field in the input for a required closed field
- throw new AlgebricksException("static type mismatch: miss a required closed field " + reqFieldName);
- }
- }
-
- List<Mutable<ILogicalExpression>> arguments = func.getArguments();
- List<Mutable<ILogicalExpression>> originalArguments = new ArrayList<Mutable<ILogicalExpression>>();
- originalArguments.addAll(arguments);
- arguments.clear();
- // re-order the closed part and fill in null fields
- for (int i = 0; i < fieldPermutation.length; i++) {
- int pos = fieldPermutation[i];
- if (pos >= 0) {
- arguments.add(originalArguments.get(2 * pos));
- arguments.add(originalArguments.get(2 * pos + 1));
- }
- if (nullFields[i]) {
- // add a null field
- arguments.add(new MutableObject<ILogicalExpression>(new ConstantExpression(new AsterixConstantValue(
- new AString(reqFieldNames[i])))));
- arguments.add(new MutableObject<ILogicalExpression>(new ConstantExpression(new AsterixConstantValue(
- ANull.NULL))));
- }
- }
-
- // add the open part
- for (int i = 0; i < openFields.length; i++) {
- if (openFields[i]) {
- arguments.add(originalArguments.get(2 * i));
- Mutable<ILogicalExpression> fExprRef = originalArguments.get(2 * i + 1);
- ILogicalExpression argExpr = fExprRef.getValue();
-
- // we need to handle open fields recursively by their default
- // types
- // for list, their item type is any
- // for record, their
- if (argExpr.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
- IAType reqFieldType = inputFieldTypes[i];
- if (inputFieldTypes[i].getTypeTag() == ATypeTag.RECORD) {
- reqFieldType = DefaultOpenFieldType.NESTED_OPEN_RECORD_TYPE;
- }
- if (inputFieldTypes[i].getTypeTag() == ATypeTag.ORDEREDLIST) {
- reqFieldType = DefaultOpenFieldType.NESTED_OPEN_AORDERED_LIST_TYPE;
- }
- if (inputFieldTypes[i].getTypeTag() == ATypeTag.UNORDEREDLIST) {
- reqFieldType = DefaultOpenFieldType.NESTED_OPEN_AUNORDERED_LIST_TYPE;
- }
- if (TypeComputerUtilities.getRequiredType((AbstractFunctionCallExpression) argExpr) == null) {
- ScalarFunctionCallExpression argFunc = (ScalarFunctionCallExpression) argExpr;
- rewriteFuncExpr(argFunc, reqFieldType, inputFieldTypes[i], env);
- }
- }
- arguments.add(fExprRef);
- }
- }
- }
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushAggFuncIntoStandaloneAggregateRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushAggFuncIntoStandaloneAggregateRule.java
new file mode 100644
index 0000000..c5a1cb0
--- /dev/null
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushAggFuncIntoStandaloneAggregateRule.java
@@ -0,0 +1,154 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.optimizer.rules;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.commons.lang3.mutable.Mutable;
+import org.apache.commons.lang3.mutable.MutableObject;
+
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalOperator;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.IOptimizationContext;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalExpressionTag;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalOperatorTag;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalVariable;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AggregateFunctionCallExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ConstantExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+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.visitors.VariableUtilities;
+import edu.uci.ics.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule;
+
+/**
+ * Pushes aggregate functions into a stand alone aggregate operator (no group by).
+ */
+public class PushAggFuncIntoStandaloneAggregateRule implements IAlgebraicRewriteRule {
+
+ @Override
+ public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
+ return false;
+ }
+
+ @Override
+ public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
+ throws AlgebricksException {
+ // Pattern to match: assign <-- aggregate <-- !(group-by)
+ AbstractLogicalOperator op = (AbstractLogicalOperator) opRef.getValue();
+ if (op.getOperatorTag() != LogicalOperatorTag.ASSIGN) {
+ return false;
+ }
+ Mutable<ILogicalOperator> opRef2 = op.getInputs().get(0);
+ AbstractLogicalOperator op2 = (AbstractLogicalOperator) opRef2.getValue();
+ if (op2.getOperatorTag() != LogicalOperatorTag.AGGREGATE) {
+ return false;
+ }
+ // If there's a group by below the agg, then we want to have the agg pushed into the group by.
+ Mutable<ILogicalOperator> opRef3 = op2.getInputs().get(0);
+ AbstractLogicalOperator op3 = (AbstractLogicalOperator) opRef3.getValue();
+ if (op3.getOperatorTag() == LogicalOperatorTag.GROUP) {
+ return false;
+ }
+
+ AssignOperator assignOp = (AssignOperator) op;
+ AggregateOperator aggOp = (AggregateOperator) op2;
+ if (aggOp.getVariables().size() != 1) {
+ return false;
+ }
+
+ // Make sure the agg expr is a listify.
+ ILogicalExpression aggExpr = aggOp.getExpressions().get(0).getValue();
+ if (aggExpr.getExpressionTag() != LogicalExpressionTag.FUNCTION_CALL) {
+ return false;
+ }
+ AbstractFunctionCallExpression origAggFuncExpr = (AbstractFunctionCallExpression) aggExpr;
+ if (origAggFuncExpr.getFunctionIdentifier() != AsterixBuiltinFunctions.LISTIFY) {
+ return false;
+ }
+
+ LogicalVariable aggVar = aggOp.getVariables().get(0);
+ List<LogicalVariable> used = new LinkedList<LogicalVariable>();
+ VariableUtilities.getUsedVariables(assignOp, used);
+ if (!used.contains(aggVar)) {
+ return false;
+ }
+
+ Mutable<ILogicalExpression> srcAssignExprRef = fingAggFuncExprRef(assignOp.getExpressions(), aggVar);
+ if (srcAssignExprRef == null) {
+ return false;
+ }
+ AbstractFunctionCallExpression assignFuncExpr = (AbstractFunctionCallExpression) srcAssignExprRef.getValue();
+ FunctionIdentifier aggFuncIdent = AsterixBuiltinFunctions.getAggregateFunction(assignFuncExpr.getFunctionIdentifier());
+
+ // Push the agg func into the agg op.
+ AbstractFunctionCallExpression aggOpExpr = (AbstractFunctionCallExpression) aggOp.getExpressions().get(0).getValue();
+ List<Mutable<ILogicalExpression>> aggArgs = new ArrayList<Mutable<ILogicalExpression>>();
+ aggArgs.add(aggOpExpr.getArguments().get(0));
+ AggregateFunctionCallExpression aggFuncExpr = AsterixBuiltinFunctions.makeAggregateFunctionExpression(aggFuncIdent, aggArgs);
+ aggOp.getExpressions().get(0).setValue(aggFuncExpr);
+
+ // The assign now just "renames" the variable to make sure the upstream plan still works.
+ srcAssignExprRef.setValue(new VariableReferenceExpression(aggVar));
+
+ // Create a new assign for a TRUE variable.
+ LogicalVariable trueVar = context.newVar();
+ AssignOperator trueAssignOp = new AssignOperator(trueVar, new MutableObject<ILogicalExpression>(ConstantExpression.TRUE));
+
+ ILogicalOperator aggInput = aggOp.getInputs().get(0).getValue();
+ aggOp.getInputs().get(0).setValue(trueAssignOp);
+ trueAssignOp.getInputs().add(new MutableObject<ILogicalOperator>(aggInput));
+
+ // Set partitioning variable.
+ aggOp.setPartitioningVariable(trueVar);
+
+ context.computeAndSetTypeEnvironmentForOperator(trueAssignOp);
+ context.computeAndSetTypeEnvironmentForOperator(aggOp);
+ context.computeAndSetTypeEnvironmentForOperator(assignOp);
+
+ return true;
+ }
+
+ private Mutable<ILogicalExpression> fingAggFuncExprRef(List<Mutable<ILogicalExpression>> exprRefs, LogicalVariable aggVar) {
+ for (Mutable<ILogicalExpression> exprRef : exprRefs) {
+ ILogicalExpression expr = exprRef.getValue();
+ if (expr.getExpressionTag() != LogicalExpressionTag.FUNCTION_CALL) {
+ continue;
+ }
+ AbstractFunctionCallExpression funcExpr = (AbstractFunctionCallExpression) expr;
+ FunctionIdentifier funcIdent = AsterixBuiltinFunctions.getAggregateFunction(funcExpr.getFunctionIdentifier());
+ if (funcIdent == null) {
+ // Recursively look in func args.
+ return fingAggFuncExprRef(funcExpr.getArguments(), aggVar);
+ }
+ // Check if this is the expr that uses aggVar.
+ Collection<LogicalVariable> usedVars = new HashSet<LogicalVariable>();
+ funcExpr.getUsedVariables(usedVars);
+ if (usedVars.contains(aggVar)) {
+ return exprRef;
+ }
+ }
+ return null;
+ }
+}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushFieldAccessRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushFieldAccessRule.java
index de0ee38..da96872 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushFieldAccessRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushFieldAccessRule.java
@@ -11,7 +11,6 @@
import edu.uci.ics.asterix.algebra.base.AsterixOperatorAnnotations;
import edu.uci.ics.asterix.common.config.DatasetConfig.DatasetType;
import edu.uci.ics.asterix.common.exceptions.AsterixRuntimeException;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
import edu.uci.ics.asterix.metadata.declared.AqlSourceId;
import edu.uci.ics.asterix.metadata.entities.Dataset;
@@ -115,9 +114,8 @@
return false;
}
AqlMetadataProvider mp = (AqlMetadataProvider) context.getMetadataProvider();
- AqlCompiledMetadataDeclarations metadata = mp.getMetadataDeclarations();
AqlSourceId asid = ((IDataSource<AqlSourceId>) scan.getDataSource()).getId();
- Dataset dataset = metadata.findDataset(asid.getDatasetName());
+ Dataset dataset = mp.findDataset(asid.getDataverseName(), asid.getDatasetName());
if (dataset == null) {
throw new AlgebricksException("Dataset " + asid.getDatasetName() + " not found.");
}
@@ -136,7 +134,7 @@
} else {
int pos = ((AInt32) obj).getIntegerValue();
String tName = dataset.getItemTypeName();
- IAType t = metadata.findType(tName);
+ IAType t = mp.findType(dataset.getDataverseName(), tName);
if (t.getTypeTag() != ATypeTag.RECORD) {
return false;
}
@@ -147,7 +145,7 @@
fldName = rt.getFieldNames()[pos];
}
- List<Index> datasetIndexes = metadata.getDatasetIndexes(dataset.getDataverseName(), dataset.getDatasetName());
+ List<Index> datasetIndexes = mp.getDatasetIndexes(dataset.getDataverseName(), dataset.getDatasetName());
boolean hasSecondaryIndex = false;
for (Index index : datasetIndexes) {
if (index.isSecondaryIndex()) {
@@ -292,8 +290,7 @@
IDataSource<AqlSourceId> dataSource = (IDataSource<AqlSourceId>) scan.getDataSource();
AqlSourceId asid = dataSource.getId();
AqlMetadataProvider mp = (AqlMetadataProvider) context.getMetadataProvider();
- AqlCompiledMetadataDeclarations metadata = mp.getMetadataDeclarations();
- Dataset dataset = metadata.findDataset(asid.getDatasetName());
+ Dataset dataset = mp.findDataset(asid.getDataverseName(), asid.getDatasetName());
if (dataset == null) {
throw new AlgebricksException("Dataset " + asid.getDatasetName() + " not found.");
}
@@ -310,7 +307,7 @@
} else {
int pos = ((AInt32) obj).getIntegerValue();
String tName = dataset.getItemTypeName();
- IAType t = metadata.findType(tName);
+ IAType t = mp.findType(dataset.getDataverseName(), tName);
if (t.getTypeTag() != ATypeTag.RECORD) {
return false;
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushSimilarityFunctionsBelowJoin.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushSimilarityFunctionsBelowJoin.java
new file mode 100644
index 0000000..c1aa1ac
--- /dev/null
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushSimilarityFunctionsBelowJoin.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.optimizer.rules;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.rewriter.rules.PushFunctionsBelowJoin;
+
+/**
+ * Pushes similarity function-call expressions below a join if possible.
+ * Assigns the similarity function-call expressions to new variables, and replaces the original
+ * expression with a corresponding variable reference expression.
+ * This rule can help reduce the cost of computing expensive similarity functions by pushing them below
+ * a join (which may blow up the cardinality).
+ * Also, this rule may help to enable other rules such as common subexpression elimination, again to reduce
+ * the number of calls to expensive similarity functions.
+ *
+ * Example:
+ *
+ * Before plan:
+ * assign [$$10] <- [funcA(funcB(simFuncX($$3, $$4)))]
+ * join (some condition)
+ * join_branch_0 where $$3 and $$4 are not live
+ * ...
+ * join_branch_1 where $$3 and $$4 are live
+ * ...
+ *
+ * After plan:
+ * assign [$$10] <- [funcA(funcB($$11))]
+ * join (some condition)
+ * join_branch_0 where $$3 and $$4 are not live
+ * ...
+ * join_branch_1 where $$3 and $$4 are live
+ * assign[$$11] <- [simFuncX($$3, $$4)]
+ * ...
+ */
+public class PushSimilarityFunctionsBelowJoin extends PushFunctionsBelowJoin {
+
+ private static final Set<FunctionIdentifier> simFuncIdents = new HashSet<FunctionIdentifier>();
+ static {
+ simFuncIdents.add(AsterixBuiltinFunctions.SIMILARITY_JACCARD);
+ simFuncIdents.add(AsterixBuiltinFunctions.SIMILARITY_JACCARD_CHECK);
+ simFuncIdents.add(AsterixBuiltinFunctions.EDIT_DISTANCE);
+ simFuncIdents.add(AsterixBuiltinFunctions.EDIT_DISTANCE_CHECK);
+ }
+
+ public PushSimilarityFunctionsBelowJoin() {
+ super(simFuncIdents);
+ }
+}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/RemoveUnusedOneToOneEquiJoinRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/RemoveUnusedOneToOneEquiJoinRule.java
new file mode 100644
index 0000000..9089c42
--- /dev/null
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/RemoveUnusedOneToOneEquiJoinRule.java
@@ -0,0 +1,211 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.optimizer.rules;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.lang3.mutable.Mutable;
+
+import edu.uci.ics.asterix.metadata.declared.AqlDataSource;
+import edu.uci.ics.asterix.metadata.utils.DatasetUtils;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalOperator;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.IOptimizationContext;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalExpressionTag;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalOperatorTag;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalVariable;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractLogicalExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.AlgebricksBuiltinFunctions;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractBinaryJoinOperator;
+import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator;
+import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.DataSourceScanOperator;
+import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.visitors.VariableUtilities;
+import edu.uci.ics.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule;
+
+/**
+ * Removes join operators for which all of the following conditions are true:
+ * 1. The live variables of one input branch of the join are not used in the upstream plan
+ * 2. The join is an inner equi join
+ * 3. The join condition only uses variables that correspond to primary keys of the same dataset
+ * Notice that the last condition implies a 1:1 join, i.e., the join does not change the result cardinality.
+ *
+ * Joins that satisfy the above conditions may be introduced by other rules
+ * which use surrogate optimizations. Such an optimization aims to reduce data copies and communication costs by
+ * using the primary keys as surrogates for the desired data items. Typically,
+ * such a surrogate-based plan introduces a top-level join to finally resolve
+ * the surrogates to the desired data items.
+ * In case the upstream plan does not require the original data items at all, such a top-level join is unnecessary.
+ * The purpose of this rule is to remove such unnecessary joins.
+ */
+public class RemoveUnusedOneToOneEquiJoinRule implements IAlgebraicRewriteRule {
+
+ private final Set<LogicalVariable> parentsUsedVars = new HashSet<LogicalVariable>();
+ private final List<LogicalVariable> usedVars = new ArrayList<LogicalVariable>();
+ private final List<LogicalVariable> liveVars = new ArrayList<LogicalVariable>();
+ private final List<LogicalVariable> pkVars = new ArrayList<LogicalVariable>();
+ private final List<DataSourceScanOperator> dataScans = new ArrayList<DataSourceScanOperator>();
+ private boolean hasRun = false;
+
+ @Override
+ public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
+ if (hasRun) {
+ return false;
+ }
+ hasRun = true;
+ if (removeUnusedJoin(opRef)) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
+ throws AlgebricksException {
+ return false;
+ }
+
+ private boolean removeUnusedJoin(Mutable<ILogicalOperator> opRef) throws AlgebricksException {
+ AbstractLogicalOperator op = (AbstractLogicalOperator) opRef.getValue();
+ boolean modified = false;
+
+ usedVars.clear();
+ VariableUtilities.getUsedVariables(op, usedVars);
+ // Propagate used variables from parents downwards.
+ parentsUsedVars.addAll(usedVars);
+
+ int numInputs = op.getInputs().size();
+ for (int i = 0; i < numInputs; i++) {
+ Mutable<ILogicalOperator> childOpRef = op.getInputs().get(i);
+ int unusedJoinBranchIndex = removeJoinFromInputBranch(childOpRef);
+ if (unusedJoinBranchIndex >= 0) {
+ int usedBranchIndex = (unusedJoinBranchIndex == 0) ? 1 : 0;
+ // Remove join at input index i, by hooking up op's input i with
+ // the join's branch at unusedJoinBranchIndex.
+ AbstractBinaryJoinOperator joinOp = (AbstractBinaryJoinOperator) childOpRef.getValue();
+ op.getInputs().set(i, joinOp.getInputs().get(usedBranchIndex));
+ modified = true;
+ }
+ // Descend into children.
+ if (removeUnusedJoin(childOpRef)) {
+ modified = true;
+ }
+ }
+ return modified;
+ }
+
+ private int removeJoinFromInputBranch(Mutable<ILogicalOperator> opRef) throws AlgebricksException {
+ AbstractLogicalOperator op = (AbstractLogicalOperator) opRef.getValue();
+ if (op.getOperatorTag() != LogicalOperatorTag.INNERJOIN) {
+ return -1;
+ }
+
+ AbstractBinaryJoinOperator joinOp = (AbstractBinaryJoinOperator) op;
+ // Make sure the join is an equi-join.
+ if (!isEquiJoin(joinOp.getCondition())) {
+ return -1;
+ }
+
+ int unusedJoinBranchIndex = -1;
+ for (int i = 0; i < joinOp.getInputs().size(); i++) {
+ liveVars.clear();
+ VariableUtilities.getLiveVariables(joinOp.getInputs().get(i).getValue(), liveVars);
+ liveVars.retainAll(parentsUsedVars);
+ if (liveVars.isEmpty()) {
+ // None of the live variables from this branch are used by its parents.
+ unusedJoinBranchIndex = i;
+ break;
+ }
+ }
+ if (unusedJoinBranchIndex < 0) {
+ // The variables from both branches are used in the upstream plan. We cannot remove this join.
+ return -1;
+ }
+
+ // Check whether one of the join branches is unused.
+ usedVars.clear();
+ VariableUtilities.getUsedVariables(joinOp, usedVars);
+
+ // Check whether all used variables originate from primary keys of exactly the same dataset.
+ // Collect a list of datascans whose primary key variables are used in the join condition.
+ gatherProducingDataScans(opRef, usedVars, dataScans);
+
+ // Check that all datascans scan the same dataset, and that the join condition
+ // only used primary key variables of those datascans.
+ for (int i = 0; i < dataScans.size(); i++) {
+ if (i > 0) {
+ AqlDataSource prevAqlDataSource = (AqlDataSource) dataScans.get(i - 1).getDataSource();
+ AqlDataSource currAqlDataSource = (AqlDataSource) dataScans.get(i).getDataSource();
+ if (!prevAqlDataSource.getDataset().equals(currAqlDataSource.getDataset())) {
+ return -1;
+ }
+ }
+ // Remove from the used variables all the primary key vars of this dataset.
+ fillPKVars(dataScans.get(i), pkVars);
+ usedVars.removeAll(pkVars);
+ }
+ if (!usedVars.isEmpty()) {
+ // The join condition also uses some other variables that are not primary
+ // keys from datasource scans of the same dataset.
+ return -1;
+ }
+ return unusedJoinBranchIndex;
+ }
+
+ private void gatherProducingDataScans(Mutable<ILogicalOperator> opRef, List<LogicalVariable> joinUsedVars,
+ List<DataSourceScanOperator> dataScans) {
+ AbstractLogicalOperator op = (AbstractLogicalOperator) opRef.getValue();
+ if (op.getOperatorTag() != LogicalOperatorTag.DATASOURCESCAN) {
+ for (Mutable<ILogicalOperator> inputOp : op.getInputs()) {
+ gatherProducingDataScans(inputOp, joinUsedVars, dataScans);
+ }
+ return;
+ }
+ DataSourceScanOperator dataScan = (DataSourceScanOperator) op;
+ fillPKVars(dataScan, pkVars);
+ // Check if join uses all PK vars.
+ if (joinUsedVars.containsAll(pkVars)) {
+ dataScans.add(dataScan);
+ }
+ }
+
+ private void fillPKVars(DataSourceScanOperator dataScan, List<LogicalVariable> pkVars) {
+ pkVars.clear();
+ AqlDataSource aqlDataSource = (AqlDataSource) dataScan.getDataSource();
+ int numPKs = DatasetUtils.getPartitioningKeys(aqlDataSource.getDataset()).size();
+ pkVars.clear();
+ for (int i = 0; i < numPKs; i++) {
+ pkVars.add(dataScan.getVariables().get(i));
+ }
+ }
+
+ private boolean isEquiJoin(Mutable<ILogicalExpression> conditionExpr) {
+ AbstractLogicalExpression expr = (AbstractLogicalExpression) conditionExpr.getValue();
+ if (expr.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
+ AbstractFunctionCallExpression funcExpr = (AbstractFunctionCallExpression) expr;
+ FunctionIdentifier funcIdent = funcExpr.getFunctionIdentifier();
+ if (funcIdent != AlgebricksBuiltinFunctions.AND && funcIdent != AlgebricksBuiltinFunctions.EQ) {
+ return false;
+ }
+ }
+ return true;
+ }
+}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SetAsterixPhysicalOperatorsRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SetAsterixPhysicalOperatorsRule.java
index 74f790f..19791e3 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SetAsterixPhysicalOperatorsRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SetAsterixPhysicalOperatorsRule.java
@@ -14,6 +14,7 @@
import edu.uci.ics.asterix.metadata.declared.AqlSourceId;
import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.optimizer.rules.am.AccessMethodJobGenParams;
+import edu.uci.ics.asterix.optimizer.rules.am.BTreeJobGenParams;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
@@ -149,8 +150,8 @@
AccessMethodJobGenParams jobGenParams = new AccessMethodJobGenParams();
jobGenParams.readFromFuncArgs(f.getArguments());
AqlMetadataProvider mp = (AqlMetadataProvider) context.getMetadataProvider();
- String dataverseName = mp.getMetadataDeclarations().getDataverseName();
- AqlSourceId dataSourceId = new AqlSourceId(dataverseName, jobGenParams.getDatasetName());
+ AqlSourceId dataSourceId = new AqlSourceId(jobGenParams.getDataverseName(),
+ jobGenParams.getDatasetName());
IDataSourceIndex<String, AqlSourceId> dsi = mp.findDataSourceIndex(jobGenParams.getIndexName(),
dataSourceId);
if (dsi == null) {
@@ -161,7 +162,11 @@
boolean requiresBroadcast = jobGenParams.getRequiresBroadcast();
switch (indexType) {
case BTREE: {
- op.setPhysicalOperator(new BTreeSearchPOperator(dsi, requiresBroadcast));
+ BTreeJobGenParams btreeJobGenParams = new BTreeJobGenParams();
+ btreeJobGenParams.readFromFuncArgs(f.getArguments());
+ op.setPhysicalOperator(new BTreeSearchPOperator(dsi, requiresBroadcast,
+ btreeJobGenParams.isPrimaryIndex(), btreeJobGenParams.getLowKeyVarList(),
+ btreeJobGenParams.getHighKeyVarList()));
break;
}
case RTREE: {
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SetClosedRecordConstructorsRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SetClosedRecordConstructorsRule.java
index 0e7a220..3dad464 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SetClosedRecordConstructorsRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SetClosedRecordConstructorsRule.java
@@ -92,47 +92,55 @@
boolean changed = false;
if (expr.getFunctionIdentifier().equals(AsterixBuiltinFunctions.OPEN_RECORD_CONSTRUCTOR)) {
ARecordType reqType = (ARecordType) TypeComputerUtilities.getRequiredType(expr);
- if (reqType != null) {
- if (reqType.isOpen())
- allClosed = false;
- }
- int n = expr.getArguments().size();
- if (n % 2 > 0) {
- throw new AlgebricksException("Record constructor expected to have an even number of arguments: "
- + expr);
- }
- for (int i = 0; i < n / 2; i++) {
- ILogicalExpression a0 = expr.getArguments().get(2 * i).getValue();
- if (a0.getExpressionTag() != LogicalExpressionTag.CONSTANT) {
- allClosed = false;
+ if (reqType == null || !reqType.isOpen()) {
+ int n = expr.getArguments().size();
+ if (n % 2 > 0) {
+ throw new AlgebricksException(
+ "Record constructor expected to have an even number of arguments: " + expr);
}
- Mutable<ILogicalExpression> aRef1 = expr.getArguments().get(2 * i + 1);
- ILogicalExpression a1 = aRef1.getValue();
- ClosedDataInfo cdi = a1.accept(this, arg);
- if (!cdi.dataIsClosed) {
- allClosed = false;
+ for (int i = 0; i < n / 2; i++) {
+ ILogicalExpression a0 = expr.getArguments().get(2 * i).getValue();
+ if (a0.getExpressionTag() != LogicalExpressionTag.CONSTANT) {
+ allClosed = false;
+ }
+ Mutable<ILogicalExpression> aRef1 = expr.getArguments().get(2 * i + 1);
+ ILogicalExpression a1 = aRef1.getValue();
+ ClosedDataInfo cdi = a1.accept(this, arg);
+ if (!cdi.dataIsClosed) {
+ allClosed = false;
+ }
+ if (cdi.expressionChanged) {
+ aRef1.setValue(cdi.expression);
+ changed = true;
+ }
}
- if (cdi.expressionChanged) {
- aRef1.setValue(cdi.expression);
+ if (allClosed) {
+ expr.setFunctionInfo(FunctionUtils
+ .getFunctionInfo(AsterixBuiltinFunctions.CLOSED_RECORD_CONSTRUCTOR));
+ GlobalConfig.ASTERIX_LOGGER.finest("Switching to CLOSED record constructor in " + expr + ".\n");
changed = true;
}
}
- if (allClosed) {
- expr.setFunctionInfo(FunctionUtils
- .getFunctionInfo(AsterixBuiltinFunctions.CLOSED_RECORD_CONSTRUCTOR));
- GlobalConfig.ASTERIX_LOGGER.finest("Switching to CLOSED record constructor in " + expr + ".\n");
- changed = true;
- }
} else {
- for (Mutable<ILogicalExpression> e : expr.getArguments()) {
- ILogicalExpression ale = e.getValue();
- ClosedDataInfo cdi = ale.accept(this, arg);
- if (!cdi.dataIsClosed) {
- allClosed = false;
+ boolean rewrite = true;
+ if (expr.getFunctionIdentifier().equals(AsterixBuiltinFunctions.ORDERED_LIST_CONSTRUCTOR)
+ || (expr.getFunctionIdentifier().equals(AsterixBuiltinFunctions.UNORDERED_LIST_CONSTRUCTOR))) {
+ IAType reqType = TypeComputerUtilities.getRequiredType(expr);
+ if (reqType == null) {
+ rewrite = false;
}
- if (cdi.expressionChanged) {
- e.setValue(cdi.expression);
- changed = true;
+ }
+ if (rewrite) {
+ for (Mutable<ILogicalExpression> e : expr.getArguments()) {
+ ILogicalExpression ale = e.getValue();
+ ClosedDataInfo cdi = ale.accept(this, arg);
+ if (!cdi.dataIsClosed) {
+ allClosed = false;
+ }
+ if (cdi.expressionChanged) {
+ e.setValue(cdi.expression);
+ changed = true;
+ }
}
}
}
@@ -142,7 +150,12 @@
@Override
public ClosedDataInfo visitVariableReferenceExpression(VariableReferenceExpression expr, Void arg)
throws AlgebricksException {
- boolean dataIsClosed = isClosedRec((IAType) env.getVarType(expr.getVariableReference()));
+ Object varType = env.getVarType(expr.getVariableReference());
+ if (varType == null) {
+ throw new AlgebricksException("Could not infer type for variable '" + expr.getVariableReference()
+ + "'.");
+ }
+ boolean dataIsClosed = isClosedRec((IAType) varType);
return new ClosedDataInfo(false, dataIsClosed, expr);
}
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 60e5a3e..e88e5b0 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
@@ -7,8 +7,10 @@
import org.apache.commons.lang3.mutable.MutableObject;
import edu.uci.ics.asterix.aql.util.FunctionUtils;
+import edu.uci.ics.asterix.om.base.ADouble;
import edu.uci.ics.asterix.om.base.AFloat;
import edu.uci.ics.asterix.om.base.AInt32;
+import edu.uci.ics.asterix.om.base.IAObject;
import edu.uci.ics.asterix.om.constants.AsterixConstantValue;
import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -31,35 +33,38 @@
/**
* Looks for a select operator, containing a condition:
- *
* similarity-function GE/GT/LE/LE constant/variable
- *
* Rewrites the select condition (and possibly the assign expr) with the equivalent similarity-check function.
- *
*/
public class SimilarityCheckRule implements IAlgebraicRewriteRule {
@Override
- public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
- AbstractLogicalOperator op = (AbstractLogicalOperator) opRef.getValue();
+ public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
+ throws AlgebricksException {
+ AbstractLogicalOperator op = (AbstractLogicalOperator) opRef.getValue();
// Look for select.
if (op.getOperatorTag() != LogicalOperatorTag.SELECT) {
return false;
}
SelectOperator select = (SelectOperator) op;
Mutable<ILogicalExpression> condExpr = select.getCondition();
-
+
// 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);
- childOp = (AbstractLogicalOperator) childOp.getInputs().get(0).getValue();
+ assigns.add((AssignOperator) childOp);
+ childOp = (AbstractLogicalOperator) childOp.getInputs().get(0).getValue();
}
return replaceSelectConditionExprs(condExpr, assigns, context);
}
- private boolean replaceSelectConditionExprs(Mutable<ILogicalExpression> expRef, List<AssignOperator> assigns, IOptimizationContext context) throws AlgebricksException {
+ private boolean replaceSelectConditionExprs(Mutable<ILogicalExpression> expRef, List<AssignOperator> assigns,
+ IOptimizationContext context) throws AlgebricksException {
ILogicalExpression expr = expRef.getValue();
if (expr.getExpressionTag() != LogicalExpressionTag.FUNCTION_CALL) {
return false;
@@ -77,10 +82,10 @@
}
return found;
}
-
+
// Look for GE/GT/LE/LT.
- if (funcIdent != AlgebricksBuiltinFunctions.GE && funcIdent != AlgebricksBuiltinFunctions.GT &&
- funcIdent != AlgebricksBuiltinFunctions.LE && funcIdent != AlgebricksBuiltinFunctions.LT) {
+ if (funcIdent != AlgebricksBuiltinFunctions.GE && funcIdent != AlgebricksBuiltinFunctions.GT
+ && funcIdent != AlgebricksBuiltinFunctions.LE && funcIdent != AlgebricksBuiltinFunctions.LT) {
return false;
}
@@ -92,8 +97,8 @@
// Normalized GE/GT/LE/LT as if constant was on the right hand side.
FunctionIdentifier normFuncIdent = null;
// One of the args must be a constant.
- if (arg1.getExpressionTag() == LogicalExpressionTag.CONSTANT) {
- ConstantExpression constExpr = (ConstantExpression) arg1;
+ if (arg1.getExpressionTag() == LogicalExpressionTag.CONSTANT) {
+ ConstantExpression constExpr = (ConstantExpression) arg1;
constVal = (AsterixConstantValue) constExpr.getValue();
nonConstExpr = arg2;
// Get func ident as if swapping lhs and rhs.
@@ -107,91 +112,101 @@
} else {
return false;
}
-
+
// The other arg is a function call. We can directly replace the select condition with an equivalent similarity check expression.
if (nonConstExpr.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
- return replaceWithFunctionCallArg(expRef, normFuncIdent, constVal, (AbstractFunctionCallExpression) nonConstExpr);
+ return replaceWithFunctionCallArg(expRef, normFuncIdent, constVal,
+ (AbstractFunctionCallExpression) nonConstExpr);
}
// The other arg ist a variable. We may have to introduce an assign operator that assigns the result of a similarity-check function to a variable.
if (nonConstExpr.getExpressionTag() == LogicalExpressionTag.VARIABLE) {
- return replaceWithVariableArg(expRef, normFuncIdent, constVal, (VariableReferenceExpression) nonConstExpr, assigns, context);
+ return replaceWithVariableArg(expRef, normFuncIdent, constVal, (VariableReferenceExpression) nonConstExpr,
+ assigns, context);
}
return false;
}
-
+
private boolean replaceWithVariableArg(Mutable<ILogicalExpression> expRef, FunctionIdentifier normFuncIdent,
- AsterixConstantValue constVal, VariableReferenceExpression varRefExpr, List<AssignOperator> assigns, IOptimizationContext context) throws AlgebricksException {
-
- // Find variable in assigns to determine its originating function.
- LogicalVariable var = varRefExpr.getVariableReference();
- Mutable<ILogicalExpression> simFuncExprRef = null;
- ScalarFunctionCallExpression simCheckFuncExpr = null;
- AssignOperator matchingAssign = null;
- for (int i = 0; i < assigns.size(); i++) {
- AssignOperator assign = assigns.get(i);
- for (int j = 0; j < assign.getVariables().size(); j++) {
- // Check if variables match.
- if (var != assign.getVariables().get(j)) {
- continue;
- }
- // Check if corresponding expr is a function call.
- if (assign.getExpressions().get(j).getValue().getExpressionTag() != LogicalExpressionTag.FUNCTION_CALL) {
- continue;
- }
- simFuncExprRef = assign.getExpressions().get(j);
- // Analyze function expression and get equivalent similarity check function.
- simCheckFuncExpr = getSimilarityCheckExpr(normFuncIdent, constVal, (AbstractFunctionCallExpression) simFuncExprRef.getValue());
- matchingAssign = assign;
- break;
- }
- if (simCheckFuncExpr != null) {
- break;
- }
- }
-
- // Only non-null if we found that varRefExpr refers to an optimizable similarity function call.
- if (simCheckFuncExpr != null) {
- // Create a new assign under matchingAssign which assigns the result of our similarity-check function to a variable.
- LogicalVariable newVar = context.newVar();
- AssignOperator newAssign = new AssignOperator(newVar, new MutableObject<ILogicalExpression>(simCheckFuncExpr));
- // Hook up inputs.
- newAssign.getInputs().add(new MutableObject<ILogicalOperator>(matchingAssign.getInputs().get(0).getValue()));
- matchingAssign.getInputs().get(0).setValue(newAssign);
-
- // Replace select condition with a get-item on newVar.
+ AsterixConstantValue constVal, VariableReferenceExpression varRefExpr, List<AssignOperator> assigns,
+ IOptimizationContext context) throws AlgebricksException {
+
+ // Find variable in assigns to determine its originating function.
+ LogicalVariable var = varRefExpr.getVariableReference();
+ Mutable<ILogicalExpression> simFuncExprRef = null;
+ ScalarFunctionCallExpression simCheckFuncExpr = null;
+ AssignOperator matchingAssign = null;
+ for (int i = 0; i < assigns.size(); i++) {
+ AssignOperator assign = assigns.get(i);
+ for (int j = 0; j < assign.getVariables().size(); j++) {
+ // Check if variables match.
+ if (var != assign.getVariables().get(j)) {
+ continue;
+ }
+ // Check if corresponding expr is a function call.
+ if (assign.getExpressions().get(j).getValue().getExpressionTag() != LogicalExpressionTag.FUNCTION_CALL) {
+ continue;
+ }
+ simFuncExprRef = assign.getExpressions().get(j);
+ // Analyze function expression and get equivalent similarity check function.
+ simCheckFuncExpr = getSimilarityCheckExpr(normFuncIdent, constVal,
+ (AbstractFunctionCallExpression) simFuncExprRef.getValue());
+ matchingAssign = assign;
+ break;
+ }
+ if (simCheckFuncExpr != null) {
+ break;
+ }
+ }
+
+ // Only non-null if we found that varRefExpr refers to an optimizable similarity function call.
+ if (simCheckFuncExpr != null) {
+ // Create a new assign under matchingAssign which assigns the result of our similarity-check function to a variable.
+ LogicalVariable newVar = context.newVar();
+ AssignOperator newAssign = new AssignOperator(newVar, new MutableObject<ILogicalExpression>(
+ simCheckFuncExpr));
+ // Hook up inputs.
+ newAssign.getInputs()
+ .add(new MutableObject<ILogicalOperator>(matchingAssign.getInputs().get(0).getValue()));
+ matchingAssign.getInputs().get(0).setValue(newAssign);
+
+ // Replace select condition with a get-item on newVar.
List<Mutable<ILogicalExpression>> selectGetItemArgs = new ArrayList<Mutable<ILogicalExpression>>();
// First arg is a variable reference expr on newVar.
selectGetItemArgs.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(newVar)));
// Second arg is the item index to be accessed, here 0.
- selectGetItemArgs.add(new MutableObject<ILogicalExpression>(new ConstantExpression(new AsterixConstantValue(new AInt32(0)))));
- ILogicalExpression selectGetItemExpr = new ScalarFunctionCallExpression(FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.GET_ITEM), selectGetItemArgs);
+ selectGetItemArgs.add(new MutableObject<ILogicalExpression>(new ConstantExpression(
+ new AsterixConstantValue(new AInt32(0)))));
+ ILogicalExpression selectGetItemExpr = new ScalarFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.GET_ITEM), selectGetItemArgs);
// Replace the old similarity function call with the new getItemExpr.
expRef.setValue(selectGetItemExpr);
-
+
// Replace expr corresponding to original variable in the original assign with a get-item on newVar.
List<Mutable<ILogicalExpression>> assignGetItemArgs = new ArrayList<Mutable<ILogicalExpression>>();
// First arg is a variable reference expr on newVar.
assignGetItemArgs.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(newVar)));
// Second arg is the item index to be accessed, here 1.
- assignGetItemArgs.add(new MutableObject<ILogicalExpression>(new ConstantExpression(new AsterixConstantValue(new AInt32(1)))));
- ILogicalExpression assignGetItemExpr = new ScalarFunctionCallExpression(FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.GET_ITEM), assignGetItemArgs);
+ assignGetItemArgs.add(new MutableObject<ILogicalExpression>(new ConstantExpression(
+ new AsterixConstantValue(new AInt32(1)))));
+ ILogicalExpression assignGetItemExpr = new ScalarFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.GET_ITEM), assignGetItemArgs);
// Replace the original assign expr with the get-item expr.
simFuncExprRef.setValue(assignGetItemExpr);
-
+
context.computeAndSetTypeEnvironmentForOperator(newAssign);
context.computeAndSetTypeEnvironmentForOperator(matchingAssign);
-
- return true;
- }
-
- return false;
+
+ return true;
+ }
+
+ return false;
}
-
+
private boolean replaceWithFunctionCallArg(Mutable<ILogicalExpression> expRef, FunctionIdentifier normFuncIdent,
- AsterixConstantValue constVal, AbstractFunctionCallExpression funcExpr) {
- // Analyze func expr to see if it is an optimizable similarity function.
- ScalarFunctionCallExpression simCheckFuncExpr = getSimilarityCheckExpr(normFuncIdent, constVal, funcExpr);
-
+ AsterixConstantValue constVal, AbstractFunctionCallExpression funcExpr) {
+ // Analyze func expr to see if it is an optimizable similarity function.
+ ScalarFunctionCallExpression simCheckFuncExpr = getSimilarityCheckExpr(normFuncIdent, constVal, funcExpr);
+
// Replace the expr in the select condition.
if (simCheckFuncExpr != null) {
// Get item 0 from var.
@@ -199,8 +214,10 @@
// First arg is the similarity-check function call.
getItemArgs.add(new MutableObject<ILogicalExpression>(simCheckFuncExpr));
// Second arg is the item index to be accessed.
- getItemArgs.add(new MutableObject<ILogicalExpression>(new ConstantExpression(new AsterixConstantValue(new AInt32(0)))));
- ILogicalExpression getItemExpr = new ScalarFunctionCallExpression(FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.GET_ITEM), getItemArgs);
+ getItemArgs.add(new MutableObject<ILogicalExpression>(new ConstantExpression(new AsterixConstantValue(
+ new AInt32(0)))));
+ ILogicalExpression getItemExpr = new ScalarFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.GET_ITEM), getItemArgs);
// Replace the old similarity function call with the new getItemExpr.
expRef.setValue(getItemExpr);
return true;
@@ -208,20 +225,29 @@
return false;
}
-
+
private ScalarFunctionCallExpression getSimilarityCheckExpr(FunctionIdentifier normFuncIdent,
- AsterixConstantValue constVal, AbstractFunctionCallExpression funcExpr) {
- // Remember args from original similarity function to add them to the similarity-check function later.
+ AsterixConstantValue constVal, AbstractFunctionCallExpression funcExpr) {
+ // Remember args from original similarity function to add them to the similarity-check function later.
ArrayList<Mutable<ILogicalExpression>> similarityArgs = null;
ScalarFunctionCallExpression simCheckFuncExpr = null;
// Look for jaccard function call, and GE or GT.
if (funcExpr.getFunctionIdentifier() == AsterixBuiltinFunctions.SIMILARITY_JACCARD) {
- AFloat aFloat = (AFloat) constVal.getObject();
- AFloat jaccThresh;
- if (normFuncIdent == AlgebricksBuiltinFunctions.GE) {
- jaccThresh = aFloat;
+ IAObject jaccThresh;
+ if (normFuncIdent == AlgebricksBuiltinFunctions.GE) {
+ if (constVal.getObject() instanceof AFloat) {
+ jaccThresh = constVal.getObject();
+ } else {
+ jaccThresh = new AFloat((float)((ADouble) constVal.getObject()).getDoubleValue());
+ }
} else if (normFuncIdent == AlgebricksBuiltinFunctions.GT) {
- float f = aFloat.getFloatValue() + Float.MIN_VALUE;
+ float threshVal = 0.0f;
+ if (constVal.getObject() instanceof AFloat) {
+ threshVal = ((AFloat) constVal.getObject()).getFloatValue();
+ } else {
+ threshVal = (float)((ADouble) constVal.getObject()).getDoubleValue();
+ }
+ float f = threshVal + Float.MIN_VALUE;
if (f > 1.0f) f = 1.0f;
jaccThresh = new AFloat(f);
} else {
@@ -253,9 +279,13 @@
simCheckFuncExpr = new ScalarFunctionCallExpression(
FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.EDIT_DISTANCE_CHECK), similarityArgs);
}
+ // Preserve all annotations.
+ if (simCheckFuncExpr != null) {
+ simCheckFuncExpr.getAnnotations().putAll(funcExpr.getAnnotations());
+ }
return simCheckFuncExpr;
}
-
+
private FunctionIdentifier getLhsAndRhsSwappedFuncIdent(FunctionIdentifier oldFuncIdent) {
if (oldFuncIdent == AlgebricksBuiltinFunctions.GE) {
return AlgebricksBuiltinFunctions.LE;
@@ -271,7 +301,7 @@
}
throw new IllegalStateException();
}
-
+
@Override
public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
return false;
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/UnnestToDataScanRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/UnnestToDataScanRule.java
index f25a671..34c5739 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/UnnestToDataScanRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/UnnestToDataScanRule.java
@@ -6,12 +6,12 @@
import org.apache.commons.lang3.mutable.Mutable;
import edu.uci.ics.asterix.common.config.DatasetConfig.DatasetType;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
import edu.uci.ics.asterix.metadata.declared.AqlDataSource;
import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
import edu.uci.ics.asterix.metadata.declared.AqlSourceId;
import edu.uci.ics.asterix.metadata.declared.ExternalFeedDataSource;
import edu.uci.ics.asterix.metadata.entities.Dataset;
+import edu.uci.ics.asterix.metadata.entities.Dataverse;
import edu.uci.ics.asterix.metadata.utils.DatasetUtils;
import edu.uci.ics.asterix.om.base.AString;
import edu.uci.ics.asterix.om.constants.AsterixConstantValue;
@@ -19,6 +19,7 @@
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.IOptimizationContext;
@@ -73,16 +74,19 @@
if (acv2.getObject().getType().getTypeTag() != ATypeTag.STRING) {
return false;
}
- String datasetName = ((AString) acv2.getObject()).getStringValue();
+ String datasetArg = ((AString) acv2.getObject()).getStringValue();
- AqlMetadataProvider mp = (AqlMetadataProvider) context.getMetadataProvider();
- AqlCompiledMetadataDeclarations metadata = mp.getMetadataDeclarations();
- Dataset dataset = metadata.findDataset(datasetName);
+ AqlMetadataProvider metadataProvider = (AqlMetadataProvider) context.getMetadataProvider();
+ Pair<String, String> datasetReference = parseDatasetReference(metadataProvider, datasetArg);
+ String dataverseName = datasetReference.first;
+ String datasetName = datasetReference.second;
+ Dataset dataset = metadataProvider.findDataset(dataverseName, datasetName);
if (dataset == null) {
- throw new AlgebricksException("Could not find dataset " + datasetName);
+ throw new AlgebricksException("Could not find dataset " + datasetName + " in dataverse "
+ + dataverseName);
}
- AqlSourceId asid = new AqlSourceId(metadata.getDataverseName(), datasetName);
+ AqlSourceId asid = new AqlSourceId(dataverseName, datasetName);
ArrayList<LogicalVariable> v = new ArrayList<LogicalVariable>();
@@ -94,7 +98,7 @@
}
v.add(unnest.getVariable());
- DataSourceScanOperator scan = new DataSourceScanOperator(v, mp.findDataSource(asid));
+ DataSourceScanOperator scan = new DataSourceScanOperator(v, metadataProvider.findDataSource(asid));
List<Mutable<ILogicalOperator>> scanInpList = scan.getInputs();
scanInpList.addAll(unnest.getInputs());
opRef.setValue(scan);
@@ -121,12 +125,13 @@
if (acv2.getObject().getType().getTypeTag() != ATypeTag.STRING) {
return false;
}
- String datasetName = ((AString) acv2.getObject()).getStringValue();
+ String datasetArg = ((AString) acv2.getObject()).getStringValue();
- AqlMetadataProvider mp = (AqlMetadataProvider) context.getMetadataProvider();
- AqlCompiledMetadataDeclarations metadata = mp.getMetadataDeclarations();
- Dataset dataset = metadata.findDataset(datasetName);
-
+ AqlMetadataProvider metadataProvider = (AqlMetadataProvider) context.getMetadataProvider();
+ Pair<String, String> datasetReference = parseDatasetReference(metadataProvider, datasetArg);
+ String dataverseName = datasetReference.first;
+ String datasetName = datasetReference.second;
+ Dataset dataset = metadataProvider.findDataset(dataverseName, datasetName);
if (dataset == null) {
throw new AlgebricksException("Could not find dataset " + datasetName);
}
@@ -135,20 +140,12 @@
throw new IllegalArgumentException("invalid dataset type:" + dataset.getDatasetType());
}
- AqlSourceId asid = new AqlSourceId(metadata.getDataverseName(), datasetName);
-
+ AqlSourceId asid = new AqlSourceId(dataverseName, datasetName);
ArrayList<LogicalVariable> v = new ArrayList<LogicalVariable>();
-
- /*
- int numPrimaryKeys = DatasetUtils.getPartitioningFunctions(acdd).size();
- for (int i = 0; i < numPrimaryKeys; i++) {
- v.add(context.newVar());
- }*/
-
v.add(unnest.getVariable());
DataSourceScanOperator scan = new DataSourceScanOperator(v, createDummyFeedDataSource(asid, dataset,
- metadata));
+ metadataProvider));
List<Mutable<ILogicalOperator>> scanInpList = scan.getInputs();
scanInpList.addAll(unnest.getInputs());
@@ -163,18 +160,6 @@
return false;
}
- private AqlDataSource createDummyFeedDataSource(AqlSourceId aqlId, Dataset dataset,
- AqlCompiledMetadataDeclarations metadata) throws AlgebricksException {
- if (!aqlId.getDataverseName().equals(metadata.getDataverseName())) {
- return null;
- }
- String tName = dataset.getItemTypeName();
- IAType itemType = metadata.findType(tName);
- ExternalFeedDataSource extDataSource = new ExternalFeedDataSource(aqlId, dataset, itemType,
- AqlDataSource.AqlDataSourceType.EXTERNAL_FEED);
- return extDataSource;
- }
-
public void addPrimaryKey(List<LogicalVariable> scanVariables, IOptimizationContext context) {
int n = scanVariables.size();
List<LogicalVariable> head = new ArrayList<LogicalVariable>(scanVariables.subList(0, n - 1));
@@ -183,4 +168,37 @@
FunctionalDependency pk = new FunctionalDependency(head, tail);
context.addPrimaryKey(pk);
}
+
+ private AqlDataSource createDummyFeedDataSource(AqlSourceId aqlId, Dataset dataset,
+ AqlMetadataProvider metadataProvider) throws AlgebricksException {
+ if (!aqlId.getDataverseName().equals(
+ metadataProvider.getDefaultDataverse() == null ? null : metadataProvider.getDefaultDataverse()
+ .getDataverseName())) {
+ return null;
+ }
+ String tName = dataset.getItemTypeName();
+ IAType itemType = metadataProvider.findType(dataset.getDataverseName(), tName);
+ ExternalFeedDataSource extDataSource = new ExternalFeedDataSource(aqlId, dataset, itemType,
+ AqlDataSource.AqlDataSourceType.EXTERNAL_FEED);
+ return extDataSource;
+ }
+
+ private Pair<String, String> parseDatasetReference(AqlMetadataProvider metadataProvider, String datasetArg)
+ throws AlgebricksException {
+ String[] datasetNameComponents = datasetArg.split("\\.");
+ String dataverseName;
+ String datasetName;
+ if (datasetNameComponents.length == 1) {
+ Dataverse defaultDataverse = metadataProvider.getDefaultDataverse();
+ if (defaultDataverse == null) {
+ throw new AlgebricksException("Unresolved dataset " + datasetArg + " Dataverse not specified.");
+ }
+ dataverseName = defaultDataverse.getDataverseName();
+ datasetName = datasetNameComponents[0];
+ } else {
+ dataverseName = datasetNameComponents[0];
+ datasetName = datasetNameComponents[1];
+ }
+ return new Pair<String, String>(dataverseName, datasetName);
+ }
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AbstractIntroduceAccessMethodRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AbstractIntroduceAccessMethodRule.java
index b378ed7..8bfef17 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AbstractIntroduceAccessMethodRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AbstractIntroduceAccessMethodRule.java
@@ -7,7 +7,6 @@
import org.apache.commons.lang3.mutable.Mutable;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
import edu.uci.ics.asterix.metadata.entities.Dataset;
import edu.uci.ics.asterix.metadata.entities.Index;
@@ -37,7 +36,7 @@
*/
public abstract class AbstractIntroduceAccessMethodRule implements IAlgebraicRewriteRule {
- private AqlCompiledMetadataDeclarations metadata;
+ private AqlMetadataProvider metadataProvider;
public abstract Map<FunctionIdentifier, List<IAccessMethod>> getAccessMethods();
@@ -60,23 +59,18 @@
}
protected void setMetadataDeclarations(IOptimizationContext context) {
- AqlMetadataProvider metadataProvider = (AqlMetadataProvider) context.getMetadataProvider();
- metadata = metadataProvider.getMetadataDeclarations();
+ metadataProvider = (AqlMetadataProvider) context.getMetadataProvider();
}
protected void fillSubTreeIndexExprs(OptimizableOperatorSubTree subTree,
Map<IAccessMethod, AccessMethodAnalysisContext> analyzedAMs) throws AlgebricksException {
- // The assign may be null if there is only a filter on the primary index key.
- // Match variables from lowest assign which comes directly after the dataset scan.
- List<LogicalVariable> varList = (!subTree.assigns.isEmpty()) ? subTree.assigns.get(subTree.assigns.size() - 1)
- .getVariables() : subTree.dataSourceScan.getVariables();
Iterator<Map.Entry<IAccessMethod, AccessMethodAnalysisContext>> amIt = analyzedAMs.entrySet().iterator();
// Check applicability of indexes by access method type.
while (amIt.hasNext()) {
Map.Entry<IAccessMethod, AccessMethodAnalysisContext> entry = amIt.next();
AccessMethodAnalysisContext amCtx = entry.getValue();
- // For the current access method type, map variables from the assign op to applicable indexes.
- fillAllIndexExprs(varList, subTree, amCtx);
+ // For the current access method type, map variables to applicable indexes.
+ fillAllIndexExprs(subTree, amCtx);
}
}
@@ -124,13 +118,13 @@
Iterator<Map.Entry<Index, List<Integer>>> it = analysisCtx.indexExprs.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<Index, List<Integer>> entry = it.next();
- Index index = entry.getKey();
- Iterator<Integer> exprsIter = entry.getValue().iterator();
+ Index index = entry.getKey();
boolean allUsed = true;
int lastFieldMatched = -1;
for (int i = 0; i < index.getKeyFieldNames().size(); i++) {
String keyField = index.getKeyFieldNames().get(i);
boolean foundKeyField = false;
+ Iterator<Integer> exprsIter = entry.getValue().iterator();
while (exprsIter.hasNext()) {
Integer ix = exprsIter.next();
IOptimizableFuncExpr optFuncExpr = analysisCtx.matchedFuncExprs.get(ix);
@@ -156,12 +150,10 @@
// If the access method requires all exprs to be matched but they are not, remove this candidate.
if (!allUsed && accessMethod.matchAllIndexExprs()) {
it.remove();
- return;
}
// A prefix of the index exprs may have been matched.
if (lastFieldMatched < 0 && accessMethod.matchPrefixIndexExprs()) {
it.remove();
- return;
}
}
}
@@ -240,7 +232,8 @@
*/
protected boolean fillIndexExprs(String fieldName, int matchedFuncExprIndex, Dataset dataset,
AccessMethodAnalysisContext analysisCtx) throws AlgebricksException {
- List<Index> datasetIndexes = metadata.getDatasetIndexes(dataset.getDataverseName(), dataset.getDatasetName());
+ List<Index> datasetIndexes = metadataProvider.getDatasetIndexes(dataset.getDataverseName(),
+ dataset.getDatasetName());
List<Index> indexCandidates = new ArrayList<Index>();
// Add an index to the candidates if one of the indexed fields is fieldName.
for (Index index : datasetIndexes) {
@@ -259,37 +252,43 @@
return true;
}
- protected void fillAllIndexExprs(List<LogicalVariable> varList, OptimizableOperatorSubTree subTree,
+ protected void fillAllIndexExprs(OptimizableOperatorSubTree subTree,
AccessMethodAnalysisContext analysisCtx) throws AlgebricksException {
for (int optFuncExprIndex = 0; optFuncExprIndex < analysisCtx.matchedFuncExprs.size(); optFuncExprIndex++) {
- for (int varIndex = 0; varIndex < varList.size(); varIndex++) {
- LogicalVariable var = varList.get(varIndex);
- IOptimizableFuncExpr optFuncExpr = analysisCtx.matchedFuncExprs.get(optFuncExprIndex);
+ IOptimizableFuncExpr optFuncExpr = analysisCtx.matchedFuncExprs.get(optFuncExprIndex);
+ // Try to match variables from optFuncExpr to assigns.
+ for (int assignIndex = 0; assignIndex < subTree.assigns.size(); assignIndex++) {
+ AssignOperator assignOp = subTree.assigns.get(assignIndex);
+ List<LogicalVariable> varList = assignOp.getVariables();
+ for (int varIndex = 0; varIndex < varList.size(); varIndex++) {
+ LogicalVariable var = varList.get(varIndex);
+ int funcVarIndex = optFuncExpr.findLogicalVar(var);
+ // No matching var in optFuncExpr.
+ if (funcVarIndex == -1) {
+ continue;
+ }
+ // At this point we have matched the optimizable func expr at optFuncExprIndex to an assigned variable.
+ String fieldName = getFieldNameOfFieldAccess(assignOp, subTree.recordType, varIndex);
+ if (fieldName == null) {
+ continue;
+ }
+ // Set the fieldName in the corresponding matched function expression, and remember matching subtree.
+ optFuncExpr.setFieldName(funcVarIndex, fieldName);
+ optFuncExpr.setOptimizableSubTree(funcVarIndex, subTree);
+ fillIndexExprs(fieldName, optFuncExprIndex, subTree.dataset, analysisCtx);
+ }
+ }
+ // Try to match variables from optFuncExpr to datasourcescan if not already matched in assigns.
+ List<LogicalVariable> dsVarList = subTree.dataSourceScan.getVariables();
+ for (int varIndex = 0; varIndex < dsVarList.size(); varIndex++) {
+ LogicalVariable var = dsVarList.get(varIndex);
int funcVarIndex = optFuncExpr.findLogicalVar(var);
// No matching var in optFuncExpr.
if (funcVarIndex == -1) {
continue;
}
- // At this point we have matched the optimizable func expr at optFuncExprIndex to an assigned variable.
- String fieldName = null;
- if (!subTree.assigns.isEmpty()) {
- // Get the fieldName corresponding to the assigned variable at varIndex
- // from the assign operator right above the datasource scan.
- // If the expr at varIndex is not a fieldAccess we get back null.
- fieldName = getFieldNameOfFieldAccess(subTree.assigns.get(subTree.assigns.size() - 1),
- subTree.recordType, varIndex);
- if (fieldName == null) {
- continue;
- }
- } else {
- // We don't have an assign, only a datasource scan.
- // The last var. is the record itself, so skip it.
- if (varIndex >= varList.size() - 1) {
- break;
- }
- // The variable value is one of the partitioning fields.
- fieldName = DatasetUtils.getPartitioningKeys(subTree.dataset).get(varIndex);
- }
+ // The variable value is one of the partitioning fields.
+ String fieldName = DatasetUtils.getPartitioningKeys(subTree.dataset).get(varIndex);
// Set the fieldName in the corresponding matched function expression, and remember matching subtree.
optFuncExpr.setFieldName(funcVarIndex, fieldName);
optFuncExpr.setOptimizableSubTree(funcVarIndex, subTree);
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AccessMethodJobGenParams.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AccessMethodJobGenParams.java
index af30163..e3a9e91 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AccessMethodJobGenParams.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AccessMethodJobGenParams.java
@@ -20,27 +20,32 @@
public class AccessMethodJobGenParams {
protected String indexName;
protected IndexType indexType;
+ protected String dataverseName;
protected String datasetName;
protected boolean retainInput;
protected boolean requiresBroadcast;
+ protected boolean isPrimaryIndex;
- private final int NUM_PARAMS = 5;
+ private final int NUM_PARAMS = 6;
public AccessMethodJobGenParams() {
}
- public AccessMethodJobGenParams(String indexName, IndexType indexType, String datasetName, boolean retainInput,
- boolean requiresBroadcast) {
+ public AccessMethodJobGenParams(String indexName, IndexType indexType, String dataverseName, String datasetName,
+ boolean retainInput, boolean requiresBroadcast) {
this.indexName = indexName;
this.indexType = indexType;
+ this.dataverseName = dataverseName;
this.datasetName = datasetName;
this.retainInput = retainInput;
this.requiresBroadcast = requiresBroadcast;
+ this.isPrimaryIndex = datasetName.equals(indexName);
}
public void writeToFuncArgs(List<Mutable<ILogicalExpression>> funcArgs) {
funcArgs.add(new MutableObject<ILogicalExpression>(AccessMethodUtils.createStringConstant(indexName)));
funcArgs.add(new MutableObject<ILogicalExpression>(AccessMethodUtils.createInt32Constant(indexType.ordinal())));
+ funcArgs.add(new MutableObject<ILogicalExpression>(AccessMethodUtils.createStringConstant(dataverseName)));
funcArgs.add(new MutableObject<ILogicalExpression>(AccessMethodUtils.createStringConstant(datasetName)));
funcArgs.add(new MutableObject<ILogicalExpression>(AccessMethodUtils.createBooleanConstant(retainInput)));
funcArgs.add(new MutableObject<ILogicalExpression>(AccessMethodUtils.createBooleanConstant(requiresBroadcast)));
@@ -49,9 +54,12 @@
public void readFromFuncArgs(List<Mutable<ILogicalExpression>> funcArgs) {
indexName = AccessMethodUtils.getStringConstant(funcArgs.get(0));
indexType = IndexType.values()[AccessMethodUtils.getInt32Constant(funcArgs.get(1))];
- datasetName = AccessMethodUtils.getStringConstant(funcArgs.get(2));
- retainInput = AccessMethodUtils.getBooleanConstant(funcArgs.get(3));
- requiresBroadcast = AccessMethodUtils.getBooleanConstant(funcArgs.get(4));
+ dataverseName = AccessMethodUtils.getStringConstant(funcArgs.get(2));
+ datasetName = AccessMethodUtils.getStringConstant(funcArgs.get(3));
+ retainInput = AccessMethodUtils.getBooleanConstant(funcArgs.get(4));
+ requiresBroadcast = AccessMethodUtils.getBooleanConstant(funcArgs.get(5));
+ isPrimaryIndex = datasetName.equals(indexName);
+ isPrimaryIndex = datasetName.equals(indexName);
}
public String getIndexName() {
@@ -62,6 +70,10 @@
return indexType;
}
+ public String getDataverseName() {
+ return dataverseName;
+ }
+
public String getDatasetName() {
return datasetName;
}
@@ -100,4 +112,8 @@
protected int getNumParams() {
return NUM_PARAMS;
}
+
+ public boolean isPrimaryIndex() {
+ return isPrimaryIndex;
+ }
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AccessMethodUtils.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AccessMethodUtils.java
index cd3712d..6651ea3 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AccessMethodUtils.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AccessMethodUtils.java
@@ -109,6 +109,24 @@
analysisCtx.matchedFuncExprs.add(new OptimizableFuncExpr(funcExpr, fieldVar, constFilterVal));
return true;
}
+
+ public static boolean analyzeFuncExprArgsForTwoVars(AbstractFunctionCallExpression funcExpr,
+ AccessMethodAnalysisContext analysisCtx) {
+ LogicalVariable fieldVar1 = null;
+ LogicalVariable fieldVar2 = null;
+ ILogicalExpression arg1 = funcExpr.getArguments().get(0).getValue();
+ ILogicalExpression arg2 = funcExpr.getArguments().get(1).getValue();
+ if (arg1.getExpressionTag() == LogicalExpressionTag.VARIABLE
+ && arg2.getExpressionTag() == LogicalExpressionTag.VARIABLE) {
+ fieldVar1 = ((VariableReferenceExpression) arg1).getVariableReference();
+ fieldVar2 = ((VariableReferenceExpression) arg2).getVariableReference();
+ } else {
+ return false;
+ }
+ analysisCtx.matchedFuncExprs.add(new OptimizableFuncExpr(funcExpr,
+ new LogicalVariable[] { fieldVar1, fieldVar2 }, null));
+ return true;
+ }
public static int getNumSecondaryKeys(Index index, ARecordType recordType) throws AlgebricksException {
switch (index.getIndexType()) {
@@ -190,6 +208,35 @@
return primaryKeyVars;
}
+ /**
+ * Returns the search key expression which feeds a secondary-index search. If we are optimizing a selection query then this method returns
+ * the a ConstantExpression from the first constant value in the optimizable function expression.
+ * If we are optimizing a join, then this method returns the VariableReferenceExpression that should feed the secondary index probe.
+ */
+ public static ILogicalExpression createSearchKeyExpr(IOptimizableFuncExpr optFuncExpr,
+ OptimizableOperatorSubTree indexSubTree, OptimizableOperatorSubTree probeSubTree) {
+ if (probeSubTree == null) {
+ // We are optimizing a selection query. Search key is a constant.
+ return new ConstantExpression(optFuncExpr.getConstantVal(0));
+ } else {
+ // We are optimizing a join query. Determine which variable feeds the secondary index.
+ if (optFuncExpr.getOperatorSubTree(0) == null || optFuncExpr.getOperatorSubTree(0) == probeSubTree) {
+ return new VariableReferenceExpression(optFuncExpr.getLogicalVar(0));
+ } else {
+ return new VariableReferenceExpression(optFuncExpr.getLogicalVar(1));
+ }
+ }
+ }
+
+ /**
+ * Returns the first expr optimizable by this index.
+ */
+ public static IOptimizableFuncExpr chooseFirstOptFuncExpr(Index chosenIndex, AccessMethodAnalysisContext analysisCtx) {
+ List<Integer> indexExprs = analysisCtx.getIndexExprs(chosenIndex);
+ int firstExprIndex = indexExprs.get(0);
+ return analysisCtx.matchedFuncExprs.get(firstExprIndex);
+ }
+
public static UnnestMapOperator createSecondaryIndexUnnestMap(Dataset dataset, ARecordType recordType, Index index,
ILogicalOperator inputOp, AccessMethodJobGenParams jobGenParams, IOptimizationContext context,
boolean outputPrimaryKeysOnly, boolean retainInput) throws AlgebricksException {
@@ -240,7 +287,7 @@
// The job gen parameters are transferred to the actual job gen via the UnnestMapOperator's function arguments.
List<Mutable<ILogicalExpression>> primaryIndexFuncArgs = new ArrayList<Mutable<ILogicalExpression>>();
BTreeJobGenParams jobGenParams = new BTreeJobGenParams(dataset.getDatasetName(), IndexType.BTREE,
- dataset.getDatasetName(), retainInput, requiresBroadcast);
+ dataset.getDataverseName(), dataset.getDatasetName(), retainInput, requiresBroadcast);
// Set low/high inclusive to true for a point lookup.
jobGenParams.setLowKeyInclusive(true);
jobGenParams.setHighKeyInclusive(true);
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/BTreeAccessMethod.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/BTreeAccessMethod.java
index 414dca3..1379bf4 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/BTreeAccessMethod.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/BTreeAccessMethod.java
@@ -1,6 +1,7 @@
package edu.uci.ics.asterix.optimizer.rules.am;
import java.util.ArrayList;
+import java.util.BitSet;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -21,13 +22,14 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalExpressionTag;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalVariable;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ConstantExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IAlgebricksConstantValue;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IndexedNLJoinExpressionAnnotation;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.AlgebricksBuiltinFunctions;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.AlgebricksBuiltinFunctions.ComparisonKind;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.IFunctionInfo;
+import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractBinaryJoinOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator.ExecutionMode;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AssignOperator;
@@ -57,7 +59,6 @@
funcIdents.add(AlgebricksBuiltinFunctions.GE);
funcIdents.add(AlgebricksBuiltinFunctions.LT);
funcIdents.add(AlgebricksBuiltinFunctions.GT);
- funcIdents.add(AlgebricksBuiltinFunctions.NEQ);
}
public static BTreeAccessMethod INSTANCE = new BTreeAccessMethod();
@@ -70,7 +71,11 @@
@Override
public boolean analyzeFuncExprArgs(AbstractFunctionCallExpression funcExpr, List<AssignOperator> assigns,
AccessMethodAnalysisContext analysisCtx) {
- return AccessMethodUtils.analyzeFuncExprArgsForOneConstAndVar(funcExpr, analysisCtx);
+ boolean matches = AccessMethodUtils.analyzeFuncExprArgsForOneConstAndVar(funcExpr, analysisCtx);
+ if (!matches) {
+ matches = AccessMethodUtils.analyzeFuncExprArgsForTwoVars(funcExpr, analysisCtx);
+ }
+ return matches;
}
@Override
@@ -88,20 +93,90 @@
public boolean applySelectPlanTransformation(Mutable<ILogicalOperator> selectRef,
OptimizableOperatorSubTree subTree, Index chosenIndex, AccessMethodAnalysisContext analysisCtx,
IOptimizationContext context) throws AlgebricksException {
- Dataset dataset = subTree.dataset;
- ARecordType recordType = subTree.recordType;
SelectOperator select = (SelectOperator) selectRef.getValue();
- DataSourceScanOperator dataSourceScan = subTree.dataSourceScan;
+ Mutable<ILogicalExpression> conditionRef = select.getCondition();
+ ILogicalOperator primaryIndexUnnestOp = createSecondaryToPrimaryPlan(selectRef, conditionRef, subTree, null,
+ chosenIndex, analysisCtx, false, false, context);
+ if (primaryIndexUnnestOp == null) {
+ return false;
+ }
Mutable<ILogicalOperator> assignRef = (subTree.assignRefs.isEmpty()) ? null : subTree.assignRefs.get(0);
AssignOperator assign = null;
if (assignRef != null) {
assign = (AssignOperator) assignRef.getValue();
}
+ // Generate new select using the new condition.
+ if (conditionRef.getValue() != null) {
+ select.getInputs().clear();
+ if (assign != null) {
+ subTree.dataSourceScanRef.setValue(primaryIndexUnnestOp);
+ select.getInputs().add(new MutableObject<ILogicalOperator>(assign));
+ } else {
+ select.getInputs().add(new MutableObject<ILogicalOperator>(primaryIndexUnnestOp));
+ }
+ } else {
+ ((AbstractLogicalOperator) primaryIndexUnnestOp).setExecutionMode(ExecutionMode.PARTITIONED);
+ if (assign != null) {
+ subTree.dataSourceScanRef.setValue(primaryIndexUnnestOp);
+ selectRef.setValue(assign);
+ } else {
+ selectRef.setValue(primaryIndexUnnestOp);
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public boolean applyJoinPlanTransformation(Mutable<ILogicalOperator> joinRef,
+ OptimizableOperatorSubTree leftSubTree, OptimizableOperatorSubTree rightSubTree, Index chosenIndex,
+ AccessMethodAnalysisContext analysisCtx, IOptimizationContext context) throws AlgebricksException {
+ AbstractBinaryJoinOperator joinOp = (AbstractBinaryJoinOperator) joinRef.getValue();
+ Mutable<ILogicalExpression> conditionRef = joinOp.getCondition();
+ // Determine if the index is applicable on the left or right side (if both, we arbitrarily prefer the left side).
+ Dataset dataset = analysisCtx.indexDatasetMap.get(chosenIndex);
+ // Determine probe and index subtrees based on chosen index.
+ OptimizableOperatorSubTree indexSubTree = null;
+ OptimizableOperatorSubTree probeSubTree = null;
+ if (leftSubTree.dataset != null && dataset.getDatasetName().equals(leftSubTree.dataset.getDatasetName())) {
+ indexSubTree = leftSubTree;
+ probeSubTree = rightSubTree;
+ } else if (rightSubTree.dataset != null
+ && dataset.getDatasetName().equals(rightSubTree.dataset.getDatasetName())) {
+ indexSubTree = rightSubTree;
+ probeSubTree = leftSubTree;
+ }
+ ILogicalOperator primaryIndexUnnestOp = createSecondaryToPrimaryPlan(joinRef, conditionRef, indexSubTree,
+ probeSubTree, chosenIndex, analysisCtx, true, true, context);
+ if (primaryIndexUnnestOp == null) {
+ return false;
+ }
+ // If there are conditions left, add a new select operator on top.
+ indexSubTree.dataSourceScanRef.setValue(primaryIndexUnnestOp);
+ if (conditionRef.getValue() != null) {
+ SelectOperator topSelect = new SelectOperator(conditionRef);
+ topSelect.getInputs().add(indexSubTree.rootRef);
+ topSelect.setExecutionMode(ExecutionMode.LOCAL);
+ context.computeAndSetTypeEnvironmentForOperator(topSelect);
+ // Replace the original join with the new subtree rooted at the select op.
+ joinRef.setValue(topSelect);
+ } else {
+ joinRef.setValue(indexSubTree.rootRef.getValue());
+ }
+ return true;
+ }
+
+ private ILogicalOperator createSecondaryToPrimaryPlan(Mutable<ILogicalOperator> topOpRef,
+ Mutable<ILogicalExpression> conditionRef, OptimizableOperatorSubTree indexSubTree,
+ OptimizableOperatorSubTree probeSubTree, Index chosenIndex, AccessMethodAnalysisContext analysisCtx,
+ boolean retainInput, boolean requiresBroadcast, IOptimizationContext context) throws AlgebricksException {
+ Dataset dataset = indexSubTree.dataset;
+ ARecordType recordType = indexSubTree.recordType;
+ DataSourceScanOperator dataSourceScan = indexSubTree.dataSourceScan;
int numSecondaryKeys = chosenIndex.getKeyFieldNames().size();
// Info on high and low keys for the BTree search predicate.
- IAlgebricksConstantValue[] lowKeyConstants = new IAlgebricksConstantValue[numSecondaryKeys];
- IAlgebricksConstantValue[] highKeyConstants = new IAlgebricksConstantValue[numSecondaryKeys];
+ ILogicalExpression[] lowKeyExprs = new ILogicalExpression[numSecondaryKeys];
+ ILogicalExpression[] highKeyExprs = new ILogicalExpression[numSecondaryKeys];
LimitType[] lowKeyLimits = new LimitType[numSecondaryKeys];
LimitType[] highKeyLimits = new LimitType[numSecondaryKeys];
boolean[] lowKeyInclusive = new boolean[numSecondaryKeys];
@@ -116,6 +191,9 @@
// If we can't figure out how to integrate a certain funcExpr into the current predicate, we just bail by setting this flag.
boolean couldntFigureOut = false;
boolean doneWithExprs = false;
+ // TODO: For now don't consider prefix searches.
+ BitSet setLowKeys = new BitSet(numSecondaryKeys);
+ BitSet setHighKeys = new BitSet(numSecondaryKeys);
// Go through the func exprs listed as optimizable by the chosen index,
// and formulate a range predicate on the secondary-index keys.
for (Integer exprIndex : exprList) {
@@ -123,26 +201,40 @@
IOptimizableFuncExpr optFuncExpr = matchedFuncExprs.get(exprIndex);
int keyPos = indexOf(optFuncExpr.getFieldName(0), chosenIndex.getKeyFieldNames());
if (keyPos < 0) {
- throw new InternalError();
+ if (optFuncExpr.getNumLogicalVars() > 1) {
+ // If we are optimizing a join, the matching field may be the second field name.
+ keyPos = indexOf(optFuncExpr.getFieldName(1), chosenIndex.getKeyFieldNames());
+ }
}
+ if (keyPos < 0) {
+ throw new AlgebricksException(
+ "Could not match optimizable function expression to any index field name.");
+ }
+ ILogicalExpression searchKeyExpr = AccessMethodUtils.createSearchKeyExpr(optFuncExpr, indexSubTree,
+ probeSubTree);
LimitType limit = getLimitType(optFuncExpr);
switch (limit) {
case EQUAL: {
if (lowKeyLimits[keyPos] == null && highKeyLimits[keyPos] == null) {
lowKeyLimits[keyPos] = highKeyLimits[keyPos] = limit;
lowKeyInclusive[keyPos] = highKeyInclusive[keyPos] = true;
- lowKeyConstants[keyPos] = highKeyConstants[keyPos] = optFuncExpr.getConstantVal(0);
+ lowKeyExprs[keyPos] = highKeyExprs[keyPos] = searchKeyExpr;
+ setLowKeys.set(keyPos);
+ setHighKeys.set(keyPos);
} else {
couldntFigureOut = true;
}
- // Mmmm, we would need an inference system here.
- doneWithExprs = true;
+ // TODO: For now don't consider prefix searches.
+ // If high and low keys are set, we exit for now.
+ if (setLowKeys.cardinality() == numSecondaryKeys && setHighKeys.cardinality() == numSecondaryKeys) {
+ doneWithExprs = true;
+ }
break;
}
case HIGH_EXCLUSIVE: {
if (highKeyLimits[keyPos] == null || (highKeyLimits[keyPos] != null && highKeyInclusive[keyPos])) {
highKeyLimits[keyPos] = limit;
- highKeyConstants[keyPos] = optFuncExpr.getConstantVal(0);
+ highKeyExprs[keyPos] = searchKeyExpr;
highKeyInclusive[keyPos] = false;
} else {
couldntFigureOut = true;
@@ -153,7 +245,7 @@
case HIGH_INCLUSIVE: {
if (highKeyLimits[keyPos] == null) {
highKeyLimits[keyPos] = limit;
- highKeyConstants[keyPos] = optFuncExpr.getConstantVal(0);
+ highKeyExprs[keyPos] = searchKeyExpr;
highKeyInclusive[keyPos] = true;
} else {
couldntFigureOut = true;
@@ -164,7 +256,7 @@
case LOW_EXCLUSIVE: {
if (lowKeyLimits[keyPos] == null || (lowKeyLimits[keyPos] != null && lowKeyInclusive[keyPos])) {
lowKeyLimits[keyPos] = limit;
- lowKeyConstants[keyPos] = optFuncExpr.getConstantVal(0);
+ lowKeyExprs[keyPos] = searchKeyExpr;
lowKeyInclusive[keyPos] = false;
} else {
couldntFigureOut = true;
@@ -175,7 +267,7 @@
case LOW_INCLUSIVE: {
if (lowKeyLimits[keyPos] == null) {
lowKeyLimits[keyPos] = limit;
- lowKeyConstants[keyPos] = optFuncExpr.getConstantVal(0);
+ lowKeyExprs[keyPos] = searchKeyExpr;
lowKeyInclusive[keyPos] = true;
} else {
couldntFigureOut = true;
@@ -196,22 +288,22 @@
}
}
if (couldntFigureOut) {
- return false;
+ return null;
}
// Rule out the cases unsupported by the current btree search
// implementation.
for (int i = 1; i < numSecondaryKeys; i++) {
if (lowKeyInclusive[i] != lowKeyInclusive[0] || highKeyInclusive[i] != highKeyInclusive[0]) {
- return false;
+ return null;
}
if (lowKeyLimits[0] == null && lowKeyLimits[i] != null || lowKeyLimits[0] != null
&& lowKeyLimits[i] == null) {
- return false;
+ return null;
}
if (highKeyLimits[0] == null && highKeyLimits[i] != null || highKeyLimits[0] != null
&& highKeyLimits[i] == null) {
- return false;
+ return null;
}
}
if (lowKeyLimits[0] == null) {
@@ -224,97 +316,92 @@
// Here we generate vars and funcs for assigning the secondary-index keys to be fed into the secondary-index search.
// List of variables for the assign.
ArrayList<LogicalVariable> keyVarList = new ArrayList<LogicalVariable>();
- // List of expressions for the assign.
- ArrayList<Mutable<ILogicalExpression>> keyExprList = new ArrayList<Mutable<ILogicalExpression>>();
- int numLowKeys = createKeyVarsAndExprs(lowKeyLimits, lowKeyConstants, keyExprList, keyVarList, context);
- int numHighKeys = createKeyVarsAndExprs(highKeyLimits, highKeyConstants, keyExprList, keyVarList, context);
+ // List of variables and expressions for the assign.
+ ArrayList<LogicalVariable> assignKeyVarList = new ArrayList<LogicalVariable>();
+ ArrayList<Mutable<ILogicalExpression>> assignKeyExprList = new ArrayList<Mutable<ILogicalExpression>>();
+ int numLowKeys = createKeyVarsAndExprs(lowKeyLimits, lowKeyExprs, assignKeyVarList, assignKeyExprList,
+ keyVarList, context);
+ int numHighKeys = createKeyVarsAndExprs(highKeyLimits, highKeyExprs, assignKeyVarList, assignKeyExprList,
+ keyVarList, context);
BTreeJobGenParams jobGenParams = new BTreeJobGenParams(chosenIndex.getIndexName(), IndexType.BTREE,
- dataset.getDatasetName(), false, false);
+ dataset.getDataverseName(), dataset.getDatasetName(), retainInput, requiresBroadcast);
jobGenParams.setLowKeyInclusive(lowKeyInclusive[0]);
jobGenParams.setHighKeyInclusive(highKeyInclusive[0]);
jobGenParams.setLowKeyVarList(keyVarList, 0, numLowKeys);
jobGenParams.setHighKeyVarList(keyVarList, numLowKeys, numHighKeys);
- // Assign operator that sets the secondary-index search-key fields.
- AssignOperator assignSearchKeys = new AssignOperator(keyVarList, keyExprList);
- // Input to this assign is the EmptyTupleSource (which the dataSourceScan also must have had as input).
- assignSearchKeys.getInputs().add(dataSourceScan.getInputs().get(0));
- assignSearchKeys.setExecutionMode(dataSourceScan.getExecutionMode());
+ ILogicalOperator inputOp = null;
+ if (!assignKeyVarList.isEmpty()) {
+ // Assign operator that sets the constant secondary-index search-key fields if necessary.
+ AssignOperator assignConstantSearchKeys = new AssignOperator(assignKeyVarList, assignKeyExprList);
+ // Input to this assign is the EmptyTupleSource (which the dataSourceScan also must have had as input).
+ assignConstantSearchKeys.getInputs().add(dataSourceScan.getInputs().get(0));
+ assignConstantSearchKeys.setExecutionMode(dataSourceScan.getExecutionMode());
+ inputOp = assignConstantSearchKeys;
+ } else {
+ // All index search keys are variables.
+ inputOp = probeSubTree.root;
+ }
UnnestMapOperator secondaryIndexUnnestOp = AccessMethodUtils.createSecondaryIndexUnnestMap(dataset, recordType,
- chosenIndex, assignSearchKeys, jobGenParams, context, false, false);
+ chosenIndex, inputOp, jobGenParams, context, false, retainInput);
// Generate the rest of the upstream plan which feeds the search results into the primary index.
UnnestMapOperator primaryIndexUnnestOp;
boolean isPrimaryIndex = chosenIndex.getIndexName().equals(dataset.getDatasetName());
if (!isPrimaryIndex) {
primaryIndexUnnestOp = AccessMethodUtils.createPrimaryIndexUnnestMap(dataSourceScan, dataset, recordType,
- secondaryIndexUnnestOp, context, true, false, false);
+ secondaryIndexUnnestOp, context, true, retainInput, false);
} else {
List<Object> primaryIndexOutputTypes = new ArrayList<Object>();
AccessMethodUtils.appendPrimaryIndexTypes(dataset, recordType, primaryIndexOutputTypes);
primaryIndexUnnestOp = new UnnestMapOperator(dataSourceScan.getVariables(),
- secondaryIndexUnnestOp.getExpressionRef(), primaryIndexOutputTypes, false);
- primaryIndexUnnestOp.getInputs().add(new MutableObject<ILogicalOperator>(assignSearchKeys));
+ secondaryIndexUnnestOp.getExpressionRef(), primaryIndexOutputTypes, retainInput);
+ primaryIndexUnnestOp.getInputs().add(new MutableObject<ILogicalOperator>(inputOp));
}
List<Mutable<ILogicalExpression>> remainingFuncExprs = new ArrayList<Mutable<ILogicalExpression>>();
- getNewSelectExprs(select, replacedFuncExprs, remainingFuncExprs);
- // Generate new select using the new condition.
+ getNewConditionExprs(conditionRef, replacedFuncExprs, remainingFuncExprs);
+ // Generate new condition.
if (!remainingFuncExprs.isEmpty()) {
ILogicalExpression pulledCond = createSelectCondition(remainingFuncExprs);
- SelectOperator selectRest = new SelectOperator(new MutableObject<ILogicalExpression>(pulledCond));
- if (assign != null) {
- subTree.dataSourceScanRef.setValue(primaryIndexUnnestOp);
- selectRest.getInputs().add(new MutableObject<ILogicalOperator>(assign));
- } else {
- selectRest.getInputs().add(new MutableObject<ILogicalOperator>(primaryIndexUnnestOp));
- }
- selectRest.setExecutionMode(((AbstractLogicalOperator) selectRef.getValue()).getExecutionMode());
- selectRef.setValue(selectRest);
+ conditionRef.setValue(pulledCond);
} else {
- primaryIndexUnnestOp.setExecutionMode(ExecutionMode.PARTITIONED);
- if (assign != null) {
- subTree.dataSourceScanRef.setValue(primaryIndexUnnestOp);
- selectRef.setValue(assign);
- } else {
- selectRef.setValue(primaryIndexUnnestOp);
- }
+ conditionRef.setValue(null);
}
- return true;
+ return primaryIndexUnnestOp;
}
- @Override
- public boolean applyJoinPlanTransformation(Mutable<ILogicalOperator> joinRef,
- OptimizableOperatorSubTree leftSubTree, OptimizableOperatorSubTree rightSubTree, Index chosenIndex,
- AccessMethodAnalysisContext analysisCtx, IOptimizationContext context) throws AlgebricksException {
- // TODO: Implement this.
- return false;
- }
-
- private int createKeyVarsAndExprs(LimitType[] keyLimits, IAlgebricksConstantValue[] keyConstants,
- ArrayList<Mutable<ILogicalExpression>> keyExprList, ArrayList<LogicalVariable> keyVarList,
- IOptimizationContext context) {
+ private int createKeyVarsAndExprs(LimitType[] keyLimits, ILogicalExpression[] searchKeyExprs,
+ ArrayList<LogicalVariable> assignKeyVarList, ArrayList<Mutable<ILogicalExpression>> assignKeyExprList,
+ ArrayList<LogicalVariable> keyVarList, IOptimizationContext context) {
if (keyLimits[0] == null) {
return 0;
}
int numKeys = keyLimits.length;
for (int i = 0; i < numKeys; i++) {
- LogicalVariable keyVar = context.newVar();
+ ILogicalExpression searchKeyExpr = searchKeyExprs[i];
+ LogicalVariable keyVar = null;
+ if (searchKeyExpr.getExpressionTag() == LogicalExpressionTag.CONSTANT) {
+ keyVar = context.newVar();
+ assignKeyExprList.add(new MutableObject<ILogicalExpression>(searchKeyExpr));
+ assignKeyVarList.add(keyVar);
+ } else {
+ keyVar = ((VariableReferenceExpression) searchKeyExpr).getVariableReference();
+ }
keyVarList.add(keyVar);
- keyExprList.add(new MutableObject<ILogicalExpression>(new ConstantExpression(keyConstants[i])));
}
return numKeys;
}
- private void getNewSelectExprs(SelectOperator select, Set<ILogicalExpression> replacedFuncExprs,
- List<Mutable<ILogicalExpression>> remainingFuncExprs) {
+ private void getNewConditionExprs(Mutable<ILogicalExpression> conditionRef,
+ Set<ILogicalExpression> replacedFuncExprs, List<Mutable<ILogicalExpression>> remainingFuncExprs) {
remainingFuncExprs.clear();
if (replacedFuncExprs.isEmpty()) {
return;
}
- AbstractFunctionCallExpression funcExpr = (AbstractFunctionCallExpression) select.getCondition().getValue();
+ AbstractFunctionCallExpression funcExpr = (AbstractFunctionCallExpression) conditionRef.getValue();
if (replacedFuncExprs.size() == 1) {
Iterator<ILogicalExpression> it = replacedFuncExprs.iterator();
if (!it.hasNext()) {
@@ -405,6 +492,12 @@
@Override
public boolean exprIsOptimizable(Index index, IOptimizableFuncExpr optFuncExpr) {
+ // If we are optimizing a join, check for the indexed nested-loop join hint.
+ if (optFuncExpr.getNumLogicalVars() == 2) {
+ if (!optFuncExpr.getFuncExpr().getAnnotations().containsKey(IndexedNLJoinExpressionAnnotation.INSTANCE)) {
+ return false;
+ }
+ }
// No additional analysis required for BTrees.
return true;
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/BTreeJobGenParams.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/BTreeJobGenParams.java
index c377a34..9a735c9 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/BTreeJobGenParams.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/BTreeJobGenParams.java
@@ -27,9 +27,9 @@
super();
}
- public BTreeJobGenParams(String indexName, IndexType indexType, String datasetName, boolean retainInput,
+ public BTreeJobGenParams(String indexName, IndexType indexType, String dataverseName, String datasetName, boolean retainInput,
boolean requiresBroadcast) {
- super(indexName, indexType, datasetName, retainInput, requiresBroadcast);
+ super(indexName, indexType, dataverseName, datasetName, retainInput, requiresBroadcast);
}
public void setLowKeyVarList(List<LogicalVariable> keyVarList, int startIndex, int numKeys) {
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IOptimizableFuncExpr.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IOptimizableFuncExpr.java
index dd91fc1..aa38ce9 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IOptimizableFuncExpr.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IOptimizableFuncExpr.java
@@ -22,4 +22,5 @@
public int findLogicalVar(LogicalVariable var);
public int findFieldName(String fieldName);
+ public void substituteVar(LogicalVariable original, LogicalVariable substitution);
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IntroduceJoinAccessMethodRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IntroduceJoinAccessMethodRule.java
index e4555aa..d6f0279 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IntroduceJoinAccessMethodRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IntroduceJoinAccessMethodRule.java
@@ -57,12 +57,15 @@
// Register access methods.
protected static Map<FunctionIdentifier, List<IAccessMethod>> accessMethods = new HashMap<FunctionIdentifier, List<IAccessMethod>>();
static {
- registerAccessMethod(InvertedIndexAccessMethod.INSTANCE, accessMethods);
+ registerAccessMethod(BTreeAccessMethod.INSTANCE, accessMethods);
+ registerAccessMethod(RTreeAccessMethod.INSTANCE, accessMethods);
+ registerAccessMethod(InvertedIndexAccessMethod.INSTANCE, accessMethods);
}
@Override
public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
throws AlgebricksException {
+ clear();
setMetadataDeclarations(context);
// Match operator pattern and initialize optimizable sub trees.
@@ -116,7 +119,7 @@
boolean res = chosenIndex.first.applyJoinPlanTransformation(joinRef, leftSubTree, rightSubTree,
chosenIndex.second, analysisCtx, context);
if (res) {
- OperatorPropertiesUtil.typeOpRec(opRef, context);
+ OperatorPropertiesUtil.typeOpRec(opRef, context);
}
context.addToDontApplySet(this, join);
return res;
@@ -153,4 +156,10 @@
public Map<FunctionIdentifier, List<IAccessMethod>> getAccessMethods() {
return accessMethods;
}
+
+ private void clear() {
+ joinRef = null;
+ join = null;
+ joinCond = null;
+ }
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java
index 59b11fc..abfcfb3 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java
@@ -70,6 +70,7 @@
@Override
public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
throws AlgebricksException {
+ clear();
setMetadataDeclarations(context);
// Match operator pattern and initialize operator members.
@@ -134,4 +135,10 @@
public Map<FunctionIdentifier, List<IAccessMethod>> getAccessMethods() {
return accessMethods;
}
+
+ private void clear() {
+ selectRef = null;
+ select = null;
+ selectCond = null;
+ }
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/InvertedIndexAccessMethod.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/InvertedIndexAccessMethod.java
index dbd92c0..84a86b1 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/InvertedIndexAccessMethod.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/InvertedIndexAccessMethod.java
@@ -1,8 +1,10 @@
package edu.uci.ics.asterix.optimizer.rules.am;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import org.apache.commons.lang3.mutable.Mutable;
import org.apache.commons.lang3.mutable.MutableObject;
@@ -44,13 +46,13 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.AlgebricksBuiltinFunctions;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator.ExecutionMode;
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.InnerJoinOperator;
-import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.ProjectOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.ReplicateOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.SelectOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.UnionAllOperator;
@@ -321,7 +323,8 @@
DataSourceScanOperator dataSourceScan = indexSubTree.dataSourceScan;
InvertedIndexJobGenParams jobGenParams = new InvertedIndexJobGenParams(chosenIndex.getIndexName(),
- chosenIndex.getIndexType(), dataset.getDatasetName(), retainInput, requiresBroadcast);
+ chosenIndex.getIndexType(), dataset.getDataverseName(), dataset.getDatasetName(), retainInput,
+ requiresBroadcast);
// Add function-specific args such as search modifier, and possibly a similarity threshold.
addFunctionSpecificArgs(optFuncExpr, jobGenParams);
// Add the type of search key from the optFuncExpr.
@@ -377,7 +380,7 @@
public boolean applySelectPlanTransformation(Mutable<ILogicalOperator> selectRef,
OptimizableOperatorSubTree subTree, Index chosenIndex, AccessMethodAnalysisContext analysisCtx,
IOptimizationContext context) throws AlgebricksException {
- IOptimizableFuncExpr optFuncExpr = chooseOptFuncExpr(chosenIndex, analysisCtx);
+ IOptimizableFuncExpr optFuncExpr = AccessMethodUtils.chooseFirstOptFuncExpr(chosenIndex, analysisCtx);
ILogicalOperator indexPlanRootOp = createSecondaryToPrimaryPlan(subTree, null, chosenIndex, optFuncExpr, false,
false, context);
// Replace the datasource scan with the new plan rooted at primaryIndexUnnestMap.
@@ -401,22 +404,34 @@
indexSubTree = rightSubTree;
probeSubTree = leftSubTree;
}
- IOptimizableFuncExpr optFuncExpr = chooseOptFuncExpr(chosenIndex, analysisCtx);
-
- // Clone the original join condition because we may have to modify it (and we also need the original).
+ IOptimizableFuncExpr optFuncExpr = AccessMethodUtils.chooseFirstOptFuncExpr(chosenIndex, analysisCtx);
InnerJoinOperator join = (InnerJoinOperator) joinRef.getValue();
+
+ // Remember the original probe subtree, and its primary-key variables,
+ // so we can later retrieve the missing attributes via an equi join.
+ List<LogicalVariable> originalSubTreePKs = new ArrayList<LogicalVariable>();
+ // Remember the primary-keys of the new probe subtree for the top-level equi join.
+ List<LogicalVariable> surrogateSubTreePKs = new ArrayList<LogicalVariable>();
+
+ // Copy probe subtree, replacing their variables with new ones. We will use the original variables
+ // to stitch together a top-level equi join.
+ Mutable<ILogicalOperator> originalProbeSubTreeRootRef = copyAndReinitProbeSubTree(probeSubTree, join
+ .getCondition().getValue(), optFuncExpr, originalSubTreePKs, surrogateSubTreePKs, context);
+
+ // Remember original live variables from the index sub tree.
+ List<LogicalVariable> indexSubTreeLiveVars = new ArrayList<LogicalVariable>();
+ VariableUtilities.getLiveVariables(indexSubTree.root, indexSubTreeLiveVars);
+
+ // Clone the original join condition because we may have to modify it (and we also need the original).
ILogicalExpression joinCond = join.getCondition().getValue().cloneExpression();
-
- // Remember original live variables to make sure our new index-based plan returns exactly those vars as well.
- List<LogicalVariable> originalLiveVars = new ArrayList<LogicalVariable>();
- VariableUtilities.getLiveVariables(join, originalLiveVars);
-
// Create "panic" (non indexed) nested-loop join path if necessary.
Mutable<ILogicalOperator> panicJoinRef = null;
+ Map<LogicalVariable, LogicalVariable> panicVarMap = null;
if (optFuncExpr.getFuncExpr().getFunctionIdentifier() == AsterixBuiltinFunctions.EDIT_DISTANCE_CHECK) {
panicJoinRef = new MutableObject<ILogicalOperator>(joinRef.getValue());
+ panicVarMap = new HashMap<LogicalVariable, LogicalVariable>();
Mutable<ILogicalOperator> newProbeRootRef = createPanicNestedLoopJoinPlan(panicJoinRef, indexSubTree,
- probeSubTree, optFuncExpr, chosenIndex, context);
+ probeSubTree, optFuncExpr, chosenIndex, panicVarMap, context);
probeSubTree.rootRef.setValue(newProbeRootRef.getValue());
probeSubTree.root = newProbeRootRef.getValue();
}
@@ -430,52 +445,150 @@
topSelect.getInputs().add(indexSubTree.rootRef);
topSelect.setExecutionMode(ExecutionMode.LOCAL);
context.computeAndSetTypeEnvironmentForOperator(topSelect);
-
- // Add a project operator on top to guarantee that our new index-based plan returns exactly the same variables as the original plan.
- ProjectOperator projectOp = new ProjectOperator(originalLiveVars);
- projectOp.getInputs().add(new MutableObject<ILogicalOperator>(topSelect));
- projectOp.setExecutionMode(ExecutionMode.LOCAL);
- context.computeAndSetTypeEnvironmentForOperator(projectOp);
- joinRef.setValue(projectOp);
+ ILogicalOperator topOp = topSelect;
// Hook up the indexed-nested loop join path with the "panic" (non indexed) nested-loop join path by putting a union all on top.
if (panicJoinRef != null) {
- // Gather live variables from the index plan and the panic plan.
- List<LogicalVariable> indexPlanLiveVars = new ArrayList<LogicalVariable>();
- VariableUtilities.getLiveVariables(joinRef.getValue(), indexPlanLiveVars);
+ LogicalVariable inputSearchVar = getInputSearchVar(optFuncExpr, indexSubTree);
+ indexSubTreeLiveVars.addAll(originalSubTreePKs);
+ indexSubTreeLiveVars.add(inputSearchVar);
List<LogicalVariable> panicPlanLiveVars = new ArrayList<LogicalVariable>();
VariableUtilities.getLiveVariables(panicJoinRef.getValue(), panicPlanLiveVars);
- if (indexPlanLiveVars.size() != panicPlanLiveVars.size()) {
- throw new AlgebricksException("Unequal number of variables returned from index plan and panic plan.");
- }
// Create variable mapping for union all operator.
List<Triple<LogicalVariable, LogicalVariable, LogicalVariable>> varMap = new ArrayList<Triple<LogicalVariable, LogicalVariable, LogicalVariable>>();
- for (int i = 0; i < indexPlanLiveVars.size(); i++) {
- varMap.add(new Triple<LogicalVariable, LogicalVariable, LogicalVariable>(indexPlanLiveVars.get(i),
- panicPlanLiveVars.get(i), indexPlanLiveVars.get(i)));
+ for (int i = 0; i < indexSubTreeLiveVars.size(); i++) {
+ LogicalVariable indexSubTreeVar = indexSubTreeLiveVars.get(i);
+ LogicalVariable panicPlanVar = panicVarMap.get(indexSubTreeVar);
+ if (panicPlanVar == null) {
+ panicPlanVar = indexSubTreeVar;
+ }
+ varMap.add(new Triple<LogicalVariable, LogicalVariable, LogicalVariable>(indexSubTreeVar, panicPlanVar,
+ indexSubTreeVar));
}
UnionAllOperator unionAllOp = new UnionAllOperator(varMap);
- unionAllOp.getInputs().add(new MutableObject<ILogicalOperator>(joinRef.getValue()));
+ unionAllOp.getInputs().add(new MutableObject<ILogicalOperator>(topOp));
unionAllOp.getInputs().add(panicJoinRef);
unionAllOp.setExecutionMode(ExecutionMode.PARTITIONED);
context.computeAndSetTypeEnvironmentForOperator(unionAllOp);
- joinRef.setValue(unionAllOp);
+ topOp = unionAllOp;
}
+
+ // Place a top-level equi-join on top to retrieve the missing variables from the original probe subtree.
+ // The inner (build) branch of the join is the subtree with the data scan, since the result of the similarity join could potentially be big.
+ // This choice may not always be the most efficient, but it seems more robust than the alternative.
+ Mutable<ILogicalExpression> eqJoinConditionRef = createPrimaryKeysEqJoinCondition(originalSubTreePKs,
+ surrogateSubTreePKs);
+ InnerJoinOperator topEqJoin = new InnerJoinOperator(eqJoinConditionRef, originalProbeSubTreeRootRef,
+ new MutableObject<ILogicalOperator>(topOp));
+ topEqJoin.setExecutionMode(ExecutionMode.PARTITIONED);
+ joinRef.setValue(topEqJoin);
+ context.computeAndSetTypeEnvironmentForOperator(topEqJoin);
+
return true;
}
- private IOptimizableFuncExpr chooseOptFuncExpr(Index chosenIndex, AccessMethodAnalysisContext analysisCtx) {
- // TODO: We can probably do something smarter here.
- // Pick the first expr optimizable by this index.
- List<Integer> indexExprs = analysisCtx.getIndexExprs(chosenIndex);
- int firstExprIndex = indexExprs.get(0);
- return analysisCtx.matchedFuncExprs.get(firstExprIndex);
+ /**
+ * Copies the probeSubTree (using new variables), and reinitializes the probeSubTree to it.
+ * Accordingly replaces the variables in the given joinCond, and the optFuncExpr.
+ * Returns a reference to the original plan root.
+ */
+ private Mutable<ILogicalOperator> copyAndReinitProbeSubTree(OptimizableOperatorSubTree probeSubTree,
+ ILogicalExpression joinCond, IOptimizableFuncExpr optFuncExpr, List<LogicalVariable> originalSubTreePKs,
+ List<LogicalVariable> surrogateSubTreePKs, IOptimizationContext context) throws AlgebricksException {
+
+ probeSubTree.getPrimaryKeyVars(originalSubTreePKs);
+
+ // Create two copies of the original probe subtree.
+ // The first copy, which becomes the new probe subtree, will retain the primary-key and secondary-search key variables,
+ // but have all other variables replaced with new ones.
+ // The second copy, which will become an input to the top-level equi-join to resolve the surrogates,
+ // will have all primary-key and secondary-search keys replaced, but retains all other original variables.
+
+ // Variable replacement map for the first copy.
+ Map<LogicalVariable, LogicalVariable> newProbeSubTreeVarMap = new HashMap<LogicalVariable, LogicalVariable>();
+ // Variable replacement map for the second copy.
+ Map<LogicalVariable, LogicalVariable> joinInputSubTreeVarMap = new HashMap<LogicalVariable, LogicalVariable>();
+ // Init with all live vars.
+ List<LogicalVariable> liveVars = new ArrayList<LogicalVariable>();
+ VariableUtilities.getLiveVariables(probeSubTree.root, liveVars);
+ for (LogicalVariable var : liveVars) {
+ joinInputSubTreeVarMap.put(var, var);
+ }
+ // Fill variable replacement maps.
+ for (int i = 0; i < optFuncExpr.getNumLogicalVars(); i++) {
+ joinInputSubTreeVarMap.put(optFuncExpr.getLogicalVar(i), context.newVar());
+ newProbeSubTreeVarMap.put(optFuncExpr.getLogicalVar(i), optFuncExpr.getLogicalVar(i));
+ }
+ for (int i = 0; i < originalSubTreePKs.size(); i++) {
+ LogicalVariable newPKVar = context.newVar();
+ surrogateSubTreePKs.add(newPKVar);
+ joinInputSubTreeVarMap.put(originalSubTreePKs.get(i), newPKVar);
+ newProbeSubTreeVarMap.put(originalSubTreePKs.get(i), originalSubTreePKs.get(i));
+ }
+
+ // Create first copy.
+ Counter firstCounter = new Counter(context.getVarCounter());
+ LogicalOperatorDeepCopyVisitor firstDeepCopyVisitor = new LogicalOperatorDeepCopyVisitor(firstCounter,
+ newProbeSubTreeVarMap);
+ ILogicalOperator newProbeSubTree = firstDeepCopyVisitor.deepCopy(probeSubTree.root, null);
+ inferTypes(newProbeSubTree, context);
+ Mutable<ILogicalOperator> newProbeSubTreeRootRef = new MutableObject<ILogicalOperator>(newProbeSubTree);
+ context.setVarCounter(firstCounter.get());
+ // Create second copy.
+ Counter secondCounter = new Counter(context.getVarCounter());
+ LogicalOperatorDeepCopyVisitor secondDeepCopyVisitor = new LogicalOperatorDeepCopyVisitor(secondCounter,
+ joinInputSubTreeVarMap);
+ ILogicalOperator joinInputSubTree = secondDeepCopyVisitor.deepCopy(probeSubTree.root, null);
+ inferTypes(joinInputSubTree, context);
+ probeSubTree.rootRef.setValue(joinInputSubTree);
+ context.setVarCounter(secondCounter.get());
+
+ // Remember the original probe subtree reference so we can return it.
+ Mutable<ILogicalOperator> originalProbeSubTreeRootRef = probeSubTree.rootRef;
+
+ // Replace the original probe subtree with its copy.
+ Dataset origDataset = probeSubTree.dataset;
+ ARecordType origRecordType = probeSubTree.recordType;
+ probeSubTree.initFromSubTree(newProbeSubTreeRootRef);
+ probeSubTree.dataset = origDataset;
+ probeSubTree.recordType = origRecordType;
+
+ // Replace the variables in the join condition based on the mapping of variables
+ // in the new probe subtree.
+ Map<LogicalVariable, LogicalVariable> varMapping = firstDeepCopyVisitor.getVariableMapping();
+ for (Map.Entry<LogicalVariable, LogicalVariable> varMapEntry : varMapping.entrySet()) {
+ if (varMapEntry.getKey() != varMapEntry.getValue()) {
+ joinCond.substituteVar(varMapEntry.getKey(), varMapEntry.getValue());
+ }
+ }
+ return originalProbeSubTreeRootRef;
+ }
+
+ private Mutable<ILogicalExpression> createPrimaryKeysEqJoinCondition(List<LogicalVariable> originalSubTreePKs,
+ List<LogicalVariable> surrogateSubTreePKs) {
+ List<Mutable<ILogicalExpression>> eqExprs = new ArrayList<Mutable<ILogicalExpression>>();
+ int numPKVars = originalSubTreePKs.size();
+ for (int i = 0; i < numPKVars; i++) {
+ List<Mutable<ILogicalExpression>> args = new ArrayList<Mutable<ILogicalExpression>>();
+ args.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(surrogateSubTreePKs.get(i))));
+ args.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(originalSubTreePKs.get(i))));
+ ILogicalExpression eqFunc = new ScalarFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AlgebricksBuiltinFunctions.EQ), args);
+ eqExprs.add(new MutableObject<ILogicalExpression>(eqFunc));
+ }
+ if (eqExprs.size() == 1) {
+ return eqExprs.get(0);
+ } else {
+ ILogicalExpression andFunc = new ScalarFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AlgebricksBuiltinFunctions.AND), eqExprs);
+ return new MutableObject<ILogicalExpression>(andFunc);
+ }
}
private Mutable<ILogicalOperator> createPanicNestedLoopJoinPlan(Mutable<ILogicalOperator> joinRef,
OptimizableOperatorSubTree indexSubTree, OptimizableOperatorSubTree probeSubTree,
- IOptimizableFuncExpr optFuncExpr, Index chosenIndex, IOptimizationContext context)
- throws AlgebricksException {
+ IOptimizableFuncExpr optFuncExpr, Index chosenIndex, Map<LogicalVariable, LogicalVariable> panicVarMap,
+ IOptimizationContext context) throws AlgebricksException {
LogicalVariable inputSearchVar = getInputSearchVar(optFuncExpr, indexSubTree);
// We split the plan into two "branches", and add selections on each side.
@@ -485,8 +598,8 @@
context.computeAndSetTypeEnvironmentForOperator(replicateOp);
// Create select ops for removing tuples that are filterable and not filterable, respectively.
- IVariableTypeEnvironment topTypeEnv = context.getOutputTypeEnvironment(joinRef.getValue());
- IAType inputSearchVarType = (IAType) topTypeEnv.getVarType(inputSearchVar);
+ IVariableTypeEnvironment probeTypeEnv = context.getOutputTypeEnvironment(probeSubTree.root);
+ IAType inputSearchVarType = (IAType) probeTypeEnv.getVarType(inputSearchVar);
Mutable<ILogicalOperator> isFilterableSelectOpRef = new MutableObject<ILogicalOperator>();
Mutable<ILogicalOperator> isNotFilterableSelectOpRef = new MutableObject<ILogicalOperator>();
createIsFilterableSelectOps(replicateOp, inputSearchVar, inputSearchVarType, optFuncExpr, chosenIndex, context,
@@ -500,6 +613,8 @@
LogicalOperatorDeepCopyVisitor deepCopyVisitor = new LogicalOperatorDeepCopyVisitor(counter);
ILogicalOperator scanSubTree = deepCopyVisitor.deepCopy(indexSubTree.root, null);
context.setVarCounter(counter.get());
+ Map<LogicalVariable, LogicalVariable> copyVarMap = deepCopyVisitor.getVariableMapping();
+ panicVarMap.putAll(copyVarMap);
List<LogicalVariable> copyLiveVars = new ArrayList<LogicalVariable>();
VariableUtilities.getLiveVariables(scanSubTree, copyLiveVars);
@@ -508,14 +623,8 @@
// condition since we deep-copied one of the scanner subtrees which
// changed variables.
InnerJoinOperator joinOp = (InnerJoinOperator) joinRef.getValue();
- // Substitute vars in the join condition due to copying of the scanSubTree.
- List<LogicalVariable> joinCondUsedVars = new ArrayList<LogicalVariable>();
- VariableUtilities.getUsedVariables(joinOp, joinCondUsedVars);
- for (int i = 0; i < joinCondUsedVars.size(); i++) {
- int ix = originalLiveVars.indexOf(joinCondUsedVars.get(i));
- if (ix >= 0) {
- joinOp.getCondition().getValue().substituteVar(originalLiveVars.get(ix), copyLiveVars.get(ix));
- }
+ for (Map.Entry<LogicalVariable, LogicalVariable> entry : copyVarMap.entrySet()) {
+ joinOp.getCondition().getValue().substituteVar(entry.getKey(), entry.getValue());
}
joinOp.getInputs().clear();
joinOp.getInputs().add(new MutableObject<ILogicalOperator>(scanSubTree));
@@ -831,4 +940,11 @@
}
}
}
+
+ private void inferTypes(ILogicalOperator op, IOptimizationContext context) throws AlgebricksException {
+ for (Mutable<ILogicalOperator> childOpRef : op.getInputs()) {
+ inferTypes(childOpRef.getValue(), context);
+ }
+ context.computeAndSetTypeEnvironmentForOperator(op);
+ }
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/InvertedIndexJobGenParams.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/InvertedIndexJobGenParams.java
index 530606e..65473c7 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/InvertedIndexJobGenParams.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/InvertedIndexJobGenParams.java
@@ -30,9 +30,9 @@
public InvertedIndexJobGenParams() {
}
- public InvertedIndexJobGenParams(String indexName, IndexType indexType, String datasetName, boolean retainInput,
- boolean requiresBroadcast) {
- super(indexName, indexType, datasetName, retainInput, requiresBroadcast);
+ public InvertedIndexJobGenParams(String indexName, IndexType indexType, String dataverseName, String datasetName,
+ boolean retainInput, boolean requiresBroadcast) {
+ super(indexName, indexType, dataverseName, datasetName, retainInput, requiresBroadcast);
}
public void setSearchModifierType(SearchModifierType searchModifierType) {
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/OptimizableFuncExpr.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/OptimizableFuncExpr.java
index 13e515a..dbbe6d9 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/OptimizableFuncExpr.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/OptimizableFuncExpr.java
@@ -96,4 +96,16 @@
public OptimizableOperatorSubTree getOperatorSubTree(int index) {
return subTrees[index];
}
+
+ @Override
+ public void substituteVar(LogicalVariable original, LogicalVariable substitution) {
+ if (logicalVars != null) {
+ for (int i = 0; i < logicalVars.length; i++) {
+ if (logicalVars[i] == original) {
+ logicalVars[i] = substitution;
+ break;
+ }
+ }
+ }
+ }
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/OptimizableOperatorSubTree.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/OptimizableOperatorSubTree.java
index 80f8cc1..fd1b89d 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/OptimizableOperatorSubTree.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/OptimizableOperatorSubTree.java
@@ -6,16 +6,18 @@
import org.apache.commons.lang3.mutable.Mutable;
import edu.uci.ics.asterix.common.config.DatasetConfig.DatasetType;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
import edu.uci.ics.asterix.metadata.entities.Dataset;
+import edu.uci.ics.asterix.metadata.utils.DatasetUtils;
import edu.uci.ics.asterix.om.types.ARecordType;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.optimizer.base.AnalysisUtil;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalOperatorTag;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalVariable;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AssignOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.DataSourceScanOperator;
@@ -27,8 +29,8 @@
* (select)? <-- (datasource scan)
*/
public class OptimizableOperatorSubTree {
- public ILogicalOperator root;
- public Mutable<ILogicalOperator> rootRef;
+ public ILogicalOperator root = null;
+ public Mutable<ILogicalOperator> rootRef = null;
public final List<Mutable<ILogicalOperator>> assignRefs = new ArrayList<Mutable<ILogicalOperator>>();
public final List<AssignOperator> assigns = new ArrayList<AssignOperator>();
public Mutable<ILogicalOperator> dataSourceScanRef = null;
@@ -38,6 +40,7 @@
public ARecordType recordType = null;
public boolean initFromSubTree(Mutable<ILogicalOperator> subTreeOpRef) {
+ reset();
rootRef = subTreeOpRef;
root = subTreeOpRef.getValue();
// Examine the op's children to match the expected patterns.
@@ -87,12 +90,13 @@
return false;
}
// Find the dataset corresponding to the datasource scan in the metadata.
- String datasetName = AnalysisUtil.getDatasetName(dataSourceScan);
- if (datasetName == null) {
+ Pair<String, String> datasetInfo = AnalysisUtil.getDatasetInfo(dataSourceScan);
+ String dataverseName = datasetInfo.first;
+ String datasetName = datasetInfo.second;
+ if (dataverseName == null || datasetName == null) {
return false;
}
- AqlCompiledMetadataDeclarations metadata = metadataProvider.getMetadataDeclarations();
- dataset = metadata.findDataset(datasetName);
+ dataset = metadataProvider.findDataset(dataverseName, datasetName);
if (dataset == null) {
throw new AlgebricksException("No metadata for dataset " + datasetName);
}
@@ -100,7 +104,7 @@
return false;
}
// Get the record type for that dataset.
- IAType itemType = metadata.findType(dataset.getItemTypeName());
+ IAType itemType = metadataProvider.findType(dataverseName, dataset.getItemTypeName());
if (itemType.getTypeTag() != ATypeTag.RECORD) {
return false;
}
@@ -111,4 +115,22 @@
public boolean hasDataSourceScan() {
return dataSourceScan != null;
}
+
+ public void reset() {
+ root = null;
+ rootRef = null;
+ assignRefs.clear();
+ assigns.clear();
+ dataSourceScanRef = null;
+ dataSourceScan = null;
+ dataset = null;
+ recordType = null;
+ }
+
+ public void getPrimaryKeyVars(List<LogicalVariable> target) {
+ int numPrimaryKeys = DatasetUtils.getPartitioningKeys(dataset).size();
+ for (int i = 0; i < numPrimaryKeys; i++) {
+ target.add(dataSourceScan.getVariables().get(i));
+ }
+ }
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/RTreeAccessMethod.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/RTreeAccessMethod.java
index dfd3ff7..45cce9c 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/RTreeAccessMethod.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/RTreeAccessMethod.java
@@ -26,8 +26,11 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ConstantExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractBinaryJoinOperator;
+import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator.ExecutionMode;
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.SelectOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.UnnestMapOperator;
/**
@@ -50,7 +53,11 @@
@Override
public boolean analyzeFuncExprArgs(AbstractFunctionCallExpression funcExpr, List<AssignOperator> assigns,
AccessMethodAnalysisContext analysisCtx) {
- return AccessMethodUtils.analyzeFuncExprArgsForOneConstAndVar(funcExpr, analysisCtx);
+ boolean matches = AccessMethodUtils.analyzeFuncExprArgsForOneConstAndVar(funcExpr, analysisCtx);
+ if (!matches) {
+ matches = AccessMethodUtils.analyzeFuncExprArgsForTwoVars(funcExpr, analysisCtx);
+ }
+ return matches;
}
@Override
@@ -65,27 +72,71 @@
@Override
public boolean applySelectPlanTransformation(Mutable<ILogicalOperator> selectRef,
- OptimizableOperatorSubTree subTree, Index index, AccessMethodAnalysisContext analysisCtx,
+ OptimizableOperatorSubTree subTree, Index chosenIndex, AccessMethodAnalysisContext analysisCtx,
IOptimizationContext context) throws AlgebricksException {
- Dataset dataset = subTree.dataset;
- ARecordType recordType = subTree.recordType;
// TODO: We can probably do something smarter here based on selectivity or MBR area.
- // Pick the first expr optimizable by this index.
- List<Integer> indexExprs = analysisCtx.getIndexExprs(index);
- int firstExprIndex = indexExprs.get(0);
- IOptimizableFuncExpr optFuncExpr = analysisCtx.matchedFuncExprs.get(firstExprIndex);
+ IOptimizableFuncExpr optFuncExpr = AccessMethodUtils.chooseFirstOptFuncExpr(chosenIndex, analysisCtx);
+ ILogicalOperator primaryIndexUnnestOp = createSecondaryToPrimaryPlan(subTree, null, chosenIndex, optFuncExpr,
+ false, false, context);
+ if (primaryIndexUnnestOp == null) {
+ return false;
+ }
+ // Replace the datasource scan with the new plan rooted at primaryIndexUnnestMap.
+ subTree.dataSourceScanRef.setValue(primaryIndexUnnestOp);
+ return true;
+ }
- // Get the number of dimensions corresponding to the field indexed by
- // chosenIndex.
+ @Override
+ public boolean applyJoinPlanTransformation(Mutable<ILogicalOperator> joinRef,
+ OptimizableOperatorSubTree leftSubTree, OptimizableOperatorSubTree rightSubTree, Index chosenIndex,
+ AccessMethodAnalysisContext analysisCtx, IOptimizationContext context) throws AlgebricksException {
+ // Determine if the index is applicable on the left or right side (if both, we arbitrarily prefer the left side).
+ Dataset dataset = analysisCtx.indexDatasetMap.get(chosenIndex);
+ // Determine probe and index subtrees based on chosen index.
+ OptimizableOperatorSubTree indexSubTree = null;
+ OptimizableOperatorSubTree probeSubTree = null;
+ if (leftSubTree.dataset != null && dataset.getDatasetName().equals(leftSubTree.dataset.getDatasetName())) {
+ indexSubTree = leftSubTree;
+ probeSubTree = rightSubTree;
+ } else if (rightSubTree.dataset != null
+ && dataset.getDatasetName().equals(rightSubTree.dataset.getDatasetName())) {
+ indexSubTree = rightSubTree;
+ probeSubTree = leftSubTree;
+ }
+ // TODO: We can probably do something smarter here based on selectivity or MBR area.
+ IOptimizableFuncExpr optFuncExpr = AccessMethodUtils.chooseFirstOptFuncExpr(chosenIndex, analysisCtx);
+ ILogicalOperator primaryIndexUnnestOp = createSecondaryToPrimaryPlan(indexSubTree, probeSubTree, chosenIndex,
+ optFuncExpr, true, true, context);
+ if (primaryIndexUnnestOp == null) {
+ return false;
+ }
+ indexSubTree.dataSourceScanRef.setValue(primaryIndexUnnestOp);
+ // Change join into a select with the same condition.
+ AbstractBinaryJoinOperator joinOp = (AbstractBinaryJoinOperator) joinRef.getValue();
+ SelectOperator topSelect = new SelectOperator(joinOp.getCondition());
+ topSelect.getInputs().add(indexSubTree.rootRef);
+ topSelect.setExecutionMode(ExecutionMode.LOCAL);
+ context.computeAndSetTypeEnvironmentForOperator(topSelect);
+ // Replace the original join with the new subtree rooted at the select op.
+ joinRef.setValue(topSelect);
+ return true;
+ }
+
+ private ILogicalOperator createSecondaryToPrimaryPlan(OptimizableOperatorSubTree indexSubTree,
+ OptimizableOperatorSubTree probeSubTree, Index chosenIndex, IOptimizableFuncExpr optFuncExpr,
+ boolean retainInput, boolean requiresBroadcast, IOptimizationContext context) throws AlgebricksException {
+ Dataset dataset = indexSubTree.dataset;
+ ARecordType recordType = indexSubTree.recordType;
+
+ // Get the number of dimensions corresponding to the field indexed by chosenIndex.
Pair<IAType, Boolean> keyPairType = Index.getNonNullableKeyFieldType(optFuncExpr.getFieldName(0), recordType);
IAType spatialType = keyPairType.first;
int numDimensions = NonTaggedFormatUtil.getNumDimensions(spatialType.getTypeTag());
int numSecondaryKeys = numDimensions * 2;
- DataSourceScanOperator dataSourceScan = subTree.dataSourceScan;
- // TODO: For now retainInput and requiresBroadcast are always false.
- RTreeJobGenParams jobGenParams = new RTreeJobGenParams(index.getIndexName(), IndexType.RTREE,
- dataset.getDatasetName(), false, false);
+ DataSourceScanOperator dataSourceScan = indexSubTree.dataSourceScan;
+ RTreeJobGenParams jobGenParams = new RTreeJobGenParams(chosenIndex.getIndexName(), IndexType.RTREE,
+ dataset.getDataverseName(), dataset.getDatasetName(), retainInput, requiresBroadcast);
// A spatial object is serialized in the constant of the func expr we are optimizing.
// The R-Tree expects as input an MBR represented with 1 field per dimension.
// Here we generate vars and funcs for extracting MBR fields from the constant into fields of a tuple (as the R-Tree expects them).
@@ -93,13 +144,14 @@
ArrayList<LogicalVariable> keyVarList = new ArrayList<LogicalVariable>();
// List of expressions for the assign.
ArrayList<Mutable<ILogicalExpression>> keyExprList = new ArrayList<Mutable<ILogicalExpression>>();
+ ILogicalExpression searchKeyExpr = AccessMethodUtils.createSearchKeyExpr(optFuncExpr, indexSubTree,
+ probeSubTree);
for (int i = 0; i < numSecondaryKeys; i++) {
// The create MBR function "extracts" one field of an MBR around the given spatial object.
AbstractFunctionCallExpression createMBR = new ScalarFunctionCallExpression(
FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.CREATE_MBR));
// Spatial object is the constant from the func expr we are optimizing.
- createMBR.getArguments().add(
- new MutableObject<ILogicalExpression>(new ConstantExpression(optFuncExpr.getConstantVal(0))));
+ createMBR.getArguments().add(new MutableObject<ILogicalExpression>(searchKeyExpr));
// The number of dimensions.
createMBR.getArguments().add(
new MutableObject<ILogicalExpression>(new ConstantExpression(new AsterixConstantValue(new AInt32(
@@ -117,26 +169,23 @@
// Assign operator that "extracts" the MBR fields from the func-expr constant into a tuple.
AssignOperator assignSearchKeys = new AssignOperator(keyVarList, keyExprList);
- // Input to this assign is the EmptyTupleSource (which the dataSourceScan also must have had as input).
- assignSearchKeys.getInputs().add(dataSourceScan.getInputs().get(0));
- assignSearchKeys.setExecutionMode(dataSourceScan.getExecutionMode());
+ if (probeSubTree == null) {
+ // We are optimizing a selection query.
+ // Input to this assign is the EmptyTupleSource (which the dataSourceScan also must have had as input).
+ assignSearchKeys.getInputs().add(dataSourceScan.getInputs().get(0));
+ assignSearchKeys.setExecutionMode(dataSourceScan.getExecutionMode());
+ } else {
+ // We are optimizing a join, place the assign op top of the probe subtree.
+ assignSearchKeys.getInputs().add(probeSubTree.rootRef);
+ }
UnnestMapOperator secondaryIndexUnnestOp = AccessMethodUtils.createSecondaryIndexUnnestMap(dataset, recordType,
- index, assignSearchKeys, jobGenParams, context, false, false);
+ chosenIndex, assignSearchKeys, jobGenParams, context, false, retainInput);
// Generate the rest of the upstream plan which feeds the search results into the primary index.
UnnestMapOperator primaryIndexUnnestOp = AccessMethodUtils.createPrimaryIndexUnnestMap(dataSourceScan, dataset,
- recordType, secondaryIndexUnnestOp, context, true, false, false);
- // Replace the datasource scan with the new plan rooted at primaryIndexUnnestMap.
- subTree.dataSourceScanRef.setValue(primaryIndexUnnestOp);
- return true;
- }
+ recordType, secondaryIndexUnnestOp, context, true, retainInput, false);
- @Override
- public boolean applyJoinPlanTransformation(Mutable<ILogicalOperator> joinRef,
- OptimizableOperatorSubTree leftSubTree, OptimizableOperatorSubTree rightSubTree, Index chosenIndex,
- AccessMethodAnalysisContext analysisCtx, IOptimizationContext context) throws AlgebricksException {
- // TODO Implement this.
- return false;
+ return primaryIndexUnnestOp;
}
@Override
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/RTreeJobGenParams.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/RTreeJobGenParams.java
index b3153f9..846bcb6 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/RTreeJobGenParams.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/RTreeJobGenParams.java
@@ -20,9 +20,9 @@
public RTreeJobGenParams() {
}
- public RTreeJobGenParams(String indexName, IndexType indexType, String datasetName, boolean retainInput,
- boolean requiresBroadcast) {
- super(indexName, indexType, datasetName, retainInput, requiresBroadcast);
+ public RTreeJobGenParams(String indexName, IndexType indexType, String dataverseName, String datasetName,
+ boolean retainInput, boolean requiresBroadcast) {
+ super(indexName, indexType, dataverseName, datasetName, retainInput, requiresBroadcast);
}
public void writeToFuncArgs(List<Mutable<ILogicalExpression>> funcArgs) {
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/typecast/StaticTypeCastUtil.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/typecast/StaticTypeCastUtil.java
new file mode 100644
index 0000000..0c6f2ea
--- /dev/null
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/typecast/StaticTypeCastUtil.java
@@ -0,0 +1,408 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.optimizer.rules.typecast;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.commons.lang3.mutable.Mutable;
+import org.apache.commons.lang3.mutable.MutableObject;
+
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.base.AString;
+import edu.uci.ics.asterix.om.constants.AsterixConstantValue;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
+import edu.uci.ics.asterix.om.pointables.base.DefaultOpenFieldType;
+import edu.uci.ics.asterix.om.typecomputer.base.TypeComputerUtilities;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.AUnionType;
+import edu.uci.ics.asterix.om.types.AbstractCollectionType;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalExpressionTag;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ConstantExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression;
+
+/**
+ * This class is utility to do type cast.
+ * It offers two public methods:
+ * 1. public static boolean rewriteListExpr(AbstractFunctionCallExpression funcExpr, IAType reqType, IAType inputType,
+ * IVariableTypeEnvironment env) throws AlgebricksException, which only enforces the list type recursively.
+ * 2. public static boolean rewriteFuncExpr(AbstractFunctionCallExpression funcExpr, IAType reqType, IAType inputType,
+ * IVariableTypeEnvironment env) throws AlgebricksException, which enforces the list type and the record type recursively.
+ *
+ * @author yingyib
+ */
+public class StaticTypeCastUtil {
+
+ /**
+ * This method is only called when funcExpr contains list constructor function calls.
+ * The List constructor is very special because a nested list is of type List<ANY>.
+ * However, the bottom-up type inference (InferTypeRule in algebricks) did not infer that so we need this method to enforce the type.
+ * We do not want to break the generality of algebricks so this method is called in an ASTERIX rule: @ IntroduceEnforcedListTypeRule} .
+ *
+ * @param funcExpr
+ * record constructor function expression
+ * @param requiredListType
+ * required record type
+ * @param inputRecordType
+ * @param env
+ * type environment
+ * @throws AlgebricksException
+ */
+ public static boolean rewriteListExpr(AbstractFunctionCallExpression funcExpr, IAType reqType, IAType inputType,
+ IVariableTypeEnvironment env) throws AlgebricksException {
+ if (funcExpr.getFunctionIdentifier() == AsterixBuiltinFunctions.UNORDERED_LIST_CONSTRUCTOR) {
+ if (reqType.equals(BuiltinType.ANY)) {
+ reqType = DefaultOpenFieldType.NESTED_OPEN_AUNORDERED_LIST_TYPE;
+ }
+ return rewriteListFuncExpr(funcExpr, (AbstractCollectionType) reqType, (AbstractCollectionType) inputType,
+ env);
+ } else if (funcExpr.getFunctionIdentifier() == AsterixBuiltinFunctions.ORDERED_LIST_CONSTRUCTOR) {
+ if (reqType.equals(BuiltinType.ANY)) {
+ reqType = DefaultOpenFieldType.NESTED_OPEN_AORDERED_LIST_TYPE;
+ }
+ return rewriteListFuncExpr(funcExpr, (AbstractCollectionType) reqType, (AbstractCollectionType) inputType,
+ env);
+ } else {
+ List<Mutable<ILogicalExpression>> args = funcExpr.getArguments();
+ boolean changed = false;
+ for (Mutable<ILogicalExpression> arg : args) {
+ ILogicalExpression argExpr = arg.getValue();
+ if (argExpr.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
+ AbstractFunctionCallExpression argFuncExpr = (AbstractFunctionCallExpression) argExpr;
+ IAType exprType = (IAType) env.getType(argFuncExpr);
+ changed = changed || rewriteListExpr(argFuncExpr, exprType, exprType, env);
+ }
+ }
+ return changed;
+ }
+ }
+
+ /**
+ * This method is to recursively enforce required types, for the list type and the record type.
+ * The List constructor is very special because
+ * 1. a nested list in a list is of type List<ANY>;
+ * 2. a nested record in a list is of type Open_Record{}.
+ * The open record constructor is very special because
+ * 1. a nested list in the open part is of type List<ANY>;
+ * 2. a nested record in the open part is of type Open_Record{}.
+ * However, the bottom-up type inference (InferTypeRule in algebricks) did not infer that so we need this method to enforce the type.
+ * We do not want to break the generality of algebricks so this method is called in an ASTERIX rule: @ IntroduceStaticTypeCastRule} .
+ *
+ * @param funcExpr
+ * the function expression whose type needs to be top-down enforced
+ * @param reqType
+ * the required type inferred from parent operators/expressions
+ * @param inputType
+ * the current inferred
+ * @param env
+ * the type environment
+ * @return true if the type is casted; otherwise, false.
+ * @throws AlgebricksException
+ */
+ public static boolean rewriteFuncExpr(AbstractFunctionCallExpression funcExpr, IAType reqType, IAType inputType,
+ IVariableTypeEnvironment env) throws AlgebricksException {
+ if (funcExpr.getFunctionIdentifier() == AsterixBuiltinFunctions.UNORDERED_LIST_CONSTRUCTOR) {
+ if (reqType.equals(BuiltinType.ANY)) {
+ reqType = DefaultOpenFieldType.NESTED_OPEN_AUNORDERED_LIST_TYPE;
+ }
+ return rewriteListFuncExpr(funcExpr, (AbstractCollectionType) reqType, (AbstractCollectionType) inputType,
+ env);
+ } else if (funcExpr.getFunctionIdentifier() == AsterixBuiltinFunctions.ORDERED_LIST_CONSTRUCTOR) {
+ if (reqType.equals(BuiltinType.ANY)) {
+ reqType = DefaultOpenFieldType.NESTED_OPEN_AORDERED_LIST_TYPE;
+ }
+ return rewriteListFuncExpr(funcExpr, (AbstractCollectionType) reqType, (AbstractCollectionType) inputType,
+ env);
+ } else if (inputType.getTypeTag().equals(ATypeTag.RECORD)) {
+ if (reqType.equals(BuiltinType.ANY)) {
+ reqType = DefaultOpenFieldType.NESTED_OPEN_RECORD_TYPE;
+ }
+ return rewriteRecordFuncExpr(funcExpr, (ARecordType) reqType, (ARecordType) inputType, env);
+ } else {
+ List<Mutable<ILogicalExpression>> args = funcExpr.getArguments();
+ boolean changed = false;
+ for (Mutable<ILogicalExpression> arg : args) {
+ ILogicalExpression argExpr = arg.getValue();
+ if (argExpr.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
+ AbstractFunctionCallExpression argFuncExpr = (AbstractFunctionCallExpression) argExpr;
+ IAType exprType = (IAType) env.getType(argFuncExpr);
+ changed = changed || rewriteFuncExpr(argFuncExpr, exprType, exprType, env);
+ }
+ }
+ return changed;
+ }
+ }
+
+ /**
+ * only called when funcExpr is record constructor
+ *
+ * @param funcExpr
+ * record constructor function expression
+ * @param requiredListType
+ * required record type
+ * @param inputRecordType
+ * @param env
+ * type environment
+ * @throws AlgebricksException
+ */
+ private static boolean rewriteRecordFuncExpr(AbstractFunctionCallExpression funcExpr,
+ ARecordType requiredRecordType, ARecordType inputRecordType, IVariableTypeEnvironment env)
+ throws AlgebricksException {
+ // if already rewritten, the required type is not null
+ if (TypeComputerUtilities.getRequiredType(funcExpr) != null)
+ return false;
+ TypeComputerUtilities.setRequiredAndInputTypes(funcExpr, requiredRecordType, inputRecordType);
+ staticRecordTypeCast(funcExpr, requiredRecordType, inputRecordType, env);
+ return true;
+ }
+
+ /**
+ * only called when funcExpr is list constructor
+ *
+ * @param funcExpr
+ * list constructor function expression
+ * @param requiredListType
+ * required list type
+ * @param inputListType
+ * @param env
+ * type environment
+ * @throws AlgebricksException
+ */
+ private static boolean rewriteListFuncExpr(AbstractFunctionCallExpression funcExpr,
+ AbstractCollectionType requiredListType, AbstractCollectionType inputListType, IVariableTypeEnvironment env)
+ throws AlgebricksException {
+ if (TypeComputerUtilities.getRequiredType(funcExpr) != null)
+ return false;
+
+ TypeComputerUtilities.setRequiredAndInputTypes(funcExpr, requiredListType, inputListType);
+ List<Mutable<ILogicalExpression>> args = funcExpr.getArguments();
+
+ IAType itemType = requiredListType.getItemType();
+ IAType inputItemType = inputListType.getItemType();
+ for (int j = 0; j < args.size(); j++) {
+ ILogicalExpression arg = args.get(j).getValue();
+ if (arg.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
+ ScalarFunctionCallExpression argFunc = (ScalarFunctionCallExpression) arg;
+ IAType currentItemType = (IAType) env.getType(argFunc);
+ if (inputItemType == null || inputItemType == BuiltinType.ANY) {
+ currentItemType = (IAType) env.getType(argFunc);
+ rewriteFuncExpr(argFunc, itemType, currentItemType, env);
+ } else {
+ rewriteFuncExpr(argFunc, itemType, inputItemType, env);
+ }
+ }
+ }
+ return true;
+ }
+
+ /**
+ * This method statically cast the type of records from their current type to the required type.
+ *
+ * @param func
+ * The record constructor expression.
+ * @param reqType
+ * The required type.
+ * @param inputType
+ * The current type.
+ * @param env
+ * The type environment.
+ * @throws AlgebricksException
+ */
+ private static void staticRecordTypeCast(AbstractFunctionCallExpression func, ARecordType reqType,
+ ARecordType inputType, IVariableTypeEnvironment env) throws AlgebricksException {
+ IAType[] reqFieldTypes = reqType.getFieldTypes();
+ String[] reqFieldNames = reqType.getFieldNames();
+ IAType[] inputFieldTypes = inputType.getFieldTypes();
+ String[] inputFieldNames = inputType.getFieldNames();
+
+ int[] fieldPermutation = new int[reqFieldTypes.length];
+ boolean[] nullFields = new boolean[reqFieldTypes.length];
+ boolean[] openFields = new boolean[inputFieldTypes.length];
+
+ Arrays.fill(nullFields, false);
+ Arrays.fill(openFields, true);
+ Arrays.fill(fieldPermutation, -1);
+
+ // forward match: match from actual to required
+ boolean matched = false;
+ for (int i = 0; i < inputFieldNames.length; i++) {
+ String fieldName = inputFieldNames[i];
+ IAType fieldType = inputFieldTypes[i];
+
+ if (2 * i + 1 > func.getArguments().size())
+ throw new AlgebricksException("expression index out of bound");
+
+ // 2*i+1 is the index of field value expression
+ ILogicalExpression arg = func.getArguments().get(2 * i + 1).getValue();
+ matched = false;
+ for (int j = 0; j < reqFieldNames.length; j++) {
+ String reqFieldName = reqFieldNames[j];
+ IAType reqFieldType = reqFieldTypes[j];
+ if (fieldName.equals(reqFieldName)) {
+ if (fieldType.equals(reqFieldType)) {
+ fieldPermutation[j] = i;
+ openFields[i] = false;
+ matched = true;
+
+ if (arg.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
+ ScalarFunctionCallExpression scalarFunc = (ScalarFunctionCallExpression) arg;
+ rewriteFuncExpr(scalarFunc, reqFieldType, fieldType, env);
+ }
+ break;
+ }
+
+ // match the optional field
+ if (reqFieldType.getTypeTag() == ATypeTag.UNION
+ && NonTaggedFormatUtil.isOptionalField((AUnionType) reqFieldType)) {
+ IAType itemType = ((AUnionType) reqFieldType).getUnionList().get(
+ NonTaggedFormatUtil.OPTIONAL_TYPE_INDEX_IN_UNION_LIST);
+ reqFieldType = itemType;
+ if (fieldType.equals(BuiltinType.ANULL) || fieldType.equals(itemType)) {
+ fieldPermutation[j] = i;
+ openFields[i] = false;
+ matched = true;
+
+ // rewrite record expr
+ if (arg.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
+ ScalarFunctionCallExpression scalarFunc = (ScalarFunctionCallExpression) arg;
+ rewriteFuncExpr(scalarFunc, reqFieldType, fieldType, env);
+ }
+ break;
+ }
+ }
+
+ // match the record field: need cast
+ if (arg.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
+ ScalarFunctionCallExpression scalarFunc = (ScalarFunctionCallExpression) arg;
+ rewriteFuncExpr(scalarFunc, reqFieldType, fieldType, env);
+ fieldPermutation[j] = i;
+ openFields[i] = false;
+ matched = true;
+ break;
+ }
+ }
+ }
+ // the input has extra fields
+ if (!matched && !reqType.isOpen())
+ throw new AlgebricksException("static type mismatch: including an extra closed field " + fieldName);
+ }
+
+ // backward match: match from required to actual
+ for (int i = 0; i < reqFieldNames.length; i++) {
+ String reqFieldName = reqFieldNames[i];
+ IAType reqFieldType = reqFieldTypes[i];
+ matched = false;
+ for (int j = 0; j < inputFieldNames.length; j++) {
+ String fieldName = inputFieldNames[j];
+ IAType fieldType = inputFieldTypes[j];
+ if (!fieldName.equals(reqFieldName))
+ continue;
+ // should check open field here
+ // because number of entries in fieldPermuations is the
+ // number of required schema fields
+ // here we want to check if an input field is matched
+ // the entry index of fieldPermuatons is req field index
+ if (!openFields[j]) {
+ matched = true;
+ break;
+ }
+
+ // match the optional field
+ if (reqFieldType.getTypeTag() == ATypeTag.UNION
+ && NonTaggedFormatUtil.isOptionalField((AUnionType) reqFieldType)) {
+ IAType itemType = ((AUnionType) reqFieldType).getUnionList().get(
+ NonTaggedFormatUtil.OPTIONAL_TYPE_INDEX_IN_UNION_LIST);
+ if (fieldType.equals(BuiltinType.ANULL) || fieldType.equals(itemType)) {
+ matched = true;
+ break;
+ }
+ }
+ }
+ if (matched)
+ continue;
+
+ if (reqFieldType.getTypeTag() == ATypeTag.UNION
+ && NonTaggedFormatUtil.isOptionalField((AUnionType) reqFieldType)) {
+ // add a null field
+ nullFields[i] = true;
+ } else {
+ // no matched field in the input for a required closed field
+ throw new AlgebricksException("static type mismatch: miss a required closed field " + reqFieldName);
+ }
+ }
+
+ List<Mutable<ILogicalExpression>> arguments = func.getArguments();
+ List<Mutable<ILogicalExpression>> originalArguments = new ArrayList<Mutable<ILogicalExpression>>();
+ originalArguments.addAll(arguments);
+ arguments.clear();
+ // re-order the closed part and fill in null fields
+ for (int i = 0; i < fieldPermutation.length; i++) {
+ int pos = fieldPermutation[i];
+ if (pos >= 0) {
+ arguments.add(originalArguments.get(2 * pos));
+ arguments.add(originalArguments.get(2 * pos + 1));
+ }
+ if (nullFields[i]) {
+ // add a null field
+ arguments.add(new MutableObject<ILogicalExpression>(new ConstantExpression(new AsterixConstantValue(
+ new AString(reqFieldNames[i])))));
+ arguments.add(new MutableObject<ILogicalExpression>(new ConstantExpression(new AsterixConstantValue(
+ ANull.NULL))));
+ }
+ }
+
+ // add the open part
+ for (int i = 0; i < openFields.length; i++) {
+ if (openFields[i]) {
+ arguments.add(originalArguments.get(2 * i));
+ Mutable<ILogicalExpression> fExprRef = originalArguments.get(2 * i + 1);
+ ILogicalExpression argExpr = fExprRef.getValue();
+
+ // we need to handle open fields recursively by their default
+ // types
+ // for list, their item type is any
+ // for record, their
+ if (argExpr.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
+ IAType reqFieldType = inputFieldTypes[i];
+ if (inputFieldTypes[i].getTypeTag() == ATypeTag.RECORD) {
+ reqFieldType = DefaultOpenFieldType.NESTED_OPEN_RECORD_TYPE;
+ }
+ if (inputFieldTypes[i].getTypeTag() == ATypeTag.ORDEREDLIST) {
+ reqFieldType = DefaultOpenFieldType.NESTED_OPEN_AORDERED_LIST_TYPE;
+ }
+ if (inputFieldTypes[i].getTypeTag() == ATypeTag.UNORDEREDLIST) {
+ reqFieldType = DefaultOpenFieldType.NESTED_OPEN_AUNORDERED_LIST_TYPE;
+ }
+ if (TypeComputerUtilities.getRequiredType((AbstractFunctionCallExpression) argExpr) == null) {
+ ScalarFunctionCallExpression argFunc = (ScalarFunctionCallExpression) argExpr;
+ rewriteFuncExpr(argFunc, reqFieldType, inputFieldTypes[i], env);
+ }
+ }
+ arguments.add(fExprRef);
+ }
+ }
+ }
+
+}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AbstractAqlTranslator.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AbstractAqlTranslator.java
index 5f31bd1..9163e35 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AbstractAqlTranslator.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AbstractAqlTranslator.java
@@ -1,90 +1,103 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package edu.uci.ics.asterix.translator;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import edu.uci.ics.asterix.aql.base.Statement;
-import edu.uci.ics.asterix.aql.expression.DataverseDecl;
-import edu.uci.ics.asterix.aql.expression.SetStatement;
-import edu.uci.ics.asterix.aql.expression.TypeDecl;
-import edu.uci.ics.asterix.aql.expression.WriteStatement;
-import edu.uci.ics.asterix.metadata.MetadataException;
-import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
+import edu.uci.ics.asterix.aql.expression.DataverseDropStatement;
+import edu.uci.ics.asterix.aql.expression.DeleteStatement;
+import edu.uci.ics.asterix.aql.expression.DropStatement;
+import edu.uci.ics.asterix.aql.expression.InsertStatement;
+import edu.uci.ics.asterix.aql.expression.NodeGroupDropStatement;
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.metadata.bootstrap.MetadataConstants;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.data.IAWriterFactory;
-import edu.uci.ics.hyracks.algebricks.runtime.writers.PrinterBasedWriterFactory;
-import edu.uci.ics.hyracks.api.io.FileReference;
-import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
+import edu.uci.ics.asterix.metadata.entities.AsterixBuiltinTypeMap;
+import edu.uci.ics.asterix.metadata.entities.Dataverse;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+/**
+ * Base class for AQL translators.
+ * Contains the common validation logic for AQL statements.
+ */
public abstract class AbstractAqlTranslator {
- public AqlCompiledMetadataDeclarations compileMetadata(MetadataTransactionContext mdTxnCtx,
- List<Statement> statements, boolean online) throws AlgebricksException, MetadataException {
- List<TypeDecl> typeDeclarations = new ArrayList<TypeDecl>();
- Map<String, String> config = new HashMap<String, String>();
+ protected static final Map<String, BuiltinType> builtinTypeMap = AsterixBuiltinTypeMap.getBuiltinTypes();
- FileSplit outputFile = null;
- IAWriterFactory writerFactory = null;
- String dataverseName = MetadataConstants.METADATA_DATAVERSE_NAME;
- for (Statement stmt : statements) {
- switch (stmt.getKind()) {
- case TYPE_DECL: {
- typeDeclarations.add((TypeDecl) stmt);
- break;
+ public void validateOperation(Dataverse defaultDataverse, Statement stmt) throws AsterixException {
+ boolean invalidOperation = false;
+ String message = null;
+ String dataverse = defaultDataverse != null ? defaultDataverse.getDataverseName() : null;
+ switch (stmt.getKind()) {
+ case INSERT:
+ InsertStatement insertStmt = (InsertStatement) stmt;
+ if (insertStmt.getDataverseName() != null) {
+ dataverse = insertStmt.getDataverseName().getValue();
}
- case DATAVERSE_DECL: {
- DataverseDecl dstmt = (DataverseDecl) stmt;
- dataverseName = dstmt.getDataverseName().toString();
- break;
+ invalidOperation = MetadataConstants.METADATA_DATAVERSE_NAME.equals(dataverse);
+ if (invalidOperation) {
+ message = "Insert operation is not permitted in dataverse "
+ + MetadataConstants.METADATA_DATAVERSE_NAME;
}
- case WRITE: {
- if (outputFile != null) {
- throw new AlgebricksException("Multiple 'write' statements.");
- }
- WriteStatement ws = (WriteStatement) stmt;
- File f = new File(ws.getFileName());
- outputFile = new FileSplit(ws.getNcName().getValue(), new FileReference(f));
- if (ws.getWriterClassName() != null) {
- try {
- writerFactory = (IAWriterFactory) Class.forName(ws.getWriterClassName()).newInstance();
- } catch (Exception e) {
- throw new AlgebricksException(e);
- }
- }
- break;
+ break;
+
+ case DELETE:
+ DeleteStatement deleteStmt = (DeleteStatement) stmt;
+ if (deleteStmt.getDataverseName() != null) {
+ dataverse = deleteStmt.getDataverseName().getValue();
}
- case SET: {
- SetStatement ss = (SetStatement) stmt;
- String pname = ss.getPropName();
- String pvalue = ss.getPropValue();
- config.put(pname, pvalue);
- break;
+ invalidOperation = MetadataConstants.METADATA_DATAVERSE_NAME.equals(dataverse);
+ if (invalidOperation) {
+ message = "Delete operation is not permitted in dataverse "
+ + MetadataConstants.METADATA_DATAVERSE_NAME;
}
- }
- }
- if (writerFactory == null) {
- writerFactory = PrinterBasedWriterFactory.INSTANCE;
+ break;
+
+ case NODEGROUP_DROP:
+ String nodegroupName = ((NodeGroupDropStatement) stmt).getNodeGroupName().getValue();
+ invalidOperation = MetadataConstants.METADATA_DEFAULT_NODEGROUP_NAME.equals(nodegroupName);
+ if (invalidOperation) {
+ message = "Cannot drop nodegroup:" + nodegroupName;
+ }
+ break;
+
+ case DATAVERSE_DROP:
+ DataverseDropStatement dvDropStmt = (DataverseDropStatement) stmt;
+ invalidOperation = MetadataConstants.METADATA_DATAVERSE_NAME.equals(dvDropStmt.getDataverseName()
+ .getValue());
+ if (invalidOperation) {
+ message = "Cannot drop dataverse:" + dvDropStmt.getDataverseName().getValue();
+ }
+ break;
+
+ case DATASET_DROP:
+ DropStatement dropStmt = (DropStatement) stmt;
+ if (dropStmt.getDataverseName() != null) {
+ dataverse = dropStmt.getDataverseName().getValue();
+ }
+ invalidOperation = MetadataConstants.METADATA_DATAVERSE_NAME.equals(dataverse);
+ if (invalidOperation) {
+ message = "Cannot drop a dataset belonging to the dataverse:"
+ + MetadataConstants.METADATA_DATAVERSE_NAME;
+ }
+ break;
+
}
- MetadataDeclTranslator metadataTranslator = new MetadataDeclTranslator(mdTxnCtx, dataverseName, outputFile,
- writerFactory, config, typeDeclarations);
- return metadataTranslator.computeMetadataDeclarations(online);
- }
-
- public void validateOperation(AqlCompiledMetadataDeclarations compiledDeclarations, Statement stmt)
- throws AlgebricksException {
- if (compiledDeclarations.getDataverseName() != null
- && compiledDeclarations.getDataverseName().equals(MetadataConstants.METADATA_DATAVERSE_NAME)) {
- if (stmt.getKind() == Statement.Kind.INSERT || stmt.getKind() == Statement.Kind.UPDATE
- || stmt.getKind() == Statement.Kind.DELETE) {
- throw new AlgebricksException(" Operation " + stmt.getKind() + " not permitted in system dataverse-"
- + MetadataConstants.METADATA_DATAVERSE_NAME);
- }
+ if (invalidOperation) {
+ throw new AsterixException("Invalid operation - " + message);
}
}
-}
\ No newline at end of file
+}
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 35fb3ae..fdf9c0b 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
@@ -12,7 +12,6 @@
import edu.uci.ics.asterix.aql.base.Clause;
import edu.uci.ics.asterix.aql.base.Expression;
import edu.uci.ics.asterix.aql.base.Expression.Kind;
-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;
@@ -76,27 +75,28 @@
import edu.uci.ics.asterix.common.config.DatasetConfig.DatasetType;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
import edu.uci.ics.asterix.formats.base.IDataFormat;
import edu.uci.ics.asterix.metadata.MetadataException;
-import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
+import edu.uci.ics.asterix.metadata.MetadataManager;
import edu.uci.ics.asterix.metadata.bootstrap.AsterixProperties;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
import edu.uci.ics.asterix.metadata.declared.AqlDataSource;
-import edu.uci.ics.asterix.metadata.declared.AqlLogicalPlanAndMetadataImpl;
import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
import edu.uci.ics.asterix.metadata.declared.AqlSourceId;
import edu.uci.ics.asterix.metadata.declared.FileSplitDataSink;
import edu.uci.ics.asterix.metadata.declared.FileSplitSinkId;
import edu.uci.ics.asterix.metadata.entities.Dataset;
+import edu.uci.ics.asterix.metadata.entities.Function;
import edu.uci.ics.asterix.metadata.utils.DatasetUtils;
import edu.uci.ics.asterix.om.base.AInt32;
import edu.uci.ics.asterix.om.base.AString;
import edu.uci.ics.asterix.om.constants.AsterixConstantValue;
import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
-import edu.uci.ics.asterix.om.functions.AsterixFunction;
import edu.uci.ics.asterix.om.functions.AsterixFunctionInfo;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.runtime.formats.FormatUtils;
+import edu.uci.ics.asterix.translator.CompiledStatements.ICompiledDmlStatement;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
@@ -105,7 +105,6 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalPlan;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalPlanAndMetadata;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalOperatorTag;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalVariable;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.OperatorAnnotations;
@@ -115,6 +114,7 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.BroadcastExpressionAnnotation;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.BroadcastExpressionAnnotation.BroadcastSide;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ConstantExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IExpressionAnnotation;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.UnnestingFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression;
@@ -154,1507 +154,1297 @@
* source for the current subtree.
*/
-public class AqlExpressionToPlanTranslator extends AbstractAqlTranslator
- implements
- IAqlExpressionVisitor<Pair<ILogicalOperator, LogicalVariable>, Mutable<ILogicalOperator>> {
+public class AqlExpressionToPlanTranslator extends AbstractAqlTranslator implements
+ IAqlExpressionVisitor<Pair<ILogicalOperator, LogicalVariable>, Mutable<ILogicalOperator>> {
- private final MetadataTransactionContext mdTxnCtx;
- private final long txnId;
- private TranslationContext context;
- private String outputDatasetName;
- private Statement.Kind dmlKind;
- private static AtomicLong outputFileID = new AtomicLong(0);
- private static final String OUTPUT_FILE_PREFIX = "OUTPUT_";
+ private final AqlMetadataProvider metadataProvider;
+ private final TranslationContext context;
+ private final String outputDatasetName;
+ private final ICompiledDmlStatement stmt;
+ private static AtomicLong outputFileID = new AtomicLong(0);
+ private static final String OUTPUT_FILE_PREFIX = "OUTPUT_";
- private static LogicalVariable METADATA_DUMMY_VAR = new LogicalVariable(-1);
+ private static LogicalVariable METADATA_DUMMY_VAR = new LogicalVariable(-1);
- public AqlExpressionToPlanTranslator(long txnId,
- MetadataTransactionContext mdTxnCtx, int currentVarCounter,
- String outputDatasetName, Statement.Kind dmlKind) {
- this.mdTxnCtx = mdTxnCtx;
- this.txnId = txnId;
- this.context = new TranslationContext(new Counter(currentVarCounter));
- this.outputDatasetName = outputDatasetName;
- this.dmlKind = dmlKind;
- }
+ public AqlExpressionToPlanTranslator(AqlMetadataProvider metadataProvider, int currentVarCounter,
+ String outputDatasetName, ICompiledDmlStatement stmt) {
+ this.context = new TranslationContext(new Counter(currentVarCounter));
+ this.outputDatasetName = outputDatasetName;
+ this.stmt = stmt;
+ this.metadataProvider = metadataProvider;
+ }
- public int getVarCounter() {
- return context.getVarCounter();
- }
+ public int getVarCounter() {
+ return context.getVarCounter();
+ }
- public ILogicalPlanAndMetadata translate(Query expr,
- AqlCompiledMetadataDeclarations compiledDeclarations)
- throws AlgebricksException, AsterixException {
- if (expr == null) {
- return null;
- }
- if (compiledDeclarations == null) {
- compiledDeclarations = compileMetadata(mdTxnCtx,
- expr.getPrologDeclList(), true);
- }
- if (!compiledDeclarations.isConnectedToDataverse())
- compiledDeclarations.connectToDataverse(compiledDeclarations
- .getDataverseName());
- IDataFormat format = compiledDeclarations.getFormat();
- if (format == null) {
- throw new AlgebricksException("Data format has not been set.");
- }
- format.registerRuntimeFunctions();
- Pair<ILogicalOperator, LogicalVariable> p = expr.accept(this,
- new MutableObject<ILogicalOperator>(
- new EmptyTupleSourceOperator()));
+ public ILogicalPlan translate(Query expr) throws AlgebricksException, AsterixException {
+ IDataFormat format = FormatUtils.getDefaultFormat();
+ format.registerRuntimeFunctions();
- ArrayList<Mutable<ILogicalOperator>> globalPlanRoots = new ArrayList<Mutable<ILogicalOperator>>();
+ Pair<ILogicalOperator, LogicalVariable> p = expr.accept(this, new MutableObject<ILogicalOperator>(
+ new EmptyTupleSourceOperator()));
- boolean isTransactionalWrite = false;
- ILogicalOperator topOp = p.first;
- ProjectOperator project = (ProjectOperator) topOp;
- LogicalVariable resVar = project.getVariables().get(0);
- if (outputDatasetName == null) {
- FileSplit outputFileSplit = compiledDeclarations.getOutputFile();
- if (outputFileSplit == null) {
- outputFileSplit = getDefaultOutputFileLocation();
- }
- compiledDeclarations.setOutputFile(outputFileSplit);
- List<Mutable<ILogicalExpression>> writeExprList = new ArrayList<Mutable<ILogicalExpression>>(
- 1);
- writeExprList.add(new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(resVar)));
- FileSplitSinkId fssi = new FileSplitSinkId(outputFileSplit);
- FileSplitDataSink sink = new FileSplitDataSink(fssi, null);
- topOp = new WriteOperator(writeExprList, sink);
- topOp.getInputs().add(new MutableObject<ILogicalOperator>(project));
- } else {
- String dataVerseName = compiledDeclarations.getDataverseName();
- Dataset dataset = compiledDeclarations
- .findDataset(outputDatasetName);
- if (dataset == null) {
- throw new AlgebricksException("Cannot find dataset "
- + outputDatasetName);
- }
+ ArrayList<Mutable<ILogicalOperator>> globalPlanRoots = new ArrayList<Mutable<ILogicalOperator>>();
- AqlSourceId sourceId = new AqlSourceId(dataVerseName,
- outputDatasetName);
- String itemTypeName = dataset.getItemTypeName();
- IAType itemType = compiledDeclarations.findType(itemTypeName);
- AqlDataSource dataSource = new AqlDataSource(sourceId, dataset,
- itemType);
- if (dataset.getDatasetType() == DatasetType.EXTERNAL) {
- throw new AlgebricksException(
- "Cannot write output to an external dataset.");
- }
- ArrayList<LogicalVariable> vars = new ArrayList<LogicalVariable>();
- ArrayList<Mutable<ILogicalExpression>> exprs = new ArrayList<Mutable<ILogicalExpression>>();
- List<Mutable<ILogicalExpression>> varRefsForLoading = new ArrayList<Mutable<ILogicalExpression>>();
+ boolean isTransactionalWrite = false;
+ ILogicalOperator topOp = p.first;
+ ProjectOperator project = (ProjectOperator) topOp;
+ LogicalVariable resVar = project.getVariables().get(0);
+ if (outputDatasetName == null) {
+ FileSplit outputFileSplit = metadataProvider.getOutputFile();
+ if (outputFileSplit == null) {
+ outputFileSplit = getDefaultOutputFileLocation();
+ }
+ metadataProvider.setOutputFile(outputFileSplit);
+ List<Mutable<ILogicalExpression>> writeExprList = new ArrayList<Mutable<ILogicalExpression>>(1);
+ writeExprList.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(resVar)));
+ FileSplitSinkId fssi = new FileSplitSinkId(outputFileSplit);
+ FileSplitDataSink sink = new FileSplitDataSink(fssi, null);
+ topOp = new WriteOperator(writeExprList, sink);
+ topOp.getInputs().add(new MutableObject<ILogicalOperator>(project));
+ } else {
- List<String> partitionKeys = DatasetUtils
- .getPartitioningKeys(dataset);
- for (String keyFieldName : partitionKeys) {
- IFunctionInfo finfoAccess = AsterixBuiltinFunctions
- .getAsterixFunctionInfo(AsterixBuiltinFunctions.FIELD_ACCESS_BY_NAME);
- @SuppressWarnings("unchecked")
- ScalarFunctionCallExpression f = new ScalarFunctionCallExpression(
- finfoAccess, new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(
- METADATA_DUMMY_VAR)),
- new MutableObject<ILogicalExpression>(
- new ConstantExpression(
- new AsterixConstantValue(new AString(
- keyFieldName)))));
- f.substituteVar(METADATA_DUMMY_VAR, resVar);
- exprs.add(new MutableObject<ILogicalExpression>(f));
- LogicalVariable v = context.newVar();
- vars.add(v);
- varRefsForLoading.add(new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(v)));
- }
- AssignOperator assign = new AssignOperator(vars, exprs);
- assign.getInputs()
- .add(new MutableObject<ILogicalOperator>(project));
+ AqlDataSource targetDatasource = validateDatasetInfo(metadataProvider, stmt.getDataverseName(),
+ stmt.getDatasetName());
- Mutable<ILogicalExpression> varRef = new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(resVar));
- ILogicalOperator load = null;
+ ArrayList<LogicalVariable> vars = new ArrayList<LogicalVariable>();
+ ArrayList<Mutable<ILogicalExpression>> exprs = new ArrayList<Mutable<ILogicalExpression>>();
+ List<Mutable<ILogicalExpression>> varRefsForLoading = new ArrayList<Mutable<ILogicalExpression>>();
- switch (dmlKind) {
- case WRITE_FROM_QUERY_RESULT: {
- load = new WriteResultOperator(dataSource, varRef,
- varRefsForLoading);
- load.getInputs().add(
- new MutableObject<ILogicalOperator>(assign));
- break;
- }
- case INSERT: {
- ILogicalOperator insertOp = new InsertDeleteOperator(
- dataSource, varRef, varRefsForLoading,
- InsertDeleteOperator.Kind.INSERT);
- insertOp.getInputs().add(
- new MutableObject<ILogicalOperator>(assign));
- load = new SinkOperator();
- load.getInputs().add(
- new MutableObject<ILogicalOperator>(insertOp));
- isTransactionalWrite = true;
- break;
- }
- case DELETE: {
- ILogicalOperator deleteOp = new InsertDeleteOperator(
- dataSource, varRef, varRefsForLoading,
- InsertDeleteOperator.Kind.DELETE);
- deleteOp.getInputs().add(
- new MutableObject<ILogicalOperator>(assign));
- load = new SinkOperator();
- load.getInputs().add(
- new MutableObject<ILogicalOperator>(deleteOp));
- isTransactionalWrite = true;
- break;
- }
- case BEGIN_FEED: {
- ILogicalOperator insertOp = new InsertDeleteOperator(
- dataSource, varRef, varRefsForLoading,
- InsertDeleteOperator.Kind.INSERT);
- insertOp.getInputs().add(
- new MutableObject<ILogicalOperator>(assign));
- load = new SinkOperator();
- load.getInputs().add(
- new MutableObject<ILogicalOperator>(insertOp));
- isTransactionalWrite = false;
- break;
- }
- }
- topOp = load;
- }
+ List<String> partitionKeys = DatasetUtils.getPartitioningKeys(targetDatasource.getDataset());
+ for (String keyFieldName : partitionKeys) {
+ IFunctionInfo finfoAccess = AsterixBuiltinFunctions
+ .getAsterixFunctionInfo(AsterixBuiltinFunctions.FIELD_ACCESS_BY_NAME);
+ @SuppressWarnings("unchecked")
+ ScalarFunctionCallExpression f = new ScalarFunctionCallExpression(finfoAccess,
+ new MutableObject<ILogicalExpression>(new VariableReferenceExpression(METADATA_DUMMY_VAR)),
+ new MutableObject<ILogicalExpression>(new ConstantExpression(new AsterixConstantValue(
+ new AString(keyFieldName)))));
+ f.substituteVar(METADATA_DUMMY_VAR, resVar);
+ exprs.add(new MutableObject<ILogicalExpression>(f));
+ LogicalVariable v = context.newVar();
+ vars.add(v);
+ varRefsForLoading.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(v)));
+ }
+ AssignOperator assign = new AssignOperator(vars, exprs);
+ assign.getInputs().add(new MutableObject<ILogicalOperator>(project));
- globalPlanRoots.add(new MutableObject<ILogicalOperator>(topOp));
- ILogicalPlan plan = new ALogicalPlanImpl(globalPlanRoots);
- AqlMetadataProvider metadataProvider = new AqlMetadataProvider(txnId,
- isTransactionalWrite, compiledDeclarations);
- ILogicalPlanAndMetadata planAndMetadata = new AqlLogicalPlanAndMetadataImpl(
- plan, metadataProvider);
- return planAndMetadata;
- }
+ Mutable<ILogicalExpression> varRef = new MutableObject<ILogicalExpression>(new VariableReferenceExpression(
+ resVar));
+ ILogicalOperator leafOperator = null;
- private FileSplit getDefaultOutputFileLocation() throws MetadataException {
- if (AsterixProperties.INSTANCE.getOutputDir() == null) {
- throw new MetadataException(
- "Output location for query result not specified at the time of deployment, must specify explicitly using 'write output to ..' statement");
- }
- String filePath = AsterixProperties.INSTANCE.getOutputDir()
- + System.getProperty("file.separator") + OUTPUT_FILE_PREFIX
- + outputFileID.incrementAndGet();
- return new FileSplit(AsterixProperties.INSTANCE.getMetadataNodeName(),
- new FileReference(new File(filePath)));
- }
+ switch (stmt.getKind()) {
+ case WRITE_FROM_QUERY_RESULT: {
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitForClause(ForClause fc,
- Mutable<ILogicalOperator> tupSource) throws AsterixException {
- LogicalVariable v = context.newVar(fc.getVarExpr());
+ leafOperator = new WriteResultOperator(targetDatasource, varRef, varRefsForLoading);
+ leafOperator.getInputs().add(new MutableObject<ILogicalOperator>(assign));
+ break;
+ }
+ case INSERT: {
+ ILogicalOperator insertOp = new InsertDeleteOperator(targetDatasource, varRef, varRefsForLoading,
+ InsertDeleteOperator.Kind.INSERT);
+ insertOp.getInputs().add(new MutableObject<ILogicalOperator>(assign));
+ leafOperator = new SinkOperator();
+ leafOperator.getInputs().add(new MutableObject<ILogicalOperator>(insertOp));
+ isTransactionalWrite = true;
+ break;
+ }
+ case DELETE: {
+ ILogicalOperator deleteOp = new InsertDeleteOperator(targetDatasource, varRef, varRefsForLoading,
+ InsertDeleteOperator.Kind.DELETE);
+ deleteOp.getInputs().add(new MutableObject<ILogicalOperator>(assign));
+ leafOperator = new SinkOperator();
+ leafOperator.getInputs().add(new MutableObject<ILogicalOperator>(deleteOp));
+ isTransactionalWrite = true;
+ break;
+ }
+ case BEGIN_FEED: {
+ ILogicalOperator insertOp = new InsertDeleteOperator(targetDatasource, varRef, varRefsForLoading,
+ InsertDeleteOperator.Kind.INSERT);
+ insertOp.getInputs().add(new MutableObject<ILogicalOperator>(assign));
+ leafOperator = new SinkOperator();
+ leafOperator.getInputs().add(new MutableObject<ILogicalOperator>(insertOp));
+ isTransactionalWrite = false;
+ break;
+ }
+ }
+ topOp = leafOperator;
+ }
- Expression inExpr = fc.getInExpr();
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(
- inExpr, tupSource);
- ILogicalOperator returnedOp;
+ globalPlanRoots.add(new MutableObject<ILogicalOperator>(topOp));
+ ILogicalPlan plan = new ALogicalPlanImpl(globalPlanRoots);
+ return plan;
+ }
- if (fc.getPosVarExpr() == null) {
- returnedOp = new UnnestOperator(v,
- new MutableObject<ILogicalExpression>(
- makeUnnestExpression(eo.first)));
- } else {
- LogicalVariable pVar = context.newVar(fc.getPosVarExpr());
- returnedOp = new UnnestOperator(v,
- new MutableObject<ILogicalExpression>(
- makeUnnestExpression(eo.first)), pVar,
- BuiltinType.AINT32);
- }
- returnedOp.getInputs().add(eo.second);
+ private AqlDataSource validateDatasetInfo(AqlMetadataProvider metadataProvider, String dataverseName,
+ String datasetName) throws AlgebricksException {
+ Dataset dataset = metadataProvider.findDataset(dataverseName, datasetName);
+ if (dataset == null) {
+ throw new AlgebricksException("Cannot find dataset " + datasetName + " in dataverse " + dataverseName);
+ }
- return new Pair<ILogicalOperator, LogicalVariable>(returnedOp, v);
- }
+ AqlSourceId sourceId = new AqlSourceId(dataverseName, datasetName);
+ String itemTypeName = dataset.getItemTypeName();
+ IAType itemType = metadataProvider.findType(dataverseName, itemTypeName);
+ AqlDataSource dataSource = new AqlDataSource(sourceId, dataset, itemType);
+ if (dataset.getDatasetType() == DatasetType.EXTERNAL) {
+ throw new AlgebricksException("Cannot write output to an external dataset.");
+ }
+ return dataSource;
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitLetClause(LetClause lc,
- Mutable<ILogicalOperator> tupSource) throws AsterixException {
- LogicalVariable v;
- ILogicalOperator returnedOp;
+ }
- switch (lc.getBindingExpr().getKind()) {
- case VARIABLE_EXPRESSION: {
- v = context.newVar(lc.getVarExpr());
- LogicalVariable prev = context.getVar(((VariableExpr) lc
- .getBindingExpr()).getVar().getId());
- returnedOp = new AssignOperator(v,
- new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(prev)));
- returnedOp.getInputs().add(tupSource);
- break;
- }
- default: {
- v = context.newVar(lc.getVarExpr());
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(
- lc.getBindingExpr(), tupSource);
- returnedOp = new AssignOperator(v,
- new MutableObject<ILogicalExpression>(eo.first));
- returnedOp.getInputs().add(eo.second);
- break;
- }
- }
- return new Pair<ILogicalOperator, LogicalVariable>(returnedOp, v);
- }
+ private FileSplit getDefaultOutputFileLocation() throws MetadataException {
+ if (AsterixProperties.INSTANCE.getOutputDir() == null) {
+ throw new MetadataException(
+ "Output location for query result not specified at the time of deployment, must specify explicitly using 'write output to ..' statement");
+ }
+ String filePath = AsterixProperties.INSTANCE.getOutputDir() + System.getProperty("file.separator")
+ + OUTPUT_FILE_PREFIX + outputFileID.incrementAndGet();
+ return new FileSplit(AsterixProperties.INSTANCE.getMetadataNodeName(), new FileReference(new File(filePath)));
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitFlworExpression(
- FLWOGRExpression flwor, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- Mutable<ILogicalOperator> flworPlan = tupSource;
- boolean isTop = context.isTopFlwor();
- if (isTop) {
- context.setTopFlwor(false);
- }
- for (Clause c : flwor.getClauseList()) {
- Pair<ILogicalOperator, LogicalVariable> pC = c.accept(this,
- flworPlan);
- flworPlan = new MutableObject<ILogicalOperator>(pC.first);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitForClause(ForClause fc, Mutable<ILogicalOperator> tupSource)
+ throws AsterixException {
+ LogicalVariable v = context.newVar(fc.getVarExpr());
- Expression r = flwor.getReturnExpr();
- boolean noFlworClause = flwor.noForClause();
+ Expression inExpr = fc.getInExpr();
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(inExpr, tupSource);
+ ILogicalOperator returnedOp;
- if (r.getKind() == Kind.VARIABLE_EXPRESSION) {
- VariableExpr v = (VariableExpr) r;
- LogicalVariable var = context.getVar(v.getVar().getId());
+ if (fc.getPosVarExpr() == null) {
+ returnedOp = new UnnestOperator(v, new MutableObject<ILogicalExpression>(makeUnnestExpression(eo.first)));
+ } else {
+ LogicalVariable pVar = context.newVar(fc.getPosVarExpr());
+ returnedOp = new UnnestOperator(v, new MutableObject<ILogicalExpression>(makeUnnestExpression(eo.first)),
+ pVar, BuiltinType.AINT32);
+ }
+ returnedOp.getInputs().add(eo.second);
- return produceFlwrResult(noFlworClause, isTop, flworPlan, var);
+ return new Pair<ILogicalOperator, LogicalVariable>(returnedOp, v);
+ }
- } else {
- Mutable<ILogicalOperator> baseOp = new MutableObject<ILogicalOperator>(
- flworPlan.getValue());
- Pair<ILogicalOperator, LogicalVariable> rRes = r.accept(this,
- baseOp);
- ILogicalOperator rOp = rRes.first;
- ILogicalOperator resOp;
- if (expressionNeedsNoNesting(r)) {
- baseOp.setValue(flworPlan.getValue());
- resOp = rOp;
- } else {
- SubplanOperator s = new SubplanOperator(rOp);
- s.getInputs().add(flworPlan);
- resOp = s;
- baseOp.setValue(new NestedTupleSourceOperator(
- new MutableObject<ILogicalOperator>(s)));
- }
- Mutable<ILogicalOperator> resOpRef = new MutableObject<ILogicalOperator>(
- resOp);
- return produceFlwrResult(noFlworClause, isTop, resOpRef,
- rRes.second);
- }
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitLetClause(LetClause lc, Mutable<ILogicalOperator> tupSource)
+ throws AsterixException {
+ LogicalVariable v;
+ ILogicalOperator returnedOp;
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitFieldAccessor(
- FieldAccessor fa, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(
- fa.getExpr(), tupSource);
- LogicalVariable v = context.newVar();
- AbstractFunctionCallExpression fldAccess = new ScalarFunctionCallExpression(
- FunctionUtils
- .getFunctionInfo(AsterixBuiltinFunctions.FIELD_ACCESS_BY_NAME));
- fldAccess.getArguments().add(
- new MutableObject<ILogicalExpression>(p.first));
- ILogicalExpression faExpr = new ConstantExpression(
- new AsterixConstantValue(new AString(fa.getIdent().getValue())));
- fldAccess.getArguments().add(
- new MutableObject<ILogicalExpression>(faExpr));
- AssignOperator a = new AssignOperator(v,
- new MutableObject<ILogicalExpression>(fldAccess));
- a.getInputs().add(p.second);
- return new Pair<ILogicalOperator, LogicalVariable>(a, v);
+ switch (lc.getBindingExpr().getKind()) {
+ case VARIABLE_EXPRESSION: {
+ v = context.newVar(lc.getVarExpr());
+ LogicalVariable prev = context.getVar(((VariableExpr) lc.getBindingExpr()).getVar().getId());
+ returnedOp = new AssignOperator(v, new MutableObject<ILogicalExpression>(
+ new VariableReferenceExpression(prev)));
+ returnedOp.getInputs().add(tupSource);
+ break;
+ }
+ default: {
+ v = context.newVar(lc.getVarExpr());
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(lc.getBindingExpr(),
+ tupSource);
+ returnedOp = new AssignOperator(v, new MutableObject<ILogicalExpression>(eo.first));
+ returnedOp.getInputs().add(eo.second);
+ break;
+ }
+ }
+ return new Pair<ILogicalOperator, LogicalVariable>(returnedOp, v);
+ }
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitFlworExpression(FLWOGRExpression flwor,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ Mutable<ILogicalOperator> flworPlan = tupSource;
+ boolean isTop = context.isTopFlwor();
+ if (isTop) {
+ context.setTopFlwor(false);
+ }
+ for (Clause c : flwor.getClauseList()) {
+ Pair<ILogicalOperator, LogicalVariable> pC = c.accept(this, flworPlan);
+ flworPlan = new MutableObject<ILogicalOperator>(pC.first);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitIndexAccessor(
- IndexAccessor ia, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(
- ia.getExpr(), tupSource);
- LogicalVariable v = context.newVar();
- AbstractFunctionCallExpression f;
- int i = ia.getIndex();
- if (i == IndexAccessor.ANY) {
- f = new ScalarFunctionCallExpression(
- FunctionUtils
- .getFunctionInfo(AsterixBuiltinFunctions.ANY_COLLECTION_MEMBER));
- f.getArguments()
- .add(new MutableObject<ILogicalExpression>(p.first));
- } else {
- f = new ScalarFunctionCallExpression(
- FunctionUtils
- .getFunctionInfo(AsterixBuiltinFunctions.GET_ITEM));
- f.getArguments()
- .add(new MutableObject<ILogicalExpression>(p.first));
- f.getArguments().add(
- new MutableObject<ILogicalExpression>(
- new ConstantExpression(new AsterixConstantValue(
- new AInt32(i)))));
- }
- AssignOperator a = new AssignOperator(v,
- new MutableObject<ILogicalExpression>(f));
- a.getInputs().add(p.second);
- return new Pair<ILogicalOperator, LogicalVariable>(a, v);
- }
+ Expression r = flwor.getReturnExpr();
+ boolean noFlworClause = flwor.noForClause();
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitCallExpr(
- CallExpr fcall, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- LogicalVariable v = context.newVar();
- AsterixFunction fid = fcall.getIdent();
- List<Mutable<ILogicalExpression>> args = new ArrayList<Mutable<ILogicalExpression>>();
- Mutable<ILogicalOperator> topOp = tupSource;
+ if (r.getKind() == Kind.VARIABLE_EXPRESSION) {
+ VariableExpr v = (VariableExpr) r;
+ LogicalVariable var = context.getVar(v.getVar().getId());
- for (Expression expr : fcall.getExprList()) {
- switch (expr.getKind()) {
- case VARIABLE_EXPRESSION: {
- LogicalVariable var = context.getVar(((VariableExpr) expr)
- .getVar().getId());
- args.add(new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(var)));
- break;
- }
- case LITERAL_EXPRESSION: {
- LiteralExpr val = (LiteralExpr) expr;
- args.add(new MutableObject<ILogicalExpression>(
- new ConstantExpression(
- new AsterixConstantValue(ConstantHelper
- .objectFromLiteral(val.getValue())))));
- break;
- }
- default: {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(
- expr, topOp);
- AbstractLogicalOperator o1 = (AbstractLogicalOperator) eo.second
- .getValue();
- args.add(new MutableObject<ILogicalExpression>(eo.first));
- if (o1 != null
- && !(o1.getOperatorTag() == LogicalOperatorTag.ASSIGN && hasOnlyChild(
- o1, topOp))) {
- topOp = eo.second;
- }
- break;
- }
- }
- }
+ return produceFlwrResult(noFlworClause, isTop, flworPlan, var);
- FunctionIdentifier fi = new FunctionIdentifier(
- AlgebricksBuiltinFunctions.ALGEBRICKS_NS, fid.getFunctionName());
- AsterixFunctionInfo afi = AsterixBuiltinFunctions.lookupFunction(fi);
- FunctionIdentifier builtinAquafi = afi == null ? null : afi
- .getFunctionIdentifier();
+ } else {
+ Mutable<ILogicalOperator> baseOp = new MutableObject<ILogicalOperator>(flworPlan.getValue());
+ Pair<ILogicalOperator, LogicalVariable> rRes = r.accept(this, baseOp);
+ ILogicalOperator rOp = rRes.first;
+ ILogicalOperator resOp;
+ if (expressionNeedsNoNesting(r)) {
+ baseOp.setValue(flworPlan.getValue());
+ resOp = rOp;
+ } else {
+ SubplanOperator s = new SubplanOperator(rOp);
+ s.getInputs().add(flworPlan);
+ resOp = s;
+ baseOp.setValue(new NestedTupleSourceOperator(new MutableObject<ILogicalOperator>(s)));
+ }
+ Mutable<ILogicalOperator> resOpRef = new MutableObject<ILogicalOperator>(resOp);
+ return produceFlwrResult(noFlworClause, isTop, resOpRef, rRes.second);
+ }
+ }
- if (builtinAquafi != null) {
- fi = builtinAquafi;
- } else {
- fi = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- fid.getFunctionName());
- FunctionIdentifier builtinAsterixFi = AsterixBuiltinFunctions
- .getBuiltinFunctionIdentifier(fi);
- if (builtinAsterixFi != null) {
- fi = builtinAsterixFi;
- }
- }
- AbstractFunctionCallExpression f;
- if (AsterixBuiltinFunctions.isBuiltinAggregateFunction(fi)) {
- f = AsterixBuiltinFunctions.makeAggregateFunctionExpression(fi,
- args);
- } else if (AsterixBuiltinFunctions.isBuiltinUnnestingFunction(fi)) {
- UnnestingFunctionCallExpression ufce = new UnnestingFunctionCallExpression(
- FunctionUtils.getFunctionInfo(fi), args);
- ufce.setReturnsUniqueValues(AsterixBuiltinFunctions
- .returnsUniqueValues(fi));
- f = ufce;
- } else {
- f = new ScalarFunctionCallExpression(
- FunctionUtils.getFunctionInfo(fi), args);
- }
- AssignOperator op = new AssignOperator(v,
- new MutableObject<ILogicalExpression>(f));
- if (topOp != null) {
- op.getInputs().add(topOp);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitFieldAccessor(FieldAccessor fa,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(fa.getExpr(), tupSource);
+ LogicalVariable v = context.newVar();
+ AbstractFunctionCallExpression fldAccess = new ScalarFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.FIELD_ACCESS_BY_NAME));
+ fldAccess.getArguments().add(new MutableObject<ILogicalExpression>(p.first));
+ ILogicalExpression faExpr = new ConstantExpression(new AsterixConstantValue(new AString(fa.getIdent()
+ .getValue())));
+ fldAccess.getArguments().add(new MutableObject<ILogicalExpression>(faExpr));
+ AssignOperator a = new AssignOperator(v, new MutableObject<ILogicalExpression>(fldAccess));
+ a.getInputs().add(p.second);
+ return new Pair<ILogicalOperator, LogicalVariable>(a, v);
- return new Pair<ILogicalOperator, LogicalVariable>(op, v);
- }
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitFunctionDecl(
- FunctionDecl fd, Mutable<ILogicalOperator> tupSource) {
- // TODO Auto-generated method stub
- throw new NotImplementedException();
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitIndexAccessor(IndexAccessor ia,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(ia.getExpr(), tupSource);
+ LogicalVariable v = context.newVar();
+ AbstractFunctionCallExpression f;
+ int i = ia.getIndex();
+ if (i == IndexAccessor.ANY) {
+ f = new ScalarFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.ANY_COLLECTION_MEMBER));
+ f.getArguments().add(new MutableObject<ILogicalExpression>(p.first));
+ } else {
+ f = new ScalarFunctionCallExpression(FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.GET_ITEM));
+ f.getArguments().add(new MutableObject<ILogicalExpression>(p.first));
+ f.getArguments().add(
+ new MutableObject<ILogicalExpression>(new ConstantExpression(
+ new AsterixConstantValue(new AInt32(i)))));
+ }
+ AssignOperator a = new AssignOperator(v, new MutableObject<ILogicalExpression>(f));
+ a.getInputs().add(p.second);
+ return new Pair<ILogicalOperator, LogicalVariable>(a, v);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitGroupbyClause(
- GroupbyClause gc, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- GroupByOperator gOp = new GroupByOperator();
- Mutable<ILogicalOperator> topOp = tupSource;
- for (GbyVariableExpressionPair ve : gc.getGbyPairList()) {
- LogicalVariable v;
- VariableExpr vexpr = ve.getVar();
- if (vexpr != null) {
- v = context.newVar(vexpr);
- } else {
- v = context.newVar();
- }
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(
- ve.getExpr(), topOp);
- gOp.addGbyExpression(v, eo.first);
- topOp = eo.second;
- }
- for (GbyVariableExpressionPair ve : gc.getDecorPairList()) {
- LogicalVariable v;
- VariableExpr vexpr = ve.getVar();
- if (vexpr != null) {
- v = context.newVar(vexpr);
- } else {
- v = context.newVar();
- }
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(
- ve.getExpr(), topOp);
- gOp.addDecorExpression(v, eo.first);
- topOp = eo.second;
- }
- gOp.getInputs().add(topOp);
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitCallExpr(CallExpr fcall, Mutable<ILogicalOperator> tupSource)
+ throws AsterixException {
+ LogicalVariable v = context.newVar();
+ FunctionSignature signature = fcall.getFunctionSignature();
+ List<Mutable<ILogicalExpression>> args = new ArrayList<Mutable<ILogicalExpression>>();
+ Mutable<ILogicalOperator> topOp = tupSource;
- for (VariableExpr var : gc.getWithVarList()) {
- LogicalVariable aggVar = context.newVar();
- LogicalVariable oldVar = context.getVar(var);
- List<Mutable<ILogicalExpression>> flArgs = new ArrayList<Mutable<ILogicalExpression>>(
- 1);
- flArgs.add(new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(oldVar)));
- AggregateFunctionCallExpression fListify = AsterixBuiltinFunctions
- .makeAggregateFunctionExpression(
- AsterixBuiltinFunctions.LISTIFY, flArgs);
- AggregateOperator agg = new AggregateOperator(
- mkSingletonArrayList(aggVar),
- (List) mkSingletonArrayList(new MutableObject<ILogicalExpression>(
- fListify)));
+ for (Expression expr : fcall.getExprList()) {
+ switch (expr.getKind()) {
+ case VARIABLE_EXPRESSION: {
+ LogicalVariable var = context.getVar(((VariableExpr) expr).getVar().getId());
+ args.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(var)));
+ break;
+ }
+ case LITERAL_EXPRESSION: {
+ LiteralExpr val = (LiteralExpr) expr;
+ args.add(new MutableObject<ILogicalExpression>(new ConstantExpression(new AsterixConstantValue(
+ ConstantHelper.objectFromLiteral(val.getValue())))));
+ break;
+ }
+ default: {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(expr, topOp);
+ AbstractLogicalOperator o1 = (AbstractLogicalOperator) eo.second.getValue();
+ args.add(new MutableObject<ILogicalExpression>(eo.first));
+ if (o1 != null && !(o1.getOperatorTag() == LogicalOperatorTag.ASSIGN && hasOnlyChild(o1, topOp))) {
+ topOp = eo.second;
+ }
+ break;
+ }
+ }
+ }
- agg.getInputs().add(
- new MutableObject<ILogicalOperator>(
- new NestedTupleSourceOperator(
- new MutableObject<ILogicalOperator>(gOp))));
- ILogicalPlan plan = new ALogicalPlanImpl(
- new MutableObject<ILogicalOperator>(agg));
- gOp.getNestedPlans().add(plan);
- // Hide the variable that was part of the "with", replacing it with
- // the one bound by the aggregation op.
- context.setVar(var, aggVar);
- }
+ AbstractFunctionCallExpression f;
+ if ((f = lookupUserDefinedFunction(signature, args)) == null) {
+ f = lookupBuiltinFunction(signature.getName(), signature.getArity(), args);
+ }
- gOp.getAnnotations().put(OperatorAnnotations.USE_HASH_GROUP_BY,
- gc.hasHashGroupByHint());
- return new Pair<ILogicalOperator, LogicalVariable>(gOp, null);
- }
+ if (f == null) {
+ throw new AsterixException(" Unknown function " + signature.getName() + "@" + signature.getArity());
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitIfExpr(IfExpr ifexpr,
- Mutable<ILogicalOperator> tupSource) throws AsterixException {
- // In the most general case, IfThenElse is translated in the following
- // way.
- //
- // We assign the result of the condition to one variable varCond.
- // We create one subplan which contains the plan for the "then" branch,
- // on top of which there is a selection whose condition is varCond.
- // Similarly, we create one subplan for the "else" branch, in which the
- // selection is not(varCond).
- // Finally, we concatenate the results. (??)
+ // Put hints into function call expr.
+ if (fcall.hasHints()) {
+ for (IExpressionAnnotation hint : fcall.getHints()) {
+ f.getAnnotations().put(hint, hint);
+ }
+ }
- Pair<ILogicalOperator, LogicalVariable> pCond = ifexpr.getCondExpr()
- .accept(this, tupSource);
- ILogicalOperator opCond = pCond.first;
- LogicalVariable varCond = pCond.second;
+ AssignOperator op = new AssignOperator(v, new MutableObject<ILogicalExpression>(f));
+ if (topOp != null) {
+ op.getInputs().add(topOp);
+ }
- SubplanOperator sp = new SubplanOperator();
- Mutable<ILogicalOperator> nestedSource = new MutableObject<ILogicalOperator>(
- new NestedTupleSourceOperator(
- new MutableObject<ILogicalOperator>(sp)));
+ return new Pair<ILogicalOperator, LogicalVariable>(op, v);
+ }
- Pair<ILogicalOperator, LogicalVariable> pThen = ifexpr.getThenExpr()
- .accept(this, nestedSource);
- SelectOperator sel1 = new SelectOperator(
- new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(varCond)));
- sel1.getInputs().add(new MutableObject<ILogicalOperator>(pThen.first));
+ private AbstractFunctionCallExpression lookupUserDefinedFunction(FunctionSignature signature,
+ List<Mutable<ILogicalExpression>> args) throws MetadataException {
+ if (signature.getNamespace() == null) {
+ return null;
+ }
+ Function function = MetadataManager.INSTANCE.getFunction(metadataProvider.getMetadataTxnContext(), signature);
+ if (function == null) {
+ return null;
+ }
+ AbstractFunctionCallExpression f = null;
+ if (function.getLanguage().equalsIgnoreCase(Function.LANGUAGE_AQL)) {
+ IFunctionInfo finfo = new AsterixFunctionInfo(signature);
+ return new ScalarFunctionCallExpression(finfo, args);
+ } else {
+ throw new MetadataException(" User defined functions written in " + function.getLanguage()
+ + " are not supported");
+ }
+ }
- Pair<ILogicalOperator, LogicalVariable> pElse = ifexpr.getElseExpr()
- .accept(this, nestedSource);
- AbstractFunctionCallExpression notVarCond = new ScalarFunctionCallExpression(
- FunctionUtils.getFunctionInfo(AlgebricksBuiltinFunctions.NOT),
- new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(varCond)));
- SelectOperator sel2 = new SelectOperator(
- new MutableObject<ILogicalExpression>(notVarCond));
- sel2.getInputs().add(new MutableObject<ILogicalOperator>(pElse.first));
+ private AbstractFunctionCallExpression lookupBuiltinFunction(String functionName, int arity,
+ List<Mutable<ILogicalExpression>> args) {
+ AbstractFunctionCallExpression f = null;
- ILogicalPlan p1 = new ALogicalPlanImpl(
- new MutableObject<ILogicalOperator>(sel1));
- sp.getNestedPlans().add(p1);
- ILogicalPlan p2 = new ALogicalPlanImpl(
- new MutableObject<ILogicalOperator>(sel2));
- sp.getNestedPlans().add(p2);
+ FunctionIdentifier fi = new FunctionIdentifier(AlgebricksBuiltinFunctions.ALGEBRICKS_NS, functionName, arity);
+ AsterixFunctionInfo afi = AsterixBuiltinFunctions.lookupFunction(fi);
+ FunctionIdentifier builtinAquafi = afi == null ? null : afi.getFunctionIdentifier();
- Mutable<ILogicalOperator> opCondRef = new MutableObject<ILogicalOperator>(
- opCond);
- sp.getInputs().add(opCondRef);
+ if (builtinAquafi != null) {
+ fi = builtinAquafi;
+ } else {
+ fi = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, functionName, arity);
+ afi = AsterixBuiltinFunctions.lookupFunction(fi);
+ if (afi == null) {
+ return null;
+ }
+ }
+ if (AsterixBuiltinFunctions.isBuiltinAggregateFunction(fi)) {
+ f = AsterixBuiltinFunctions.makeAggregateFunctionExpression(fi, args);
+ } else if (AsterixBuiltinFunctions.isBuiltinUnnestingFunction(fi)) {
+ UnnestingFunctionCallExpression ufce = new UnnestingFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(fi), args);
+ ufce.setReturnsUniqueValues(AsterixBuiltinFunctions.returnsUniqueValues(fi));
+ f = ufce;
+ } else {
+ f = new ScalarFunctionCallExpression(FunctionUtils.getFunctionInfo(fi), args);
+ }
+ return f;
+ }
- LogicalVariable resV = context.newVar();
- AbstractFunctionCallExpression concatNonNull = new ScalarFunctionCallExpression(
- FunctionUtils
- .getFunctionInfo(AsterixBuiltinFunctions.CONCAT_NON_NULL),
- new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(pThen.second)),
- new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(pElse.second)));
- AssignOperator a = new AssignOperator(resV,
- new MutableObject<ILogicalExpression>(concatNonNull));
- a.getInputs().add(new MutableObject<ILogicalOperator>(sp));
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitFunctionDecl(FunctionDecl fd,
+ Mutable<ILogicalOperator> tupSource) {
+ // TODO Auto-generated method stub
+ throw new NotImplementedException();
+ }
- return new Pair<ILogicalOperator, LogicalVariable>(a, resV);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitGroupbyClause(GroupbyClause gc,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ GroupByOperator gOp = new GroupByOperator();
+ Mutable<ILogicalOperator> topOp = tupSource;
+ for (GbyVariableExpressionPair ve : gc.getGbyPairList()) {
+ LogicalVariable v;
+ VariableExpr vexpr = ve.getVar();
+ if (vexpr != null) {
+ v = context.newVar(vexpr);
+ } else {
+ v = context.newVar();
+ }
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(ve.getExpr(), topOp);
+ gOp.addGbyExpression(v, eo.first);
+ topOp = eo.second;
+ }
+ for (GbyVariableExpressionPair ve : gc.getDecorPairList()) {
+ LogicalVariable v;
+ VariableExpr vexpr = ve.getVar();
+ if (vexpr != null) {
+ v = context.newVar(vexpr);
+ } else {
+ v = context.newVar();
+ }
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(ve.getExpr(), topOp);
+ gOp.addDecorExpression(v, eo.first);
+ topOp = eo.second;
+ }
+ gOp.getInputs().add(topOp);
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitLiteralExpr(
- LiteralExpr l, Mutable<ILogicalOperator> tupSource) {
- LogicalVariable var = context.newVar();
- AssignOperator a = new AssignOperator(var,
- new MutableObject<ILogicalExpression>(new ConstantExpression(
- new AsterixConstantValue(ConstantHelper
- .objectFromLiteral(l.getValue())))));
- if (tupSource != null) {
- a.getInputs().add(tupSource);
- }
- return new Pair<ILogicalOperator, LogicalVariable>(a, var);
- }
+ for (VariableExpr var : gc.getWithVarList()) {
+ LogicalVariable aggVar = context.newVar();
+ LogicalVariable oldVar = context.getVar(var);
+ List<Mutable<ILogicalExpression>> flArgs = new ArrayList<Mutable<ILogicalExpression>>(1);
+ flArgs.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(oldVar)));
+ AggregateFunctionCallExpression fListify = AsterixBuiltinFunctions.makeAggregateFunctionExpression(
+ AsterixBuiltinFunctions.LISTIFY, flArgs);
+ AggregateOperator agg = new AggregateOperator(mkSingletonArrayList(aggVar),
+ (List) mkSingletonArrayList(new MutableObject<ILogicalExpression>(fListify)));
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitOperatorExpr(
- OperatorExpr op, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- ArrayList<OperatorType> ops = op.getOpList();
- int nOps = ops.size();
+ agg.getInputs().add(
+ new MutableObject<ILogicalOperator>(new NestedTupleSourceOperator(
+ new MutableObject<ILogicalOperator>(gOp))));
+ ILogicalPlan plan = new ALogicalPlanImpl(new MutableObject<ILogicalOperator>(agg));
+ gOp.getNestedPlans().add(plan);
+ // Hide the variable that was part of the "with", replacing it with
+ // the one bound by the aggregation op.
+ context.setVar(var, aggVar);
+ }
- if (nOps > 0
- && (ops.get(0) == OperatorType.AND || ops.get(0) == OperatorType.OR)) {
- return visitAndOrOperator(op, tupSource);
- }
+ gOp.getAnnotations().put(OperatorAnnotations.USE_HASH_GROUP_BY, gc.hasHashGroupByHint());
+ return new Pair<ILogicalOperator, LogicalVariable>(gOp, null);
+ }
- ArrayList<Expression> exprs = op.getExprList();
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitIfExpr(IfExpr ifexpr, Mutable<ILogicalOperator> tupSource)
+ throws AsterixException {
+ // In the most general case, IfThenElse is translated in the following
+ // way.
+ //
+ // We assign the result of the condition to one variable varCond.
+ // We create one subplan which contains the plan for the "then" branch,
+ // on top of which there is a selection whose condition is varCond.
+ // Similarly, we create one subplan for the "else" branch, in which the
+ // selection is not(varCond).
+ // Finally, we concatenate the results. (??)
- Mutable<ILogicalOperator> topOp = tupSource;
+ Pair<ILogicalOperator, LogicalVariable> pCond = ifexpr.getCondExpr().accept(this, tupSource);
+ ILogicalOperator opCond = pCond.first;
+ LogicalVariable varCond = pCond.second;
- ILogicalExpression currExpr = null;
- for (int i = 0; i <= nOps; i++) {
+ SubplanOperator sp = new SubplanOperator();
+ Mutable<ILogicalOperator> nestedSource = new MutableObject<ILogicalOperator>(new NestedTupleSourceOperator(
+ new MutableObject<ILogicalOperator>(sp)));
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(
- exprs.get(i), topOp);
- topOp = p.second;
- ILogicalExpression e = p.first;
- // now look at the operator
- if (i < nOps) {
- if (OperatorExpr.opIsComparison(ops.get(i))) {
- AbstractFunctionCallExpression c = createComparisonExpression(ops
- .get(i));
+ Pair<ILogicalOperator, LogicalVariable> pThen = ifexpr.getThenExpr().accept(this, nestedSource);
+ SelectOperator sel1 = new SelectOperator(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(
+ varCond)));
+ sel1.getInputs().add(new MutableObject<ILogicalOperator>(pThen.first));
- // chain the operators
- if (i == 0) {
- c.getArguments().add(
- new MutableObject<ILogicalExpression>(e));
- currExpr = c;
- if (op.isBroadcastOperand(i)) {
- BroadcastExpressionAnnotation bcast = new BroadcastExpressionAnnotation();
- bcast.setObject(BroadcastSide.LEFT);
- c.getAnnotations()
- .put(BroadcastExpressionAnnotation.BROADCAST_ANNOTATION_KEY,
- bcast);
- }
- } else {
- ((AbstractFunctionCallExpression) currExpr)
- .getArguments()
- .add(new MutableObject<ILogicalExpression>(e));
- c.getArguments()
- .add(new MutableObject<ILogicalExpression>(
- currExpr));
- currExpr = c;
- if (i == 1 && op.isBroadcastOperand(i)) {
- BroadcastExpressionAnnotation bcast = new BroadcastExpressionAnnotation();
- bcast.setObject(BroadcastSide.RIGHT);
- c.getAnnotations()
- .put(BroadcastExpressionAnnotation.BROADCAST_ANNOTATION_KEY,
- bcast);
- }
- }
- } else {
- AbstractFunctionCallExpression f = createFunctionCallExpressionForBuiltinOperator(ops
- .get(i));
+ Pair<ILogicalOperator, LogicalVariable> pElse = ifexpr.getElseExpr().accept(this, nestedSource);
+ AbstractFunctionCallExpression notVarCond = new ScalarFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AlgebricksBuiltinFunctions.NOT), new MutableObject<ILogicalExpression>(
+ new VariableReferenceExpression(varCond)));
+ SelectOperator sel2 = new SelectOperator(new MutableObject<ILogicalExpression>(notVarCond));
+ sel2.getInputs().add(new MutableObject<ILogicalOperator>(pElse.first));
- if (i == 0) {
- f.getArguments().add(
- new MutableObject<ILogicalExpression>(e));
- currExpr = f;
- } else {
- ((AbstractFunctionCallExpression) currExpr)
- .getArguments()
- .add(new MutableObject<ILogicalExpression>(e));
- f.getArguments()
- .add(new MutableObject<ILogicalExpression>(
- currExpr));
- currExpr = f;
- }
- }
- } else { // don't forget the last expression...
- ((AbstractFunctionCallExpression) currExpr).getArguments().add(
- new MutableObject<ILogicalExpression>(e));
- if (i == 1 && op.isBroadcastOperand(i)) {
- BroadcastExpressionAnnotation bcast = new BroadcastExpressionAnnotation();
- bcast.setObject(BroadcastSide.RIGHT);
- ((AbstractFunctionCallExpression) currExpr)
- .getAnnotations()
- .put(BroadcastExpressionAnnotation.BROADCAST_ANNOTATION_KEY,
- bcast);
- }
- }
- }
+ ILogicalPlan p1 = new ALogicalPlanImpl(new MutableObject<ILogicalOperator>(sel1));
+ sp.getNestedPlans().add(p1);
+ ILogicalPlan p2 = new ALogicalPlanImpl(new MutableObject<ILogicalOperator>(sel2));
+ sp.getNestedPlans().add(p2);
- LogicalVariable assignedVar = context.newVar();
- AssignOperator a = new AssignOperator(assignedVar,
- new MutableObject<ILogicalExpression>(currExpr));
+ Mutable<ILogicalOperator> opCondRef = new MutableObject<ILogicalOperator>(opCond);
+ sp.getInputs().add(opCondRef);
- a.getInputs().add(topOp);
+ LogicalVariable resV = context.newVar();
+ AbstractFunctionCallExpression concatNonNull = new ScalarFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.CONCAT_NON_NULL),
+ new MutableObject<ILogicalExpression>(new VariableReferenceExpression(pThen.second)),
+ new MutableObject<ILogicalExpression>(new VariableReferenceExpression(pElse.second)));
+ AssignOperator a = new AssignOperator(resV, new MutableObject<ILogicalExpression>(concatNonNull));
+ a.getInputs().add(new MutableObject<ILogicalOperator>(sp));
- return new Pair<ILogicalOperator, LogicalVariable>(a, assignedVar);
- }
+ return new Pair<ILogicalOperator, LogicalVariable>(a, resV);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitOrderbyClause(
- OrderbyClause oc, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitLiteralExpr(LiteralExpr l, Mutable<ILogicalOperator> tupSource) {
+ LogicalVariable var = context.newVar();
+ AssignOperator a = new AssignOperator(var, new MutableObject<ILogicalExpression>(new ConstantExpression(
+ new AsterixConstantValue(ConstantHelper.objectFromLiteral(l.getValue())))));
+ if (tupSource != null) {
+ a.getInputs().add(tupSource);
+ }
+ return new Pair<ILogicalOperator, LogicalVariable>(a, var);
+ }
- OrderOperator ord = new OrderOperator();
- Iterator<OrderModifier> modifIter = oc.getModifierList().iterator();
- Mutable<ILogicalOperator> topOp = tupSource;
- for (Expression e : oc.getOrderbyList()) {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(
- e, topOp);
- OrderModifier m = modifIter.next();
- OrderOperator.IOrder comp = (m == OrderModifier.ASC) ? OrderOperator.ASC_ORDER
- : OrderOperator.DESC_ORDER;
- ord.getOrderExpressions().add(
- new Pair<IOrder, Mutable<ILogicalExpression>>(comp,
- new MutableObject<ILogicalExpression>(p.first)));
- topOp = p.second;
- }
- ord.getInputs().add(topOp);
- if (oc.getNumTuples() > 0) {
- ord.getAnnotations().put(OperatorAnnotations.CARDINALITY,
- oc.getNumTuples());
- }
- if (oc.getNumFrames() > 0) {
- ord.getAnnotations().put(OperatorAnnotations.MAX_NUMBER_FRAMES,
- oc.getNumFrames());
- }
- return new Pair<ILogicalOperator, LogicalVariable>(ord, null);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitOperatorExpr(OperatorExpr op,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ ArrayList<OperatorType> ops = op.getOpList();
+ int nOps = ops.size();
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitQuantifiedExpression(
- QuantifiedExpression qe, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- Mutable<ILogicalOperator> topOp = tupSource;
+ if (nOps > 0 && (ops.get(0) == OperatorType.AND || ops.get(0) == OperatorType.OR)) {
+ return visitAndOrOperator(op, tupSource);
+ }
- ILogicalOperator firstOp = null;
- Mutable<ILogicalOperator> lastOp = null;
+ ArrayList<Expression> exprs = op.getExprList();
- for (QuantifiedPair qt : qe.getQuantifiedList()) {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo1 = aqlExprToAlgExpression(
- qt.getExpr(), topOp);
- topOp = eo1.second;
- LogicalVariable uVar = context.newVar(qt.getVarExpr());
- ILogicalOperator u = new UnnestOperator(uVar,
- new MutableObject<ILogicalExpression>(
- makeUnnestExpression(eo1.first)));
+ Mutable<ILogicalOperator> topOp = tupSource;
- if (firstOp == null) {
- firstOp = u;
- }
- if (lastOp != null) {
- u.getInputs().add(lastOp);
- }
- lastOp = new MutableObject<ILogicalOperator>(u);
- }
+ ILogicalExpression currExpr = null;
+ for (int i = 0; i <= nOps; i++) {
- // We make all the unnest correspond. to quantif. vars. sit on top
- // in the hope of enabling joins & other optimiz.
- firstOp.getInputs().add(topOp);
- topOp = lastOp;
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(exprs.get(i), topOp);
+ topOp = p.second;
+ ILogicalExpression e = p.first;
+ // now look at the operator
+ if (i < nOps) {
+ if (OperatorExpr.opIsComparison(ops.get(i))) {
+ AbstractFunctionCallExpression c = createComparisonExpression(ops.get(i));
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo2 = aqlExprToAlgExpression(
- qe.getSatisfiesExpr(), topOp);
+ // chain the operators
+ if (i == 0) {
+ c.getArguments().add(new MutableObject<ILogicalExpression>(e));
+ currExpr = c;
+ if (op.isBroadcastOperand(i)) {
+ BroadcastExpressionAnnotation bcast = new BroadcastExpressionAnnotation();
+ bcast.setObject(BroadcastSide.LEFT);
+ c.getAnnotations().put(BroadcastExpressionAnnotation.BROADCAST_ANNOTATION_KEY, bcast);
+ }
+ } else {
+ ((AbstractFunctionCallExpression) currExpr).getArguments().add(
+ new MutableObject<ILogicalExpression>(e));
+ c.getArguments().add(new MutableObject<ILogicalExpression>(currExpr));
+ currExpr = c;
+ if (i == 1 && op.isBroadcastOperand(i)) {
+ BroadcastExpressionAnnotation bcast = new BroadcastExpressionAnnotation();
+ bcast.setObject(BroadcastSide.RIGHT);
+ c.getAnnotations().put(BroadcastExpressionAnnotation.BROADCAST_ANNOTATION_KEY, bcast);
+ }
+ }
+ } else {
+ AbstractFunctionCallExpression f = createFunctionCallExpressionForBuiltinOperator(ops.get(i));
+
+ if (i == 0) {
+ f.getArguments().add(new MutableObject<ILogicalExpression>(e));
+ currExpr = f;
+ } else {
+ ((AbstractFunctionCallExpression) currExpr).getArguments().add(
+ new MutableObject<ILogicalExpression>(e));
+ f.getArguments().add(new MutableObject<ILogicalExpression>(currExpr));
+ currExpr = f;
+ }
+ }
+ } else { // don't forget the last expression...
+ ((AbstractFunctionCallExpression) currExpr).getArguments()
+ .add(new MutableObject<ILogicalExpression>(e));
+ if (i == 1 && op.isBroadcastOperand(i)) {
+ BroadcastExpressionAnnotation bcast = new BroadcastExpressionAnnotation();
+ bcast.setObject(BroadcastSide.RIGHT);
+ ((AbstractFunctionCallExpression) currExpr).getAnnotations().put(
+ BroadcastExpressionAnnotation.BROADCAST_ANNOTATION_KEY, bcast);
+ }
+ }
+ }
+
+ // Add hints as annotations.
+ if (op.hasHints() && currExpr instanceof AbstractFunctionCallExpression) {
+ AbstractFunctionCallExpression currFuncExpr = (AbstractFunctionCallExpression) currExpr;
+ for (IExpressionAnnotation hint : op.getHints()) {
+ currFuncExpr.getAnnotations().put(hint, hint);
+ }
+ }
+
+ LogicalVariable assignedVar = context.newVar();
+ AssignOperator a = new AssignOperator(assignedVar, new MutableObject<ILogicalExpression>(currExpr));
+
+ a.getInputs().add(topOp);
+
+ return new Pair<ILogicalOperator, LogicalVariable>(a, assignedVar);
+ }
+
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitOrderbyClause(OrderbyClause oc,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+
+ OrderOperator ord = new OrderOperator();
+ Iterator<OrderModifier> modifIter = oc.getModifierList().iterator();
+ Mutable<ILogicalOperator> topOp = tupSource;
+ for (Expression e : oc.getOrderbyList()) {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(e, topOp);
+ OrderModifier m = modifIter.next();
+ OrderOperator.IOrder comp = (m == OrderModifier.ASC) ? OrderOperator.ASC_ORDER : OrderOperator.DESC_ORDER;
+ ord.getOrderExpressions()
+ .add(new Pair<IOrder, Mutable<ILogicalExpression>>(comp, new MutableObject<ILogicalExpression>(
+ p.first)));
+ topOp = p.second;
+ }
+ ord.getInputs().add(topOp);
+ if (oc.getNumTuples() > 0) {
+ ord.getAnnotations().put(OperatorAnnotations.CARDINALITY, oc.getNumTuples());
+ }
+ if (oc.getNumFrames() > 0) {
+ ord.getAnnotations().put(OperatorAnnotations.MAX_NUMBER_FRAMES, oc.getNumFrames());
+ }
+ return new Pair<ILogicalOperator, LogicalVariable>(ord, null);
+ }
+
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitQuantifiedExpression(QuantifiedExpression qe,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ Mutable<ILogicalOperator> topOp = tupSource;
+
+ ILogicalOperator firstOp = null;
+ Mutable<ILogicalOperator> lastOp = null;
+
+ for (QuantifiedPair qt : qe.getQuantifiedList()) {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo1 = aqlExprToAlgExpression(qt.getExpr(), topOp);
+ topOp = eo1.second;
+ LogicalVariable uVar = context.newVar(qt.getVarExpr());
+ ILogicalOperator u = new UnnestOperator(uVar, new MutableObject<ILogicalExpression>(
+ makeUnnestExpression(eo1.first)));
+
+ if (firstOp == null) {
+ firstOp = u;
+ }
+ if (lastOp != null) {
+ u.getInputs().add(lastOp);
+ }
+ lastOp = new MutableObject<ILogicalOperator>(u);
+ }
+
+ // We make all the unnest correspond. to quantif. vars. sit on top
+ // in the hope of enabling joins & other optimiz.
+ firstOp.getInputs().add(topOp);
+ topOp = lastOp;
+
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo2 = aqlExprToAlgExpression(qe.getSatisfiesExpr(), topOp);
- AggregateFunctionCallExpression fAgg;
- SelectOperator s;
- if (qe.getQuantifier() == Quantifier.SOME) {
- s = new SelectOperator(new MutableObject<ILogicalExpression>(
- eo2.first));
- s.getInputs().add(eo2.second);
- fAgg = AsterixBuiltinFunctions.makeAggregateFunctionExpression(
- AsterixBuiltinFunctions.NON_EMPTY_STREAM,
- new ArrayList<Mutable<ILogicalExpression>>());
- } else { // EVERY
- List<Mutable<ILogicalExpression>> satExprList = new ArrayList<Mutable<ILogicalExpression>>(
- 1);
- satExprList.add(new MutableObject<ILogicalExpression>(eo2.first));
- s = new SelectOperator(new MutableObject<ILogicalExpression>(
- new ScalarFunctionCallExpression(FunctionUtils
- .getFunctionInfo(AlgebricksBuiltinFunctions.NOT),
- satExprList)));
- s.getInputs().add(eo2.second);
- fAgg = AsterixBuiltinFunctions.makeAggregateFunctionExpression(
- AsterixBuiltinFunctions.EMPTY_STREAM,
- new ArrayList<Mutable<ILogicalExpression>>());
- }
- LogicalVariable qeVar = context.newVar();
- AggregateOperator a = new AggregateOperator(
- mkSingletonArrayList(qeVar),
- (List) mkSingletonArrayList(new MutableObject<ILogicalExpression>(
- fAgg)));
- a.getInputs().add(new MutableObject<ILogicalOperator>(s));
- return new Pair<ILogicalOperator, LogicalVariable>(a, qeVar);
- }
+ AggregateFunctionCallExpression fAgg;
+ SelectOperator s;
+ if (qe.getQuantifier() == Quantifier.SOME) {
+ s = new SelectOperator(new MutableObject<ILogicalExpression>(eo2.first));
+ s.getInputs().add(eo2.second);
+ fAgg = AsterixBuiltinFunctions.makeAggregateFunctionExpression(AsterixBuiltinFunctions.NON_EMPTY_STREAM,
+ new ArrayList<Mutable<ILogicalExpression>>());
+ } else { // EVERY
+ List<Mutable<ILogicalExpression>> satExprList = new ArrayList<Mutable<ILogicalExpression>>(1);
+ satExprList.add(new MutableObject<ILogicalExpression>(eo2.first));
+ s = new SelectOperator(new MutableObject<ILogicalExpression>(new ScalarFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AlgebricksBuiltinFunctions.NOT), satExprList)));
+ s.getInputs().add(eo2.second);
+ fAgg = AsterixBuiltinFunctions.makeAggregateFunctionExpression(AsterixBuiltinFunctions.EMPTY_STREAM,
+ new ArrayList<Mutable<ILogicalExpression>>());
+ }
+ LogicalVariable qeVar = context.newVar();
+ AggregateOperator a = new AggregateOperator(mkSingletonArrayList(qeVar),
+ (List) mkSingletonArrayList(new MutableObject<ILogicalExpression>(fAgg)));
+ a.getInputs().add(new MutableObject<ILogicalOperator>(s));
+ return new Pair<ILogicalOperator, LogicalVariable>(a, qeVar);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitQuery(Query q,
- Mutable<ILogicalOperator> tupSource) throws AsterixException {
- return q.getBody().accept(this, tupSource);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitQuery(Query q, Mutable<ILogicalOperator> tupSource)
+ throws AsterixException {
+ return q.getBody().accept(this, tupSource);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitRecordConstructor(
- RecordConstructor rc, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- AbstractFunctionCallExpression f = new ScalarFunctionCallExpression(
- FunctionUtils
- .getFunctionInfo(AsterixBuiltinFunctions.OPEN_RECORD_CONSTRUCTOR));
- LogicalVariable v1 = context.newVar();
- AssignOperator a = new AssignOperator(v1,
- new MutableObject<ILogicalExpression>(f));
- Mutable<ILogicalOperator> topOp = tupSource;
- for (FieldBinding fb : rc.getFbList()) {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo1 = aqlExprToAlgExpression(
- fb.getLeftExpr(), topOp);
- f.getArguments().add(
- new MutableObject<ILogicalExpression>(eo1.first));
- topOp = eo1.second;
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo2 = aqlExprToAlgExpression(
- fb.getRightExpr(), topOp);
- f.getArguments().add(
- new MutableObject<ILogicalExpression>(eo2.first));
- topOp = eo2.second;
- }
- a.getInputs().add(topOp);
- return new Pair<ILogicalOperator, LogicalVariable>(a, v1);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitRecordConstructor(RecordConstructor rc,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ AbstractFunctionCallExpression f = new ScalarFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.OPEN_RECORD_CONSTRUCTOR));
+ LogicalVariable v1 = context.newVar();
+ AssignOperator a = new AssignOperator(v1, new MutableObject<ILogicalExpression>(f));
+ Mutable<ILogicalOperator> topOp = tupSource;
+ for (FieldBinding fb : rc.getFbList()) {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo1 = aqlExprToAlgExpression(fb.getLeftExpr(), topOp);
+ f.getArguments().add(new MutableObject<ILogicalExpression>(eo1.first));
+ topOp = eo1.second;
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo2 = aqlExprToAlgExpression(fb.getRightExpr(), topOp);
+ f.getArguments().add(new MutableObject<ILogicalExpression>(eo2.first));
+ topOp = eo2.second;
+ }
+ a.getInputs().add(topOp);
+ return new Pair<ILogicalOperator, LogicalVariable>(a, v1);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitListConstructor(
- ListConstructor lc, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- FunctionIdentifier fid = (lc.getType() == Type.ORDERED_LIST_CONSTRUCTOR) ? AsterixBuiltinFunctions.ORDERED_LIST_CONSTRUCTOR
- : AsterixBuiltinFunctions.UNORDERED_LIST_CONSTRUCTOR;
- AbstractFunctionCallExpression f = new ScalarFunctionCallExpression(
- FunctionUtils.getFunctionInfo(fid));
- LogicalVariable v1 = context.newVar();
- AssignOperator a = new AssignOperator(v1,
- new MutableObject<ILogicalExpression>(f));
- Mutable<ILogicalOperator> topOp = tupSource;
- for (Expression expr : lc.getExprList()) {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(
- expr, topOp);
- f.getArguments().add(
- new MutableObject<ILogicalExpression>(eo.first));
- topOp = eo.second;
- }
- a.getInputs().add(topOp);
- return new Pair<ILogicalOperator, LogicalVariable>(a, v1);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitListConstructor(ListConstructor lc,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ FunctionIdentifier fid = (lc.getType() == Type.ORDERED_LIST_CONSTRUCTOR) ? AsterixBuiltinFunctions.ORDERED_LIST_CONSTRUCTOR
+ : AsterixBuiltinFunctions.UNORDERED_LIST_CONSTRUCTOR;
+ AbstractFunctionCallExpression f = new ScalarFunctionCallExpression(FunctionUtils.getFunctionInfo(fid));
+ LogicalVariable v1 = context.newVar();
+ AssignOperator a = new AssignOperator(v1, new MutableObject<ILogicalExpression>(f));
+ Mutable<ILogicalOperator> topOp = tupSource;
+ for (Expression expr : lc.getExprList()) {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(expr, topOp);
+ f.getArguments().add(new MutableObject<ILogicalExpression>(eo.first));
+ topOp = eo.second;
+ }
+ a.getInputs().add(topOp);
+ return new Pair<ILogicalOperator, LogicalVariable>(a, v1);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitUnaryExpr(UnaryExpr u,
- Mutable<ILogicalOperator> tupSource) throws AsterixException {
- Expression expr = u.getExpr();
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(
- expr, tupSource);
- LogicalVariable v1 = context.newVar();
- AssignOperator a;
- if (u.getSign() == Sign.POSITIVE) {
- a = new AssignOperator(v1, new MutableObject<ILogicalExpression>(
- eo.first));
- } else {
- AbstractFunctionCallExpression m = new ScalarFunctionCallExpression(
- FunctionUtils
- .getFunctionInfo(AsterixBuiltinFunctions.NUMERIC_UNARY_MINUS));
- m.getArguments().add(
- new MutableObject<ILogicalExpression>(eo.first));
- a = new AssignOperator(v1, new MutableObject<ILogicalExpression>(m));
- }
- a.getInputs().add(eo.second);
- return new Pair<ILogicalOperator, LogicalVariable>(a, v1);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitUnaryExpr(UnaryExpr u, Mutable<ILogicalOperator> tupSource)
+ throws AsterixException {
+ Expression expr = u.getExpr();
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(expr, tupSource);
+ LogicalVariable v1 = context.newVar();
+ AssignOperator a;
+ if (u.getSign() == Sign.POSITIVE) {
+ a = new AssignOperator(v1, new MutableObject<ILogicalExpression>(eo.first));
+ } else {
+ AbstractFunctionCallExpression m = new ScalarFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.NUMERIC_UNARY_MINUS));
+ m.getArguments().add(new MutableObject<ILogicalExpression>(eo.first));
+ a = new AssignOperator(v1, new MutableObject<ILogicalExpression>(m));
+ }
+ a.getInputs().add(eo.second);
+ return new Pair<ILogicalOperator, LogicalVariable>(a, v1);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitVariableExpr(
- VariableExpr v, Mutable<ILogicalOperator> tupSource) {
- // Should we ever get to this method?
- LogicalVariable var = context.newVar();
- LogicalVariable oldV = context.getVar(v.getVar().getId());
- AssignOperator a = new AssignOperator(var,
- new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(oldV)));
- a.getInputs().add(tupSource);
- return new Pair<ILogicalOperator, LogicalVariable>(a, var);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitVariableExpr(VariableExpr v, Mutable<ILogicalOperator> tupSource) {
+ // Should we ever get to this method?
+ LogicalVariable var = context.newVar();
+ LogicalVariable oldV = context.getVar(v.getVar().getId());
+ AssignOperator a = new AssignOperator(var, new MutableObject<ILogicalExpression>(
+ new VariableReferenceExpression(oldV)));
+ a.getInputs().add(tupSource);
+ return new Pair<ILogicalOperator, LogicalVariable>(a, var);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitWhereClause(
- WhereClause w, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(
- w.getWhereExpr(), tupSource);
- SelectOperator s = new SelectOperator(
- new MutableObject<ILogicalExpression>(p.first));
- s.getInputs().add(p.second);
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitWhereClause(WhereClause w, Mutable<ILogicalOperator> tupSource)
+ throws AsterixException {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(w.getWhereExpr(), tupSource);
+ SelectOperator s = new SelectOperator(new MutableObject<ILogicalExpression>(p.first));
+ s.getInputs().add(p.second);
- return new Pair<ILogicalOperator, LogicalVariable>(s, null);
- }
+ return new Pair<ILogicalOperator, LogicalVariable>(s, null);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitLimitClause(
- LimitClause lc, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p1 = aqlExprToAlgExpression(
- lc.getLimitExpr(), tupSource);
- LimitOperator opLim;
- Expression offset = lc.getOffset();
- if (offset != null) {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p2 = aqlExprToAlgExpression(
- offset, p1.second);
- opLim = new LimitOperator(p1.first, p2.first);
- opLim.getInputs().add(p2.second);
- } else {
- opLim = new LimitOperator(p1.first);
- opLim.getInputs().add(p1.second);
- }
- return new Pair<ILogicalOperator, LogicalVariable>(opLim, null);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitLimitClause(LimitClause lc, Mutable<ILogicalOperator> tupSource)
+ throws AsterixException {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> p1 = aqlExprToAlgExpression(lc.getLimitExpr(), tupSource);
+ LimitOperator opLim;
+ Expression offset = lc.getOffset();
+ if (offset != null) {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> p2 = aqlExprToAlgExpression(offset, p1.second);
+ opLim = new LimitOperator(p1.first, p2.first);
+ opLim.getInputs().add(p2.second);
+ } else {
+ opLim = new LimitOperator(p1.first);
+ opLim.getInputs().add(p1.second);
+ }
+ return new Pair<ILogicalOperator, LogicalVariable>(opLim, null);
+ }
- @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> 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>>();
- Mutable<ILogicalOperator> input = null;
- for (Expression expr : dc.getDistinctByExpr()) {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(
- expr, tupSource);
- exprList.add(new MutableObject<ILogicalExpression>(p.first));
- input = p.second;
- }
- DistinctOperator opDistinct = new DistinctOperator(exprList);
- opDistinct.getInputs().add(input);
- return new Pair<ILogicalOperator, LogicalVariable>(opDistinct, null);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitDistinctClause(DistinctClause dc,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ List<Mutable<ILogicalExpression>> exprList = new ArrayList<Mutable<ILogicalExpression>>();
+ Mutable<ILogicalOperator> input = null;
+ for (Expression expr : dc.getDistinctByExpr()) {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(expr, tupSource);
+ exprList.add(new MutableObject<ILogicalExpression>(p.first));
+ input = p.second;
+ }
+ DistinctOperator opDistinct = new DistinctOperator(exprList);
+ opDistinct.getInputs().add(input);
+ return new Pair<ILogicalOperator, LogicalVariable>(opDistinct, null);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitUnionExpr(
- UnionExpr unionExpr, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- Mutable<ILogicalOperator> ts = tupSource;
- ILogicalOperator lastOp = null;
- LogicalVariable lastVar = null;
- boolean first = true;
- for (Expression e : unionExpr.getExprs()) {
- if (first) {
- first = false;
- } else {
- ts = new MutableObject<ILogicalOperator>(
- new EmptyTupleSourceOperator());
- }
- Pair<ILogicalOperator, LogicalVariable> p1 = e.accept(this, ts);
- if (lastOp == null) {
- lastOp = p1.first;
- lastVar = p1.second;
- } else {
- LogicalVariable unnestVar1 = context.newVar();
- UnnestOperator unnest1 = new UnnestOperator(
- unnestVar1,
- new MutableObject<ILogicalExpression>(
- makeUnnestExpression(new VariableReferenceExpression(
- lastVar))));
- unnest1.getInputs().add(
- new MutableObject<ILogicalOperator>(lastOp));
- LogicalVariable unnestVar2 = context.newVar();
- UnnestOperator unnest2 = new UnnestOperator(
- unnestVar2,
- new MutableObject<ILogicalExpression>(
- makeUnnestExpression(new VariableReferenceExpression(
- p1.second))));
- unnest2.getInputs().add(
- new MutableObject<ILogicalOperator>(p1.first));
- List<Triple<LogicalVariable, LogicalVariable, LogicalVariable>> varMap = new ArrayList<Triple<LogicalVariable, LogicalVariable, LogicalVariable>>(
- 1);
- LogicalVariable resultVar = context.newVar();
- Triple<LogicalVariable, LogicalVariable, LogicalVariable> triple = new Triple<LogicalVariable, LogicalVariable, LogicalVariable>(
- unnestVar1, unnestVar2, resultVar);
- varMap.add(triple);
- UnionAllOperator unionOp = new UnionAllOperator(varMap);
- unionOp.getInputs().add(
- new MutableObject<ILogicalOperator>(unnest1));
- unionOp.getInputs().add(
- new MutableObject<ILogicalOperator>(unnest2));
- lastVar = resultVar;
- lastOp = unionOp;
- }
- }
- LogicalVariable aggVar = context.newVar();
- ArrayList<LogicalVariable> aggregVars = new ArrayList<LogicalVariable>(
- 1);
- aggregVars.add(aggVar);
- List<Mutable<ILogicalExpression>> afcExprs = new ArrayList<Mutable<ILogicalExpression>>(
- 1);
- afcExprs.add(new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(lastVar)));
- AggregateFunctionCallExpression afc = AsterixBuiltinFunctions
- .makeAggregateFunctionExpression(
- AsterixBuiltinFunctions.LISTIFY, afcExprs);
- ArrayList<Mutable<ILogicalExpression>> aggregExprs = new ArrayList<Mutable<ILogicalExpression>>(
- 1);
- aggregExprs.add(new MutableObject<ILogicalExpression>(afc));
- AggregateOperator agg = new AggregateOperator(aggregVars, aggregExprs);
- agg.getInputs().add(new MutableObject<ILogicalOperator>(lastOp));
- return new Pair<ILogicalOperator, LogicalVariable>(agg, aggVar);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitUnionExpr(UnionExpr unionExpr,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ Mutable<ILogicalOperator> ts = tupSource;
+ ILogicalOperator lastOp = null;
+ LogicalVariable lastVar = null;
+ boolean first = true;
+ for (Expression e : unionExpr.getExprs()) {
+ if (first) {
+ first = false;
+ } else {
+ ts = new MutableObject<ILogicalOperator>(new EmptyTupleSourceOperator());
+ }
+ Pair<ILogicalOperator, LogicalVariable> p1 = e.accept(this, ts);
+ if (lastOp == null) {
+ lastOp = p1.first;
+ lastVar = p1.second;
+ } else {
+ LogicalVariable unnestVar1 = context.newVar();
+ UnnestOperator unnest1 = new UnnestOperator(unnestVar1, new MutableObject<ILogicalExpression>(
+ makeUnnestExpression(new VariableReferenceExpression(lastVar))));
+ unnest1.getInputs().add(new MutableObject<ILogicalOperator>(lastOp));
+ LogicalVariable unnestVar2 = context.newVar();
+ UnnestOperator unnest2 = new UnnestOperator(unnestVar2, new MutableObject<ILogicalExpression>(
+ makeUnnestExpression(new VariableReferenceExpression(p1.second))));
+ unnest2.getInputs().add(new MutableObject<ILogicalOperator>(p1.first));
+ List<Triple<LogicalVariable, LogicalVariable, LogicalVariable>> varMap = new ArrayList<Triple<LogicalVariable, LogicalVariable, LogicalVariable>>(
+ 1);
+ LogicalVariable resultVar = context.newVar();
+ Triple<LogicalVariable, LogicalVariable, LogicalVariable> triple = new Triple<LogicalVariable, LogicalVariable, LogicalVariable>(
+ unnestVar1, unnestVar2, resultVar);
+ varMap.add(triple);
+ UnionAllOperator unionOp = new UnionAllOperator(varMap);
+ unionOp.getInputs().add(new MutableObject<ILogicalOperator>(unnest1));
+ unionOp.getInputs().add(new MutableObject<ILogicalOperator>(unnest2));
+ lastVar = resultVar;
+ lastOp = unionOp;
+ }
+ }
+ LogicalVariable aggVar = context.newVar();
+ ArrayList<LogicalVariable> aggregVars = new ArrayList<LogicalVariable>(1);
+ aggregVars.add(aggVar);
+ List<Mutable<ILogicalExpression>> afcExprs = new ArrayList<Mutable<ILogicalExpression>>(1);
+ afcExprs.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(lastVar)));
+ AggregateFunctionCallExpression afc = AsterixBuiltinFunctions.makeAggregateFunctionExpression(
+ AsterixBuiltinFunctions.LISTIFY, afcExprs);
+ ArrayList<Mutable<ILogicalExpression>> aggregExprs = new ArrayList<Mutable<ILogicalExpression>>(1);
+ aggregExprs.add(new MutableObject<ILogicalExpression>(afc));
+ AggregateOperator agg = new AggregateOperator(aggregVars, aggregExprs);
+ agg.getInputs().add(new MutableObject<ILogicalOperator>(lastOp));
+ return new Pair<ILogicalOperator, LogicalVariable>(agg, aggVar);
+ }
- private AbstractFunctionCallExpression createComparisonExpression(
- OperatorType t) {
- FunctionIdentifier fi = operatorTypeToFunctionIdentifier(t);
- IFunctionInfo finfo = FunctionUtils.getFunctionInfo(fi);
- return new ScalarFunctionCallExpression(finfo);
- }
+ private AbstractFunctionCallExpression createComparisonExpression(OperatorType t) {
+ FunctionIdentifier fi = operatorTypeToFunctionIdentifier(t);
+ IFunctionInfo finfo = FunctionUtils.getFunctionInfo(fi);
+ return new ScalarFunctionCallExpression(finfo);
+ }
- private FunctionIdentifier operatorTypeToFunctionIdentifier(OperatorType t) {
- switch (t) {
- case EQ: {
- return AlgebricksBuiltinFunctions.EQ;
- }
- case NEQ: {
- return AlgebricksBuiltinFunctions.NEQ;
- }
- case GT: {
- return AlgebricksBuiltinFunctions.GT;
- }
- case GE: {
- return AlgebricksBuiltinFunctions.GE;
- }
- case LT: {
- return AlgebricksBuiltinFunctions.LT;
- }
- case LE: {
- return AlgebricksBuiltinFunctions.LE;
- }
- default: {
- throw new IllegalStateException();
- }
- }
- }
+ private FunctionIdentifier operatorTypeToFunctionIdentifier(OperatorType t) {
+ switch (t) {
+ case EQ: {
+ return AlgebricksBuiltinFunctions.EQ;
+ }
+ case NEQ: {
+ return AlgebricksBuiltinFunctions.NEQ;
+ }
+ case GT: {
+ return AlgebricksBuiltinFunctions.GT;
+ }
+ case GE: {
+ return AlgebricksBuiltinFunctions.GE;
+ }
+ case LT: {
+ return AlgebricksBuiltinFunctions.LT;
+ }
+ case LE: {
+ return AlgebricksBuiltinFunctions.LE;
+ }
+ default: {
+ throw new IllegalStateException();
+ }
+ }
+ }
- private AbstractFunctionCallExpression createFunctionCallExpressionForBuiltinOperator(
- OperatorType t) throws AsterixException {
+ private AbstractFunctionCallExpression createFunctionCallExpressionForBuiltinOperator(OperatorType t)
+ throws AsterixException {
- FunctionIdentifier fid = null;
- switch (t) {
- case PLUS: {
- fid = AlgebricksBuiltinFunctions.NUMERIC_ADD;
- break;
- }
- case MINUS: {
- fid = AsterixBuiltinFunctions.NUMERIC_SUBTRACT;
- break;
- }
- case MUL: {
- fid = AsterixBuiltinFunctions.NUMERIC_MULTIPLY;
- break;
- }
- case DIV: {
- fid = AsterixBuiltinFunctions.NUMERIC_DIVIDE;
- break;
- }
- case MOD: {
- fid = AsterixBuiltinFunctions.NUMERIC_MOD;
- break;
- }
- case IDIV: {
- fid = AsterixBuiltinFunctions.NUMERIC_IDIV;
- break;
- }
- case CARET: {
- fid = AsterixBuiltinFunctions.CARET;
- break;
- }
- case AND: {
- fid = AlgebricksBuiltinFunctions.AND;
- break;
- }
- case OR: {
- fid = AlgebricksBuiltinFunctions.OR;
- break;
- }
- case FUZZY_EQ: {
- fid = AsterixBuiltinFunctions.FUZZY_EQ;
- break;
- }
+ FunctionIdentifier fid = null;
+ switch (t) {
+ case PLUS: {
+ fid = AlgebricksBuiltinFunctions.NUMERIC_ADD;
+ break;
+ }
+ case MINUS: {
+ fid = AsterixBuiltinFunctions.NUMERIC_SUBTRACT;
+ break;
+ }
+ case MUL: {
+ fid = AsterixBuiltinFunctions.NUMERIC_MULTIPLY;
+ break;
+ }
+ case DIV: {
+ fid = AsterixBuiltinFunctions.NUMERIC_DIVIDE;
+ break;
+ }
+ case MOD: {
+ fid = AsterixBuiltinFunctions.NUMERIC_MOD;
+ break;
+ }
+ case IDIV: {
+ fid = AsterixBuiltinFunctions.NUMERIC_IDIV;
+ break;
+ }
+ case CARET: {
+ fid = AsterixBuiltinFunctions.CARET;
+ break;
+ }
+ case AND: {
+ fid = AlgebricksBuiltinFunctions.AND;
+ break;
+ }
+ case OR: {
+ fid = AlgebricksBuiltinFunctions.OR;
+ break;
+ }
+ case FUZZY_EQ: {
+ fid = AsterixBuiltinFunctions.FUZZY_EQ;
+ break;
+ }
- default: {
- throw new NotImplementedException("Operator " + t
- + " is not yet implemented");
- }
- }
- return new ScalarFunctionCallExpression(
- FunctionUtils.getFunctionInfo(fid));
- }
+ default: {
+ throw new NotImplementedException("Operator " + t + " is not yet implemented");
+ }
+ }
+ return new ScalarFunctionCallExpression(FunctionUtils.getFunctionInfo(fid));
+ }
- private static boolean hasOnlyChild(ILogicalOperator parent,
- Mutable<ILogicalOperator> childCandidate) {
- List<Mutable<ILogicalOperator>> inp = parent.getInputs();
- if (inp == null || inp.size() != 1) {
- return false;
- }
- return inp.get(0) == childCandidate;
- }
+ private static boolean hasOnlyChild(ILogicalOperator parent, Mutable<ILogicalOperator> childCandidate) {
+ List<Mutable<ILogicalOperator>> inp = parent.getInputs();
+ if (inp == null || inp.size() != 1) {
+ return false;
+ }
+ return inp.get(0) == childCandidate;
+ }
- private Pair<ILogicalExpression, Mutable<ILogicalOperator>> aqlExprToAlgExpression(
- Expression expr, Mutable<ILogicalOperator> topOp)
- throws AsterixException {
- switch (expr.getKind()) {
- case VARIABLE_EXPRESSION: {
- VariableReferenceExpression ve = new VariableReferenceExpression(
- context.getVar(((VariableExpr) expr).getVar().getId()));
- return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(ve,
- topOp);
- }
- case LITERAL_EXPRESSION: {
- LiteralExpr val = (LiteralExpr) expr;
- return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(
- new ConstantExpression(new AsterixConstantValue(
- ConstantHelper.objectFromLiteral(val.getValue()))),
- topOp);
- }
- default: {
- // Mutable<ILogicalOperator> src = new
- // Mutable<ILogicalOperator>();
- // Mutable<ILogicalOperator> src = topOp;
- if (expressionNeedsNoNesting(expr)) {
- Pair<ILogicalOperator, LogicalVariable> p = expr.accept(this,
- topOp);
- ILogicalExpression exp = ((AssignOperator) p.first)
- .getExpressions().get(0).getValue();
- return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(
- exp, p.first.getInputs().get(0));
- } else {
- Mutable<ILogicalOperator> src = new MutableObject<ILogicalOperator>();
+ private Pair<ILogicalExpression, Mutable<ILogicalOperator>> aqlExprToAlgExpression(Expression expr,
+ Mutable<ILogicalOperator> topOp) throws AsterixException {
+ switch (expr.getKind()) {
+ case VARIABLE_EXPRESSION: {
+ VariableReferenceExpression ve = new VariableReferenceExpression(context.getVar(((VariableExpr) expr)
+ .getVar().getId()));
+ return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(ve, topOp);
+ }
+ case LITERAL_EXPRESSION: {
+ LiteralExpr val = (LiteralExpr) expr;
+ return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(new ConstantExpression(
+ new AsterixConstantValue(ConstantHelper.objectFromLiteral(val.getValue()))), topOp);
+ }
+ default: {
+ // Mutable<ILogicalOperator> src = new
+ // Mutable<ILogicalOperator>();
+ // Mutable<ILogicalOperator> src = topOp;
+ if (expressionNeedsNoNesting(expr)) {
+ Pair<ILogicalOperator, LogicalVariable> p = expr.accept(this, topOp);
+ ILogicalExpression exp = ((AssignOperator) p.first).getExpressions().get(0).getValue();
+ return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(exp, p.first.getInputs().get(0));
+ } else {
+ Mutable<ILogicalOperator> src = new MutableObject<ILogicalOperator>();
- Pair<ILogicalOperator, LogicalVariable> p = expr.accept(this,
- src);
+ Pair<ILogicalOperator, LogicalVariable> p = expr.accept(this, src);
- if (((AbstractLogicalOperator) p.first).getOperatorTag() == LogicalOperatorTag.SUBPLAN) {
- // src.setOperator(topOp.getOperator());
- Mutable<ILogicalOperator> top2 = new MutableObject<ILogicalOperator>(
- p.first);
- return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(
- new VariableReferenceExpression(p.second), top2);
- } else {
- SubplanOperator s = new SubplanOperator();
- s.getInputs().add(topOp);
- src.setValue(new NestedTupleSourceOperator(
- new MutableObject<ILogicalOperator>(s)));
- Mutable<ILogicalOperator> planRoot = new MutableObject<ILogicalOperator>(
- p.first);
- s.setRootOp(planRoot);
- return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(
- new VariableReferenceExpression(p.second),
- new MutableObject<ILogicalOperator>(s));
- }
- }
- }
- }
+ if (((AbstractLogicalOperator) p.first).getOperatorTag() == LogicalOperatorTag.SUBPLAN) {
+ // src.setOperator(topOp.getOperator());
+ Mutable<ILogicalOperator> top2 = new MutableObject<ILogicalOperator>(p.first);
+ return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(new VariableReferenceExpression(
+ p.second), top2);
+ } else {
+ SubplanOperator s = new SubplanOperator();
+ s.getInputs().add(topOp);
+ src.setValue(new NestedTupleSourceOperator(new MutableObject<ILogicalOperator>(s)));
+ Mutable<ILogicalOperator> planRoot = new MutableObject<ILogicalOperator>(p.first);
+ s.setRootOp(planRoot);
+ return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(new VariableReferenceExpression(
+ p.second), new MutableObject<ILogicalOperator>(s));
+ }
+ }
+ }
+ }
- }
+ }
- private Pair<ILogicalOperator, LogicalVariable> produceFlwrResult(
- boolean noForClause, boolean isTop,
- Mutable<ILogicalOperator> resOpRef, LogicalVariable resVar) {
- if (isTop) {
- ProjectOperator pr = new ProjectOperator(resVar);
- pr.getInputs().add(resOpRef);
- return new Pair<ILogicalOperator, LogicalVariable>(pr, resVar);
+ private Pair<ILogicalOperator, LogicalVariable> produceFlwrResult(boolean noForClause, boolean isTop,
+ Mutable<ILogicalOperator> resOpRef, LogicalVariable resVar) {
+ if (isTop) {
+ ProjectOperator pr = new ProjectOperator(resVar);
+ pr.getInputs().add(resOpRef);
+ return new Pair<ILogicalOperator, LogicalVariable>(pr, resVar);
- } else if (noForClause) {
- return new Pair<ILogicalOperator, LogicalVariable>(
- resOpRef.getValue(), resVar);
- } else {
- return aggListify(resVar, resOpRef, false);
- }
- }
+ } else if (noForClause) {
+ return new Pair<ILogicalOperator, LogicalVariable>(resOpRef.getValue(), resVar);
+ } else {
+ return aggListify(resVar, resOpRef, false);
+ }
+ }
- private Pair<ILogicalOperator, LogicalVariable> aggListify(
- LogicalVariable var, Mutable<ILogicalOperator> opRef,
- boolean bProject) {
- AggregateFunctionCallExpression funAgg = AsterixBuiltinFunctions
- .makeAggregateFunctionExpression(
- AsterixBuiltinFunctions.LISTIFY,
- new ArrayList<Mutable<ILogicalExpression>>());
- funAgg.getArguments().add(
- new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(var)));
- LogicalVariable varListified = context.newVar();
- AggregateOperator agg = new AggregateOperator(
- mkSingletonArrayList(varListified),
- (List) mkSingletonArrayList(new MutableObject<ILogicalExpression>(
- funAgg)));
- agg.getInputs().add(opRef);
- ILogicalOperator res;
- if (bProject) {
- ProjectOperator pr = new ProjectOperator(varListified);
- pr.getInputs().add(new MutableObject<ILogicalOperator>(agg));
- res = pr;
- } else {
- res = agg;
- }
- return new Pair<ILogicalOperator, LogicalVariable>(res, varListified);
- }
+ private Pair<ILogicalOperator, LogicalVariable> aggListify(LogicalVariable var, Mutable<ILogicalOperator> opRef,
+ boolean bProject) {
+ AggregateFunctionCallExpression funAgg = AsterixBuiltinFunctions.makeAggregateFunctionExpression(
+ AsterixBuiltinFunctions.LISTIFY, new ArrayList<Mutable<ILogicalExpression>>());
+ funAgg.getArguments().add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(var)));
+ LogicalVariable varListified = context.newVar();
+ AggregateOperator agg = new AggregateOperator(mkSingletonArrayList(varListified),
+ (List) mkSingletonArrayList(new MutableObject<ILogicalExpression>(funAgg)));
+ agg.getInputs().add(opRef);
+ ILogicalOperator res;
+ if (bProject) {
+ ProjectOperator pr = new ProjectOperator(varListified);
+ pr.getInputs().add(new MutableObject<ILogicalOperator>(agg));
+ res = pr;
+ } else {
+ res = agg;
+ }
+ return new Pair<ILogicalOperator, LogicalVariable>(res, varListified);
+ }
- private Pair<ILogicalOperator, LogicalVariable> visitAndOrOperator(
- OperatorExpr op, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- ArrayList<OperatorType> ops = op.getOpList();
- int nOps = ops.size();
+ private Pair<ILogicalOperator, LogicalVariable> visitAndOrOperator(OperatorExpr op,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ ArrayList<OperatorType> ops = op.getOpList();
+ int nOps = ops.size();
- ArrayList<Expression> exprs = op.getExprList();
+ ArrayList<Expression> exprs = op.getExprList();
- Mutable<ILogicalOperator> topOp = tupSource;
+ Mutable<ILogicalOperator> topOp = tupSource;
- OperatorType opLogical = ops.get(0);
- AbstractFunctionCallExpression f = createFunctionCallExpressionForBuiltinOperator(opLogical);
+ OperatorType opLogical = ops.get(0);
+ AbstractFunctionCallExpression f = createFunctionCallExpressionForBuiltinOperator(opLogical);
- for (int i = 0; i <= nOps; i++) {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(
- exprs.get(i), topOp);
- topOp = p.second;
- // now look at the operator
- if (i < nOps) {
- if (ops.get(i) != opLogical) {
- throw new TranslationException("Unexpected operator "
- + ops.get(i) + " in an OperatorExpr starting with "
- + opLogical);
- }
- }
- f.getArguments()
- .add(new MutableObject<ILogicalExpression>(p.first));
- }
+ for (int i = 0; i <= nOps; i++) {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(exprs.get(i), topOp);
+ topOp = p.second;
+ // now look at the operator
+ if (i < nOps) {
+ if (ops.get(i) != opLogical) {
+ throw new TranslationException("Unexpected operator " + ops.get(i)
+ + " in an OperatorExpr starting with " + opLogical);
+ }
+ }
+ f.getArguments().add(new MutableObject<ILogicalExpression>(p.first));
+ }
- LogicalVariable assignedVar = context.newVar();
- AssignOperator a = new AssignOperator(assignedVar,
- new MutableObject<ILogicalExpression>(f));
- a.getInputs().add(topOp);
+ LogicalVariable assignedVar = context.newVar();
+ AssignOperator a = new AssignOperator(assignedVar, new MutableObject<ILogicalExpression>(f));
+ a.getInputs().add(topOp);
- return new Pair<ILogicalOperator, LogicalVariable>(a, assignedVar);
+ return new Pair<ILogicalOperator, LogicalVariable>(a, assignedVar);
- }
+ }
- private static boolean expressionNeedsNoNesting(Expression expr) {
- Kind k = expr.getKind();
- return k == Kind.LITERAL_EXPRESSION
- || k == Kind.LIST_CONSTRUCTOR_EXPRESSION
- || k == Kind.RECORD_CONSTRUCTOR_EXPRESSION
- || k == Kind.VARIABLE_EXPRESSION || k == Kind.CALL_EXPRESSION
- || k == Kind.OP_EXPRESSION
- || k == Kind.FIELD_ACCESSOR_EXPRESSION
- || k == Kind.INDEX_ACCESSOR_EXPRESSION
- || k == Kind.UNARY_EXPRESSION;
- }
+ private static boolean expressionNeedsNoNesting(Expression expr) {
+ Kind k = expr.getKind();
+ return k == Kind.LITERAL_EXPRESSION || k == Kind.LIST_CONSTRUCTOR_EXPRESSION
+ || k == Kind.RECORD_CONSTRUCTOR_EXPRESSION || k == Kind.VARIABLE_EXPRESSION
+ || k == Kind.CALL_EXPRESSION || k == Kind.OP_EXPRESSION || k == Kind.FIELD_ACCESSOR_EXPRESSION
+ || k == Kind.INDEX_ACCESSOR_EXPRESSION || k == Kind.UNARY_EXPRESSION;
+ }
- private <T> ArrayList<T> mkSingletonArrayList(T item) {
- ArrayList<T> array = new ArrayList<T>(1);
- array.add(item);
- return array;
- }
+ private <T> ArrayList<T> mkSingletonArrayList(T item) {
+ ArrayList<T> array = new ArrayList<T>(1);
+ array.add(item);
+ return array;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitTypeDecl(TypeDecl td,
- Mutable<ILogicalOperator> arg) throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitTypeDecl(TypeDecl td, Mutable<ILogicalOperator> arg)
+ throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitRecordTypeDefiniton(
- RecordTypeDefinition tre, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitRecordTypeDefiniton(RecordTypeDefinition tre,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitTypeReferenceExpression(
- TypeReferenceExpression tre, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitTypeReferenceExpression(TypeReferenceExpression tre,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitNodegroupDecl(
- NodegroupDecl ngd, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitNodegroupDecl(NodegroupDecl ngd, Mutable<ILogicalOperator> arg)
+ throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitLoadFromFileStatement(
- LoadFromFileStatement stmtLoad, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitLoadFromFileStatement(LoadFromFileStatement stmtLoad,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitWriteFromQueryResultStatement(
- WriteFromQueryResultStatement stmtLoad,
- Mutable<ILogicalOperator> arg) throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitWriteFromQueryResultStatement(
+ WriteFromQueryResultStatement stmtLoad, Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitDropStatement(
- DropStatement del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitDropStatement(DropStatement del, Mutable<ILogicalOperator> arg)
+ throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitControlFeedStatement(
- ControlFeedStatement del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitControlFeedStatement(ControlFeedStatement del,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitCreateIndexStatement(
- CreateIndexStatement cis, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitCreateIndexStatement(CreateIndexStatement cis,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitOrderedListTypeDefiniton(
- OrderedListTypeDefinition olte, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitOrderedListTypeDefiniton(OrderedListTypeDefinition olte,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitUnorderedListTypeDefiniton(
- UnorderedListTypeDefinition ulte, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitUnorderedListTypeDefiniton(UnorderedListTypeDefinition ulte,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- private ILogicalExpression makeUnnestExpression(ILogicalExpression expr) {
- switch (expr.getExpressionTag()) {
- case VARIABLE: {
- return new UnnestingFunctionCallExpression(
- FunctionUtils
- .getFunctionInfo(AsterixBuiltinFunctions.SCAN_COLLECTION),
- new MutableObject<ILogicalExpression>(expr));
- }
- case FUNCTION_CALL: {
- AbstractFunctionCallExpression fce = (AbstractFunctionCallExpression) expr;
- if (fce.getKind() == FunctionKind.UNNEST) {
- return expr;
- } else {
- return new UnnestingFunctionCallExpression(
- FunctionUtils
- .getFunctionInfo(AsterixBuiltinFunctions.SCAN_COLLECTION),
- new MutableObject<ILogicalExpression>(expr));
- }
- }
- default: {
- return expr;
- }
- }
- }
+ private ILogicalExpression makeUnnestExpression(ILogicalExpression expr) {
+ switch (expr.getExpressionTag()) {
+ case VARIABLE: {
+ return new UnnestingFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.SCAN_COLLECTION),
+ new MutableObject<ILogicalExpression>(expr));
+ }
+ case FUNCTION_CALL: {
+ AbstractFunctionCallExpression fce = (AbstractFunctionCallExpression) expr;
+ if (fce.getKind() == FunctionKind.UNNEST) {
+ return expr;
+ } else {
+ return new UnnestingFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.SCAN_COLLECTION),
+ new MutableObject<ILogicalExpression>(expr));
+ }
+ }
+ default: {
+ return expr;
+ }
+ }
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitInsertStatement(
- InsertStatement insert, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitInsertStatement(InsertStatement insert,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitDeleteStatement(
- DeleteStatement del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitDeleteStatement(DeleteStatement del,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitUpdateStatement(
- UpdateStatement update, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitUpdateStatement(UpdateStatement update,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitUpdateClause(
- UpdateClause del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitUpdateClause(UpdateClause del, Mutable<ILogicalOperator> arg)
+ throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitDataverseDecl(
- DataverseDecl dv, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitDataverseDecl(DataverseDecl dv, Mutable<ILogicalOperator> arg)
+ throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitDatasetDecl(
- DatasetDecl dd, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitDatasetDecl(DatasetDecl dd, Mutable<ILogicalOperator> arg)
+ throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitSetStatement(
- SetStatement ss, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitSetStatement(SetStatement ss, Mutable<ILogicalOperator> arg)
+ throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitWriteStatement(
- WriteStatement ws, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitWriteStatement(WriteStatement ws, Mutable<ILogicalOperator> arg)
+ throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitLoadFromQueryResultStatement(
- WriteFromQueryResultStatement stmtLoad,
- Mutable<ILogicalOperator> arg) throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitLoadFromQueryResultStatement(
+ WriteFromQueryResultStatement stmtLoad, Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitCreateDataverseStatement(
- CreateDataverseStatement del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitCreateDataverseStatement(CreateDataverseStatement del,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitIndexDropStatement(
- IndexDropStatement del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitIndexDropStatement(IndexDropStatement del,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitNodeGroupDropStatement(
- NodeGroupDropStatement del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitNodeGroupDropStatement(NodeGroupDropStatement del,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitDataverseDropStatement(
- DataverseDropStatement del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitDataverseDropStatement(DataverseDropStatement del,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitTypeDropStatement(
- TypeDropStatement del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitTypeDropStatement(TypeDropStatement del,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visit(
- CreateFunctionStatement cfs, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visit(CreateFunctionStatement cfs, Mutable<ILogicalOperator> arg)
+ throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitFunctionDropStatement(
- FunctionDropStatement del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitFunctionDropStatement(FunctionDropStatement del,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitBeginFeedStatement(
- BeginFeedStatement bf, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitBeginFeedStatement(BeginFeedStatement bf,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
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 4fc1fc8..be6e2af 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
@@ -79,10 +79,8 @@
import edu.uci.ics.asterix.common.config.DatasetConfig.DatasetType;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
import edu.uci.ics.asterix.formats.base.IDataFormat;
-import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
-import edu.uci.ics.asterix.metadata.declared.AqlLogicalPlanAndMetadataImpl;
import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
import edu.uci.ics.asterix.metadata.declared.FileSplitDataSink;
import edu.uci.ics.asterix.metadata.declared.FileSplitSinkId;
@@ -92,11 +90,11 @@
import edu.uci.ics.asterix.om.base.AString;
import edu.uci.ics.asterix.om.constants.AsterixConstantValue;
import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
-import edu.uci.ics.asterix.om.functions.AsterixFunction;
import edu.uci.ics.asterix.om.functions.AsterixFunctionInfo;
import edu.uci.ics.asterix.om.types.ARecordType;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.translator.CompiledStatements.ICompiledDmlStatement;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
@@ -105,7 +103,6 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalOperator;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalPlan;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalPlanAndMetadata;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalOperatorTag;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalVariable;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.OperatorAnnotations;
@@ -153,1576 +150,1315 @@
* source for the current subtree.
*/
-public class AqlPlusExpressionToPlanTranslator extends AbstractAqlTranslator
- implements
- IAqlPlusExpressionVisitor<Pair<ILogicalOperator, LogicalVariable>, Mutable<ILogicalOperator>> {
+public class AqlPlusExpressionToPlanTranslator extends AbstractAqlTranslator implements
+ IAqlPlusExpressionVisitor<Pair<ILogicalOperator, LogicalVariable>, Mutable<ILogicalOperator>> {
- private static final Logger LOGGER = Logger
- .getLogger(AqlPlusExpressionToPlanTranslator.class.getName());
+ private static final Logger LOGGER = Logger.getLogger(AqlPlusExpressionToPlanTranslator.class.getName());
- private class MetaScopeLogicalVariable {
- private HashMap<Identifier, LogicalVariable> map = new HashMap<Identifier, LogicalVariable>();
+ private class MetaScopeLogicalVariable {
+ private HashMap<Identifier, LogicalVariable> map = new HashMap<Identifier, LogicalVariable>();
- public VariableReferenceExpression getVariableReferenceExpression(
- Identifier id) throws AsterixException {
- LogicalVariable var = map.get(id);
- LOGGER.fine("get:" + id + ":" + var);
- if (var == null) {
- throw new AsterixException("Identifier " + id
- + " not found in AQL+ meta-scope.");
- }
- return new VariableReferenceExpression(var);
- }
+ public VariableReferenceExpression getVariableReferenceExpression(Identifier id) throws AsterixException {
+ LogicalVariable var = map.get(id);
+ LOGGER.fine("get:" + id + ":" + var);
+ if (var == null) {
+ throw new AsterixException("Identifier " + id + " not found in AQL+ meta-scope.");
+ }
+ return new VariableReferenceExpression(var);
+ }
- public void put(Identifier id, LogicalVariable var) {
- LOGGER.fine("put:" + id + ":" + var);
- map.put(id, var);
- }
- }
+ public void put(Identifier id, LogicalVariable var) {
+ LOGGER.fine("put:" + id + ":" + var);
+ map.put(id, var);
+ }
+ }
- private class MetaScopeILogicalOperator {
- private HashMap<Identifier, ILogicalOperator> map = new HashMap<Identifier, ILogicalOperator>();
+ private class MetaScopeILogicalOperator {
+ private HashMap<Identifier, ILogicalOperator> map = new HashMap<Identifier, ILogicalOperator>();
- public ILogicalOperator get(Identifier id) throws AsterixException {
- ILogicalOperator op = map.get(id);
- if (op == null) {
- throw new AsterixException("Identifier " + id
- + " not found in AQL+ meta-scope.");
- }
- return op;
- }
+ public ILogicalOperator get(Identifier id) throws AsterixException {
+ ILogicalOperator op = map.get(id);
+ if (op == null) {
+ throw new AsterixException("Identifier " + id + " not found in AQL+ meta-scope.");
+ }
+ return op;
+ }
- public void put(Identifier id, ILogicalOperator op) {
- LOGGER.fine("put:" + id + ":" + op);
- map.put(id, op);
- }
- }
+ public void put(Identifier id, ILogicalOperator op) {
+ LOGGER.fine("put:" + id + ":" + op);
+ map.put(id, op);
+ }
+ }
- private final long txnId;
- private final MetadataTransactionContext mdTxnCtx;
- private TranslationContext context;
- private String outputDatasetName;
- private MetaScopeLogicalVariable metaScopeExp = new MetaScopeLogicalVariable();
- private MetaScopeILogicalOperator metaScopeOp = new MetaScopeILogicalOperator();
- private static LogicalVariable METADATA_DUMMY_VAR = new LogicalVariable(-1);
+ private final long txnId;
+ private TranslationContext context;
+ private String outputDatasetName;
+ private ICompiledDmlStatement stmt;
+ private AqlMetadataProvider metadataProvider;
- public AqlPlusExpressionToPlanTranslator(long txnId,
- MetadataTransactionContext mdTxnCtx, Counter currentVarCounter,
- String outputDatasetName) {
- this.txnId = txnId;
- this.mdTxnCtx = mdTxnCtx;
- this.context = new TranslationContext(currentVarCounter);
- this.outputDatasetName = outputDatasetName;
- this.context.setTopFlwor(false);
- }
+ private MetaScopeLogicalVariable metaScopeExp = new MetaScopeLogicalVariable();
+ private MetaScopeILogicalOperator metaScopeOp = new MetaScopeILogicalOperator();
+ private static LogicalVariable METADATA_DUMMY_VAR = new LogicalVariable(-1);
- public int getVarCounter() {
- return context.getVarCounter();
- }
+
+
+ public AqlPlusExpressionToPlanTranslator(long txnId, AqlMetadataProvider metadataProvider,
+ Counter currentVarCounter, String outputDatasetName, ICompiledDmlStatement stmt) {
+ this.txnId = txnId;
+ this.metadataProvider = metadataProvider;
+ this.context = new TranslationContext(currentVarCounter);
+ this.outputDatasetName = outputDatasetName;
+ this.stmt = stmt;
+ this.context.setTopFlwor(false);
+ }
- public ILogicalPlanAndMetadata translate(Query expr)
- throws AlgebricksException, AsterixException {
- return translate(expr, null);
- }
+ public int getVarCounter() {
+ return context.getVarCounter();
+ }
- public ILogicalPlanAndMetadata translate(Query expr,
- AqlCompiledMetadataDeclarations compiledDeclarations)
- throws AlgebricksException, AsterixException {
- if (expr == null) {
- return null;
- }
- if (compiledDeclarations == null) {
- compiledDeclarations = compileMetadata(mdTxnCtx,
- expr.getPrologDeclList(), true);
- }
- if (!compiledDeclarations.isConnectedToDataverse())
- compiledDeclarations.connectToDataverse(compiledDeclarations
- .getDataverseName());
- IDataFormat format = compiledDeclarations.getFormat();
- if (format == null) {
- throw new AlgebricksException("Data format has not been set.");
- }
- format.registerRuntimeFunctions();
- Pair<ILogicalOperator, LogicalVariable> p = expr.accept(this,
- new MutableObject<ILogicalOperator>(
- new EmptyTupleSourceOperator()));
+ public ILogicalPlan translate(Query expr) throws AlgebricksException, AsterixException {
+ return translate(expr, null);
+ }
- ArrayList<Mutable<ILogicalOperator>> globalPlanRoots = new ArrayList<Mutable<ILogicalOperator>>();
+ 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.");
+ }
+ format.registerRuntimeFunctions();
+ Pair<ILogicalOperator, LogicalVariable> p = expr.accept(this, new MutableObject<ILogicalOperator>(
+ new EmptyTupleSourceOperator()));
- boolean isTransactionalWrite = false;
- ILogicalOperator topOp = p.first;
- ProjectOperator project = (ProjectOperator) topOp;
- LogicalVariable resVar = project.getVariables().get(0);
- if (outputDatasetName == null) {
- List<Mutable<ILogicalExpression>> writeExprList = new ArrayList<Mutable<ILogicalExpression>>(
- 1);
- writeExprList.add(new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(resVar)));
- FileSplitSinkId fssi = new FileSplitSinkId(
- compiledDeclarations.getOutputFile());
- FileSplitDataSink sink = new FileSplitDataSink(fssi, null);
- topOp = new WriteOperator(writeExprList, sink);
- topOp.getInputs().add(new MutableObject<ILogicalOperator>(project));
- } else {
- Dataset dataset = compiledDeclarations
- .findDataset(outputDatasetName);
- if (dataset == null) {
- throw new AlgebricksException("Cannot find dataset "
- + outputDatasetName);
- }
- if (dataset.getDatasetType() == DatasetType.EXTERNAL) {
- throw new AlgebricksException(
- "Cannot write output to an external dataset.");
- }
- ARecordType itemType = (ARecordType) compiledDeclarations
- .findType(dataset.getItemTypeName());
- List<String> partitioningKeys = DatasetUtils
- .getPartitioningKeys(dataset);
- ArrayList<LogicalVariable> vars = new ArrayList<LogicalVariable>();
- ArrayList<Mutable<ILogicalExpression>> exprs = new ArrayList<Mutable<ILogicalExpression>>();
- List<Mutable<ILogicalExpression>> varRefsForLoading = new ArrayList<Mutable<ILogicalExpression>>();
- for (String partitioningKey : partitioningKeys) {
- Triple<ICopyEvaluatorFactory, ScalarFunctionCallExpression, IAType> partitioner = format
- .partitioningEvaluatorFactory(itemType, partitioningKey);
- AbstractFunctionCallExpression f = partitioner.second
- .cloneExpression();
- f.substituteVar(METADATA_DUMMY_VAR, resVar);
- exprs.add(new MutableObject<ILogicalExpression>(f));
- LogicalVariable v = context.newVar();
- vars.add(v);
- varRefsForLoading.add(new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(v)));
- }
- AssignOperator assign = new AssignOperator(vars, exprs);
- assign.getInputs()
- .add(new MutableObject<ILogicalOperator>(project));
- }
+ ArrayList<Mutable<ILogicalOperator>> globalPlanRoots = new ArrayList<Mutable<ILogicalOperator>>();
- globalPlanRoots.add(new MutableObject<ILogicalOperator>(topOp));
- ILogicalPlan plan = new ALogicalPlanImpl(globalPlanRoots);
- AqlMetadataProvider metadataProvider = new AqlMetadataProvider(txnId,
- isTransactionalWrite, compiledDeclarations);
- ILogicalPlanAndMetadata planAndMetadata = new AqlLogicalPlanAndMetadataImpl(
- plan, metadataProvider);
- return planAndMetadata;
- }
+ boolean isTransactionalWrite = false;
+ ILogicalOperator topOp = p.first;
+ ProjectOperator project = (ProjectOperator) topOp;
+ LogicalVariable resVar = project.getVariables().get(0);
+ if (outputDatasetName == null) {
+ List<Mutable<ILogicalExpression>> writeExprList = new ArrayList<Mutable<ILogicalExpression>>(1);
+ writeExprList.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(resVar)));
+ FileSplitSinkId fssi = new FileSplitSinkId(metadata.getOutputFile());
+ FileSplitDataSink sink = new FileSplitDataSink(fssi, null);
+ topOp = new WriteOperator(writeExprList, sink);
+ topOp.getInputs().add(new MutableObject<ILogicalOperator>(project));
+ } else {
+ Dataset dataset = metadata.findDataset(stmt.getDataverseName(), outputDatasetName);
+ if (dataset == null) {
+ throw new AlgebricksException("Cannot find dataset " + outputDatasetName);
+ }
+ if (dataset.getDatasetType() == DatasetType.EXTERNAL) {
+ throw new AlgebricksException("Cannot write output to an external dataset.");
+ }
+ ARecordType itemType = (ARecordType) metadata.findType(dataset.getDataverseName(),
+ dataset.getItemTypeName());
+ List<String> partitioningKeys = DatasetUtils.getPartitioningKeys(dataset);
+ ArrayList<LogicalVariable> vars = new ArrayList<LogicalVariable>();
+ ArrayList<Mutable<ILogicalExpression>> exprs = new ArrayList<Mutable<ILogicalExpression>>();
+ List<Mutable<ILogicalExpression>> varRefsForLoading = new ArrayList<Mutable<ILogicalExpression>>();
+ for (String partitioningKey : partitioningKeys) {
+ Triple<ICopyEvaluatorFactory, ScalarFunctionCallExpression, IAType> partitioner = format
+ .partitioningEvaluatorFactory(itemType, partitioningKey);
+ AbstractFunctionCallExpression f = partitioner.second.cloneExpression();
+ f.substituteVar(METADATA_DUMMY_VAR, resVar);
+ exprs.add(new MutableObject<ILogicalExpression>(f));
+ LogicalVariable v = context.newVar();
+ vars.add(v);
+ varRefsForLoading.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(v)));
+ }
+ AssignOperator assign = new AssignOperator(vars, exprs);
+ assign.getInputs().add(new MutableObject<ILogicalOperator>(project));
+ }
- public ILogicalPlan translate(List<Clause> clauses)
- throws AlgebricksException, AsterixException {
+ globalPlanRoots.add(new MutableObject<ILogicalOperator>(topOp));
+ ILogicalPlan plan = new ALogicalPlanImpl(globalPlanRoots);
+ return plan;
+ }
- if (clauses == null) {
- return null;
- }
+ public ILogicalPlan translate(List<Clause> clauses) throws AlgebricksException, AsterixException {
- Mutable<ILogicalOperator> opRef = new MutableObject<ILogicalOperator>(
- new EmptyTupleSourceOperator());
- Pair<ILogicalOperator, LogicalVariable> p = null;
- for (Clause c : clauses) {
- p = c.accept(this, opRef);
- opRef = new MutableObject<ILogicalOperator>(p.first);
- }
+ if (clauses == null) {
+ return null;
+ }
- ArrayList<Mutable<ILogicalOperator>> globalPlanRoots = new ArrayList<Mutable<ILogicalOperator>>();
+ Mutable<ILogicalOperator> opRef = new MutableObject<ILogicalOperator>(new EmptyTupleSourceOperator());
+ Pair<ILogicalOperator, LogicalVariable> p = null;
+ for (Clause c : clauses) {
+ p = c.accept(this, opRef);
+ opRef = new MutableObject<ILogicalOperator>(p.first);
+ }
- ILogicalOperator topOp = p.first;
+ ArrayList<Mutable<ILogicalOperator>> globalPlanRoots = new ArrayList<Mutable<ILogicalOperator>>();
- globalPlanRoots.add(new MutableObject<ILogicalOperator>(topOp));
- ILogicalPlan plan = new ALogicalPlanImpl(globalPlanRoots);
- return plan;
- }
+ ILogicalOperator topOp = p.first;
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitForClause(ForClause fc,
- Mutable<ILogicalOperator> tupSource) throws AsterixException {
- LogicalVariable v = context.newVar(fc.getVarExpr());
+ globalPlanRoots.add(new MutableObject<ILogicalOperator>(topOp));
+ ILogicalPlan plan = new ALogicalPlanImpl(globalPlanRoots);
+ return plan;
+ }
- Expression inExpr = fc.getInExpr();
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(
- inExpr, tupSource);
- ILogicalOperator returnedOp;
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitForClause(ForClause fc, Mutable<ILogicalOperator> tupSource)
+ throws AsterixException {
+ LogicalVariable v = context.newVar(fc.getVarExpr());
- if (fc.getPosVarExpr() == null) {
- returnedOp = new UnnestOperator(v,
- new MutableObject<ILogicalExpression>(
- makeUnnestExpression(eo.first)));
- } else {
- LogicalVariable pVar = context.newVar(fc.getPosVarExpr());
- returnedOp = new UnnestOperator(v,
- new MutableObject<ILogicalExpression>(
- makeUnnestExpression(eo.first)), pVar,
- BuiltinType.AINT32);
- }
- returnedOp.getInputs().add(eo.second);
+ Expression inExpr = fc.getInExpr();
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(inExpr, tupSource);
+ ILogicalOperator returnedOp;
- return new Pair<ILogicalOperator, LogicalVariable>(returnedOp, v);
- }
+ if (fc.getPosVarExpr() == null) {
+ returnedOp = new UnnestOperator(v, new MutableObject<ILogicalExpression>(makeUnnestExpression(eo.first)));
+ } else {
+ LogicalVariable pVar = context.newVar(fc.getPosVarExpr());
+ returnedOp = new UnnestOperator(v, new MutableObject<ILogicalExpression>(makeUnnestExpression(eo.first)),
+ pVar, BuiltinType.AINT32);
+ }
+ returnedOp.getInputs().add(eo.second);
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitLetClause(LetClause lc,
- Mutable<ILogicalOperator> tupSource) throws AsterixException {
- LogicalVariable v;
- ILogicalOperator returnedOp;
+ return new Pair<ILogicalOperator, LogicalVariable>(returnedOp, v);
+ }
- switch (lc.getBindingExpr().getKind()) {
- case VARIABLE_EXPRESSION: {
- v = context.newVar(lc.getVarExpr());
- LogicalVariable prev = context.getVar(((VariableExpr) lc
- .getBindingExpr()).getVar().getId());
- returnedOp = new AssignOperator(v,
- new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(prev)));
- returnedOp.getInputs().add(tupSource);
- break;
- }
- default: {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(
- lc.getBindingExpr(), tupSource);
- v = context.newVar(lc.getVarExpr());
- returnedOp = new AssignOperator(v,
- new MutableObject<ILogicalExpression>(eo.first));
- returnedOp.getInputs().add(eo.second);
- break;
- }
- }
- return new Pair<ILogicalOperator, LogicalVariable>(returnedOp, v);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitLetClause(LetClause lc, Mutable<ILogicalOperator> tupSource)
+ throws AsterixException {
+ LogicalVariable v;
+ ILogicalOperator returnedOp;
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitFlworExpression(
- FLWOGRExpression flwor, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- Mutable<ILogicalOperator> flworPlan = tupSource;
- boolean isTop = context.isTopFlwor();
- if (isTop) {
- context.setTopFlwor(false);
- }
- for (Clause c : flwor.getClauseList()) {
- Pair<ILogicalOperator, LogicalVariable> pC = c.accept(this,
- flworPlan);
- flworPlan = new MutableObject<ILogicalOperator>(pC.first);
- }
+ switch (lc.getBindingExpr().getKind()) {
+ case VARIABLE_EXPRESSION: {
+ v = context.newVar(lc.getVarExpr());
+ LogicalVariable prev = context.getVar(((VariableExpr) lc.getBindingExpr()).getVar().getId());
+ returnedOp = new AssignOperator(v, new MutableObject<ILogicalExpression>(
+ new VariableReferenceExpression(prev)));
+ returnedOp.getInputs().add(tupSource);
+ break;
+ }
+ default: {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(lc.getBindingExpr(),
+ tupSource);
+ v = context.newVar(lc.getVarExpr());
+ returnedOp = new AssignOperator(v, new MutableObject<ILogicalExpression>(eo.first));
+ returnedOp.getInputs().add(eo.second);
+ break;
+ }
+ }
+ return new Pair<ILogicalOperator, LogicalVariable>(returnedOp, v);
+ }
- Expression r = flwor.getReturnExpr();
- boolean noFlworClause = flwor.noForClause();
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitFlworExpression(FLWOGRExpression flwor,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ Mutable<ILogicalOperator> flworPlan = tupSource;
+ boolean isTop = context.isTopFlwor();
+ if (isTop) {
+ context.setTopFlwor(false);
+ }
+ for (Clause c : flwor.getClauseList()) {
+ Pair<ILogicalOperator, LogicalVariable> pC = c.accept(this, flworPlan);
+ flworPlan = new MutableObject<ILogicalOperator>(pC.first);
+ }
- if (r.getKind() == Kind.VARIABLE_EXPRESSION) {
- VariableExpr v = (VariableExpr) r;
- LogicalVariable var = context.getVar(v.getVar().getId());
+ Expression r = flwor.getReturnExpr();
+ boolean noFlworClause = flwor.noForClause();
- return produceFlwrResult(noFlworClause, isTop, flworPlan, var);
+ if (r.getKind() == Kind.VARIABLE_EXPRESSION) {
+ VariableExpr v = (VariableExpr) r;
+ LogicalVariable var = context.getVar(v.getVar().getId());
- } else {
- Mutable<ILogicalOperator> baseOp = new MutableObject<ILogicalOperator>(
- flworPlan.getValue());
- Pair<ILogicalOperator, LogicalVariable> rRes = r.accept(this,
- baseOp);
- ILogicalOperator rOp = rRes.first;
- ILogicalOperator resOp;
- if (expressionNeedsNoNesting(r)) {
- baseOp.setValue(flworPlan.getValue());
- resOp = rOp;
- } else {
- SubplanOperator s = new SubplanOperator(rOp);
- s.getInputs().add(flworPlan);
- resOp = s;
- baseOp.setValue(new NestedTupleSourceOperator(
- new MutableObject<ILogicalOperator>(s)));
- }
- Mutable<ILogicalOperator> resOpRef = new MutableObject<ILogicalOperator>(
- resOp);
- return produceFlwrResult(noFlworClause, isTop, resOpRef,
- rRes.second);
- }
- }
+ return produceFlwrResult(noFlworClause, isTop, flworPlan, var);
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitFieldAccessor(
- FieldAccessor fa, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(
- fa.getExpr(), tupSource);
- LogicalVariable v = context.newVar();
- AbstractFunctionCallExpression fldAccess = new ScalarFunctionCallExpression(
- FunctionUtils
- .getFunctionInfo(AsterixBuiltinFunctions.FIELD_ACCESS_BY_NAME));
- fldAccess.getArguments().add(
- new MutableObject<ILogicalExpression>(p.first));
- ILogicalExpression faExpr = new ConstantExpression(
- new AsterixConstantValue(new AString(fa.getIdent().getValue())));
- fldAccess.getArguments().add(
- new MutableObject<ILogicalExpression>(faExpr));
- AssignOperator a = new AssignOperator(v,
- new MutableObject<ILogicalExpression>(fldAccess));
- a.getInputs().add(p.second);
- return new Pair<ILogicalOperator, LogicalVariable>(a, v);
+ } else {
+ Mutable<ILogicalOperator> baseOp = new MutableObject<ILogicalOperator>(flworPlan.getValue());
+ Pair<ILogicalOperator, LogicalVariable> rRes = r.accept(this, baseOp);
+ ILogicalOperator rOp = rRes.first;
+ ILogicalOperator resOp;
+ if (expressionNeedsNoNesting(r)) {
+ baseOp.setValue(flworPlan.getValue());
+ resOp = rOp;
+ } else {
+ SubplanOperator s = new SubplanOperator(rOp);
+ s.getInputs().add(flworPlan);
+ resOp = s;
+ baseOp.setValue(new NestedTupleSourceOperator(new MutableObject<ILogicalOperator>(s)));
+ }
+ Mutable<ILogicalOperator> resOpRef = new MutableObject<ILogicalOperator>(resOp);
+ return produceFlwrResult(noFlworClause, isTop, resOpRef, rRes.second);
+ }
+ }
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitFieldAccessor(FieldAccessor fa,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(fa.getExpr(), tupSource);
+ LogicalVariable v = context.newVar();
+ AbstractFunctionCallExpression fldAccess = new ScalarFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.FIELD_ACCESS_BY_NAME));
+ fldAccess.getArguments().add(new MutableObject<ILogicalExpression>(p.first));
+ ILogicalExpression faExpr = new ConstantExpression(new AsterixConstantValue(new AString(fa.getIdent()
+ .getValue())));
+ fldAccess.getArguments().add(new MutableObject<ILogicalExpression>(faExpr));
+ AssignOperator a = new AssignOperator(v, new MutableObject<ILogicalExpression>(fldAccess));
+ a.getInputs().add(p.second);
+ return new Pair<ILogicalOperator, LogicalVariable>(a, v);
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitIndexAccessor(
- IndexAccessor ia, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(
- ia.getExpr(), tupSource);
- LogicalVariable v = context.newVar();
- AbstractFunctionCallExpression f;
- int i = ia.getIndex();
- if (i == IndexAccessor.ANY) {
- f = new ScalarFunctionCallExpression(
- FunctionUtils
- .getFunctionInfo(AsterixBuiltinFunctions.ANY_COLLECTION_MEMBER));
- f.getArguments()
- .add(new MutableObject<ILogicalExpression>(p.first));
- } else {
- f = new ScalarFunctionCallExpression(
- FunctionUtils
- .getFunctionInfo(AsterixBuiltinFunctions.GET_ITEM));
- f.getArguments()
- .add(new MutableObject<ILogicalExpression>(p.first));
- f.getArguments().add(
- new MutableObject<ILogicalExpression>(
- new ConstantExpression(new AsterixConstantValue(
- new AInt32(i)))));
- }
- AssignOperator a = new AssignOperator(v,
- new MutableObject<ILogicalExpression>(f));
- a.getInputs().add(p.second);
- return new Pair<ILogicalOperator, LogicalVariable>(a, v);
- }
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitCallExpr(
- CallExpr fcall, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- LogicalVariable v = context.newVar();
- AsterixFunction fid = fcall.getIdent();
- List<Mutable<ILogicalExpression>> args = new ArrayList<Mutable<ILogicalExpression>>();
- Mutable<ILogicalOperator> topOp = tupSource;
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitIndexAccessor(IndexAccessor ia,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(ia.getExpr(), tupSource);
+ LogicalVariable v = context.newVar();
+ AbstractFunctionCallExpression f;
+ int i = ia.getIndex();
+ if (i == IndexAccessor.ANY) {
+ f = new ScalarFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.ANY_COLLECTION_MEMBER));
+ f.getArguments().add(new MutableObject<ILogicalExpression>(p.first));
+ } else {
+ f = new ScalarFunctionCallExpression(FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.GET_ITEM));
+ f.getArguments().add(new MutableObject<ILogicalExpression>(p.first));
+ f.getArguments().add(
+ new MutableObject<ILogicalExpression>(new ConstantExpression(
+ new AsterixConstantValue(new AInt32(i)))));
+ }
+ AssignOperator a = new AssignOperator(v, new MutableObject<ILogicalExpression>(f));
+ a.getInputs().add(p.second);
+ return new Pair<ILogicalOperator, LogicalVariable>(a, v);
+ }
- for (Expression expr : fcall.getExprList()) {
- switch (expr.getKind()) {
- case VARIABLE_EXPRESSION: {
- LogicalVariable var = context.getVar(((VariableExpr) expr)
- .getVar().getId());
- args.add(new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(var)));
- break;
- }
- case LITERAL_EXPRESSION: {
- LiteralExpr val = (LiteralExpr) expr;
- args.add(new MutableObject<ILogicalExpression>(
- new ConstantExpression(
- new AsterixConstantValue(ConstantHelper
- .objectFromLiteral(val.getValue())))));
- break;
- }
- default: {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(
- expr, topOp);
- AbstractLogicalOperator o1 = (AbstractLogicalOperator) eo.second
- .getValue();
- args.add(new MutableObject<ILogicalExpression>(eo.first));
- if (o1 != null
- && !(o1.getOperatorTag() == LogicalOperatorTag.ASSIGN && hasOnlyChild(
- o1, topOp))) {
- topOp = eo.second;
- }
- break;
- }
- }
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitCallExpr(CallExpr fcall, Mutable<ILogicalOperator> tupSource)
+ throws AsterixException {
+ LogicalVariable v = context.newVar();
+ FunctionSignature signature = fcall.getFunctionSignature();
+ List<Mutable<ILogicalExpression>> args = new ArrayList<Mutable<ILogicalExpression>>();
+ Mutable<ILogicalOperator> topOp = tupSource;
- FunctionIdentifier fi = new FunctionIdentifier(
- AlgebricksBuiltinFunctions.ALGEBRICKS_NS, fid.getFunctionName());
- AsterixFunctionInfo afi = AsterixBuiltinFunctions.lookupFunction(fi);
- FunctionIdentifier builtinAquafi = afi == null ? null : afi
- .getFunctionIdentifier();
+ for (Expression expr : fcall.getExprList()) {
+ switch (expr.getKind()) {
+ case VARIABLE_EXPRESSION: {
+ LogicalVariable var = context.getVar(((VariableExpr) expr).getVar().getId());
+ args.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(var)));
+ break;
+ }
+ case LITERAL_EXPRESSION: {
+ LiteralExpr val = (LiteralExpr) expr;
+ args.add(new MutableObject<ILogicalExpression>(new ConstantExpression(new AsterixConstantValue(
+ ConstantHelper.objectFromLiteral(val.getValue())))));
+ break;
+ }
+ default: {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(expr, topOp);
+ AbstractLogicalOperator o1 = (AbstractLogicalOperator) eo.second.getValue();
+ args.add(new MutableObject<ILogicalExpression>(eo.first));
+ if (o1 != null && !(o1.getOperatorTag() == LogicalOperatorTag.ASSIGN && hasOnlyChild(o1, topOp))) {
+ topOp = eo.second;
+ }
+ break;
+ }
+ }
+ }
- if (builtinAquafi != null) {
- fi = builtinAquafi;
- } else {
- fi = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- fid.getFunctionName());
- FunctionIdentifier builtinAsterixFi = AsterixBuiltinFunctions
- .getBuiltinFunctionIdentifier(fi);
- if (builtinAsterixFi != null) {
- fi = builtinAsterixFi;
- }
- }
- AbstractFunctionCallExpression f;
- if (AsterixBuiltinFunctions.isBuiltinAggregateFunction(fi)) {
- f = AsterixBuiltinFunctions.makeAggregateFunctionExpression(fi,
- args);
- } else if (AsterixBuiltinFunctions.isBuiltinUnnestingFunction(fi)) {
- UnnestingFunctionCallExpression ufce = new UnnestingFunctionCallExpression(
- FunctionUtils.getFunctionInfo(fi), args);
- ufce.setReturnsUniqueValues(AsterixBuiltinFunctions
- .returnsUniqueValues(fi));
- f = ufce;
- } else {
- f = new ScalarFunctionCallExpression(
- FunctionUtils.getFunctionInfo(fi), args);
- }
- AssignOperator op = new AssignOperator(v,
- new MutableObject<ILogicalExpression>(f));
- if (topOp != null) {
- op.getInputs().add(topOp);
- }
+ FunctionIdentifier fi = new FunctionIdentifier(AlgebricksBuiltinFunctions.ALGEBRICKS_NS, signature.getName());
+ AsterixFunctionInfo afi = AsterixBuiltinFunctions.lookupFunction(fi);
+ FunctionIdentifier builtinAquafi = afi == null ? null : afi.getFunctionIdentifier();
- return new Pair<ILogicalOperator, LogicalVariable>(op, v);
- }
+ if (builtinAquafi != null) {
+ fi = builtinAquafi;
+ } else {
+ fi = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, signature.getName());
+ FunctionIdentifier builtinAsterixFi = AsterixBuiltinFunctions.getBuiltinFunctionIdentifier(fi);
+ if (builtinAsterixFi != null) {
+ fi = builtinAsterixFi;
+ }
+ }
+ AbstractFunctionCallExpression f;
+ if (AsterixBuiltinFunctions.isBuiltinAggregateFunction(fi)) {
+ f = AsterixBuiltinFunctions.makeAggregateFunctionExpression(fi, args);
+ } else if (AsterixBuiltinFunctions.isBuiltinUnnestingFunction(fi)) {
+ UnnestingFunctionCallExpression ufce = new UnnestingFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(fi), args);
+ ufce.setReturnsUniqueValues(AsterixBuiltinFunctions.returnsUniqueValues(fi));
+ f = ufce;
+ } else {
+ f = new ScalarFunctionCallExpression(FunctionUtils.getFunctionInfo(fi), args);
+ }
+ AssignOperator op = new AssignOperator(v, new MutableObject<ILogicalExpression>(f));
+ if (topOp != null) {
+ op.getInputs().add(topOp);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitFunctionDecl(
- FunctionDecl fd, Mutable<ILogicalOperator> tupSource) {
- // TODO Auto-generated method stub
- throw new NotImplementedException();
- }
+ return new Pair<ILogicalOperator, LogicalVariable>(op, v);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitGroupbyClause(
- GroupbyClause gc, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- GroupByOperator gOp = new GroupByOperator();
- Mutable<ILogicalOperator> topOp = tupSource;
- for (GbyVariableExpressionPair ve : gc.getGbyPairList()) {
- LogicalVariable v;
- VariableExpr vexpr = ve.getVar();
- if (vexpr != null) {
- v = context.newVar(vexpr);
- } else {
- v = context.newVar();
- }
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(
- ve.getExpr(), topOp);
- gOp.addGbyExpression(v, eo.first);
- topOp = eo.second;
- }
- for (GbyVariableExpressionPair ve : gc.getDecorPairList()) {
- LogicalVariable v;
- VariableExpr vexpr = ve.getVar();
- if (vexpr != null) {
- v = context.newVar(vexpr);
- } else {
- v = context.newVar();
- }
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(
- ve.getExpr(), topOp);
- gOp.addDecorExpression(v, eo.first);
- topOp = eo.second;
- }
- gOp.getInputs().add(topOp);
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitFunctionDecl(FunctionDecl fd,
+ Mutable<ILogicalOperator> tupSource) {
+ // TODO Auto-generated method stub
+ throw new NotImplementedException();
+ }
- for (VariableExpr var : gc.getWithVarList()) {
- LogicalVariable aggVar = context.newVar();
- LogicalVariable oldVar = context.getVar(var);
- List<Mutable<ILogicalExpression>> flArgs = new ArrayList<Mutable<ILogicalExpression>>(
- 1);
- flArgs.add(new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(oldVar)));
- AggregateFunctionCallExpression fListify = AsterixBuiltinFunctions
- .makeAggregateFunctionExpression(
- AsterixBuiltinFunctions.LISTIFY, flArgs);
- AggregateOperator agg = new AggregateOperator(
- mkSingletonArrayList(aggVar),
- (List) mkSingletonArrayList(new MutableObject<ILogicalExpression>(
- fListify)));
- agg.getInputs().add(
- new MutableObject<ILogicalOperator>(
- new NestedTupleSourceOperator(
- new MutableObject<ILogicalOperator>(gOp))));
- ILogicalPlan plan = new ALogicalPlanImpl(
- new MutableObject<ILogicalOperator>(agg));
- gOp.getNestedPlans().add(plan);
- // Hide the variable that was part of the "with", replacing it with
- // the one bound by the aggregation op.
- context.setVar(var, aggVar);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitGroupbyClause(GroupbyClause gc,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ GroupByOperator gOp = new GroupByOperator();
+ Mutable<ILogicalOperator> topOp = tupSource;
+ for (GbyVariableExpressionPair ve : gc.getGbyPairList()) {
+ LogicalVariable v;
+ VariableExpr vexpr = ve.getVar();
+ if (vexpr != null) {
+ v = context.newVar(vexpr);
+ } else {
+ v = context.newVar();
+ }
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(ve.getExpr(), topOp);
+ gOp.addGbyExpression(v, eo.first);
+ topOp = eo.second;
+ }
+ for (GbyVariableExpressionPair ve : gc.getDecorPairList()) {
+ LogicalVariable v;
+ VariableExpr vexpr = ve.getVar();
+ if (vexpr != null) {
+ v = context.newVar(vexpr);
+ } else {
+ v = context.newVar();
+ }
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(ve.getExpr(), topOp);
+ gOp.addDecorExpression(v, eo.first);
+ topOp = eo.second;
+ }
+ gOp.getInputs().add(topOp);
- gOp.getAnnotations().put(OperatorAnnotations.USE_HASH_GROUP_BY,
- gc.hasHashGroupByHint());
- return new Pair<ILogicalOperator, LogicalVariable>(gOp, null);
- }
+ for (VariableExpr var : gc.getWithVarList()) {
+ LogicalVariable aggVar = context.newVar();
+ LogicalVariable oldVar = context.getVar(var);
+ List<Mutable<ILogicalExpression>> flArgs = new ArrayList<Mutable<ILogicalExpression>>(1);
+ flArgs.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(oldVar)));
+ AggregateFunctionCallExpression fListify = AsterixBuiltinFunctions.makeAggregateFunctionExpression(
+ AsterixBuiltinFunctions.LISTIFY, flArgs);
+ AggregateOperator agg = new AggregateOperator(mkSingletonArrayList(aggVar),
+ (List) mkSingletonArrayList(new MutableObject<ILogicalExpression>(fListify)));
+ agg.getInputs().add(
+ new MutableObject<ILogicalOperator>(new NestedTupleSourceOperator(
+ new MutableObject<ILogicalOperator>(gOp))));
+ ILogicalPlan plan = new ALogicalPlanImpl(new MutableObject<ILogicalOperator>(agg));
+ gOp.getNestedPlans().add(plan);
+ // Hide the variable that was part of the "with", replacing it with
+ // the one bound by the aggregation op.
+ context.setVar(var, aggVar);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitIfExpr(IfExpr ifexpr,
- Mutable<ILogicalOperator> tupSource) throws AsterixException {
- // In the most general case, IfThenElse is translated in the following
- // way.
- //
- // We assign the result of the condition to one variable varCond.
- // We create one subplan which contains the plan for the "then" branch,
- // on top of which there is a selection whose condition is varCond.
- // Similarly, we create one subplan for the "else" branch, in which the
- // selection is not(varCond).
- // Finally, we concatenate the results. (??)
+ gOp.getAnnotations().put(OperatorAnnotations.USE_HASH_GROUP_BY, gc.hasHashGroupByHint());
+ return new Pair<ILogicalOperator, LogicalVariable>(gOp, null);
+ }
- Pair<ILogicalOperator, LogicalVariable> pCond = ifexpr.getCondExpr()
- .accept(this, tupSource);
- ILogicalOperator opCond = pCond.first;
- LogicalVariable varCond = pCond.second;
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitIfExpr(IfExpr ifexpr, Mutable<ILogicalOperator> tupSource)
+ throws AsterixException {
+ // In the most general case, IfThenElse is translated in the following
+ // way.
+ //
+ // We assign the result of the condition to one variable varCond.
+ // We create one subplan which contains the plan for the "then" branch,
+ // on top of which there is a selection whose condition is varCond.
+ // Similarly, we create one subplan for the "else" branch, in which the
+ // selection is not(varCond).
+ // Finally, we concatenate the results. (??)
- SubplanOperator sp = new SubplanOperator();
- Mutable<ILogicalOperator> nestedSource = new MutableObject<ILogicalOperator>(
- new NestedTupleSourceOperator(
- new MutableObject<ILogicalOperator>(sp)));
+ Pair<ILogicalOperator, LogicalVariable> pCond = ifexpr.getCondExpr().accept(this, tupSource);
+ ILogicalOperator opCond = pCond.first;
+ LogicalVariable varCond = pCond.second;
- Pair<ILogicalOperator, LogicalVariable> pThen = ifexpr.getThenExpr()
- .accept(this, nestedSource);
- SelectOperator sel1 = new SelectOperator(
- new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(varCond)));
- sel1.getInputs().add(new MutableObject<ILogicalOperator>(pThen.first));
+ SubplanOperator sp = new SubplanOperator();
+ Mutable<ILogicalOperator> nestedSource = new MutableObject<ILogicalOperator>(new NestedTupleSourceOperator(
+ new MutableObject<ILogicalOperator>(sp)));
- Pair<ILogicalOperator, LogicalVariable> pElse = ifexpr.getElseExpr()
- .accept(this, nestedSource);
- AbstractFunctionCallExpression notVarCond = new ScalarFunctionCallExpression(
- FunctionUtils.getFunctionInfo(AlgebricksBuiltinFunctions.NOT),
- new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(varCond)));
- SelectOperator sel2 = new SelectOperator(
- new MutableObject<ILogicalExpression>(notVarCond));
- sel2.getInputs().add(new MutableObject<ILogicalOperator>(pElse.first));
+ Pair<ILogicalOperator, LogicalVariable> pThen = ifexpr.getThenExpr().accept(this, nestedSource);
+ SelectOperator sel1 = new SelectOperator(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(
+ varCond)));
+ sel1.getInputs().add(new MutableObject<ILogicalOperator>(pThen.first));
- ILogicalPlan p1 = new ALogicalPlanImpl(
- new MutableObject<ILogicalOperator>(sel1));
- sp.getNestedPlans().add(p1);
- ILogicalPlan p2 = new ALogicalPlanImpl(
- new MutableObject<ILogicalOperator>(sel2));
- sp.getNestedPlans().add(p2);
+ Pair<ILogicalOperator, LogicalVariable> pElse = ifexpr.getElseExpr().accept(this, nestedSource);
+ AbstractFunctionCallExpression notVarCond = new ScalarFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AlgebricksBuiltinFunctions.NOT), new MutableObject<ILogicalExpression>(
+ new VariableReferenceExpression(varCond)));
+ SelectOperator sel2 = new SelectOperator(new MutableObject<ILogicalExpression>(notVarCond));
+ sel2.getInputs().add(new MutableObject<ILogicalOperator>(pElse.first));
- Mutable<ILogicalOperator> opCondRef = new MutableObject<ILogicalOperator>(
- opCond);
- sp.getInputs().add(opCondRef);
+ ILogicalPlan p1 = new ALogicalPlanImpl(new MutableObject<ILogicalOperator>(sel1));
+ sp.getNestedPlans().add(p1);
+ ILogicalPlan p2 = new ALogicalPlanImpl(new MutableObject<ILogicalOperator>(sel2));
+ sp.getNestedPlans().add(p2);
- LogicalVariable resV = context.newVar();
- AbstractFunctionCallExpression concatNonNull = new ScalarFunctionCallExpression(
- FunctionUtils
- .getFunctionInfo(AsterixBuiltinFunctions.CONCAT_NON_NULL),
- new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(pThen.second)),
- new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(pElse.second)));
- AssignOperator a = new AssignOperator(resV,
- new MutableObject<ILogicalExpression>(concatNonNull));
- a.getInputs().add(new MutableObject<ILogicalOperator>(sp));
+ Mutable<ILogicalOperator> opCondRef = new MutableObject<ILogicalOperator>(opCond);
+ sp.getInputs().add(opCondRef);
- return new Pair<ILogicalOperator, LogicalVariable>(a, resV);
- }
+ LogicalVariable resV = context.newVar();
+ AbstractFunctionCallExpression concatNonNull = new ScalarFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.CONCAT_NON_NULL),
+ new MutableObject<ILogicalExpression>(new VariableReferenceExpression(pThen.second)),
+ new MutableObject<ILogicalExpression>(new VariableReferenceExpression(pElse.second)));
+ AssignOperator a = new AssignOperator(resV, new MutableObject<ILogicalExpression>(concatNonNull));
+ a.getInputs().add(new MutableObject<ILogicalOperator>(sp));
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitLiteralExpr(
- LiteralExpr l, Mutable<ILogicalOperator> tupSource) {
- LogicalVariable var = context.newVar();
- AssignOperator a = new AssignOperator(var,
- new MutableObject<ILogicalExpression>(new ConstantExpression(
- new AsterixConstantValue(ConstantHelper
- .objectFromLiteral(l.getValue())))));
- if (tupSource != null) {
- a.getInputs().add(tupSource);
- }
- return new Pair<ILogicalOperator, LogicalVariable>(a, var);
- }
+ return new Pair<ILogicalOperator, LogicalVariable>(a, resV);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitOperatorExpr(
- OperatorExpr op, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- ArrayList<OperatorType> ops = op.getOpList();
- int nOps = ops.size();
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitLiteralExpr(LiteralExpr l, Mutable<ILogicalOperator> tupSource) {
+ LogicalVariable var = context.newVar();
+ AssignOperator a = new AssignOperator(var, new MutableObject<ILogicalExpression>(new ConstantExpression(
+ new AsterixConstantValue(ConstantHelper.objectFromLiteral(l.getValue())))));
+ if (tupSource != null) {
+ a.getInputs().add(tupSource);
+ }
+ return new Pair<ILogicalOperator, LogicalVariable>(a, var);
+ }
- if (nOps > 0
- && (ops.get(0) == OperatorType.AND || ops.get(0) == OperatorType.OR)) {
- return visitAndOrOperator(op, tupSource);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitOperatorExpr(OperatorExpr op,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ ArrayList<OperatorType> ops = op.getOpList();
+ int nOps = ops.size();
- ArrayList<Expression> exprs = op.getExprList();
+ if (nOps > 0 && (ops.get(0) == OperatorType.AND || ops.get(0) == OperatorType.OR)) {
+ return visitAndOrOperator(op, tupSource);
+ }
- Mutable<ILogicalOperator> topOp = tupSource;
+ ArrayList<Expression> exprs = op.getExprList();
- ILogicalExpression currExpr = null;
- for (int i = 0; i <= nOps; i++) {
+ Mutable<ILogicalOperator> topOp = tupSource;
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(
- exprs.get(i), topOp);
- topOp = p.second;
- ILogicalExpression e = p.first;
- // now look at the operator
- if (i < nOps) {
- if (OperatorExpr.opIsComparison(ops.get(i))) {
- AbstractFunctionCallExpression c = createComparisonExpression(ops
- .get(i));
+ ILogicalExpression currExpr = null;
+ for (int i = 0; i <= nOps; i++) {
- // chain the operators
- if (i == 0) {
- c.getArguments().add(
- new MutableObject<ILogicalExpression>(e));
- currExpr = c;
- if (op.isBroadcastOperand(i)) {
- BroadcastExpressionAnnotation bcast = new BroadcastExpressionAnnotation();
- bcast.setObject(BroadcastSide.LEFT);
- c.getAnnotations()
- .put(BroadcastExpressionAnnotation.BROADCAST_ANNOTATION_KEY,
- bcast);
- }
- } else {
- ((AbstractFunctionCallExpression) currExpr)
- .getArguments()
- .add(new MutableObject<ILogicalExpression>(e));
- c.getArguments()
- .add(new MutableObject<ILogicalExpression>(
- currExpr));
- currExpr = c;
- if (i == 1 && op.isBroadcastOperand(i)) {
- BroadcastExpressionAnnotation bcast = new BroadcastExpressionAnnotation();
- bcast.setObject(BroadcastSide.RIGHT);
- c.getAnnotations()
- .put(BroadcastExpressionAnnotation.BROADCAST_ANNOTATION_KEY,
- bcast);
- }
- }
- } else {
- AbstractFunctionCallExpression f = createFunctionCallExpressionForBuiltinOperator(ops
- .get(i));
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(exprs.get(i), topOp);
+ topOp = p.second;
+ ILogicalExpression e = p.first;
+ // now look at the operator
+ if (i < nOps) {
+ if (OperatorExpr.opIsComparison(ops.get(i))) {
+ AbstractFunctionCallExpression c = createComparisonExpression(ops.get(i));
- if (i == 0) {
- f.getArguments().add(
- new MutableObject<ILogicalExpression>(e));
- currExpr = f;
- } else {
- ((AbstractFunctionCallExpression) currExpr)
- .getArguments()
- .add(new MutableObject<ILogicalExpression>(e));
- f.getArguments()
- .add(new MutableObject<ILogicalExpression>(
- currExpr));
- currExpr = f;
- }
- }
- } else { // don't forget the last expression...
- ((AbstractFunctionCallExpression) currExpr).getArguments().add(
- new MutableObject<ILogicalExpression>(e));
- if (i == 1 && op.isBroadcastOperand(i)) {
- BroadcastExpressionAnnotation bcast = new BroadcastExpressionAnnotation();
- bcast.setObject(BroadcastSide.RIGHT);
- ((AbstractFunctionCallExpression) currExpr)
- .getAnnotations()
- .put(BroadcastExpressionAnnotation.BROADCAST_ANNOTATION_KEY,
- bcast);
- }
- }
- }
+ // chain the operators
+ if (i == 0) {
+ c.getArguments().add(new MutableObject<ILogicalExpression>(e));
+ currExpr = c;
+ if (op.isBroadcastOperand(i)) {
+ BroadcastExpressionAnnotation bcast = new BroadcastExpressionAnnotation();
+ bcast.setObject(BroadcastSide.LEFT);
+ c.getAnnotations().put(BroadcastExpressionAnnotation.BROADCAST_ANNOTATION_KEY, bcast);
+ }
+ } else {
+ ((AbstractFunctionCallExpression) currExpr).getArguments().add(
+ new MutableObject<ILogicalExpression>(e));
+ c.getArguments().add(new MutableObject<ILogicalExpression>(currExpr));
+ currExpr = c;
+ if (i == 1 && op.isBroadcastOperand(i)) {
+ BroadcastExpressionAnnotation bcast = new BroadcastExpressionAnnotation();
+ bcast.setObject(BroadcastSide.RIGHT);
+ c.getAnnotations().put(BroadcastExpressionAnnotation.BROADCAST_ANNOTATION_KEY, bcast);
+ }
+ }
+ } else {
+ AbstractFunctionCallExpression f = createFunctionCallExpressionForBuiltinOperator(ops.get(i));
- LogicalVariable assignedVar = context.newVar();
- AssignOperator a = new AssignOperator(assignedVar,
- new MutableObject<ILogicalExpression>(currExpr));
+ if (i == 0) {
+ f.getArguments().add(new MutableObject<ILogicalExpression>(e));
+ currExpr = f;
+ } else {
+ ((AbstractFunctionCallExpression) currExpr).getArguments().add(
+ new MutableObject<ILogicalExpression>(e));
+ f.getArguments().add(new MutableObject<ILogicalExpression>(currExpr));
+ currExpr = f;
+ }
+ }
+ } else { // don't forget the last expression...
+ ((AbstractFunctionCallExpression) currExpr).getArguments()
+ .add(new MutableObject<ILogicalExpression>(e));
+ if (i == 1 && op.isBroadcastOperand(i)) {
+ BroadcastExpressionAnnotation bcast = new BroadcastExpressionAnnotation();
+ bcast.setObject(BroadcastSide.RIGHT);
+ ((AbstractFunctionCallExpression) currExpr).getAnnotations().put(
+ BroadcastExpressionAnnotation.BROADCAST_ANNOTATION_KEY, bcast);
+ }
+ }
+ }
- a.getInputs().add(topOp);
+ LogicalVariable assignedVar = context.newVar();
+ AssignOperator a = new AssignOperator(assignedVar, new MutableObject<ILogicalExpression>(currExpr));
- return new Pair<ILogicalOperator, LogicalVariable>(a, assignedVar);
- }
+ a.getInputs().add(topOp);
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitOrderbyClause(
- OrderbyClause oc, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
+ return new Pair<ILogicalOperator, LogicalVariable>(a, assignedVar);
+ }
- OrderOperator ord = new OrderOperator();
- Iterator<OrderModifier> modifIter = oc.getModifierList().iterator();
- Mutable<ILogicalOperator> topOp = tupSource;
- for (Expression e : oc.getOrderbyList()) {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(
- e, topOp);
- OrderModifier m = modifIter.next();
- OrderOperator.IOrder comp = (m == OrderModifier.ASC) ? OrderOperator.ASC_ORDER
- : OrderOperator.DESC_ORDER;
- ord.getOrderExpressions().add(
- new Pair<IOrder, Mutable<ILogicalExpression>>(comp,
- new MutableObject<ILogicalExpression>(p.first)));
- topOp = p.second;
- }
- ord.getInputs().add(topOp);
- if (oc.getNumTuples() > 0) {
- ord.getAnnotations().put(OperatorAnnotations.CARDINALITY,
- oc.getNumTuples());
- }
- if (oc.getNumFrames() > 0) {
- ord.getAnnotations().put(OperatorAnnotations.MAX_NUMBER_FRAMES,
- oc.getNumFrames());
- }
- return new Pair<ILogicalOperator, LogicalVariable>(ord, null);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitOrderbyClause(OrderbyClause oc,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitQuantifiedExpression(
- QuantifiedExpression qe, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- Mutable<ILogicalOperator> topOp = tupSource;
+ OrderOperator ord = new OrderOperator();
+ Iterator<OrderModifier> modifIter = oc.getModifierList().iterator();
+ Mutable<ILogicalOperator> topOp = tupSource;
+ for (Expression e : oc.getOrderbyList()) {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(e, topOp);
+ OrderModifier m = modifIter.next();
+ OrderOperator.IOrder comp = (m == OrderModifier.ASC) ? OrderOperator.ASC_ORDER : OrderOperator.DESC_ORDER;
+ ord.getOrderExpressions()
+ .add(new Pair<IOrder, Mutable<ILogicalExpression>>(comp, new MutableObject<ILogicalExpression>(
+ p.first)));
+ topOp = p.second;
+ }
+ ord.getInputs().add(topOp);
+ if (oc.getNumTuples() > 0) {
+ ord.getAnnotations().put(OperatorAnnotations.CARDINALITY, oc.getNumTuples());
+ }
+ if (oc.getNumFrames() > 0) {
+ ord.getAnnotations().put(OperatorAnnotations.MAX_NUMBER_FRAMES, oc.getNumFrames());
+ }
+ return new Pair<ILogicalOperator, LogicalVariable>(ord, null);
+ }
- ILogicalOperator firstOp = null;
- Mutable<ILogicalOperator> lastOp = null;
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitQuantifiedExpression(QuantifiedExpression qe,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ Mutable<ILogicalOperator> topOp = tupSource;
- for (QuantifiedPair qt : qe.getQuantifiedList()) {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo1 = aqlExprToAlgExpression(
- qt.getExpr(), topOp);
- topOp = eo1.second;
- LogicalVariable uVar = context.newVar(qt.getVarExpr());
- ILogicalOperator u = new UnnestOperator(uVar,
- new MutableObject<ILogicalExpression>(
- makeUnnestExpression(eo1.first)));
+ ILogicalOperator firstOp = null;
+ Mutable<ILogicalOperator> lastOp = null;
- if (firstOp == null) {
- firstOp = u;
- }
- if (lastOp != null) {
- u.getInputs().add(lastOp);
- }
- lastOp = new MutableObject<ILogicalOperator>(u);
- }
+ for (QuantifiedPair qt : qe.getQuantifiedList()) {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo1 = aqlExprToAlgExpression(qt.getExpr(), topOp);
+ topOp = eo1.second;
+ LogicalVariable uVar = context.newVar(qt.getVarExpr());
+ ILogicalOperator u = new UnnestOperator(uVar, new MutableObject<ILogicalExpression>(
+ makeUnnestExpression(eo1.first)));
- // We make all the unnest correspond. to quantif. vars. sit on top
- // in the hope of enabling joins & other optimiz.
- firstOp.getInputs().add(topOp);
- topOp = lastOp;
+ if (firstOp == null) {
+ firstOp = u;
+ }
+ if (lastOp != null) {
+ u.getInputs().add(lastOp);
+ }
+ lastOp = new MutableObject<ILogicalOperator>(u);
+ }
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo2 = aqlExprToAlgExpression(
- qe.getSatisfiesExpr(), topOp);
+ // We make all the unnest correspond. to quantif. vars. sit on top
+ // in the hope of enabling joins & other optimiz.
+ firstOp.getInputs().add(topOp);
+ topOp = lastOp;
- AggregateFunctionCallExpression fAgg;
- SelectOperator s;
- if (qe.getQuantifier() == Quantifier.SOME) {
- s = new SelectOperator(new MutableObject<ILogicalExpression>(
- eo2.first));
- s.getInputs().add(eo2.second);
- fAgg = AsterixBuiltinFunctions.makeAggregateFunctionExpression(
- AsterixBuiltinFunctions.NON_EMPTY_STREAM,
- new ArrayList<Mutable<ILogicalExpression>>());
- } else { // EVERY
- List<Mutable<ILogicalExpression>> satExprList = new ArrayList<Mutable<ILogicalExpression>>(
- 1);
- satExprList.add(new MutableObject<ILogicalExpression>(eo2.first));
- s = new SelectOperator(new MutableObject<ILogicalExpression>(
- new ScalarFunctionCallExpression(FunctionUtils
- .getFunctionInfo(AlgebricksBuiltinFunctions.NOT),
- satExprList)));
- s.getInputs().add(eo2.second);
- fAgg = AsterixBuiltinFunctions.makeAggregateFunctionExpression(
- AsterixBuiltinFunctions.EMPTY_STREAM,
- new ArrayList<Mutable<ILogicalExpression>>());
- }
- LogicalVariable qeVar = context.newVar();
- AggregateOperator a = new AggregateOperator(
- mkSingletonArrayList(qeVar),
- (List) mkSingletonArrayList(new MutableObject<ILogicalExpression>(
- fAgg)));
- a.getInputs().add(new MutableObject<ILogicalOperator>(s));
- return new Pair<ILogicalOperator, LogicalVariable>(a, qeVar);
- }
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo2 = aqlExprToAlgExpression(qe.getSatisfiesExpr(), topOp);
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitQuery(Query q,
- Mutable<ILogicalOperator> tupSource) throws AsterixException {
- return q.getBody().accept(this, tupSource);
- }
+ AggregateFunctionCallExpression fAgg;
+ SelectOperator s;
+ if (qe.getQuantifier() == Quantifier.SOME) {
+ s = new SelectOperator(new MutableObject<ILogicalExpression>(eo2.first));
+ s.getInputs().add(eo2.second);
+ fAgg = AsterixBuiltinFunctions.makeAggregateFunctionExpression(AsterixBuiltinFunctions.NON_EMPTY_STREAM,
+ new ArrayList<Mutable<ILogicalExpression>>());
+ } else { // EVERY
+ List<Mutable<ILogicalExpression>> satExprList = new ArrayList<Mutable<ILogicalExpression>>(1);
+ satExprList.add(new MutableObject<ILogicalExpression>(eo2.first));
+ s = new SelectOperator(new MutableObject<ILogicalExpression>(new ScalarFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AlgebricksBuiltinFunctions.NOT), satExprList)));
+ s.getInputs().add(eo2.second);
+ fAgg = AsterixBuiltinFunctions.makeAggregateFunctionExpression(AsterixBuiltinFunctions.EMPTY_STREAM,
+ new ArrayList<Mutable<ILogicalExpression>>());
+ }
+ LogicalVariable qeVar = context.newVar();
+ AggregateOperator a = new AggregateOperator(mkSingletonArrayList(qeVar),
+ (List) mkSingletonArrayList(new MutableObject<ILogicalExpression>(fAgg)));
+ a.getInputs().add(new MutableObject<ILogicalOperator>(s));
+ return new Pair<ILogicalOperator, LogicalVariable>(a, qeVar);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitRecordConstructor(
- RecordConstructor rc, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- AbstractFunctionCallExpression f = new ScalarFunctionCallExpression(
- FunctionUtils
- .getFunctionInfo(AsterixBuiltinFunctions.OPEN_RECORD_CONSTRUCTOR));
- LogicalVariable v1 = context.newVar();
- AssignOperator a = new AssignOperator(v1,
- new MutableObject<ILogicalExpression>(f));
- Mutable<ILogicalOperator> topOp = tupSource;
- for (FieldBinding fb : rc.getFbList()) {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo1 = aqlExprToAlgExpression(
- fb.getLeftExpr(), topOp);
- f.getArguments().add(
- new MutableObject<ILogicalExpression>(eo1.first));
- topOp = eo1.second;
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo2 = aqlExprToAlgExpression(
- fb.getRightExpr(), topOp);
- f.getArguments().add(
- new MutableObject<ILogicalExpression>(eo2.first));
- topOp = eo2.second;
- }
- a.getInputs().add(topOp);
- return new Pair<ILogicalOperator, LogicalVariable>(a, v1);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitQuery(Query q, Mutable<ILogicalOperator> tupSource)
+ throws AsterixException {
+ return q.getBody().accept(this, tupSource);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitListConstructor(
- ListConstructor lc, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- FunctionIdentifier fid = (lc.getType() == Type.ORDERED_LIST_CONSTRUCTOR) ? AsterixBuiltinFunctions.ORDERED_LIST_CONSTRUCTOR
- : AsterixBuiltinFunctions.UNORDERED_LIST_CONSTRUCTOR;
- AbstractFunctionCallExpression f = new ScalarFunctionCallExpression(
- FunctionUtils.getFunctionInfo(fid));
- LogicalVariable v1 = context.newVar();
- AssignOperator a = new AssignOperator(v1,
- new MutableObject<ILogicalExpression>(f));
- Mutable<ILogicalOperator> topOp = tupSource;
- for (Expression expr : lc.getExprList()) {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(
- expr, topOp);
- f.getArguments().add(
- new MutableObject<ILogicalExpression>(eo.first));
- topOp = eo.second;
- }
- a.getInputs().add(topOp);
- return new Pair<ILogicalOperator, LogicalVariable>(a, v1);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitRecordConstructor(RecordConstructor rc,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ AbstractFunctionCallExpression f = new ScalarFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.OPEN_RECORD_CONSTRUCTOR));
+ LogicalVariable v1 = context.newVar();
+ AssignOperator a = new AssignOperator(v1, new MutableObject<ILogicalExpression>(f));
+ Mutable<ILogicalOperator> topOp = tupSource;
+ for (FieldBinding fb : rc.getFbList()) {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo1 = aqlExprToAlgExpression(fb.getLeftExpr(), topOp);
+ f.getArguments().add(new MutableObject<ILogicalExpression>(eo1.first));
+ topOp = eo1.second;
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo2 = aqlExprToAlgExpression(fb.getRightExpr(), topOp);
+ f.getArguments().add(new MutableObject<ILogicalExpression>(eo2.first));
+ topOp = eo2.second;
+ }
+ a.getInputs().add(topOp);
+ return new Pair<ILogicalOperator, LogicalVariable>(a, v1);
+ }
+
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitListConstructor(ListConstructor lc,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ FunctionIdentifier fid = (lc.getType() == Type.ORDERED_LIST_CONSTRUCTOR) ? AsterixBuiltinFunctions.ORDERED_LIST_CONSTRUCTOR
+ : AsterixBuiltinFunctions.UNORDERED_LIST_CONSTRUCTOR;
+ AbstractFunctionCallExpression f = new ScalarFunctionCallExpression(FunctionUtils.getFunctionInfo(fid));
+ LogicalVariable v1 = context.newVar();
+ AssignOperator a = new AssignOperator(v1, new MutableObject<ILogicalExpression>(f));
+ Mutable<ILogicalOperator> topOp = tupSource;
+ for (Expression expr : lc.getExprList()) {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(expr, topOp);
+ f.getArguments().add(new MutableObject<ILogicalExpression>(eo.first));
+ topOp = eo.second;
+ }
+ a.getInputs().add(topOp);
+ return new Pair<ILogicalOperator, LogicalVariable>(a, v1);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitUnaryExpr(UnaryExpr u,
- Mutable<ILogicalOperator> tupSource) throws AsterixException {
- Expression expr = u.getExpr();
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(
- expr, tupSource);
- LogicalVariable v1 = context.newVar();
- AssignOperator a;
- if (u.getSign() == Sign.POSITIVE) {
- a = new AssignOperator(v1, new MutableObject<ILogicalExpression>(
- eo.first));
- } else {
- AbstractFunctionCallExpression m = new ScalarFunctionCallExpression(
- FunctionUtils
- .getFunctionInfo(AsterixBuiltinFunctions.NUMERIC_UNARY_MINUS));
- m.getArguments().add(
- new MutableObject<ILogicalExpression>(eo.first));
- a = new AssignOperator(v1, new MutableObject<ILogicalExpression>(m));
- }
- a.getInputs().add(eo.second);
- return new Pair<ILogicalOperator, LogicalVariable>(a, v1);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitUnaryExpr(UnaryExpr u, Mutable<ILogicalOperator> tupSource)
+ throws AsterixException {
+ Expression expr = u.getExpr();
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = aqlExprToAlgExpression(expr, tupSource);
+ LogicalVariable v1 = context.newVar();
+ AssignOperator a;
+ if (u.getSign() == Sign.POSITIVE) {
+ a = new AssignOperator(v1, new MutableObject<ILogicalExpression>(eo.first));
+ } else {
+ AbstractFunctionCallExpression m = new ScalarFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.NUMERIC_UNARY_MINUS));
+ m.getArguments().add(new MutableObject<ILogicalExpression>(eo.first));
+ a = new AssignOperator(v1, new MutableObject<ILogicalExpression>(m));
+ }
+ a.getInputs().add(eo.second);
+ return new Pair<ILogicalOperator, LogicalVariable>(a, v1);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitVariableExpr(
- VariableExpr v, Mutable<ILogicalOperator> tupSource) {
- // Should we ever get to this method?
- LogicalVariable var = context.newVar();
- LogicalVariable oldV = context.getVar(v.getVar().getId());
- AssignOperator a = new AssignOperator(var,
- new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(oldV)));
- a.getInputs().add(tupSource);
- return new Pair<ILogicalOperator, LogicalVariable>(a, var);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitVariableExpr(VariableExpr v, Mutable<ILogicalOperator> tupSource) {
+ // Should we ever get to this method?
+ LogicalVariable var = context.newVar();
+ LogicalVariable oldV = context.getVar(v.getVar().getId());
+ AssignOperator a = new AssignOperator(var, new MutableObject<ILogicalExpression>(
+ new VariableReferenceExpression(oldV)));
+ a.getInputs().add(tupSource);
+ return new Pair<ILogicalOperator, LogicalVariable>(a, var);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitWhereClause(
- WhereClause w, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(
- w.getWhereExpr(), tupSource);
- SelectOperator s = new SelectOperator(
- new MutableObject<ILogicalExpression>(p.first));
- s.getInputs().add(p.second);
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitWhereClause(WhereClause w, Mutable<ILogicalOperator> tupSource)
+ throws AsterixException {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(w.getWhereExpr(), tupSource);
+ SelectOperator s = new SelectOperator(new MutableObject<ILogicalExpression>(p.first));
+ s.getInputs().add(p.second);
- return new Pair<ILogicalOperator, LogicalVariable>(s, null);
- }
+ return new Pair<ILogicalOperator, LogicalVariable>(s, null);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitLimitClause(
- LimitClause lc, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p1 = aqlExprToAlgExpression(
- lc.getLimitExpr(), tupSource);
- LimitOperator opLim;
- Expression offset = lc.getOffset();
- if (offset != null) {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p2 = aqlExprToAlgExpression(
- offset, p1.second);
- opLim = new LimitOperator(p1.first, p2.first);
- opLim.getInputs().add(p2.second);
- } else {
- opLim = new LimitOperator(p1.first);
- opLim.getInputs().add(p1.second);
- }
- return new Pair<ILogicalOperator, LogicalVariable>(opLim, null);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitLimitClause(LimitClause lc, Mutable<ILogicalOperator> tupSource)
+ throws AsterixException {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> p1 = aqlExprToAlgExpression(lc.getLimitExpr(), tupSource);
+ LimitOperator opLim;
+ Expression offset = lc.getOffset();
+ if (offset != null) {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> p2 = aqlExprToAlgExpression(offset, p1.second);
+ opLim = new LimitOperator(p1.first, p2.first);
+ opLim.getInputs().add(p2.second);
+ } else {
+ opLim = new LimitOperator(p1.first);
+ opLim.getInputs().add(p1.second);
+ }
+ return new Pair<ILogicalOperator, LogicalVariable>(opLim, null);
+ }
- @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> 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>>();
- Mutable<ILogicalOperator> input = null;
- for (Expression expr : dc.getDistinctByExpr()) {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(
- expr, tupSource);
- exprList.add(new MutableObject<ILogicalExpression>(p.first));
- input = p.second;
- }
- DistinctOperator opDistinct = new DistinctOperator(exprList);
- opDistinct.getInputs().add(input);
- return new Pair<ILogicalOperator, LogicalVariable>(opDistinct, null);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitDistinctClause(DistinctClause dc,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ List<Mutable<ILogicalExpression>> exprList = new ArrayList<Mutable<ILogicalExpression>>();
+ Mutable<ILogicalOperator> input = null;
+ for (Expression expr : dc.getDistinctByExpr()) {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(expr, tupSource);
+ exprList.add(new MutableObject<ILogicalExpression>(p.first));
+ input = p.second;
+ }
+ DistinctOperator opDistinct = new DistinctOperator(exprList);
+ opDistinct.getInputs().add(input);
+ return new Pair<ILogicalOperator, LogicalVariable>(opDistinct, null);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitUnionExpr(
- UnionExpr unionExpr, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- Mutable<ILogicalOperator> ts = tupSource;
- ILogicalOperator lastOp = null;
- LogicalVariable lastVar = null;
- boolean first = true;
- for (Expression e : unionExpr.getExprs()) {
- if (first) {
- first = false;
- } else {
- ts = new MutableObject<ILogicalOperator>(
- new EmptyTupleSourceOperator());
- }
- Pair<ILogicalOperator, LogicalVariable> p1 = e.accept(this, ts);
- if (lastOp == null) {
- lastOp = p1.first;
- lastVar = p1.second;
- } else {
- LogicalVariable unnestVar1 = context.newVar();
- UnnestOperator unnest1 = new UnnestOperator(
- unnestVar1,
- new MutableObject<ILogicalExpression>(
- makeUnnestExpression(new VariableReferenceExpression(
- lastVar))));
- unnest1.getInputs().add(
- new MutableObject<ILogicalOperator>(lastOp));
- LogicalVariable unnestVar2 = context.newVar();
- UnnestOperator unnest2 = new UnnestOperator(
- unnestVar2,
- new MutableObject<ILogicalExpression>(
- makeUnnestExpression(new VariableReferenceExpression(
- p1.second))));
- unnest2.getInputs().add(
- new MutableObject<ILogicalOperator>(p1.first));
- List<Triple<LogicalVariable, LogicalVariable, LogicalVariable>> varMap = new ArrayList<Triple<LogicalVariable, LogicalVariable, LogicalVariable>>(
- 1);
- LogicalVariable resultVar = context.newVar();
- Triple<LogicalVariable, LogicalVariable, LogicalVariable> triple = new Triple<LogicalVariable, LogicalVariable, LogicalVariable>(
- unnestVar1, unnestVar2, resultVar);
- varMap.add(triple);
- UnionAllOperator unionOp = new UnionAllOperator(varMap);
- unionOp.getInputs().add(
- new MutableObject<ILogicalOperator>(unnest1));
- unionOp.getInputs().add(
- new MutableObject<ILogicalOperator>(unnest2));
- lastVar = resultVar;
- lastOp = unionOp;
- }
- }
- LogicalVariable aggVar = context.newVar();
- ArrayList<LogicalVariable> aggregVars = new ArrayList<LogicalVariable>(
- 1);
- aggregVars.add(aggVar);
- List<Mutable<ILogicalExpression>> afcExprs = new ArrayList<Mutable<ILogicalExpression>>(
- 1);
- afcExprs.add(new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(lastVar)));
- AggregateFunctionCallExpression afc = AsterixBuiltinFunctions
- .makeAggregateFunctionExpression(
- AsterixBuiltinFunctions.LISTIFY, afcExprs);
- ArrayList<Mutable<ILogicalExpression>> aggregExprs = new ArrayList<Mutable<ILogicalExpression>>(
- 1);
- aggregExprs.add(new MutableObject<ILogicalExpression>(afc));
- AggregateOperator agg = new AggregateOperator(aggregVars, aggregExprs);
- agg.getInputs().add(new MutableObject<ILogicalOperator>(lastOp));
- return new Pair<ILogicalOperator, LogicalVariable>(agg, aggVar);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitUnionExpr(UnionExpr unionExpr,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ Mutable<ILogicalOperator> ts = tupSource;
+ ILogicalOperator lastOp = null;
+ LogicalVariable lastVar = null;
+ boolean first = true;
+ for (Expression e : unionExpr.getExprs()) {
+ if (first) {
+ first = false;
+ } else {
+ ts = new MutableObject<ILogicalOperator>(new EmptyTupleSourceOperator());
+ }
+ Pair<ILogicalOperator, LogicalVariable> p1 = e.accept(this, ts);
+ if (lastOp == null) {
+ lastOp = p1.first;
+ lastVar = p1.second;
+ } else {
+ LogicalVariable unnestVar1 = context.newVar();
+ UnnestOperator unnest1 = new UnnestOperator(unnestVar1, new MutableObject<ILogicalExpression>(
+ makeUnnestExpression(new VariableReferenceExpression(lastVar))));
+ unnest1.getInputs().add(new MutableObject<ILogicalOperator>(lastOp));
+ LogicalVariable unnestVar2 = context.newVar();
+ UnnestOperator unnest2 = new UnnestOperator(unnestVar2, new MutableObject<ILogicalExpression>(
+ makeUnnestExpression(new VariableReferenceExpression(p1.second))));
+ unnest2.getInputs().add(new MutableObject<ILogicalOperator>(p1.first));
+ List<Triple<LogicalVariable, LogicalVariable, LogicalVariable>> varMap = new ArrayList<Triple<LogicalVariable, LogicalVariable, LogicalVariable>>(
+ 1);
+ LogicalVariable resultVar = context.newVar();
+ Triple<LogicalVariable, LogicalVariable, LogicalVariable> triple = new Triple<LogicalVariable, LogicalVariable, LogicalVariable>(
+ unnestVar1, unnestVar2, resultVar);
+ varMap.add(triple);
+ UnionAllOperator unionOp = new UnionAllOperator(varMap);
+ unionOp.getInputs().add(new MutableObject<ILogicalOperator>(unnest1));
+ unionOp.getInputs().add(new MutableObject<ILogicalOperator>(unnest2));
+ lastVar = resultVar;
+ lastOp = unionOp;
+ }
+ }
+ LogicalVariable aggVar = context.newVar();
+ ArrayList<LogicalVariable> aggregVars = new ArrayList<LogicalVariable>(1);
+ aggregVars.add(aggVar);
+ List<Mutable<ILogicalExpression>> afcExprs = new ArrayList<Mutable<ILogicalExpression>>(1);
+ afcExprs.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(lastVar)));
+ AggregateFunctionCallExpression afc = AsterixBuiltinFunctions.makeAggregateFunctionExpression(
+ AsterixBuiltinFunctions.LISTIFY, afcExprs);
+ ArrayList<Mutable<ILogicalExpression>> aggregExprs = new ArrayList<Mutable<ILogicalExpression>>(1);
+ aggregExprs.add(new MutableObject<ILogicalExpression>(afc));
+ AggregateOperator agg = new AggregateOperator(aggregVars, aggregExprs);
+ agg.getInputs().add(new MutableObject<ILogicalOperator>(lastOp));
+ return new Pair<ILogicalOperator, LogicalVariable>(agg, aggVar);
+ }
- private AbstractFunctionCallExpression createComparisonExpression(
- OperatorType t) {
- FunctionIdentifier fi = operatorTypeToFunctionIdentifier(t);
- IFunctionInfo finfo = FunctionUtils.getFunctionInfo(fi);
- return new ScalarFunctionCallExpression(finfo);
- }
+ private AbstractFunctionCallExpression createComparisonExpression(OperatorType t) {
+ FunctionIdentifier fi = operatorTypeToFunctionIdentifier(t);
+ IFunctionInfo finfo = FunctionUtils.getFunctionInfo(fi);
+ return new ScalarFunctionCallExpression(finfo);
+ }
- private FunctionIdentifier operatorTypeToFunctionIdentifier(OperatorType t) {
- switch (t) {
- case EQ: {
- return AlgebricksBuiltinFunctions.EQ;
- }
- case NEQ: {
- return AlgebricksBuiltinFunctions.NEQ;
- }
- case GT: {
- return AlgebricksBuiltinFunctions.GT;
- }
- case GE: {
- return AlgebricksBuiltinFunctions.GE;
- }
- case LT: {
- return AlgebricksBuiltinFunctions.LT;
- }
- case LE: {
- return AlgebricksBuiltinFunctions.LE;
- }
- default: {
- throw new IllegalStateException();
- }
- }
- }
+ private FunctionIdentifier operatorTypeToFunctionIdentifier(OperatorType t) {
+ switch (t) {
+ case EQ: {
+ return AlgebricksBuiltinFunctions.EQ;
+ }
+ case NEQ: {
+ return AlgebricksBuiltinFunctions.NEQ;
+ }
+ case GT: {
+ return AlgebricksBuiltinFunctions.GT;
+ }
+ case GE: {
+ return AlgebricksBuiltinFunctions.GE;
+ }
+ case LT: {
+ return AlgebricksBuiltinFunctions.LT;
+ }
+ case LE: {
+ return AlgebricksBuiltinFunctions.LE;
+ }
+ default: {
+ throw new IllegalStateException();
+ }
+ }
+ }
- private AbstractFunctionCallExpression createFunctionCallExpressionForBuiltinOperator(
- OperatorType t) throws AsterixException {
+ private AbstractFunctionCallExpression createFunctionCallExpressionForBuiltinOperator(OperatorType t)
+ throws AsterixException {
- FunctionIdentifier fid = null;
- switch (t) {
- case PLUS: {
- fid = AlgebricksBuiltinFunctions.NUMERIC_ADD;
- break;
- }
- case MINUS: {
- fid = AsterixBuiltinFunctions.NUMERIC_SUBTRACT;
- break;
- }
- case MUL: {
- fid = AsterixBuiltinFunctions.NUMERIC_MULTIPLY;
- break;
- }
- case DIV: {
- fid = AsterixBuiltinFunctions.NUMERIC_DIVIDE;
- break;
- }
- case MOD: {
- fid = AsterixBuiltinFunctions.NUMERIC_MOD;
- break;
- }
- case IDIV: {
- fid = AsterixBuiltinFunctions.NUMERIC_IDIV;
- break;
- }
- case CARET: {
- fid = AsterixBuiltinFunctions.CARET;
- break;
- }
- case AND: {
- fid = AlgebricksBuiltinFunctions.AND;
- break;
- }
- case OR: {
- fid = AlgebricksBuiltinFunctions.OR;
- break;
- }
- case FUZZY_EQ: {
- fid = AsterixBuiltinFunctions.FUZZY_EQ;
- break;
- }
+ FunctionIdentifier fid = null;
+ switch (t) {
+ case PLUS: {
+ fid = AlgebricksBuiltinFunctions.NUMERIC_ADD;
+ break;
+ }
+ case MINUS: {
+ fid = AsterixBuiltinFunctions.NUMERIC_SUBTRACT;
+ break;
+ }
+ case MUL: {
+ fid = AsterixBuiltinFunctions.NUMERIC_MULTIPLY;
+ break;
+ }
+ case DIV: {
+ fid = AsterixBuiltinFunctions.NUMERIC_DIVIDE;
+ break;
+ }
+ case MOD: {
+ fid = AsterixBuiltinFunctions.NUMERIC_MOD;
+ break;
+ }
+ case IDIV: {
+ fid = AsterixBuiltinFunctions.NUMERIC_IDIV;
+ break;
+ }
+ case CARET: {
+ fid = AsterixBuiltinFunctions.CARET;
+ break;
+ }
+ case AND: {
+ fid = AlgebricksBuiltinFunctions.AND;
+ break;
+ }
+ case OR: {
+ fid = AlgebricksBuiltinFunctions.OR;
+ break;
+ }
+ case FUZZY_EQ: {
+ fid = AsterixBuiltinFunctions.FUZZY_EQ;
+ break;
+ }
- default: {
- throw new NotImplementedException("Operator " + t
- + " is not yet implemented");
- }
- }
- return new ScalarFunctionCallExpression(
- FunctionUtils.getFunctionInfo(fid));
- }
+ default: {
+ throw new NotImplementedException("Operator " + t + " is not yet implemented");
+ }
+ }
+ return new ScalarFunctionCallExpression(FunctionUtils.getFunctionInfo(fid));
+ }
- private static boolean hasOnlyChild(ILogicalOperator parent,
- Mutable<ILogicalOperator> childCandidate) {
- List<Mutable<ILogicalOperator>> inp = parent.getInputs();
- if (inp == null || inp.size() != 1) {
- return false;
- }
- return inp.get(0) == childCandidate;
- }
+ private static boolean hasOnlyChild(ILogicalOperator parent, Mutable<ILogicalOperator> childCandidate) {
+ List<Mutable<ILogicalOperator>> inp = parent.getInputs();
+ if (inp == null || inp.size() != 1) {
+ return false;
+ }
+ return inp.get(0) == childCandidate;
+ }
- private Pair<ILogicalExpression, Mutable<ILogicalOperator>> aqlExprToAlgExpression(
- Expression expr, Mutable<ILogicalOperator> topOp)
- throws AsterixException {
- switch (expr.getKind()) {
- case VARIABLE_EXPRESSION: {
- VariableReferenceExpression ve = new VariableReferenceExpression(
- context.getVar(((VariableExpr) expr).getVar().getId()));
- return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(ve,
- topOp);
- }
- case METAVARIABLE_EXPRESSION: {
- ILogicalExpression le = metaScopeExp
- .getVariableReferenceExpression(((VariableExpr) expr)
- .getVar());
- return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(le,
- topOp);
- }
- case LITERAL_EXPRESSION: {
- LiteralExpr val = (LiteralExpr) expr;
- return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(
- new ConstantExpression(new AsterixConstantValue(
- ConstantHelper.objectFromLiteral(val.getValue()))),
- topOp);
- }
- default: {
- // Mutable<ILogicalExpression> src = new
- // Mutable<ILogicalExpression>();
- // Mutable<ILogicalExpression> src = topOp;
- if (expressionNeedsNoNesting(expr)) {
- Pair<ILogicalOperator, LogicalVariable> p = expr.accept(this,
- topOp);
- ILogicalExpression exp = ((AssignOperator) p.first)
- .getExpressions().get(0).getValue();
- return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(
- exp, p.first.getInputs().get(0));
- } else {
- Mutable<ILogicalOperator> src = new MutableObject<ILogicalOperator>();
+ private Pair<ILogicalExpression, Mutable<ILogicalOperator>> aqlExprToAlgExpression(Expression expr,
+ Mutable<ILogicalOperator> topOp) throws AsterixException {
+ switch (expr.getKind()) {
+ case VARIABLE_EXPRESSION: {
+ VariableReferenceExpression ve = new VariableReferenceExpression(context.getVar(((VariableExpr) expr)
+ .getVar().getId()));
+ return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(ve, topOp);
+ }
+ case METAVARIABLE_EXPRESSION: {
+ ILogicalExpression le = metaScopeExp.getVariableReferenceExpression(((VariableExpr) expr).getVar());
+ return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(le, topOp);
+ }
+ case LITERAL_EXPRESSION: {
+ LiteralExpr val = (LiteralExpr) expr;
+ return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(new ConstantExpression(
+ new AsterixConstantValue(ConstantHelper.objectFromLiteral(val.getValue()))), topOp);
+ }
+ default: {
+ // Mutable<ILogicalExpression> src = new
+ // Mutable<ILogicalExpression>();
+ // Mutable<ILogicalExpression> src = topOp;
+ if (expressionNeedsNoNesting(expr)) {
+ Pair<ILogicalOperator, LogicalVariable> p = expr.accept(this, topOp);
+ ILogicalExpression exp = ((AssignOperator) p.first).getExpressions().get(0).getValue();
+ return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(exp, p.first.getInputs().get(0));
+ } else {
+ Mutable<ILogicalOperator> src = new MutableObject<ILogicalOperator>();
- Pair<ILogicalOperator, LogicalVariable> p = expr.accept(this,
- src);
+ Pair<ILogicalOperator, LogicalVariable> p = expr.accept(this, src);
- if (((AbstractLogicalOperator) p.first).getOperatorTag() == LogicalOperatorTag.SUBPLAN) {
- // src.setOperator(topOp.getOperator());
- Mutable<ILogicalOperator> top2 = new MutableObject<ILogicalOperator>(
- p.first);
- return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(
- new VariableReferenceExpression(p.second), top2);
- } else {
- SubplanOperator s = new SubplanOperator();
- s.getInputs().add(topOp);
- src.setValue(new NestedTupleSourceOperator(
- new MutableObject<ILogicalOperator>(s)));
- Mutable<ILogicalOperator> planRoot = new MutableObject<ILogicalOperator>(
- p.first);
- s.setRootOp(planRoot);
- return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(
- new VariableReferenceExpression(p.second),
- new MutableObject<ILogicalOperator>(s));
- }
- }
- }
- }
+ if (((AbstractLogicalOperator) p.first).getOperatorTag() == LogicalOperatorTag.SUBPLAN) {
+ // src.setOperator(topOp.getOperator());
+ Mutable<ILogicalOperator> top2 = new MutableObject<ILogicalOperator>(p.first);
+ return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(new VariableReferenceExpression(
+ p.second), top2);
+ } else {
+ SubplanOperator s = new SubplanOperator();
+ s.getInputs().add(topOp);
+ src.setValue(new NestedTupleSourceOperator(new MutableObject<ILogicalOperator>(s)));
+ Mutable<ILogicalOperator> planRoot = new MutableObject<ILogicalOperator>(p.first);
+ s.setRootOp(planRoot);
+ return new Pair<ILogicalExpression, Mutable<ILogicalOperator>>(new VariableReferenceExpression(
+ p.second), new MutableObject<ILogicalOperator>(s));
+ }
+ }
+ }
+ }
- }
+ }
- private Pair<ILogicalOperator, LogicalVariable> produceFlwrResult(
- boolean noForClause, boolean isTop,
- Mutable<ILogicalOperator> resOpRef, LogicalVariable resVar) {
- if (isTop) {
- ProjectOperator pr = new ProjectOperator(resVar);
- pr.getInputs().add(resOpRef);
- return new Pair<ILogicalOperator, LogicalVariable>(pr, resVar);
+ private Pair<ILogicalOperator, LogicalVariable> produceFlwrResult(boolean noForClause, boolean isTop,
+ Mutable<ILogicalOperator> resOpRef, LogicalVariable resVar) {
+ if (isTop) {
+ ProjectOperator pr = new ProjectOperator(resVar);
+ pr.getInputs().add(resOpRef);
+ return new Pair<ILogicalOperator, LogicalVariable>(pr, resVar);
- } else if (noForClause) {
- return new Pair<ILogicalOperator, LogicalVariable>(
- resOpRef.getValue(), resVar);
- } else {
- return aggListify(resVar, resOpRef, false);
- }
- }
+ } else if (noForClause) {
+ return new Pair<ILogicalOperator, LogicalVariable>(resOpRef.getValue(), resVar);
+ } else {
+ return aggListify(resVar, resOpRef, false);
+ }
+ }
- private Pair<ILogicalOperator, LogicalVariable> aggListify(
- LogicalVariable var, Mutable<ILogicalOperator> opRef,
- boolean bProject) {
- AggregateFunctionCallExpression funAgg = AsterixBuiltinFunctions
- .makeAggregateFunctionExpression(
- AsterixBuiltinFunctions.LISTIFY,
- new ArrayList<Mutable<ILogicalExpression>>());
- funAgg.getArguments().add(
- new MutableObject<ILogicalExpression>(
- new VariableReferenceExpression(var)));
- LogicalVariable varListified = context.newVar();
- AggregateOperator agg = new AggregateOperator(
- mkSingletonArrayList(varListified),
- (List) mkSingletonArrayList(new MutableObject<ILogicalExpression>(
- funAgg)));
- agg.getInputs().add(opRef);
- ILogicalOperator res;
- if (bProject) {
- ProjectOperator pr = new ProjectOperator(varListified);
- pr.getInputs().add(new MutableObject<ILogicalOperator>(agg));
- res = pr;
- } else {
- res = agg;
- }
- return new Pair<ILogicalOperator, LogicalVariable>(res, varListified);
- }
+ private Pair<ILogicalOperator, LogicalVariable> aggListify(LogicalVariable var, Mutable<ILogicalOperator> opRef,
+ boolean bProject) {
+ AggregateFunctionCallExpression funAgg = AsterixBuiltinFunctions.makeAggregateFunctionExpression(
+ AsterixBuiltinFunctions.LISTIFY, new ArrayList<Mutable<ILogicalExpression>>());
+ funAgg.getArguments().add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(var)));
+ LogicalVariable varListified = context.newVar();
+ AggregateOperator agg = new AggregateOperator(mkSingletonArrayList(varListified),
+ (List) mkSingletonArrayList(new MutableObject<ILogicalExpression>(funAgg)));
+ agg.getInputs().add(opRef);
+ ILogicalOperator res;
+ if (bProject) {
+ ProjectOperator pr = new ProjectOperator(varListified);
+ pr.getInputs().add(new MutableObject<ILogicalOperator>(agg));
+ res = pr;
+ } else {
+ res = agg;
+ }
+ return new Pair<ILogicalOperator, LogicalVariable>(res, varListified);
+ }
- private Pair<ILogicalOperator, LogicalVariable> visitAndOrOperator(
- OperatorExpr op, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- ArrayList<OperatorType> ops = op.getOpList();
- int nOps = ops.size();
+ private Pair<ILogicalOperator, LogicalVariable> visitAndOrOperator(OperatorExpr op,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ ArrayList<OperatorType> ops = op.getOpList();
+ int nOps = ops.size();
- ArrayList<Expression> exprs = op.getExprList();
+ ArrayList<Expression> exprs = op.getExprList();
- Mutable<ILogicalOperator> topOp = tupSource;
+ Mutable<ILogicalOperator> topOp = tupSource;
- OperatorType opLogical = ops.get(0);
- AbstractFunctionCallExpression f = createFunctionCallExpressionForBuiltinOperator(opLogical);
+ OperatorType opLogical = ops.get(0);
+ AbstractFunctionCallExpression f = createFunctionCallExpressionForBuiltinOperator(opLogical);
- for (int i = 0; i <= nOps; i++) {
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(
- exprs.get(i), topOp);
- topOp = p.second;
- // now look at the operator
- if (i < nOps) {
- if (ops.get(i) != opLogical) {
- throw new TranslationException("Unexpected operator "
- + ops.get(i) + " in an OperatorExpr starting with "
- + opLogical);
- }
- }
- f.getArguments()
- .add(new MutableObject<ILogicalExpression>(p.first));
- }
+ for (int i = 0; i <= nOps; i++) {
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = aqlExprToAlgExpression(exprs.get(i), topOp);
+ topOp = p.second;
+ // now look at the operator
+ if (i < nOps) {
+ if (ops.get(i) != opLogical) {
+ throw new TranslationException("Unexpected operator " + ops.get(i)
+ + " in an OperatorExpr starting with " + opLogical);
+ }
+ }
+ f.getArguments().add(new MutableObject<ILogicalExpression>(p.first));
+ }
- LogicalVariable assignedVar = context.newVar();
- AssignOperator a = new AssignOperator(assignedVar,
- new MutableObject<ILogicalExpression>(f));
- a.getInputs().add(topOp);
+ LogicalVariable assignedVar = context.newVar();
+ AssignOperator a = new AssignOperator(assignedVar, new MutableObject<ILogicalExpression>(f));
+ a.getInputs().add(topOp);
- return new Pair<ILogicalOperator, LogicalVariable>(a, assignedVar);
+ return new Pair<ILogicalOperator, LogicalVariable>(a, assignedVar);
- }
+ }
- private static boolean expressionNeedsNoNesting(Expression expr) {
- Kind k = expr.getKind();
- return k == Kind.LITERAL_EXPRESSION
- || k == Kind.LIST_CONSTRUCTOR_EXPRESSION
- || k == Kind.RECORD_CONSTRUCTOR_EXPRESSION
- || k == Kind.VARIABLE_EXPRESSION || k == Kind.CALL_EXPRESSION
- || k == Kind.OP_EXPRESSION
- || k == Kind.FIELD_ACCESSOR_EXPRESSION
- || k == Kind.INDEX_ACCESSOR_EXPRESSION
- || k == Kind.UNARY_EXPRESSION;
- }
+ private static boolean expressionNeedsNoNesting(Expression expr) {
+ Kind k = expr.getKind();
+ return k == Kind.LITERAL_EXPRESSION || k == Kind.LIST_CONSTRUCTOR_EXPRESSION
+ || k == Kind.RECORD_CONSTRUCTOR_EXPRESSION || k == Kind.VARIABLE_EXPRESSION
+ || k == Kind.CALL_EXPRESSION || k == Kind.OP_EXPRESSION || k == Kind.FIELD_ACCESSOR_EXPRESSION
+ || k == Kind.INDEX_ACCESSOR_EXPRESSION || k == Kind.UNARY_EXPRESSION;
+ }
- private <T> ArrayList<T> mkSingletonArrayList(T item) {
- ArrayList<T> array = new ArrayList<T>(1);
- array.add(item);
- return array;
- }
+ private <T> ArrayList<T> mkSingletonArrayList(T item) {
+ ArrayList<T> array = new ArrayList<T>(1);
+ array.add(item);
+ return array;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitTypeDecl(TypeDecl td,
- Mutable<ILogicalOperator> arg) throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitTypeDecl(TypeDecl td, Mutable<ILogicalOperator> arg)
+ throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitRecordTypeDefiniton(
- RecordTypeDefinition tre, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitRecordTypeDefiniton(RecordTypeDefinition tre,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitTypeReferenceExpression(
- TypeReferenceExpression tre, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitTypeReferenceExpression(TypeReferenceExpression tre,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitNodegroupDecl(
- NodegroupDecl ngd, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitNodegroupDecl(NodegroupDecl ngd, Mutable<ILogicalOperator> arg)
+ throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitLoadFromFileStatement(
- LoadFromFileStatement stmtLoad, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitLoadFromFileStatement(LoadFromFileStatement stmtLoad,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitWriteFromQueryResultStatement(
- WriteFromQueryResultStatement stmtLoad,
- Mutable<ILogicalOperator> arg) throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitWriteFromQueryResultStatement(
+ WriteFromQueryResultStatement stmtLoad, Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitDropStatement(
- DropStatement del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitDropStatement(DropStatement del, Mutable<ILogicalOperator> arg)
+ throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitCreateIndexStatement(
- CreateIndexStatement cis, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitCreateIndexStatement(CreateIndexStatement cis,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitOrderedListTypeDefiniton(
- OrderedListTypeDefinition olte, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitOrderedListTypeDefiniton(OrderedListTypeDefinition olte,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitUnorderedListTypeDefiniton(
- UnorderedListTypeDefinition ulte, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitUnorderedListTypeDefiniton(UnorderedListTypeDefinition ulte,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitMetaVariableClause(
- MetaVariableClause mc, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- return new Pair<ILogicalOperator, LogicalVariable>(metaScopeOp.get(mc
- .getVar()), null);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitMetaVariableClause(MetaVariableClause mc,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ return new Pair<ILogicalOperator, LogicalVariable>(metaScopeOp.get(mc.getVar()), null);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitJoinClause(
- JoinClause jc, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- // Pair<ILogicalOperator, LogicalVariable> leftSide =
- // jc.getLeftExpr().accept(this, tupSource);
- Mutable<ILogicalOperator> opRef = tupSource;
- Pair<ILogicalOperator, LogicalVariable> leftSide = null;
- for (Clause c : jc.getLeftClauses()) {
- leftSide = c.accept(this, opRef);
- opRef = new MutableObject<ILogicalOperator>(leftSide.first);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitJoinClause(JoinClause jc, Mutable<ILogicalOperator> tupSource)
+ throws AsterixException {
+ // Pair<ILogicalOperator, LogicalVariable> leftSide =
+ // jc.getLeftExpr().accept(this, tupSource);
+ Mutable<ILogicalOperator> opRef = tupSource;
+ Pair<ILogicalOperator, LogicalVariable> leftSide = null;
+ for (Clause c : jc.getLeftClauses()) {
+ leftSide = c.accept(this, opRef);
+ opRef = new MutableObject<ILogicalOperator>(leftSide.first);
+ }
- // Pair<ILogicalOperator, LogicalVariable> rightSide =
- // jc.getRightExpr().accept(this, tupSource);
- opRef = tupSource;
- Pair<ILogicalOperator, LogicalVariable> rightSide = null;
- for (Clause c : jc.getRightClauses()) {
- rightSide = c.accept(this, opRef);
- opRef = new MutableObject<ILogicalOperator>(rightSide.first);
- }
+ // Pair<ILogicalOperator, LogicalVariable> rightSide =
+ // jc.getRightExpr().accept(this, tupSource);
+ opRef = tupSource;
+ Pair<ILogicalOperator, LogicalVariable> rightSide = null;
+ for (Clause c : jc.getRightClauses()) {
+ rightSide = c.accept(this, opRef);
+ opRef = new MutableObject<ILogicalOperator>(rightSide.first);
+ }
- Pair<ILogicalExpression, Mutable<ILogicalOperator>> whereCond = aqlExprToAlgExpression(
- jc.getWhereExpr(), tupSource);
+ Pair<ILogicalExpression, Mutable<ILogicalOperator>> whereCond = aqlExprToAlgExpression(jc.getWhereExpr(),
+ tupSource);
- AbstractBinaryJoinOperator join;
- switch (jc.getKind()) {
- case INNER: {
- join = new InnerJoinOperator(new MutableObject<ILogicalExpression>(
- whereCond.first));
- break;
- }
- case LEFT_OUTER: {
- join = new LeftOuterJoinOperator(
- new MutableObject<ILogicalExpression>(whereCond.first));
- break;
- }
- default: {
- throw new IllegalStateException();
- }
- }
- join.getInputs().add(
- new MutableObject<ILogicalOperator>(leftSide.first));
- join.getInputs().add(
- new MutableObject<ILogicalOperator>(rightSide.first));
- return new Pair<ILogicalOperator, LogicalVariable>(join, null);
- }
+ AbstractBinaryJoinOperator join;
+ switch (jc.getKind()) {
+ case INNER: {
+ join = new InnerJoinOperator(new MutableObject<ILogicalExpression>(whereCond.first));
+ break;
+ }
+ case LEFT_OUTER: {
+ join = new LeftOuterJoinOperator(new MutableObject<ILogicalExpression>(whereCond.first));
+ break;
+ }
+ default: {
+ throw new IllegalStateException();
+ }
+ }
+ join.getInputs().add(new MutableObject<ILogicalOperator>(leftSide.first));
+ join.getInputs().add(new MutableObject<ILogicalOperator>(rightSide.first));
+ return new Pair<ILogicalOperator, LogicalVariable>(join, null);
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitMetaVariableExpr(
- MetaVariableExpr me, Mutable<ILogicalOperator> tupSource)
- throws AsterixException {
- LogicalVariable var = context.newVar();
- AssignOperator a = new AssignOperator(var,
- new MutableObject<ILogicalExpression>(metaScopeExp
- .getVariableReferenceExpression(me.getVar())));
- a.getInputs().add(tupSource);
- return new Pair<ILogicalOperator, LogicalVariable>(a, var);
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitMetaVariableExpr(MetaVariableExpr me,
+ Mutable<ILogicalOperator> tupSource) throws AsterixException {
+ LogicalVariable var = context.newVar();
+ AssignOperator a = new AssignOperator(var, new MutableObject<ILogicalExpression>(
+ metaScopeExp.getVariableReferenceExpression(me.getVar())));
+ a.getInputs().add(tupSource);
+ return new Pair<ILogicalOperator, LogicalVariable>(a, var);
+ }
- public void addOperatorToMetaScope(Identifier id, ILogicalOperator op) {
- metaScopeOp.put(id, op);
- }
+ public void addOperatorToMetaScope(Identifier id, ILogicalOperator op) {
+ metaScopeOp.put(id, op);
+ }
- public void addVariableToMetaScope(Identifier id, LogicalVariable var) {
- metaScopeExp.put(id, var);
- }
+ public void addVariableToMetaScope(Identifier id, LogicalVariable var) {
+ metaScopeExp.put(id, var);
+ }
- private ILogicalExpression makeUnnestExpression(ILogicalExpression expr) {
- switch (expr.getExpressionTag()) {
- case VARIABLE: {
- return new UnnestingFunctionCallExpression(
- FunctionUtils
- .getFunctionInfo(AsterixBuiltinFunctions.SCAN_COLLECTION),
- new MutableObject<ILogicalExpression>(expr));
- }
- case FUNCTION_CALL: {
- AbstractFunctionCallExpression fce = (AbstractFunctionCallExpression) expr;
- if (fce.getKind() == FunctionKind.UNNEST) {
- return expr;
- } else {
- return new UnnestingFunctionCallExpression(
- FunctionUtils
- .getFunctionInfo(AsterixBuiltinFunctions.SCAN_COLLECTION),
- new MutableObject<ILogicalExpression>(expr));
- }
- }
- default: {
- return expr;
- }
- }
- }
+ private ILogicalExpression makeUnnestExpression(ILogicalExpression expr) {
+ switch (expr.getExpressionTag()) {
+ case VARIABLE: {
+ return new UnnestingFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.SCAN_COLLECTION),
+ new MutableObject<ILogicalExpression>(expr));
+ }
+ case FUNCTION_CALL: {
+ AbstractFunctionCallExpression fce = (AbstractFunctionCallExpression) expr;
+ if (fce.getKind() == FunctionKind.UNNEST) {
+ return expr;
+ } else {
+ return new UnnestingFunctionCallExpression(
+ FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.SCAN_COLLECTION),
+ new MutableObject<ILogicalExpression>(expr));
+ }
+ }
+ default: {
+ return expr;
+ }
+ }
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitInsertStatement(
- InsertStatement insert, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitInsertStatement(InsertStatement insert,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitDeleteStatement(
- DeleteStatement del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitDeleteStatement(DeleteStatement del,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitUpdateStatement(
- UpdateStatement update, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitUpdateStatement(UpdateStatement update,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitUpdateClause(
- UpdateClause del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitUpdateClause(UpdateClause del, Mutable<ILogicalOperator> arg)
+ throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitDataverseDecl(
- DataverseDecl dv, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitDataverseDecl(DataverseDecl dv, Mutable<ILogicalOperator> arg)
+ throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitDatasetDecl(
- DatasetDecl dd, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitDatasetDecl(DatasetDecl dd, Mutable<ILogicalOperator> arg)
+ throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitSetStatement(
- SetStatement ss, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitSetStatement(SetStatement ss, Mutable<ILogicalOperator> arg)
+ throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitWriteStatement(
- WriteStatement ws, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitWriteStatement(WriteStatement ws, Mutable<ILogicalOperator> arg)
+ throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitLoadFromQueryResultStatement(
- WriteFromQueryResultStatement stmtLoad,
- Mutable<ILogicalOperator> arg) throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitLoadFromQueryResultStatement(
+ WriteFromQueryResultStatement stmtLoad, Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitCreateDataverseStatement(
- CreateDataverseStatement del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitCreateDataverseStatement(CreateDataverseStatement del,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitIndexDropStatement(
- IndexDropStatement del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitIndexDropStatement(IndexDropStatement del,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitNodeGroupDropStatement(
- NodeGroupDropStatement del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitNodeGroupDropStatement(NodeGroupDropStatement del,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitDataverseDropStatement(
- DataverseDropStatement del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitDataverseDropStatement(DataverseDropStatement del,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitTypeDropStatement(
- TypeDropStatement del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitTypeDropStatement(TypeDropStatement del,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitControlFeedStatement(
- ControlFeedStatement del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitControlFeedStatement(ControlFeedStatement del,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visit(
- CreateFunctionStatement cfs, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visit(CreateFunctionStatement cfs, Mutable<ILogicalOperator> arg)
+ throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitFunctionDropStatement(
- FunctionDropStatement del, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitFunctionDropStatement(FunctionDropStatement del,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Pair<ILogicalOperator, LogicalVariable> visitBeginFeedStatement(
- BeginFeedStatement bf, Mutable<ILogicalOperator> arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Pair<ILogicalOperator, LogicalVariable> visitBeginFeedStatement(BeginFeedStatement bf,
+ Mutable<ILogicalOperator> arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
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
new file mode 100644
index 0000000..625fed1
--- /dev/null
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/CompiledStatements.java
@@ -0,0 +1,575 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.translator;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import edu.uci.ics.asterix.aql.base.Clause;
+import edu.uci.ics.asterix.aql.base.Expression;
+import edu.uci.ics.asterix.aql.base.Statement.Kind;
+import edu.uci.ics.asterix.aql.expression.CallExpr;
+import edu.uci.ics.asterix.aql.expression.ControlFeedStatement.OperationType;
+import edu.uci.ics.asterix.aql.expression.FLWOGRExpression;
+import edu.uci.ics.asterix.aql.expression.FieldAccessor;
+import edu.uci.ics.asterix.aql.expression.FieldBinding;
+import edu.uci.ics.asterix.aql.expression.ForClause;
+import edu.uci.ics.asterix.aql.expression.Identifier;
+import edu.uci.ics.asterix.aql.expression.LiteralExpr;
+import edu.uci.ics.asterix.aql.expression.Query;
+import edu.uci.ics.asterix.aql.expression.RecordConstructor;
+import edu.uci.ics.asterix.aql.expression.VariableExpr;
+import edu.uci.ics.asterix.aql.expression.WhereClause;
+import edu.uci.ics.asterix.aql.literal.StringLiteral;
+import edu.uci.ics.asterix.common.config.DatasetConfig.IndexType;
+import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
+import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
+import edu.uci.ics.asterix.metadata.entities.Dataset;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+
+/**
+ * An AQL statement instance is translated into an instance of type CompileX
+ * that has additional fields for use by the AqlTranslator.
+ */
+public class CompiledStatements {
+
+ public static interface ICompiledStatement {
+
+ public Kind getKind();
+ }
+
+ public static class CompiledWriteFromQueryResultStatement implements
+ ICompiledDmlStatement {
+
+ 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 String getDataverseName() {
+ return dataverseName;
+ }
+
+ public String getDatasetName() {
+ return datasetName;
+ }
+
+ public int getVarCounter() {
+ return varCounter;
+ }
+
+ public Query getQuery() {
+ return query;
+ }
+
+ @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 CompiledDatasetDropStatement(String dataverseName,
+ String datasetName) {
+ this.dataverseName = dataverseName;
+ this.datasetName = datasetName;
+ }
+
+ public String getDataverseName() {
+ return dataverseName;
+ }
+
+ public String getDatasetName() {
+ return datasetName;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.DATASET_DROP;
+ }
+ }
+
+ // 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 String getDataverseName() {
+ return dataverseName;
+ }
+
+ public String getFormat() {
+ return format;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.CREATE_DATAVERSE;
+ }
+ }
+
+ public static class CompiledNodeGroupDropStatement implements
+ ICompiledStatement {
+ private String nodeGroupName;
+
+ public CompiledNodeGroupDropStatement(String nodeGroupName) {
+ this.nodeGroupName = nodeGroupName;
+ }
+
+ public String getNodeGroupName() {
+ return nodeGroupName;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.NODEGROUP_DROP;
+ }
+ }
+
+ 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 String getDataverseName() {
+ return dataverseName;
+ }
+
+ public String getDatasetName() {
+ return datasetName;
+ }
+
+ public String getIndexName() {
+ return indexName;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.INDEX_DROP;
+ }
+ }
+
+ 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 String getDataverseName() {
+ return dataverseName;
+ }
+
+ public boolean getIfExists() {
+ return ifExists;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.DATAVERSE_DROP;
+ }
+ }
+
+ public static class CompiledTypeDropStatement implements ICompiledStatement {
+ private String typeName;
+
+ public CompiledTypeDropStatement(String nodeGroupName) {
+ this.typeName = nodeGroupName;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.TYPE_DROP;
+ }
+ }
+
+ public static interface ICompiledDmlStatement extends ICompiledStatement {
+
+ public String getDataverseName();
+
+ 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;
+
+ // 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 String getDatasetName() {
+ return datasetName;
+ }
+
+ public String getDataverseName() {
+ return dataverseName;
+ }
+
+ public String getIndexName() {
+ return indexName;
+ }
+
+ public List<String> getKeyFields() {
+ return keyFields;
+ }
+
+ public IndexType getIndexType() {
+ return indexType;
+ }
+
+ public int getGramLength() {
+ return gramLength;
+ }
+
+ @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 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 boolean alreadySorted() {
+ return alreadySorted;
+ }
+
+ public String getAdapter() {
+ return adapter;
+ }
+
+ public Map<String, String> getProperties() {
+ return properties;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.LOAD_FROM_FILE;
+ }
+ }
+
+ public static class CompiledInsertStatement implements
+ ICompiledDmlStatement {
+ private final String dataverseName;
+ private final String datasetName;
+ private final Query query;
+ private final int varCounter;
+
+ public CompiledInsertStatement(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 getDatasetName() {
+ return datasetName;
+ }
+
+ public int getVarCounter() {
+ return varCounter;
+ }
+
+ public Query getQuery() {
+ return query;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.INSERT;
+ }
+ }
+
+ public static class CompiledBeginFeedStatement implements
+ ICompiledDmlStatement {
+ private String dataverseName;
+ private String datasetName;
+ private Query query;
+ private int varCounter;
+
+ 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 getDataverseName() {
+ return dataverseName;
+ }
+
+ @Override
+ public String getDatasetName() {
+ return datasetName;
+ }
+
+ public int getVarCounter() {
+ return varCounter;
+ }
+
+ public Query getQuery() {
+ return query;
+ }
+
+ public void setQuery(Query query) {
+ this.query = query;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.BEGIN_FEED;
+ }
+ }
+
+ 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;
+
+ 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 getDataverseName() {
+ return dataverseName;
+ }
+
+ @Override
+ public String getDatasetName() {
+ return datasetName;
+ }
+
+ public OperationType getOperationType() {
+ return operationType;
+ }
+
+ public int getVarCounter() {
+ return varCounter;
+ }
+
+ public Query getQuery() {
+ return query;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.CONTROL_FEED;
+ }
+
+ public Map<String, String> getProperties() {
+ return alteredParams;
+ }
+
+ public void setProperties(Map<String, String> properties) {
+ this.alteredParams = properties;
+ }
+ }
+
+ 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 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;
+ }
+
+ @Override
+ public String getDatasetName() {
+ return datasetName;
+ }
+
+ @Override
+ public String getDataverseName() {
+ return dataverseName;
+ }
+
+ public int getVarCounter() {
+ return varCounter;
+ }
+
+ public Expression getCondition() {
+ return condition;
+ }
+
+ public Clause getDieClause() {
+ return dieClause;
+ }
+
+ 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);
+
+ 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);
+ }
+
+ 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;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.DELETE;
+ }
+
+ }
+
+}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/DmlTranslator.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/DmlTranslator.java
deleted file mode 100644
index c8b1079..0000000
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/DmlTranslator.java
+++ /dev/null
@@ -1,492 +0,0 @@
-package edu.uci.ics.asterix.translator;
-
-import java.rmi.RemoteException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-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.base.Statement.Kind;
-import edu.uci.ics.asterix.aql.expression.BeginFeedStatement;
-import edu.uci.ics.asterix.aql.expression.CallExpr;
-import edu.uci.ics.asterix.aql.expression.ControlFeedStatement;
-import edu.uci.ics.asterix.aql.expression.ControlFeedStatement.OperationType;
-import edu.uci.ics.asterix.aql.expression.CreateIndexStatement;
-import edu.uci.ics.asterix.aql.expression.DeleteStatement;
-import edu.uci.ics.asterix.aql.expression.FLWOGRExpression;
-import edu.uci.ics.asterix.aql.expression.FieldAccessor;
-import edu.uci.ics.asterix.aql.expression.FieldBinding;
-import edu.uci.ics.asterix.aql.expression.ForClause;
-import edu.uci.ics.asterix.aql.expression.Identifier;
-import edu.uci.ics.asterix.aql.expression.InsertStatement;
-import edu.uci.ics.asterix.aql.expression.LiteralExpr;
-import edu.uci.ics.asterix.aql.expression.LoadFromFileStatement;
-import edu.uci.ics.asterix.aql.expression.Query;
-import edu.uci.ics.asterix.aql.expression.RecordConstructor;
-import edu.uci.ics.asterix.aql.expression.VariableExpr;
-import edu.uci.ics.asterix.aql.expression.WhereClause;
-import edu.uci.ics.asterix.aql.expression.WriteFromQueryResultStatement;
-import edu.uci.ics.asterix.aql.literal.StringLiteral;
-import edu.uci.ics.asterix.common.config.DatasetConfig.DatasetType;
-import edu.uci.ics.asterix.common.config.DatasetConfig.IndexType;
-import edu.uci.ics.asterix.metadata.IDatasetDetails;
-import edu.uci.ics.asterix.metadata.MetadataException;
-import edu.uci.ics.asterix.metadata.MetadataManager;
-import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
-import edu.uci.ics.asterix.metadata.entities.Dataset;
-import edu.uci.ics.asterix.metadata.entities.FeedDatasetDetails;
-import edu.uci.ics.asterix.metadata.entities.Index;
-import edu.uci.ics.asterix.om.functions.AsterixFunction;
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.transaction.management.exception.ACIDException;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-
-public class DmlTranslator extends AbstractAqlTranslator {
-
- private final MetadataTransactionContext mdTxnCtx;
- private final List<Statement> aqlStatements;
- private AqlCompiledMetadataDeclarations compiledDeclarations;
- private List<ICompiledDmlStatement> compiledDmlStatements;
-
- public DmlTranslator(MetadataTransactionContext mdTxnCtx, List<Statement> aqlStatements) {
- this.mdTxnCtx = mdTxnCtx;
- this.aqlStatements = aqlStatements;
- }
-
- public void translate() throws AlgebricksException, RemoteException, ACIDException, MetadataException {
- compiledDeclarations = compileMetadata(mdTxnCtx, aqlStatements, true);
- compiledDmlStatements = compileDmlStatements();
- }
-
- public AqlCompiledMetadataDeclarations getCompiledDeclarations() {
- return compiledDeclarations;
- }
-
- public List<ICompiledDmlStatement> getCompiledDmlStatements() {
- return compiledDmlStatements;
- }
-
- private List<ICompiledDmlStatement> compileDmlStatements() throws AlgebricksException, MetadataException {
- List<ICompiledDmlStatement> dmlStatements = new ArrayList<ICompiledDmlStatement>();
- for (Statement stmt : aqlStatements) {
- validateOperation(compiledDeclarations, stmt);
- switch (stmt.getKind()) {
- case LOAD_FROM_FILE: {
- LoadFromFileStatement loadStmt = (LoadFromFileStatement) stmt;
- CompiledLoadFromFileStatement cls = new CompiledLoadFromFileStatement(loadStmt.getDatasetName()
- .getValue(), loadStmt.getAdapter(), loadStmt.getProperties(),
- loadStmt.dataIsAlreadySorted());
- dmlStatements.add(cls);
- // Also load the dataset's secondary indexes.
- List<Index> datasetIndexes = MetadataManager.INSTANCE.getDatasetIndexes(mdTxnCtx,
- compiledDeclarations.getDataverseName(), loadStmt.getDatasetName().getValue());
- for (Index index : datasetIndexes) {
- if (!index.isSecondaryIndex()) {
- continue;
- }
- // Create CompiledCreateIndexStatement from metadata entity 'index'.
- CompiledCreateIndexStatement cis = new CompiledCreateIndexStatement(index.getIndexName(),
- index.getDatasetName(), index.getKeyFieldNames(), index.getGramLength(),
- index.getIndexType());
- dmlStatements.add(cis);
- }
- break;
- }
- case WRITE_FROM_QUERY_RESULT: {
- WriteFromQueryResultStatement st1 = (WriteFromQueryResultStatement) stmt;
- CompiledWriteFromQueryResultStatement clfrqs = new CompiledWriteFromQueryResultStatement(st1
- .getDatasetName().getValue(), st1.getQuery(), st1.getVarCounter());
- dmlStatements.add(clfrqs);
- break;
- }
- case CREATE_INDEX: {
- CreateIndexStatement cis = (CreateIndexStatement) stmt;
- // Assumptions: We first processed the DDL, which added the secondary index to the metadata.
- // If the index's dataset is being loaded in this 'session', then let the load add
- // the CompiledCreateIndexStatement to dmlStatements, and don't add it again here.
- // It's better to have the load handle this because:
- // 1. There may be more secondary indexes to load, which were possibly created in an earlier session.
- // 2. If the create index stmt came before the load stmt, then we would first create an empty index only to load it again later.
- // This may cause problems because the index would be considered loaded (even though it was loaded empty).
- for (Statement s : aqlStatements) {
- if (s.getKind() != Kind.LOAD_FROM_FILE) {
- continue;
- }
- LoadFromFileStatement loadStmt = (LoadFromFileStatement) s;
- if (loadStmt.getDatasetName().equals(cis.getDatasetName())) {
- cis.setNeedToCreate(false);
- }
- }
- if (cis.getNeedToCreate()) {
- CompiledCreateIndexStatement ccis = new CompiledCreateIndexStatement(cis.getIndexName()
- .getValue(), cis.getDatasetName().getValue(), cis.getFieldExprs(), cis.getGramLength(),
- cis.getIndexType());
- dmlStatements.add(ccis);
- }
- break;
- }
- case INSERT: {
- InsertStatement is = (InsertStatement) stmt;
- CompiledInsertStatement clfrqs = new CompiledInsertStatement(is.getDatasetName().getValue(),
- is.getQuery(), is.getVarCounter());
- dmlStatements.add(clfrqs);
- break;
- }
- case DELETE: {
- DeleteStatement ds = (DeleteStatement) stmt;
- CompiledDeleteStatement clfrqs = new CompiledDeleteStatement(ds.getVariableExpr(),
- ds.getDatasetName(), ds.getCondition(), ds.getDieClause(), ds.getVarCounter(),
- compiledDeclarations);
- dmlStatements.add(clfrqs);
- break;
- }
-
- case BEGIN_FEED: {
- BeginFeedStatement bfs = (BeginFeedStatement) stmt;
- CompiledBeginFeedStatement cbfs = new CompiledBeginFeedStatement(bfs.getDatasetName(),
- bfs.getQuery(), bfs.getVarCounter());
- dmlStatements.add(cbfs);
- Dataset dataset;
- try {
- dataset = MetadataManager.INSTANCE.getDataset(mdTxnCtx,
- compiledDeclarations.getDataverseName(), bfs.getDatasetName().getValue());
- } catch (MetadataException me) {
- throw new AlgebricksException(me);
- }
- IDatasetDetails datasetDetails = dataset.getDatasetDetails();
- if (datasetDetails.getDatasetType() != DatasetType.FEED) {
- throw new IllegalArgumentException("Dataset " + bfs.getDatasetName().getValue()
- + " is not a feed dataset");
- }
- bfs.initialize((FeedDatasetDetails) datasetDetails);
- cbfs.setQuery(bfs.getQuery());
- break;
- }
-
- case CONTROL_FEED: {
- ControlFeedStatement cfs = (ControlFeedStatement) stmt;
- CompiledControlFeedStatement clcfs = new CompiledControlFeedStatement(cfs.getOperationType(),
- cfs.getDatasetName(), cfs.getAlterAdapterConfParams());
- dmlStatements.add(clcfs);
- break;
-
- }
- }
- }
- return dmlStatements;
- }
-
- public static interface ICompiledDmlStatement {
-
- public abstract Kind getKind();
- }
-
- public static class CompiledCreateIndexStatement implements ICompiledDmlStatement {
- private final String indexName;
- private final String datasetName;
- private final List<String> keyFields;
- private final IndexType indexType;
-
- // Specific to NGram index.
- private final int gramLength;
-
- public CompiledCreateIndexStatement(String indexName, String datasetName, List<String> keyFields,
- int gramLength, IndexType indexType) {
- this.indexName = indexName;
- this.datasetName = datasetName;
- this.keyFields = keyFields;
- this.gramLength = gramLength;
- this.indexType = indexType;
- }
-
- public String getDatasetName() {
- return datasetName;
- }
-
- public String getIndexName() {
- return indexName;
- }
-
- public List<String> getKeyFields() {
- return keyFields;
- }
-
- public IndexType getIndexType() {
- return indexType;
- }
-
- public int getGramLength() {
- return gramLength;
- }
-
- @Override
- public Kind getKind() {
- return Kind.CREATE_INDEX;
- }
- }
-
- public static class CompiledLoadFromFileStatement implements ICompiledDmlStatement {
- private String datasetName;
- private boolean alreadySorted;
- private String adapter;
- private Map<String, String> properties;
-
- public CompiledLoadFromFileStatement(String datasetName, String adapter, Map<String, String> properties,
- boolean alreadySorted) {
- this.datasetName = datasetName;
- this.alreadySorted = alreadySorted;
- this.adapter = adapter;
- this.properties = properties;
- }
-
- public String getDatasetName() {
- return datasetName;
- }
-
- public boolean alreadySorted() {
- return alreadySorted;
- }
-
- public String getAdapter() {
- return adapter;
- }
-
- public Map<String, String> getProperties() {
- return properties;
- }
-
- @Override
- public Kind getKind() {
- return Kind.LOAD_FROM_FILE;
- }
- }
-
- public static class CompiledWriteFromQueryResultStatement implements ICompiledDmlStatement {
-
- private String datasetName;
- private Query query;
- private int varCounter;
-
- public CompiledWriteFromQueryResultStatement(String datasetName, Query query, int varCounter) {
- this.datasetName = datasetName;
- this.query = query;
- this.varCounter = varCounter;
- }
-
- public String getDatasetName() {
- return datasetName;
- }
-
- public int getVarCounter() {
- return varCounter;
- }
-
- public Query getQuery() {
- return query;
- }
-
- @Override
- public Kind getKind() {
- return Kind.WRITE_FROM_QUERY_RESULT;
- }
-
- }
-
- public static class CompiledInsertStatement implements ICompiledDmlStatement {
- private String datasetName;
- private Query query;
- private int varCounter;
-
- public CompiledInsertStatement(String datasetName, Query query, int varCounter) {
- this.datasetName = datasetName;
- this.query = query;
- this.varCounter = varCounter;
- }
-
- public String getDatasetName() {
- return datasetName;
- }
-
- public int getVarCounter() {
- return varCounter;
- }
-
- public Query getQuery() {
- return query;
- }
-
- @Override
- public Kind getKind() {
- return Kind.INSERT;
- }
- }
-
- public static class CompiledBeginFeedStatement implements ICompiledDmlStatement {
- private Identifier datasetName;
- private Query query;
- private int varCounter;
-
- public CompiledBeginFeedStatement(Identifier datasetName, Query query, int varCounter) {
- this.datasetName = datasetName;
- this.query = query;
- this.varCounter = varCounter;
- }
-
- public Identifier getDatasetName() {
- return datasetName;
- }
-
- public int getVarCounter() {
- return varCounter;
- }
-
- public Query getQuery() {
- return query;
- }
-
- public void setQuery(Query query) {
- this.query = query;
- }
-
- @Override
- public Kind getKind() {
- return Kind.BEGIN_FEED;
- }
- }
-
- public static class CompiledControlFeedStatement implements ICompiledDmlStatement {
- private Identifier datasetName;
- private OperationType operationType;
- private Query query;
- private int varCounter;
- private Map<String, String> alteredParams;
-
- public CompiledControlFeedStatement(OperationType operationType, Identifier datasetName,
- Map<String, String> alteredParams) {
- this.datasetName = datasetName;
- this.operationType = operationType;
- this.alteredParams = alteredParams;
- }
-
- public Identifier getDatasetName() {
- return datasetName;
- }
-
- public OperationType getOperationType() {
- return operationType;
- }
-
- public int getVarCounter() {
- return varCounter;
- }
-
- public Query getQuery() {
- return query;
- }
-
- @Override
- public Kind getKind() {
- return Kind.CONTROL_FEED;
- }
-
- public Map<String, String> getProperties() {
- return alteredParams;
- }
-
- public void setProperties(Map<String, String> properties) {
- this.alteredParams = properties;
- }
- }
-
- public static class CompiledDeleteStatement implements ICompiledDmlStatement {
- private VariableExpr var;
- private Identifier dataset;
- private Expression condition;
- private Clause dieClause;
- private int varCounter;
- private AqlCompiledMetadataDeclarations compiledDeclarations;
-
- public CompiledDeleteStatement(VariableExpr var, Identifier dataset, Expression condition, Clause dieClause,
- int varCounter, AqlCompiledMetadataDeclarations compiledDeclarations) {
- this.var = var;
- this.dataset = dataset;
- this.condition = condition;
- this.dieClause = dieClause;
- this.varCounter = varCounter;
- this.compiledDeclarations = compiledDeclarations;
- }
-
- public Identifier getDataset() {
- return dataset;
- }
-
- public String getDatasetName() {
- return dataset.getValue();
- }
-
- public int getVarCounter() {
- return varCounter;
- }
-
- public Expression getCondition() {
- return condition;
- }
-
- public Clause getDieClause() {
- return dieClause;
- }
-
- public Query getQuery() throws AlgebricksException {
- String datasetName = dataset.getValue();
-
- List<Expression> arguments = new ArrayList<Expression>();
- LiteralExpr argumentLiteral = new LiteralExpr(new StringLiteral(datasetName));
- arguments.add(argumentLiteral);
-
- CallExpr callExpression = new CallExpr(new AsterixFunction("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);
- }
-
- Dataset dataset = compiledDeclarations.findDataset(datasetName);
- if (dataset == null) {
- throw new AlgebricksException("Unknown dataset " + datasetName);
- }
- String itemTypeName = dataset.getItemTypeName();
- IAType itemType = compiledDeclarations.findType(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;
- }
-
- @Override
- public Kind getKind() {
- return Kind.DELETE;
- }
-
- }
-
-}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/MetadataDeclTranslator.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/MetadataDeclTranslator.java
deleted file mode 100644
index 77b8a04..0000000
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/MetadataDeclTranslator.java
+++ /dev/null
@@ -1,366 +0,0 @@
-package edu.uci.ics.asterix.translator;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import edu.uci.ics.asterix.aql.expression.OrderedListTypeDefinition;
-import edu.uci.ics.asterix.aql.expression.RecordTypeDefinition;
-import edu.uci.ics.asterix.aql.expression.RecordTypeDefinition.RecordKind;
-import edu.uci.ics.asterix.aql.expression.TypeDecl;
-import edu.uci.ics.asterix.aql.expression.TypeExpression;
-import edu.uci.ics.asterix.aql.expression.TypeReferenceExpression;
-import edu.uci.ics.asterix.aql.expression.UnorderedListTypeDefinition;
-import edu.uci.ics.asterix.common.annotations.IRecordFieldDataGen;
-import edu.uci.ics.asterix.common.annotations.RecordDataGenAnnotation;
-import edu.uci.ics.asterix.common.annotations.TypeDataGen;
-import edu.uci.ics.asterix.metadata.MetadataException;
-import edu.uci.ics.asterix.metadata.MetadataManager;
-import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
-import edu.uci.ics.asterix.metadata.bootstrap.AsterixProperties;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
-import edu.uci.ics.asterix.metadata.entities.AsterixBuiltinTypeMap;
-import edu.uci.ics.asterix.metadata.entities.Datatype;
-import edu.uci.ics.asterix.om.types.AOrderedListType;
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.AUnionType;
-import edu.uci.ics.asterix.om.types.AUnorderedListType;
-import edu.uci.ics.asterix.om.types.AbstractCollectionType;
-import edu.uci.ics.asterix.om.types.BuiltinType;
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.data.IAWriterFactory;
-import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
-
-public final class MetadataDeclTranslator {
- private final MetadataTransactionContext mdTxnCtx;
- private final String dataverseName;
- private final List<TypeDecl> typeDeclarations;
- private final FileSplit outputFile;
- private final Map<String, String> config;
- private final IAWriterFactory writerFactory;
-
- public MetadataDeclTranslator(MetadataTransactionContext mdTxnCtx, String dataverseName, FileSplit outputFile,
- IAWriterFactory writerFactory, Map<String, String> config, List<TypeDecl> typeDeclarations) {
- this.mdTxnCtx = mdTxnCtx;
- this.dataverseName = dataverseName;
- this.outputFile = outputFile;
- this.writerFactory = writerFactory;
- this.config = config;
- this.typeDeclarations = typeDeclarations;
- }
-
- // TODO: Should this not throw an AsterixException?
- public AqlCompiledMetadataDeclarations computeMetadataDeclarations(boolean online) throws AlgebricksException,
- MetadataException {
- Map<String, TypeDataGen> typeDataGenMap = new HashMap<String, TypeDataGen>();
- for (TypeDecl td : typeDeclarations) {
- TypeDataGen tdg = td.getDatagenAnnotation();
- if (tdg != null) {
- typeDataGenMap.put(td.getIdent().getValue(), tdg);
- }
- }
- Map<String, IAType> typeMap = computeTypes();
- Map<String, String[]> stores = AsterixProperties.INSTANCE.getStores();
- return new AqlCompiledMetadataDeclarations(mdTxnCtx, dataverseName, outputFile, config, stores, typeMap,
- typeDataGenMap, writerFactory, online);
- }
-
- private Map<String, IAType> computeTypes() throws AlgebricksException, MetadataException {
- Map<String, IAType> typeMap = new HashMap<String, IAType>();
- Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes = new HashMap<String, Map<ARecordType, List<Integer>>>();
- Map<String, List<AbstractCollectionType>> incompleteItemTypes = new HashMap<String, List<AbstractCollectionType>>();
- Map<String, List<String>> incompleteTopLevelTypeReferences = new HashMap<String, List<String>>();
-
- firstPass(typeMap, incompleteFieldTypes, incompleteItemTypes, incompleteTopLevelTypeReferences);
- secondPass(typeMap, incompleteFieldTypes, incompleteItemTypes, incompleteTopLevelTypeReferences);
- return typeMap;
- }
-
- private void secondPass(Map<String, IAType> typeMap,
- Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes,
- Map<String, List<AbstractCollectionType>> incompleteItemTypes,
- Map<String, List<String>> incompleteTopLevelTypeReferences) throws AlgebricksException, MetadataException {
- // solve remaining top level references
- for (String trefName : incompleteTopLevelTypeReferences.keySet()) {
- IAType t = typeMap.get(trefName);
- if (t == null) {
- throw new AlgebricksException("Could not resolve type " + trefName);
- }
- for (String tname : incompleteTopLevelTypeReferences.get(trefName)) {
- typeMap.put(tname, t);
- }
- }
- // solve remaining field type references
- for (String trefName : incompleteFieldTypes.keySet()) {
- IAType t = typeMap.get(trefName);
- if (t == null) {
- // Try to get type from the metadata manager.
- Datatype metadataDataType = MetadataManager.INSTANCE.getDatatype(mdTxnCtx, dataverseName, trefName);
- if (metadataDataType == null) {
- throw new AlgebricksException("Could not resolve type " + trefName);
- }
- t = metadataDataType.getDatatype();
- typeMap.put(trefName, t);
- }
- Map<ARecordType, List<Integer>> fieldsToFix = incompleteFieldTypes.get(trefName);
- for (ARecordType recType : fieldsToFix.keySet()) {
- List<Integer> positions = fieldsToFix.get(recType);
- IAType[] fldTypes = recType.getFieldTypes();
- for (Integer pos : positions) {
- if (fldTypes[pos] == null) {
- fldTypes[pos] = t;
- } else { // nullable
- AUnionType nullableUnion = (AUnionType) fldTypes[pos];
- nullableUnion.setTypeAtIndex(t, 1);
- }
- }
- }
- }
- // solve remaining item type references
- for (String trefName : incompleteItemTypes.keySet()) {
- IAType t = typeMap.get(trefName);
- if (t == null) {
- throw new AlgebricksException("Could not resolve type " + trefName);
- }
- for (AbstractCollectionType act : incompleteItemTypes.get(trefName)) {
- act.setItemType(t);
- }
- }
- }
-
- private void firstPass(Map<String, IAType> typeMap,
- Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes,
- Map<String, List<AbstractCollectionType>> incompleteItemTypes,
- Map<String, List<String>> incompleteTopLevelTypeReferences) throws AlgebricksException {
- for (TypeDecl td : typeDeclarations) {
- TypeExpression texpr = td.getTypeDef();
- String tdname = td.getIdent().getValue();
- if (AsterixBuiltinTypeMap.getBuiltinTypes().get(tdname) != null) {
- throw new AlgebricksException("Cannot redefine builtin type " + tdname + " .");
- }
- switch (texpr.getTypeKind()) {
- case TYPEREFERENCE: {
- TypeReferenceExpression tre = (TypeReferenceExpression) texpr;
- IAType t = solveTypeReference(tre, typeMap);
- if (t != null) {
- typeMap.put(tdname, t);
- } else {
- addIncompleteTopLevelTypeReference(tdname, tre, incompleteTopLevelTypeReferences);
- }
- break;
- }
- case RECORD: {
- RecordTypeDefinition rtd = (RecordTypeDefinition) texpr;
- ARecordType recType = computeRecordType(tdname, rtd, typeMap, incompleteFieldTypes,
- incompleteItemTypes);
- typeMap.put(tdname, recType);
- break;
- }
- case ORDEREDLIST: {
- OrderedListTypeDefinition oltd = (OrderedListTypeDefinition) texpr;
- AOrderedListType olType = computeOrderedListType(tdname, oltd, typeMap, incompleteItemTypes,
- incompleteFieldTypes);
- typeMap.put(tdname, olType);
- break;
- }
- case UNORDEREDLIST: {
- UnorderedListTypeDefinition ultd = (UnorderedListTypeDefinition) texpr;
- AUnorderedListType ulType = computeUnorderedListType(tdname, ultd, typeMap, incompleteItemTypes,
- incompleteFieldTypes);
- typeMap.put(tdname, ulType);
- break;
- }
- default: {
- throw new IllegalStateException();
- }
- }
- }
- }
-
- private AOrderedListType computeOrderedListType(String typeName, OrderedListTypeDefinition oltd,
- Map<String, IAType> typeMap, Map<String, List<AbstractCollectionType>> incompleteItemTypes,
- Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes) {
- TypeExpression tExpr = oltd.getItemTypeExpression();
- AOrderedListType aolt = new AOrderedListType(null, typeName);
- setCollectionItemType(tExpr, typeMap, incompleteItemTypes, incompleteFieldTypes, aolt);
- return aolt;
- }
-
- private AUnorderedListType computeUnorderedListType(String typeName, UnorderedListTypeDefinition ultd,
- Map<String, IAType> typeMap, Map<String, List<AbstractCollectionType>> incompleteItemTypes,
- Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes) {
- TypeExpression tExpr = ultd.getItemTypeExpression();
- AUnorderedListType ault = new AUnorderedListType(null, typeName);
- setCollectionItemType(tExpr, typeMap, incompleteItemTypes, incompleteFieldTypes, ault);
- return ault;
- }
-
- private void setCollectionItemType(TypeExpression tExpr, Map<String, IAType> typeMap,
- Map<String, List<AbstractCollectionType>> incompleteItemTypes,
- Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes, AbstractCollectionType act) {
- switch (tExpr.getTypeKind()) {
- case ORDEREDLIST: {
- OrderedListTypeDefinition oltd = (OrderedListTypeDefinition) tExpr;
- IAType t = computeOrderedListType(null, oltd, typeMap, incompleteItemTypes, incompleteFieldTypes);
- act.setItemType(t);
- break;
- }
- case UNORDEREDLIST: {
- UnorderedListTypeDefinition ultd = (UnorderedListTypeDefinition) tExpr;
- IAType t = computeUnorderedListType(null, ultd, typeMap, incompleteItemTypes, incompleteFieldTypes);
- act.setItemType(t);
- break;
- }
- case RECORD: {
- RecordTypeDefinition rtd = (RecordTypeDefinition) tExpr;
- IAType t = computeRecordType(null, rtd, typeMap, incompleteFieldTypes, incompleteItemTypes);
- act.setItemType(t);
- break;
- }
- case TYPEREFERENCE: {
- TypeReferenceExpression tre = (TypeReferenceExpression) tExpr;
- IAType tref = solveTypeReference(tre, typeMap);
- if (tref != null) {
- act.setItemType(tref);
- } else {
- addIncompleteCollectionTypeReference(act, tre, incompleteItemTypes);
- }
- break;
- }
- default: {
- throw new IllegalStateException();
- }
- }
- }
-
- private ARecordType computeRecordType(String typeName, RecordTypeDefinition rtd, Map<String, IAType> typeMap,
- Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes,
- Map<String, List<AbstractCollectionType>> incompleteItemTypes) {
- List<String> names = rtd.getFieldNames();
- int n = names.size();
- String[] fldNames = new String[n];
- IAType[] fldTypes = new IAType[n];
- int i = 0;
- for (String s : names) {
- fldNames[i++] = s;
- }
- boolean isOpen = rtd.getRecordKind() == RecordKind.OPEN;
- ARecordType recType = new ARecordType(typeName, fldNames, fldTypes, isOpen);
-
- List<IRecordFieldDataGen> fieldDataGen = rtd.getFieldDataGen();
- if (fieldDataGen.size() == n) {
- IRecordFieldDataGen[] rfdg = new IRecordFieldDataGen[n];
- rfdg = fieldDataGen.toArray(rfdg);
- recType.getAnnotations().add(new RecordDataGenAnnotation(rfdg, rtd.getUndeclaredFieldsDataGen()));
- }
-
- for (int j = 0; j < n; j++) {
- TypeExpression texpr = rtd.getFieldTypes().get(j);
- switch (texpr.getTypeKind()) {
- case TYPEREFERENCE: {
- TypeReferenceExpression tre = (TypeReferenceExpression) texpr;
- IAType tref = solveTypeReference(tre, typeMap);
- if (tref != null) {
- if (!rtd.getNullableFields().get(j)) { // not nullable
- fldTypes[j] = tref;
- } else { // nullable
- fldTypes[j] = makeUnionWithNull(null, tref);
- }
- } else {
- addIncompleteFieldTypeReference(recType, j, tre, incompleteFieldTypes);
- if (rtd.getNullableFields().get(j)) {
- fldTypes[j] = makeUnionWithNull(null, null);
- }
- }
- break;
- }
- case RECORD: {
- RecordTypeDefinition recTypeDef2 = (RecordTypeDefinition) texpr;
- IAType t2 = computeRecordType(null, recTypeDef2, typeMap, incompleteFieldTypes, incompleteItemTypes);
- if (!rtd.getNullableFields().get(j)) { // not nullable
- fldTypes[j] = t2;
- } else { // nullable
- fldTypes[j] = makeUnionWithNull(null, t2);
- }
- break;
- }
- case ORDEREDLIST: {
- OrderedListTypeDefinition oltd = (OrderedListTypeDefinition) texpr;
- IAType t2 = computeOrderedListType(null, oltd, typeMap, incompleteItemTypes, incompleteFieldTypes);
- fldTypes[j] = (rtd.getNullableFields().get(j)) ? makeUnionWithNull(null, t2) : t2;
- break;
- }
- case UNORDEREDLIST: {
- UnorderedListTypeDefinition ultd = (UnorderedListTypeDefinition) texpr;
- IAType t2 = computeUnorderedListType(null, ultd, typeMap, incompleteItemTypes, incompleteFieldTypes);
- fldTypes[j] = (rtd.getNullableFields().get(j)) ? makeUnionWithNull(null, t2) : t2;
- break;
- }
- default: {
- throw new IllegalStateException();
- }
- }
-
- }
-
- return recType;
- }
-
- private AUnionType makeUnionWithNull(String unionTypeName, IAType type) {
- ArrayList<IAType> unionList = new ArrayList<IAType>(2);
- unionList.add(BuiltinType.ANULL);
- unionList.add(type);
- return new AUnionType(unionList, unionTypeName);
- }
-
- private void addIncompleteCollectionTypeReference(AbstractCollectionType collType, TypeReferenceExpression tre,
- Map<String, List<AbstractCollectionType>> incompleteItemTypes) {
- String typeName = tre.getIdent().getValue();
- List<AbstractCollectionType> typeList = incompleteItemTypes.get(typeName);
- if (typeList == null) {
- typeList = new LinkedList<AbstractCollectionType>();
- incompleteItemTypes.put(typeName, typeList);
- }
- typeList.add(collType);
- }
-
- private void addIncompleteFieldTypeReference(ARecordType recType, int fldPosition, TypeReferenceExpression tre,
- Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes) {
- String typeName = tre.getIdent().getValue();
- Map<ARecordType, List<Integer>> refMap = incompleteFieldTypes.get(typeName);
- if (refMap == null) {
- refMap = new HashMap<ARecordType, List<Integer>>();
- incompleteFieldTypes.put(typeName, refMap);
- }
- List<Integer> typeList = refMap.get(recType);
- if (typeList == null) {
- typeList = new ArrayList<Integer>();
- refMap.put(recType, typeList);
- }
- typeList.add(fldPosition);
- }
-
- private void addIncompleteTopLevelTypeReference(String tdeclName, TypeReferenceExpression tre,
- Map<String, List<String>> incompleteTopLevelTypeReferences) {
- String name = tre.getIdent().getValue();
- List<String> refList = incompleteTopLevelTypeReferences.get(name);
- if (refList == null) {
- refList = new LinkedList<String>();
- incompleteTopLevelTypeReferences.put(name, refList);
- }
- refList.add(tdeclName);
- }
-
- private IAType solveTypeReference(TypeReferenceExpression tre, Map<String, IAType> typeMap) {
- String name = tre.getIdent().getValue();
- IAType builtin = AsterixBuiltinTypeMap.getBuiltinTypes().get(name);
- if (builtin != null) {
- return builtin;
- } else {
- return typeMap.get(name);
- }
- }
-}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/TypeTranslator.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/TypeTranslator.java
new file mode 100644
index 0000000..4047d9a
--- /dev/null
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/TypeTranslator.java
@@ -0,0 +1,391 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.translator;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import edu.uci.ics.asterix.aql.expression.OrderedListTypeDefinition;
+import edu.uci.ics.asterix.aql.expression.RecordTypeDefinition;
+import edu.uci.ics.asterix.aql.expression.RecordTypeDefinition.RecordKind;
+import edu.uci.ics.asterix.aql.expression.TypeDecl;
+import edu.uci.ics.asterix.aql.expression.TypeExpression;
+import edu.uci.ics.asterix.aql.expression.TypeReferenceExpression;
+import edu.uci.ics.asterix.aql.expression.UnorderedListTypeDefinition;
+import edu.uci.ics.asterix.common.annotations.IRecordFieldDataGen;
+import edu.uci.ics.asterix.common.annotations.RecordDataGenAnnotation;
+import edu.uci.ics.asterix.metadata.MetadataException;
+import edu.uci.ics.asterix.metadata.MetadataManager;
+import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
+import edu.uci.ics.asterix.metadata.entities.AsterixBuiltinTypeMap;
+import edu.uci.ics.asterix.metadata.entities.Datatype;
+import edu.uci.ics.asterix.om.types.AOrderedListType;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.AUnionType;
+import edu.uci.ics.asterix.om.types.AUnorderedListType;
+import edu.uci.ics.asterix.om.types.AbstractCollectionType;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.types.TypeSignature;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+
+public class TypeTranslator {
+
+ public static Map<TypeSignature, IAType> computeTypes(MetadataTransactionContext mdTxnCtx, TypeDecl tDec,
+ String defaultDataverse) throws AlgebricksException, MetadataException {
+ Map<TypeSignature, IAType> typeMap = new HashMap<TypeSignature, IAType>();
+ Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes = new HashMap<String, Map<ARecordType, List<Integer>>>();
+ Map<TypeSignature, List<AbstractCollectionType>> incompleteItemTypes = new HashMap<TypeSignature, List<AbstractCollectionType>>();
+ Map<TypeSignature, List<TypeSignature>> incompleteTopLevelTypeReferences = new HashMap<TypeSignature, List<TypeSignature>>();
+ String typeDataverse = tDec.getDataverseName() == null ? defaultDataverse : tDec.getDataverseName().getValue();
+ firstPass(tDec, typeMap, incompleteFieldTypes, incompleteItemTypes, incompleteTopLevelTypeReferences,
+ typeDataverse);
+ secondPass(mdTxnCtx, typeMap, incompleteFieldTypes, incompleteItemTypes, incompleteTopLevelTypeReferences,
+ typeDataverse);
+
+ return typeMap;
+ }
+
+ public static Map<TypeSignature, IAType> computeTypes(MetadataTransactionContext mdTxnCtx, TypeDecl tDec,
+ String defaultDataverse, Map<TypeSignature, IAType> typeMap) throws AlgebricksException, MetadataException {
+ Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes = new HashMap<String, Map<ARecordType, List<Integer>>>();
+ Map<TypeSignature, List<AbstractCollectionType>> incompleteItemTypes = new HashMap<TypeSignature, List<AbstractCollectionType>>();
+ Map<TypeSignature, List<TypeSignature>> incompleteTopLevelTypeReferences = new HashMap<TypeSignature, List<TypeSignature>>();
+ String typeDataverse = tDec.getDataverseName() == null ? defaultDataverse : tDec.getDataverseName().getValue();
+ firstPass(tDec, typeMap, incompleteFieldTypes, incompleteItemTypes, incompleteTopLevelTypeReferences,
+ typeDataverse);
+ secondPass(mdTxnCtx, typeMap, incompleteFieldTypes, incompleteItemTypes, incompleteTopLevelTypeReferences,
+ typeDataverse);
+
+ return typeMap;
+ }
+
+ private static Map<String, BuiltinType> builtinTypeMap = AsterixBuiltinTypeMap.getBuiltinTypes();
+
+ private static void firstPass(TypeDecl td, Map<TypeSignature, IAType> typeMap,
+ Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes,
+ Map<TypeSignature, List<AbstractCollectionType>> incompleteItemTypes,
+ Map<TypeSignature, List<TypeSignature>> incompleteTopLevelTypeReferences, String typeDataverse)
+ throws AlgebricksException {
+
+ TypeExpression texpr = td.getTypeDef();
+ String tdname = td.getIdent().getValue();
+ if (builtinTypeMap.get(tdname) != null) {
+ throw new AlgebricksException("Cannot redefine builtin type " + tdname + " .");
+ }
+ TypeSignature typeSignature = new TypeSignature(typeDataverse, tdname);
+ switch (texpr.getTypeKind()) {
+ case TYPEREFERENCE: {
+ TypeReferenceExpression tre = (TypeReferenceExpression) texpr;
+ IAType t = solveTypeReference(typeSignature, typeMap);
+ if (t != null) {
+ typeMap.put(typeSignature, t);
+ } else {
+ addIncompleteTopLevelTypeReference(tdname, tre, incompleteTopLevelTypeReferences, typeDataverse);
+ }
+ break;
+ }
+ case RECORD: {
+ RecordTypeDefinition rtd = (RecordTypeDefinition) texpr;
+ ARecordType recType = computeRecordType(typeSignature, rtd, typeMap, incompleteFieldTypes,
+ incompleteItemTypes, typeDataverse);
+ typeMap.put(typeSignature, recType);
+ break;
+ }
+ case ORDEREDLIST: {
+ OrderedListTypeDefinition oltd = (OrderedListTypeDefinition) texpr;
+ AOrderedListType olType = computeOrderedListType(typeSignature, oltd, typeMap, incompleteItemTypes,
+ incompleteFieldTypes, typeDataverse);
+ typeMap.put(typeSignature, olType);
+ break;
+ }
+ case UNORDEREDLIST: {
+ UnorderedListTypeDefinition ultd = (UnorderedListTypeDefinition) texpr;
+ AUnorderedListType ulType = computeUnorderedListType(typeSignature, ultd, typeMap, incompleteItemTypes,
+ incompleteFieldTypes, typeDataverse);
+ typeMap.put(typeSignature, ulType);
+ break;
+ }
+ default: {
+ throw new IllegalStateException();
+ }
+ }
+ }
+
+ private static void secondPass(MetadataTransactionContext mdTxnCtx, Map<TypeSignature, IAType> typeMap,
+ Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes,
+ Map<TypeSignature, List<AbstractCollectionType>> incompleteItemTypes,
+ Map<TypeSignature, List<TypeSignature>> incompleteTopLevelTypeReferences, String typeDataverse)
+ throws AlgebricksException, MetadataException {
+ // solve remaining top level references
+
+ for (TypeSignature typeSignature : incompleteTopLevelTypeReferences.keySet()) {
+ IAType t;// = typeMap.get(trefName);
+ Datatype dt = MetadataManager.INSTANCE.getDatatype(mdTxnCtx, typeSignature.getNamespace(),
+ typeSignature.getName());
+ if (dt == null) {
+ throw new AlgebricksException("Could not resolve type " + typeSignature);
+ } else
+ t = dt.getDatatype();
+ for (TypeSignature sign : incompleteTopLevelTypeReferences.get(typeSignature)) {
+ typeMap.put(sign, t);
+ }
+ }
+ // solve remaining field type references
+ for (String trefName : incompleteFieldTypes.keySet()) {
+ IAType t;// = typeMap.get(trefName);
+ Datatype dt = MetadataManager.INSTANCE.getDatatype(mdTxnCtx, typeDataverse, trefName);
+ if (dt == null) {
+ throw new AlgebricksException("Could not resolve type " + trefName);
+ } else
+ t = dt.getDatatype();
+ Map<ARecordType, List<Integer>> fieldsToFix = incompleteFieldTypes.get(trefName);
+ for (ARecordType recType : fieldsToFix.keySet()) {
+ List<Integer> positions = fieldsToFix.get(recType);
+ IAType[] fldTypes = recType.getFieldTypes();
+ for (Integer pos : positions) {
+ if (fldTypes[pos] == null) {
+ fldTypes[pos] = t;
+ } else { // nullable
+ AUnionType nullableUnion = (AUnionType) fldTypes[pos];
+ nullableUnion.setTypeAtIndex(t, 1);
+ }
+ }
+ }
+ }
+
+ // solve remaining item type references
+ for (TypeSignature typeSignature : incompleteItemTypes.keySet()) {
+ IAType t;// = typeMap.get(trefName);
+ Datatype dt = null;
+ if (MetadataManager.INSTANCE != null) {
+ dt = MetadataManager.INSTANCE.getDatatype(mdTxnCtx, typeSignature.getNamespace(),
+ typeSignature.getName());
+ if (dt == null) {
+ throw new AlgebricksException("Could not resolve type " + typeSignature);
+ }
+ t = dt.getDatatype();
+ } else {
+ t = typeMap.get(typeSignature);
+ }
+ for (AbstractCollectionType act : incompleteItemTypes.get(typeSignature)) {
+ act.setItemType(t);
+ }
+ }
+ }
+
+ private static AOrderedListType computeOrderedListType(TypeSignature typeSignature, OrderedListTypeDefinition oltd,
+ Map<TypeSignature, IAType> typeMap, Map<TypeSignature, List<AbstractCollectionType>> incompleteItemTypes,
+ Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes, String defaultDataverse) {
+ TypeExpression tExpr = oltd.getItemTypeExpression();
+ String typeName = typeSignature != null ? typeSignature.getName() : null;
+ AOrderedListType aolt = new AOrderedListType(null, typeName);
+ setCollectionItemType(tExpr, typeMap, incompleteItemTypes, incompleteFieldTypes, aolt, defaultDataverse);
+ return aolt;
+ }
+
+ private static AUnorderedListType computeUnorderedListType(TypeSignature typeSignature,
+ UnorderedListTypeDefinition ultd, Map<TypeSignature, IAType> typeMap,
+ Map<TypeSignature, List<AbstractCollectionType>> incompleteItemTypes,
+ Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes, String defaulDataverse) {
+ TypeExpression tExpr = ultd.getItemTypeExpression();
+ String typeName = typeSignature != null ? typeSignature.getName() : null;
+ AUnorderedListType ault = new AUnorderedListType(null, typeName);
+ setCollectionItemType(tExpr, typeMap, incompleteItemTypes, incompleteFieldTypes, ault, defaulDataverse);
+ return ault;
+ }
+
+ private static void setCollectionItemType(TypeExpression tExpr, Map<TypeSignature, IAType> typeMap,
+ Map<TypeSignature, List<AbstractCollectionType>> incompleteItemTypes,
+ Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes, AbstractCollectionType act,
+ String defaultDataverse) {
+ switch (tExpr.getTypeKind()) {
+ case ORDEREDLIST: {
+ OrderedListTypeDefinition oltd = (OrderedListTypeDefinition) tExpr;
+ IAType t = computeOrderedListType(null, oltd, typeMap, incompleteItemTypes, incompleteFieldTypes,
+ defaultDataverse);
+ act.setItemType(t);
+ break;
+ }
+ case UNORDEREDLIST: {
+ UnorderedListTypeDefinition ultd = (UnorderedListTypeDefinition) tExpr;
+ IAType t = computeUnorderedListType(null, ultd, typeMap, incompleteItemTypes, incompleteFieldTypes,
+ defaultDataverse);
+ act.setItemType(t);
+ break;
+ }
+ case RECORD: {
+ RecordTypeDefinition rtd = (RecordTypeDefinition) tExpr;
+ IAType t = computeRecordType(null, rtd, typeMap, incompleteFieldTypes, incompleteItemTypes,
+ defaultDataverse);
+ act.setItemType(t);
+ break;
+ }
+ case TYPEREFERENCE: {
+ TypeReferenceExpression tre = (TypeReferenceExpression) tExpr;
+ TypeSignature signature = new TypeSignature(defaultDataverse, tre.getIdent().getValue());
+ IAType tref = solveTypeReference(signature, typeMap);
+ if (tref != null) {
+ act.setItemType(tref);
+ } else {
+ addIncompleteCollectionTypeReference(act, tre, incompleteItemTypes, defaultDataverse);
+ }
+ break;
+ }
+ default: {
+ throw new IllegalStateException();
+ }
+ }
+ }
+
+ private static void addIncompleteCollectionTypeReference(AbstractCollectionType collType,
+ TypeReferenceExpression tre, Map<TypeSignature, List<AbstractCollectionType>> incompleteItemTypes,
+ String defaultDataverse) {
+ String typeName = tre.getIdent().getValue();
+ TypeSignature typeSignature = new TypeSignature(defaultDataverse, typeName);
+ List<AbstractCollectionType> typeList = incompleteItemTypes.get(typeName);
+ if (typeList == null) {
+ typeList = new LinkedList<AbstractCollectionType>();
+ incompleteItemTypes.put(typeSignature, typeList);
+ }
+ typeList.add(collType);
+ }
+
+ private static void addIncompleteFieldTypeReference(ARecordType recType, int fldPosition,
+ TypeReferenceExpression tre, Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes) {
+ String typeName = tre.getIdent().getValue();
+ Map<ARecordType, List<Integer>> refMap = incompleteFieldTypes.get(typeName);
+ if (refMap == null) {
+ refMap = new HashMap<ARecordType, List<Integer>>();
+ incompleteFieldTypes.put(typeName, refMap);
+ }
+ List<Integer> typeList = refMap.get(recType);
+ if (typeList == null) {
+ typeList = new ArrayList<Integer>();
+ refMap.put(recType, typeList);
+ }
+ typeList.add(fldPosition);
+ }
+
+ private static void addIncompleteTopLevelTypeReference(String tdeclName, TypeReferenceExpression tre,
+ Map<TypeSignature, List<TypeSignature>> incompleteTopLevelTypeReferences, String defaultDataverse) {
+ String name = tre.getIdent().getValue();
+ TypeSignature typeSignature = new TypeSignature(defaultDataverse, name);
+ List<TypeSignature> refList = incompleteTopLevelTypeReferences.get(name);
+ if (refList == null) {
+ refList = new LinkedList<TypeSignature>();
+ incompleteTopLevelTypeReferences.put(new TypeSignature(defaultDataverse, tre.getIdent().getValue()),
+ refList);
+ }
+ refList.add(typeSignature);
+ }
+
+ private static IAType solveTypeReference(TypeSignature typeSignature, Map<TypeSignature, IAType> typeMap) {
+ IAType builtin = builtinTypeMap.get(typeSignature.getName());
+ if (builtin != null) {
+ return builtin;
+ } else {
+ return typeMap.get(typeSignature);
+ }
+ }
+
+ private static ARecordType computeRecordType(TypeSignature typeSignature, RecordTypeDefinition rtd,
+ Map<TypeSignature, IAType> typeMap, Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes,
+ Map<TypeSignature, List<AbstractCollectionType>> incompleteItemTypes, String defaultDataverse) {
+ List<String> names = rtd.getFieldNames();
+ int n = names.size();
+ String[] fldNames = new String[n];
+ IAType[] fldTypes = new IAType[n];
+ int i = 0;
+ for (String s : names) {
+ fldNames[i++] = s;
+ }
+ boolean isOpen = rtd.getRecordKind() == RecordKind.OPEN;
+ ARecordType recType = new ARecordType(typeSignature == null ? null : typeSignature.getName(), fldNames,
+ fldTypes, isOpen);
+
+ List<IRecordFieldDataGen> fieldDataGen = rtd.getFieldDataGen();
+ if (fieldDataGen.size() == n) {
+ IRecordFieldDataGen[] rfdg = new IRecordFieldDataGen[n];
+ rfdg = fieldDataGen.toArray(rfdg);
+ recType.getAnnotations().add(new RecordDataGenAnnotation(rfdg, rtd.getUndeclaredFieldsDataGen()));
+ }
+
+ for (int j = 0; j < n; j++) {
+ TypeExpression texpr = rtd.getFieldTypes().get(j);
+ switch (texpr.getTypeKind()) {
+ case TYPEREFERENCE: {
+ TypeReferenceExpression tre = (TypeReferenceExpression) texpr;
+ TypeSignature signature = new TypeSignature(defaultDataverse, tre.getIdent().getValue());
+ IAType tref = solveTypeReference(signature, typeMap);
+ if (tref != null) {
+ if (!rtd.getNullableFields().get(j)) { // not nullable
+ fldTypes[j] = tref;
+ } else { // nullable
+ fldTypes[j] = makeUnionWithNull(null, tref);
+ }
+ } else {
+ addIncompleteFieldTypeReference(recType, j, tre, incompleteFieldTypes);
+ if (rtd.getNullableFields().get(j)) {
+ fldTypes[j] = makeUnionWithNull(null, null);
+ }
+ }
+ break;
+ }
+ case RECORD: {
+ RecordTypeDefinition recTypeDef2 = (RecordTypeDefinition) texpr;
+ IAType t2 = computeRecordType(null, recTypeDef2, typeMap, incompleteFieldTypes,
+ incompleteItemTypes, defaultDataverse);
+ if (!rtd.getNullableFields().get(j)) { // not nullable
+ fldTypes[j] = t2;
+ } else { // nullable
+ fldTypes[j] = makeUnionWithNull(null, t2);
+ }
+ break;
+ }
+ case ORDEREDLIST: {
+ OrderedListTypeDefinition oltd = (OrderedListTypeDefinition) texpr;
+ IAType t2 = computeOrderedListType(null, oltd, typeMap, incompleteItemTypes, incompleteFieldTypes,
+ defaultDataverse);
+ fldTypes[j] = (rtd.getNullableFields().get(j)) ? makeUnionWithNull(null, t2) : t2;
+ break;
+ }
+ case UNORDEREDLIST: {
+ UnorderedListTypeDefinition ultd = (UnorderedListTypeDefinition) texpr;
+ IAType t2 = computeUnorderedListType(null, ultd, typeMap, incompleteItemTypes,
+ incompleteFieldTypes, defaultDataverse);
+ fldTypes[j] = (rtd.getNullableFields().get(j)) ? makeUnionWithNull(null, t2) : t2;
+ break;
+ }
+ default: {
+ throw new IllegalStateException();
+ }
+ }
+
+ }
+
+ return recType;
+ }
+
+ private static AUnionType makeUnionWithNull(String unionTypeName, IAType type) {
+ ArrayList<IAType> unionList = new ArrayList<IAType>(2);
+ unionList.add(BuiltinType.ANULL);
+ unionList.add(type);
+ return new AUnionType(unionList, unionTypeName);
+ }
+}
diff --git a/asterix-algebra/src/main/javacc/AQLPlus.jj b/asterix-algebra/src/main/javacc/AQLPlus.jj
index 3422652..5b97d04 100644
--- a/asterix-algebra/src/main/javacc/AQLPlus.jj
+++ b/asterix-algebra/src/main/javacc/AQLPlus.jj
@@ -26,7 +26,6 @@
import edu.uci.ics.asterix.aql.literal.NullLiteral;
import edu.uci.ics.asterix.aql.literal.StringLiteral;
import edu.uci.ics.asterix.aql.literal.TrueLiteral;
-
import edu.uci.ics.asterix.aql.parser.ScopeChecker;
import edu.uci.ics.asterix.aql.base.*;
import edu.uci.ics.asterix.aql.expression.*;
@@ -36,8 +35,15 @@
import edu.uci.ics.asterix.aql.context.Scope;
import edu.uci.ics.asterix.aql.context.RootScopeFactory;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-
import edu.uci.ics.asterix.om.functions.AsterixFunction;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
+import edu.uci.ics.asterix.metadata.bootstrap.MetadataConstants;
+
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IExpressionAnnotation;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IndexedNLJoinExpressionAnnotation;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
+
+
public class AQLPlusParser extends ScopeChecker {
@@ -57,6 +63,8 @@
private static final String HASH_GROUP_BY_HINT = "hash";
private static final String BROADCAST_JOIN_HINT = "bcast";
private static final String INMEMORY_HINT = "inmem";
+ private static final String INDEXED_NESTED_LOOP_JOIN_HINT = "indexnl";
+
private static String getHint(Token t) {
@@ -75,17 +83,7 @@
File file = new File(args[0]);
Reader fis = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
AQLPlusParser parser = new AQLPlusParser(fis);
- Statement st = parser.Statement();
- st.accept(new AQLPrintVisitor(), 0);
-
-// System.out.println("FunctionCalls not found:");
-// for(FunctionDescriptor fd: notFoundFunctionList)
-// {
-// if(lookupFunctionSignature(fd.getValue(), fd.getArity())!=null)
-// notFoundFunctionList.remove(fd);
-// }
-// System.out.println(notFoundFunctionList.toString());
-
+ List<Statement> st = parser.Statement();
}
public void initScope() {
@@ -96,7 +94,7 @@
PARSER_END(AQLPlusParser)
-Statement Statement() throws ParseException:
+List<Statement> Statement() throws ParseException:
{
Query query = null;
// scopeStack.push(RootScopeFactory.createRootScope(this));
@@ -129,26 +127,20 @@
| "set" {
decls.add(SetStatement());
}
+ |
+ {
+ decls.add(Query()) ;
+ } ";"
+
)*
- (query = Query())?
)
<EOF>
)
{
- if (query == null) {
- query = new Query(true);
- }
- query.setPrologDeclList(decls);
-
-// for(FunctionDecl fdc : fdList)
-// {
-// FunctionDescriptor fd = (FunctionDescriptor) fdc.getIdent();
-// notFoundFunctionList.remove(fd);
-// }
-// }
- return query;
+
+ return decls;
}
}
@@ -187,7 +179,7 @@
<DATASET> <IDENTIFIER> { datasetName = new Identifier(token.image); }
<LEFTPAREN> query = Query() <RIGHTPAREN>
{
- stmt = new WriteFromQueryResultStatement(datasetName, query, getVarCounter());
+ stmt = new WriteFromQueryResultStatement(null, datasetName, query, getVarCounter());
} ))
";"
@@ -201,10 +193,10 @@
Identifier dvName = null;
}
{
- "dataverse" <IDENTIFIER> { dvName = new Identifier(token.image); }
+ "dataverse" <IDENTIFIER> { defaultDataverse = token.image;}
";"
{
- return new DataverseDecl(dvName);
+ return new DataverseDecl(new Identifier(defaultDataverse));
}
}
@@ -272,7 +264,7 @@
";"
{
- return new LoadFromFileStatement(datasetName, adapter, properties, alreadySorted);
+ return new LoadFromFileStatement(null, datasetName, adapter, properties, alreadySorted);
}
}
@@ -289,7 +281,7 @@
"as"
( typeExpr = TypeExpr() )
{
- return new TypeDecl(ident, typeExpr);
+ return new TypeDecl(null, ident, typeExpr);
}
}
@@ -393,8 +385,8 @@
FunctionDecl FunctionDeclaration() throws ParseException:
{
- FunctionDecl func = new FunctionDecl();
- AsterixFunction ident;
+ FunctionDecl funcDecl;
+ FunctionSignature signature;
String functionName;
int arity = 0;
List<VarIdentifier> paramList = new ArrayList<VarIdentifier>();
@@ -427,12 +419,10 @@
})*)? <RIGHTPAREN> "{" funcBody = Expression() "}"
{
- ident = new AsterixFunction(functionName, arity);
- getCurrentScope().addFunctionDescriptor(ident, false);
- func.setIdent(ident);
- func.setFuncBody(funcBody);
- func.setParamList(paramList);
- return func;
+ signature = new FunctionSignature(defaultDataverse, functionName, arity);
+ getCurrentScope().addFunctionDescriptor(signature, false);
+ funcDecl = new FunctionDecl(signature, paramList, funcBody);
+ return funcDecl;
}
}
@@ -1044,16 +1034,24 @@
Expression FunctionCallExpr() throws ParseException:
{
- CallExpr pf = new CallExpr();
- List<Expression > argList = new ArrayList<Expression >();
+ CallExpr callExpr;
+ List<Expression> argList = new ArrayList<Expression>();
Expression tmp;
int arity = 0;
- Token funcName;
+ String funcName;
+ String dataverse;
+ String hint=null;
+ String id1=null;
+ String id2=null;
}
-{
- ( <IDENTIFIER> | <DATASET> )
+{
+ ( <IDENTIFIER> { dataverse = defaultDataverse; funcName = token.image;}
+ ("." <IDENTIFIER> { dataverse = funcName; funcName = token.image;})?
+ |
+ <DATASET> {dataverse = MetadataConstants.METADATA_DATAVERSE_NAME; funcName = getToken(0).toString();}
+ )
{
- funcName = getToken(0);
+ hint=getHint(token);
}
<LEFTPAREN> (tmp = Expression()
{
@@ -1062,16 +1060,16 @@
} ("," tmp = Expression() { argList.add(tmp); arity++; })*)? <RIGHTPAREN>
{
- AsterixFunction fd = lookupFunctionSignature(funcName.toString(), arity);
- if(fd == null)
- {
- fd = new AsterixFunction(funcName.toString(), arity);
-// notFoundFunctionList.add(fd);
- }
-// throw new ParseException("can't find function "+ funcName.toString() + "@" + arity);
- pf.setIdent(fd);
- pf.setExprList(argList);
- return pf;
+ FunctionSignature signature = lookupFunctionSignature(dataverse, funcName.toString(), arity);
+ if(signature == null)
+ {
+ signature = new FunctionSignature(dataverse, funcName.toString(), arity);
+ }
+ callExpr = new CallExpr(signature,argList);
+ if (hint != null && hint.startsWith(INDEXED_NESTED_LOOP_JOIN_HINT)) {
+ callExpr.addHint(IndexedNLJoinExpressionAnnotation.INSTANCE);
+ }
+ return callExpr;
}
}
diff --git a/asterix-app/data/fn-ln.adm b/asterix-app/data/fn-ln.adm
new file mode 100644
index 0000000..7387288
--- /dev/null
+++ b/asterix-app/data/fn-ln.adm
@@ -0,0 +1,123 @@
+Hugh|Lema
+Schwan|Phil
+Noemi|Eacret
+Julio|Mattocks
+Lance|Kottke
+Kurt|Liz
+Neva|Barbeau
+Karina|Tuthill
+Maricela|Cambron
+Allan|Piland
+Javier|Makuch
+Pearlie|Aumann
+Chandra|Hase
+Christian|Convery
+Panther|Ritch
+Ted|Elsea
+Tabatha|Bladen
+Clayton|Oltman
+Sharron|Darwin
+Clayton|Durgin
+Julio|Iorio
+Emilia|Chenail
+Kenya|Almquist
+Alejandra|Lacefield
+Karina|Michelsen
+Katy|Delillo
+Benita|Kleist
+Earlene|Paluch
+Kurt|Petermann
+Starner|Stuart
+Sofia|Cuff
+Milagros|Murguia
+Margery|Haldeman
+Max|Mell
+Micco|Mercy
+Clare|Vangieson
+Elnora|Dimauro
+Pearlie|Kocian
+Clayton|Delany
+Kubik|Kuhn
+Allan|Tomes
+Lonnie|Aller
+Neil|Hurrell
+Clayton|Engles
+Javier|Gabrielson
+Allan|Alejandre
+Julio|Isa
+Roslyn|Simmerman
+Neil|Deforge
+Earlene|Marcy
+Erik|Lechuga
+Tyrone|Holtzclaw
+Lance|Hankey
+Mallory|Gladding
+Tia|Braaten
+Julio|Vanpatten
+Max|Teachout
+Karina|Wingerter
+Earlene|Wallick
+Julio|Bosket
+Lakisha|Quashie
+Milagros|Forkey
+Erik|Dobek
+Dollie|Dattilo
+Benita|Maltos
+Kurt|Biscoe
+Loraine|Housel
+Jamie|Rachal
+Liza|Fredenburg
+Ericka|Feldmann
+Lorrie|Sharon
+Roxie|Houghtaling
+Julio|Ruben
+Mathew|Fuschetto
+Allyson|Remus
+Earlene|Linebarger
+Clinton|Sick
+Ted|Caba
+Fernando|Engelke
+Mathew|Courchesne
+Cody|Vinyard
+Benita|Fravel
+Emilia|Square
+Tania|Loffredo
+Cody|Rodreguez
+Marcie|States
+Hazeltine|Susan
+Annabelle|Nimmo
+Ted|Saini
+Darren|Thorington
+Neil|Gunnerson
+Clinton|Fredricks
+Lance|Farquhar
+Tabatha|Crisler
+Max|Durney
+Carmella|Strauser
+Kelly|Carrales
+Guy|Merten
+Noreen|Ruhland
+Julio|Damore
+Selena|Truby
+Alejandra|Commons
+Allyson|Balk
+Nelson|Byun
+Christian|Reidhead
+Pearlie|Hopkin
+Nelson|Wohlers
+Marcie|Rasnake
+Hugh|Marshburn
+Mathew|Marasco
+Kurt|Veres
+Julio|Barkett
+Michael|Carey
+Chen|Li
+Sharad|Mehrotra
+Tony|Givargis
+Young Seok|Kim
+Khurram Faraaz|Mohammed
+Yingyi|Bu
+Susan|Malaika
+Roger|Sanders
+Harry|Xu
+Paul|Zubi
diff --git a/asterix-app/data/hdfs/asterix_info.txt b/asterix-app/data/hdfs/asterix_info.txt
new file mode 100644
index 0000000..a9a5596
--- /dev/null
+++ b/asterix-app/data/hdfs/asterix_info.txt
@@ -0,0 +1,4 @@
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
diff --git a/asterix-app/data/hdfs/large_text b/asterix-app/data/hdfs/large_text
new file mode 100644
index 0000000..31a394d
--- /dev/null
+++ b/asterix-app/data/hdfs/large_text
@@ -0,0 +1,136 @@
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
+The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information.
+The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters.
+ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual.
+ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information.
diff --git a/asterix-app/data/hdfs/obamatweets.adm b/asterix-app/data/hdfs/obamatweets.adm
new file mode 100644
index 0000000..2567483
--- /dev/null
+++ b/asterix-app/data/hdfs/obamatweets.adm
@@ -0,0 +1,11 @@
+{ "id": "nc1:1", "username": "BronsonMike", "location": "", "text": "@GottaLaff @reutersus Christie and obama just foul weather friends", "timestamp": "Thu Dec 06 16:53:06 PST 2012" }
+{ "id": "nc1:100", "username": "KidrauhlProuds", "location": "", "text": "RT @01Direclieber: A filha do Michael Jackson uma Belieber,a filha do Eminem e uma Belieber,as filhas de Obama sao Beliebers, e a filha do meu pai e Belieber", "timestamp": "Thu Dec 06 16:53:16 PST 2012" }
+{ "id": "nc1:102", "username": "jaysauce82", "location": "", "text": "Not voting for President Obama #BadDecision", "timestamp": "Thu Dec 06 16:53:16 PST 2012" }
+{ "id": "nc1:104", "username": "princeofsupras", "location": "", "text": "RT @01Direclieber: A filha do Michael Jackson e uma Belieber,a filha do Eminem e uma Belieber,as filhas de Obama sao Beliebers, e a filha do meu pai e Belieber", "timestamp": "Thu Dec 06 16:53:15 PST 2012" }
+{ "id": "nc1:106", "username": "GulfDogs", "location": "", "text": "Obama Admin Knew Libyan Terrorists Had US-Provided Weaponsteaparty #tcot #ccot #NewGuards #BreitbartArmy #patriotwttp://t.co/vJxzrQUE", "timestamp": "Thu Dec 06 16:53:14 PST 2012" }
+{ "id": "nc1:108", "username": "Laugzpz", "location": "", "text": "@AlfredoJalife Maestro Obama se hace de la vista gorda, es un acuerdo de siempre creo yo.", "timestamp": "Thu Dec 06 16:53:14 PST 2012" }
+{ "id": "nc1:11", "username": "magarika", "location": "", "text": "RT @ken24xavier: Obama tells SOROS - our plan is ALMOST finished http://t.co/WvzK0GtU", "timestamp": "Thu Dec 06 16:53:05 PST 2012" }
+{ "id": "nc1:111", "username": "ToucanMall", "location": "", "text": "RT @WorldWar3Watch: Michelle Obama Gets More Grammy Nominations Than Justin ... #Obama #WW3 http://t.co/0Wv2GKij", "timestamp": "Thu Dec 06 16:53:13 PST 2012" }
+{ "id": "nc1:113", "username": "ToucanMall", "location": "", "text": "RT @ObamaPalooza: Tiffany Shared What $2,000 Meant to Her ... and the President Stopped by to Talk About It http://t.co/sgT7lsNV #Obama", "timestamp": "Thu Dec 06 16:53:12 PST 2012" }
+{ "id": "nc1:115", "username": "thewildpitch", "location": "", "text": "RT @RevkahJC: Dennis Miller: Obama Should Just Say He Wants To Tax Successful People http://t.co/Ihlemy9Y", "timestamp": "Thu Dec 06 16:53:11 PST 2012" }
+{ "id": "nc1:117", "username": "Rnugent24", "location": "", "text": "RT @ConservativeQuo: unemployment is above 8% again. I wonder how long it will take for Obama to start blaming Bush? 3-2-1 #tcot #antiobama", "timestamp": "Thu Dec 06 16:53:10 PST 2012" }
diff --git a/asterix-app/data/hdfs/textFileS b/asterix-app/data/hdfs/textFileS
new file mode 100644
index 0000000..4bd0604
--- /dev/null
+++ b/asterix-app/data/hdfs/textFileS
Binary files differ
diff --git a/asterix-app/data/id-fn-ln.adm b/asterix-app/data/id-fn-ln.adm
new file mode 100644
index 0000000..faa342e
--- /dev/null
+++ b/asterix-app/data/id-fn-ln.adm
@@ -0,0 +1,123 @@
+1|Hugh|Lema
+2|Schwan|Phil
+3|Noemi|Eacret
+4|Julio|Mattocks
+5|Lance|Kottke
+6|Kurt|Liz
+7|Neva|Barbeau
+8|Karina|Tuthill
+9|Maricela|Cambron
+10|Allan|Piland
+11|Javier|Makuch
+12|Pearlie|Aumann
+13|Chandra|Hase
+14|Christian|Convery
+15|Panther|Ritch
+16|Ted|Elsea
+17|Tabatha|Bladen
+18|Clayton|Oltman
+19|Sharron|Darwin
+20|Clayton|Durgin
+22|Julio|Iorio
+23|Emilia|Chenail
+24|Kenya|Almquist
+25|Alejandra|Lacefield
+26|Karina|Michelsen
+27|Katy|Delillo
+28|Benita|Kleist
+29|Earlene|Paluch
+30|Kurt|Petermann
+31|Starner|Stuart
+32|Sofia|Cuff
+33|Milagros|Murguia
+34|Margery|Haldeman
+35|Max|Mell
+36|Micco|Mercy
+37|Clare|Vangieson
+38|Elnora|Dimauro
+39|Pearlie|Kocian
+40|Clayton|Delany
+41|Kubik|Kuhn
+42|Allan|Tomes
+43|Lonnie|Aller
+44|Neil|Hurrell
+45|Clayton|Engles
+46|Javier|Gabrielson
+47|Allan|Alejandre
+48|Julio|Isa
+49|Roslyn|Simmerman
+50|Neil|Deforge
+51|Earlene|Marcy
+52|Erik|Lechuga
+53|Tyrone|Holtzclaw
+54|Lance|Hankey
+55|Mallory|Gladding
+56|Tia|Braaten
+57|Julio|Vanpatten
+58|Max|Teachout
+59|Karina|Wingerter
+60|Earlene|Wallick
+61|Julio|Bosket
+62|Lakisha|Quashie
+63|Milagros|Forkey
+64|Erik|Dobek
+65|Dollie|Dattilo
+66|Benita|Maltos
+67|Kurt|Biscoe
+68|Loraine|Housel
+69|Jamie|Rachal
+70|Liza|Fredenburg
+71|Ericka|Feldmann
+72|Lorrie|Sharon
+73|Roxie|Houghtaling
+74|Julio|Ruben
+75|Mathew|Fuschetto
+76|Allyson|Remus
+77|Earlene|Linebarger
+78|Clinton|Sick
+79|Ted|Caba
+80|Fernando|Engelke
+81|Mathew|Courchesne
+82|Cody|Vinyard
+83|Benita|Fravel
+84|Emilia|Square
+85|Tania|Loffredo
+86|Cody|Rodreguez
+87|Marcie|States
+88|Hazeltine|Susan
+89|Annabelle|Nimmo
+90|Ted|Saini
+91|Darren|Thorington
+92|Neil|Gunnerson
+93|Clinton|Fredricks
+94|Lance|Farquhar
+95|Tabatha|Crisler
+96|Max|Durney
+97|Carmella|Strauser
+98|Kelly|Carrales
+99|Guy|Merten
+100|Noreen|Ruhland
+101|Julio|Damore
+102|Selena|Truby
+103|Alejandra|Commons
+104|Allyson|Balk
+105|Nelson|Byun
+106|Christian|Reidhead
+107|Pearlie|Hopkin
+108|Nelson|Wohlers
+109|Marcie|Rasnake
+110|Hugh|Marshburn
+111|Mathew|Marasco
+112|Kurt|Veres
+113|Julio|Barkett
+114|Michael|Carey
+115|Chen|Li
+116|Sharad|Mehrotra
+117|Tony|Givargis
+118|Young Seok|Kim
+119|Khurram Faraaz|Mohammed
+120|Yingyi|Bu
+121|Susan|Malaika
+122|Roger|Sanders
+123|Harry|Xu
+124|Paul|Zubi
diff --git a/asterix-app/data/names.adm b/asterix-app/data/names.adm
new file mode 100644
index 0000000..35c137e
--- /dev/null
+++ b/asterix-app/data/names.adm
@@ -0,0 +1,120 @@
+711|Hugh|Lema|25|HR
+721|Schwan|Phil|34|Payroll
+732|Noemi|Eacret|56|HR
+741|Julio|Mattocks|38|Sales
+751|Lance|Kottke|34|IT
+761|Kurt|Liz|32|HR
+771|Neva|Barbeau|45|Sales
+781|Karina|Tuthill|46|Payroll
+791|Maricela|Cambron|36|IT
+110|Allan|Piland|29|HR
+101|Javier|Makuch|28|IT
+112|Pearlie|Aumann|31|Payroll
+113|Chandra|Hase|34|Sales
+114|Christian|Convery|28|HR
+115|Panther|Ritch|26|IT
+116|Ted|Elsea|26|IT
+117|Tabatha|Bladen|25|HR
+118|Clayton|Oltman|42|Sales
+119|Sharron|Darwin|32|Payroll
+210|Clayton|Durgin|52|HR
+299|Julio|Iorio|37|IT
+212|Emilia|Chenail|26|Sales
+213|Kenya|Almquist|43|Payroll
+214|Alejandra|Lacefield|41|HR
+215|Karina|Michelsen|46|IT
+216|Katy|Delillo|36|IT
+217|Benita|Kleist|37|HR
+218|Earlene|Paluch|31|IT
+219|Kurt|Petermann|27|Payroll
+915|Starner|Stuart|25|Sales
+925|Sofia|Cuff|30|HR
+935|Milagros|Murguia|31|IT
+945|Margery|Haldeman|32|IT
+955|Max|Mell|33|HR
+965|Micco|Mercy|31|Payroll
+975|Clare|Vangieson|34|IT
+985|Elnora|Dimauro|35|Sales
+995|Pearlie|Kocian|38|HR
+809|Clayton|Delany|23|IT
+811|Kubik|Kuhn|27|HR
+821|Allan|Tomes|29|Payroll
+831|Lonnie|Aller|33|Sales
+841|Neil|Hurrell|26|IT
+851|Clayton|Engles|41|HR
+861|Javier|Gabrielson|39|Payroll
+871|Allan|Alejandre|48|IT
+881|Julio|Isa|38|Sales
+891|Roslyn|Simmerman|31|IT
+601|Neil|Deforge|26|HR
+611|Earlene|Marcy|32|IT
+621|Erik|Lechuga|42|Payroll
+631|Tyrone|Holtzclaw|34|Sales
+641|Lance|Hankey|35|Sales
+651|Mallory|Gladding|31|HR
+661|Tia|Braaten|40|IT
+671|Julio|Vanpatten|30|Payroll
+681|Max|Teachout|34|IT
+691|Karina|Wingerter|31|IT
+8301|Earlene|Wallick|26|HR
+8338|Julio|Bosket|28|Payroll
+5438|Lakisha|Quashie|29|HR
+538|Milagros|Forkey|34|Sales
+504|Erik|Dobek|29|IT
+584|Dollie|Dattilo|32|Payroll
+524|Benita|Maltos|33|IT
+534|Kurt|Biscoe|36|HR
+544|Loraine|Housel|30|Sales
+554|Jamie|Rachal|30|IT
+564|Liza|Fredenburg|37|IT
+574|Ericka|Feldmann|29|Sales
+589|Lorrie|Sharon|27|IT
+594|Roxie|Houghtaling|40|Payroll
+514|Julio|Ruben|41|IT
+414|Mathew|Fuschetto|34|HR
+424|Allyson|Remus|32|IT
+434|Earlene|Linebarger|26|Payroll
+444|Clinton|Sick|29|IT
+454|Ted|Caba|28|HR|Sales
+464|Fernando|Engelke|39|IT
+474|Mathew|Courchesne|31|IT
+484|Cody|Vinyard|36|Payroll
+494|Benita|Fravel|33|Sales
+404|Emilia|Square|32|IT
+1263|Tania|Loffredo|25|IT
+363|Cody|Rodreguez|26|IT
+463|Marcie|States|28|IT
+3563|Hazeltine|Susan|29|Sales
+7663|Annabelle|Nimmo|30|Payroll
+9763|Ted|Saini|31|IT
+1863|Darren|Thorington|32|Sales
+2963|Neil|Gunnerson|34|IT
+1410|Clinton|Fredricks|34|IT
+1411|Lance|Farquhar|32|HR
+1412|Tabatha|Crisler|33|IT
+1413|Max|Durney|29|IT
+1414|Carmella|Strauser|30|Payroll
+1415|Kelly|Carrales|40|IT
+1416|Guy|Merten|29|Sales
+1417|Noreen|Ruhland|29|IT
+1418|Julio|Damore|27|Sales
+1419|Selena|Truby|25|HR
+1420|Alejandra|Commons|30|Sales
+1421|Allyson|Balk|30|IT
+1422|Nelson|Byun|40|Sales
+1423|Christian|Reidhead|40|IT
+1424|Pearlie|Hopkin|48|Payroll
+1425|Nelson|Wohlers|41|HR
+1426|Marcie|Rasnake|42|Sales
+1427|Hugh|Marshburn|43|Payroll
+1428|Mathew|Marasco|45|Sales
+1429|Kurt|Veres|32|IT
+1430|Julio|Barkett|39|Sales
+4727|Michael|Carey|50|Payroll
+2333|Chen|Li|42|HR
+7444|Sharad|Mehrotra|42|Sales
+9555|Tony|Givargis|40|Sales
+3666|Young Seok|Kim|35|Payroll
+9941|Khurram Faraaz|Mohammed|30|HR
+1007|Yingyi|Bu|27|IT
+1999|Susan|Malaika|42|HR
diff --git a/asterix-app/data/spatial/spatialData.json b/asterix-app/data/spatial/spatialData.json
index 6f094ee..e2dd151 100644
--- a/asterix-app/data/spatial/spatialData.json
+++ b/asterix-app/data/spatial/spatialData.json
@@ -1,19 +1,19 @@
-{"id": 1, "point": point("4.1,7.0"), "kwds": "sign ahead", "line1": line("4.0,7.0 9.0,7.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.2,7.0")}
-{"id": 2, "point": point("40.2152,-75.0449"), "kwds": "factory hosedan", "line1": line("-4.0,2.0 2.0,2.0"), "line2": line("4.0,7.0 2.0,17.0"), "poly1": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0")}
-{"id": 3, "point": point("43.5083,-79.3007"), "kwds": "enterprisecamp torcamp", "line1": line("3.0,0.0 0.0,4.0"), "line2": line("4.0,7.0 2.0,17.0"), "poly1": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0"), "poly2": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0")}
-{"id": 4, "point": point("43.5083,-79.3007"), "kwds": "enterprisecamp torcamp", "line1": line("4.0,7.0 2.0,17.0"), "line2": line("4.0,7.0 2.0,17.0"), "poly1": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0 2.0,1.0 1.0,0.0"), "poly2": polygon("2.0,1.0 2.0,2.0 3.0,2.0 3.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0")}
-{"id": 5, "point": point("43.5083,-79.3007"), "kwds": "enterprisecamp torcamp", "line1": line("4.0,7.0 2.0,17.0"), "line2": line("4.0,7.0 2.0,17.0"), "poly1": polygon("100.0,100.0 100.0,400.0 300.0,400.0 300.0,100.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0")}
-{"id": 6, "point": point("43.5083,-79.3007"), "kwds": "enterprisecamp torcamp", "line1": line("0.0,5.0 1.0,7.0"), "line2": line("4.0,7.0 2.0,-17.0"), "poly1": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0"), "poly2": polygon("3.1,1.0 2.9,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0")}
-{"id": 7, "point": point("43.5083,-79.3007"), "kwds": "enterprisecamp torcamp", "line1": line("0.0,5.0 4.0,7.1"), "line2": line("4.0,7.0 2.0,-17.0"), "poly1": polygon("-5.0,-2.0 -4.0,-1.0 -3.0,-1.0 -2.0,-2.0 -4.0,-4.0 -5.0,-3.0"), "poly2": polygon("3.0,1.0 3.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("3.0,6.0 5.0,7.0")}
-{"id": 8, "point": point("43.5083,-79.3007"), "kwds": "enterprisecamp torcamp", "line1": line("4.0,7.0 2.0,17.0"), "line2": line("4.0,7.0 2.0,17.0"), "poly1": polygon("-5.0,-2.0 -4.0,-1.0 -3.0,-1.0 -2.0,-2.0 -4.0,-4.0 -5.0,-3.0"), "poly2": polygon("-3.0,-3.0 -1.0,-3.0 -3.0,-5.0"), "rec": rectangle("0.0,0.0 4.0,4.0")}
-{"id": 9, "point": point("5.0,1.0"), "kwds": "sign ahead", "line1": line("5.0,1.0 5.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0")}
-{"id": 10, "point": point("2.0,3.0"), "kwds": "sign ahead", "line1": line("1.0,2.0 3.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("6.01,1.0 6.0,4.0 12.0,4.0 12.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0")}
-{"id": 11, "point": point("4.9,0.0"), "kwds": "sign ahead", "line1": line("1.0,2.0 3.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("4.9,0.1 4.9,4.0 12.0,4.0 12.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0")}
-{"id": 12, "point": point("6.0,3.0"), "kwds": "sign ahead", "line1": line("1.0,2.0 3.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("4.0,1.0 4.0,4.0 12.0,4.0 12.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0")}
-{"id": 13, "point": point("5.0,5.0"), "kwds": "sign ahead", "line1": line("1.0,2.0 3.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("6.0,1.0 6.0,4.0 12.0,4.0 12.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0")}
-{"id": 14, "point": point("5.1,5.1"), "kwds": "sign ahead", "line1": line("1.0,2.0 3.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("5.0,1.0 5.0,4.0 12.0,4.0 12.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0")}
-{"id": 15, "point": point("-2.0,3.0"), "kwds": "sign ahead", "line1": line("1.0,2.0 3.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("5.1,1.0 5.1,4.0 12.0,4.0 12.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0")}
-{"id": 16, "point": point("-2.0,3.0"), "kwds": "sign ahead", "line1": line("1.0,2.0 3.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0")}
-{"id": 17, "point": point("4.1,7.0"), "kwds": "sign ahead", "line1": line("4.0,7.0 9.0,7.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("0.0,6.0 0.0,0.0 3.0,0.0 4.0,1.0 6.0,1.0 8.0,0.0 12.0,0.0 13.0,2.0 8.0,2.0 8.0,4.0 11.0,4.0 11.0,6.0 6.0,6.0 4.0,3.0 2.0,6.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0")}
-{"id": 18, "point": point("-2.0,3.0"), "kwds": "sign ahead", "line1": line("1.0,2.0 3.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("5.0,1.0 7.0,1.0 7.0,4.0 6.0,2.0 5.0,4.0"), "poly2": polygon("6.0,3.0 7.0,5.0 6.0,7.0 5.0,5.0"), "rec": rectangle("0.0,0.0 4.0,4.0")}
-{"id": 19, "point": point("-2.0,3.0"), "kwds": "sign ahead", "line1": line("1.0,2.0 3.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("5.0,1.0 7.0,1.0 7.0,4.0 6.0,2.0 5.0,4.0"), "poly2": polygon("6.0,1.0 7.0,5.0 6.0,7.0 5.0,5.0"), "rec": rectangle("0.0,0.0 4.0,4.0")}
\ No newline at end of file
+{"id": 1, "point": point("4.1,7.0"), "kwds": "sign ahead", "line1": line("4.0,7.0 9.0,7.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.2,7.0"), "circle" : circle("1.0,1.0 10.0")}
+{"id": 2, "point": point("40.2152,-75.0449"), "kwds": "factory hosedan", "line1": line("-4.0,2.0 2.0,2.0"), "line2": line("4.0,7.0 2.0,17.0"), "poly1": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0"), "circle" : circle("2.0,3.0 2.0")}
+{"id": 3, "point": point("43.5083,-79.3007"), "kwds": "enterprisecamp torcamp", "line1": line("3.0,0.0 0.0,4.0"), "line2": line("4.0,7.0 2.0,17.0"), "poly1": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0"), "poly2": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0"), "circle" : circle("5.5,1.0 10.0")}
+{"id": 4, "point": point("43.5083,-79.3007"), "kwds": "enterprisecamp torcamp", "line1": line("4.0,7.0 2.0,17.0"), "line2": line("4.0,7.0 2.0,17.0"), "poly1": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0 2.0,1.0 1.0,0.0"), "poly2": polygon("2.0,1.0 2.0,2.0 3.0,2.0 3.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0"), "circle" : circle("77.0,4.0 30.0")}
+{"id": 5, "point": point("43.5083,-79.3007"), "kwds": "enterprisecamp torcamp", "line1": line("4.0,7.0 2.0,17.0"), "line2": line("4.0,7.0 2.0,17.0"), "poly1": polygon("100.0,100.0 100.0,400.0 300.0,400.0 300.0,100.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0"), "circle" : circle("88.0,1.0 10.0")}
+{"id": 6, "point": point("43.5083,-79.3007"), "kwds": "enterprisecamp torcamp", "line1": line("0.0,5.0 1.0,7.0"), "line2": line("4.0,7.0 2.0,-17.0"), "poly1": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0"), "poly2": polygon("3.1,1.0 2.9,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0"), "circle" : circle("1.0,1.0 10.0")}
+{"id": 7, "point": point("43.5083,-79.3007"), "kwds": "enterprisecamp torcamp", "line1": line("0.0,5.0 4.0,7.1"), "line2": line("4.0,7.0 2.0,-17.0"), "poly1": polygon("-5.0,-2.0 -4.0,-1.0 -3.0,-1.0 -2.0,-2.0 -4.0,-4.0 -5.0,-3.0"), "poly2": polygon("3.0,1.0 3.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("3.0,6.0 5.0,7.0"), "circle" : circle("13.0,75.0 1.0")}
+{"id": 8, "point": point("43.5083,-79.3007"), "kwds": "enterprisecamp torcamp", "line1": line("4.0,7.0 2.0,17.0"), "line2": line("4.0,7.0 2.0,17.0"), "poly1": polygon("-5.0,-2.0 -4.0,-1.0 -3.0,-1.0 -2.0,-2.0 -4.0,-4.0 -5.0,-3.0"), "poly2": polygon("-3.0,-3.0 -1.0,-3.0 -3.0,-5.0"), "rec": rectangle("0.0,0.0 4.0,4.0"), "circle" : circle("76.0,87.0 50.0")}
+{"id": 9, "point": point("5.0,1.0"), "kwds": "sign ahead", "line1": line("5.0,1.0 5.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0"), "circle" : circle("11.0,14.0 15.0")}
+{"id": 10, "point": point("2.0,3.0"), "kwds": "sign ahead", "line1": line("1.0,2.0 3.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("6.01,1.0 6.0,4.0 12.0,4.0 12.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0"), "circle" : circle("1.0,76.0 17.0")}
+{"id": 11, "point": point("4.9,0.0"), "kwds": "sign ahead", "line1": line("1.0,2.0 3.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("4.9,0.1 4.9,4.0 12.0,4.0 12.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0"), "circle" : circle("22.0,35.0 144.0")}
+{"id": 12, "point": point("6.0,3.0"), "kwds": "sign ahead", "line1": line("1.0,2.0 3.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("4.0,1.0 4.0,4.0 12.0,4.0 12.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0"), "circle" : circle("1.0,23.0 12.0")}
+{"id": 13, "point": point("5.0,5.0"), "kwds": "sign ahead", "line1": line("1.0,2.0 3.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("6.0,1.0 6.0,4.0 12.0,4.0 12.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0"), "circle" : circle("30.0,11.0 11.0")}
+{"id": 14, "point": point("5.1,5.1"), "kwds": "sign ahead", "line1": line("1.0,2.0 3.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("5.0,1.0 5.0,4.0 12.0,4.0 12.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0"), "circle" : circle("1.0,66.0 17.0")}
+{"id": 15, "point": point("-2.0,3.0"), "kwds": "sign ahead", "line1": line("1.0,2.0 3.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("5.1,1.0 5.1,4.0 12.0,4.0 12.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0"), "circle" : circle("12.0,87.0 10.0")}
+{"id": 16, "point": point("-2.0,3.0"), "kwds": "sign ahead", "line1": line("1.0,2.0 3.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0"), "circle" : circle("1.0,35.0 10.0")}
+{"id": 17, "point": point("4.1,7.0"), "kwds": "sign ahead", "line1": line("4.0,7.0 9.0,7.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("0.0,6.0 0.0,0.0 3.0,0.0 4.0,1.0 6.0,1.0 8.0,0.0 12.0,0.0 13.0,2.0 8.0,2.0 8.0,4.0 11.0,4.0 11.0,6.0 6.0,6.0 4.0,3.0 2.0,6.0"), "poly2": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), "rec": rectangle("0.0,0.0 4.0,4.0"), "circle" : circle("1.0,51.0 10.0")}
+{"id": 18, "point": point("-2.0,3.0"), "kwds": "sign ahead", "line1": line("1.0,2.0 3.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("5.0,1.0 7.0,1.0 7.0,4.0 6.0,2.0 5.0,4.0"), "poly2": polygon("6.0,3.0 7.0,5.0 6.0,7.0 5.0,5.0"), "rec": rectangle("0.0,0.0 4.0,4.0"), "circle" : circle("43.0,45.0 12.0")}
+{"id": 19, "point": point("-2.0,3.0"), "kwds": "sign ahead", "line1": line("1.0,2.0 3.0,4.0"), "line2": line("5.0,8.0 5.0,1.0"), "poly1": polygon("5.0,1.0 7.0,1.0 7.0,4.0 6.0,2.0 5.0,4.0"), "poly2": polygon("6.0,1.0 7.0,5.0 6.0,7.0 5.0,5.0"), "rec": rectangle("0.0,0.0 4.0,4.0"), "circle" : circle("65.0,2.0 13.0")}
\ No newline at end of file
diff --git a/asterix-app/data/twitter/obamatweets.adm b/asterix-app/data/twitter/obamatweets.adm
new file mode 100644
index 0000000..9720960
--- /dev/null
+++ b/asterix-app/data/twitter/obamatweets.adm
@@ -0,0 +1,12 @@
+{ "id": "nc1:1", "username": "BronsonMike", "location": "", "text": "@GottaLaff @reutersus Christie and obama just foul weather friends", "timestamp": "Thu Dec 06 16:53:06 PST 2012" }
+{ "id": "nc1:100", "username": "KidrauhlProuds", "location": "", "text": "RT @01Direclieber: A filha do Michael Jackson uma Belieber,a filha do Eminem e uma Belieber,as filhas de Obama sao Beliebers, e a filha do meu pai e Belieber", "timestamp": "Thu Dec 06 16:53:16 PST 2012" }
+{ "id": "nc1:102", "username": "jaysauce82", "location": "", "text": "Not voting for President Obama #BadDecision", "timestamp": "Thu Dec 06 16:53:16 PST 2012" }
+{ "id": "nc1:104", "username": "princeofsupras", "location": "", "text": "RT @01Direclieber: A filha do Michael Jackson e uma Belieber,a filha do Eminem e uma Belieber,as filhas de Obama sao Beliebers, e a filha do meu pai e Belieber", "timestamp": "Thu Dec 06 16:53:15 PST 2012" }
+{ "id": "nc1:106", "username": "GulfDogs", "location": "", "text": "Obama Admin Knew Libyan Terrorists Had US-Provided Weaponsteaparty #tcot #ccot #NewGuards #BreitbartArmy #patriotwttp://t.co/vJxzrQUE", "timestamp": "Thu Dec 06 16:53:14 PST 2012" }
+{ "id": "nc1:108", "username": "Laugzpz", "location": "", "text": "@AlfredoJalife Maestro Obama se hace de la vista gorda, es un acuerdo de siempre creo yo.", "timestamp": "Thu Dec 06 16:53:14 PST 2012" }
+{ "id": "nc1:11", "username": "magarika", "location": "", "text": "RT @ken24xavier: Obama tells SOROS - our plan is ALMOST finished http://t.co/WvzK0GtU", "timestamp": "Thu Dec 06 16:53:05 PST 2012" }
+{ "id": "nc1:111", "username": "ToucanMall", "location": "", "text": "RT @WorldWar3Watch: Michelle Obama Gets More Grammy Nominations Than Justin ... #Obama #WW3 http://t.co/0Wv2GKij", "timestamp": "Thu Dec 06 16:53:13 PST 2012" }
+{ "id": "nc1:113", "username": "ToucanMall", "location": "", "text": "RT @ObamaPalooza: Tiffany Shared What $2,000 Meant to Her ... and the President Stopped by to Talk About It http://t.co/sgT7lsNV #Obama", "timestamp": "Thu Dec 06 16:53:12 PST 2012" }
+{ "id": "nc1:115", "username": "thewildpitch", "location": "", "text": "RT @RevkahJC: Dennis Miller: Obama Should Just Say He Wants To Tax Successful People http://t.co/Ihlemy9Y", "timestamp": "Thu Dec 06 16:53:11 PST 2012" }
+{ "id": "nc1:117", "username": "Rnugent24", "location": "", "text": "RT @ConservativeQuo: unemployment is above 8% again. I wonder how long it will take for Obama to start blaming Bush? 3-2-1 #tcot #antiobama", "timestamp": "Thu Dec 06 16:53:10 PST 2012" }
+{ "id": "nc1:119", "username": "ToucanMall", "location": "", "text": "RT @Newitrsdotcom: I hope #Obama will win re-election... Other four years without meaningless #wars", "timestamp": "Thu Dec 06 16:53:09 PST 2012" }
diff --git a/asterix-app/data/twitter/tw_messages.adm b/asterix-app/data/twitter/tw_messages.adm
new file mode 100644
index 0000000..88f5e24
--- /dev/null
+++ b/asterix-app/data/twitter/tw_messages.adm
@@ -0,0 +1,10 @@
+{"tweetid":"1","tweetid-copy":"1","user":{"screen-name":"RollandEckhardstein#211","lang":"en","friends_count":3657079,"statuses_count":268,"name":"Rolland Eckhardstein","followers_count":3311368},"sender-location":point("42.13,80.43"),"send-time":datetime("2005-12-05T21:06:41"),"send-time-copy":datetime("2005-12-05T21:06:41"),"referred-topics":{{"samsung","plan"}},"message-text":" love samsung the plan is amazing"}
+{"tweetid":"2","tweetid-copy":"2","user":{"screen-name":"RollandEckhardstein#211","lang":"en","friends_count":3657079,"statuses_count":268,"name":"David Eckhardstein","followers_count":3311368},"sender-location":point("28.86,70.44"),"send-time":datetime("2007-08-15T06:44:17"),"send-time-copy":datetime("2007-08-15T06:44:17"),"referred-topics":{{"sprint","voice-clarity"}},"message-text":" like sprint its voice-clarity is mind-blowing"}
+{"tweetid":"3","tweetid-copy":"3","user":{"screen-name":"RollandEckhard#500","lang":"en","friends_count":3657079,"statuses_count":268,"name":"Rolland Hetfield","followers_count":3311368},"sender-location":point("39.84,86.48"),"send-time":datetime("2008-12-24T00:07:04"),"send-time-copy":datetime("2008-12-24T00:07:04"),"referred-topics":{{"verizon","voice-command"}},"message-text":" can't stand verizon its voice-command is terrible:("}
+{"tweetid":"4","tweetid-copy":"4","user":{"screen-name":"RollandEckhardstein#221","lang":"en","friends_count":3657079,"statuses_count":268,"name":"Rolland Eckhardstinz","followers_count":3311368},"sender-location":point("27.67,87.32"),"send-time":datetime("2007-02-05T16:39:13"),"send-time-copy":datetime("2007-02-05T16:39:13"),"referred-topics":{{"t-mobile","customer-service"}},"message-text":" love t-mobile its customer-service is mind-blowing"}
+{"tweetid":"5","tweetid-copy":"5","user":{"screen-name":"RollandEcstein#211","lang":"en","friends_count":3657079,"statuses_count":268,"name":"Rolland Eckhardst","followers_count":3311368},"sender-location":point("27.3,92.77"),"send-time":datetime("2010-09-12T06:15:28"),"send-time-copy":datetime("2010-09-12T06:15:28"),"referred-topics":{{"t-mobile","customization"}},"message-text":" like t-mobile the customization is amazing:)"}
+{"tweetid":"6","tweetid-copy":"6","user":{"screen-name":"Rollkhardstein#211","lang":"en","friends_count":3657079,"statuses_count":268,"name":"Kirk Hammette ","followers_count":3311368},"sender-location":point("45.62,84.78"),"send-time":datetime("2012-01-23T06:23:13"),"send-time-copy":datetime("2012-01-23T06:23:13"),"referred-topics":{{"iphone","network"}},"message-text":" like iphone its network is awesome:)"}
+{"tweetid":"7","tweetid-copy":"7","user":{"screen-name":"andEckhardstein#211","lang":"en","friends_count":3657079,"statuses_count":268,"name":"Rolland khardstein","followers_count":3311368},"sender-location":point("44.12,81.46"),"send-time":datetime("2012-02-17T17:30:26"),"send-time-copy":datetime("2012-02-17T17:30:26"),"referred-topics":{{"t-mobile","network"}},"message-text":" hate t-mobile the network is bad"}
+{"tweetid":"8","tweetid-copy":"8","user":{"screen-name":"Rolltein#211","lang":"en","friends_count":3657079,"statuses_count":268,"name":"Ron Eckhardstein","followers_count":3311368},"sender-location":point("36.86,90.71"),"send-time":datetime("2009-03-12T13:18:04"),"send-time-copy":datetime("2009-03-12T13:18:04"),"referred-topics":{{"at&t","touch-screen"}},"message-text":" dislike at&t its touch-screen is OMG"}
+{"tweetid":"9","tweetid-copy":"9","user":{"screen-name":"Roldstein#211","lang":"en","friends_count":3657079,"statuses_count":268,"name":"Rolland Eckdstein","followers_count":3311368},"sender-location":point("29.07,97.05"),"send-time":datetime("2012-08-15T20:19:46"),"send-time-copy":datetime("2012-08-15T20:19:46"),"referred-topics":{{"verizon","speed"}},"message-text":" hate verizon its speed is bad"}
+{"tweetid":"10","tweetid-copy":"10","user":{"screen-name":"Rolldstein#211","lang":"en","friends_count":3657079,"statuses_count":268,"name":"Rolland Eckhardstful","followers_count":3311368},"sender-location":point("46.94,93.98"),"send-time":datetime("2011-04-07T14:08:46"),"send-time-copy":datetime("2011-04-07T14:08:46"),"referred-topics":{{"t-mobile","signal"}},"message-text":" like t-mobile the signal is good"}
\ No newline at end of file
diff --git a/asterix-app/pom.xml b/asterix-app/pom.xml
index 5d7a187..b47aadc 100644
--- a/asterix-app/pom.xml
+++ b/asterix-app/pom.xml
@@ -72,13 +72,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.7.2</version>
+ <version>2.8</version>
<configuration>
<!-- doesn't work from m2eclipse, currently <additionalClasspathElements>
<additionalClasspathElement>${basedir}/src/main/resources</additionalClasspathElement>
</additionalClasspathElements> -->
<forkMode>pertest</forkMode>
- <argLine>-enableassertions -Xmx${test.heap.size}m
+ <argLine>-enableassertions -Xmx${test.heap.size}m
-Dfile.encoding=UTF-8
-Djava.util.logging.config.file=src/test/resources/logging.properties
-Xdebug
@@ -129,17 +129,17 @@
<dependency>
<groupId>edu.uci.ics.hyracks</groupId>
<artifactId>hyracks-control-cc</artifactId>
- <version>0.2.1-SNAPSHOT</version>
+ <version>0.2.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>edu.uci.ics.hyracks</groupId>
<artifactId>hyracks-control-nc</artifactId>
- <version>0.2.1-SNAPSHOT</version>
+ <version>0.2.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>edu.uci.ics.hyracks</groupId>
<artifactId>hyracks-algebricks-compiler</artifactId>
- <version>0.2.1-SNAPSHOT</version>
+ <version>0.2.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>edu.uci.ics.asterix</groupId>
@@ -209,6 +209,17 @@
<type>jar</type>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>net.sourceforge.cobertura</groupId>
+ <artifactId>cobertura</artifactId>
+ <version>1.9.4</version>
+ </dependency>
+ <dependency>
+ <groupId>edu.uci.ics.asterix</groupId>
+ <artifactId>asterix-test-framework</artifactId>
+ <version>0.0.4-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/aqlj/server/APIClientThread.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/aqlj/server/APIClientThread.java
index dee3ee0..9879a2d 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/aqlj/server/APIClientThread.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/aqlj/server/APIClientThread.java
@@ -20,40 +20,36 @@
import java.io.StringReader;
import java.net.Socket;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.logging.Logger;
-import org.json.JSONException;
-
import edu.uci.ics.asterix.api.aqlj.common.AQLJException;
import edu.uci.ics.asterix.api.aqlj.common.AQLJProtocol;
import edu.uci.ics.asterix.api.aqlj.common.AQLJStream;
-import edu.uci.ics.asterix.api.common.APIFramework;
import edu.uci.ics.asterix.api.common.APIFramework.DisplayFormat;
import edu.uci.ics.asterix.api.common.AsterixHyracksIntegrationUtil;
-import edu.uci.ics.asterix.api.common.Job;
import edu.uci.ics.asterix.api.common.SessionConfig;
-import edu.uci.ics.asterix.aql.expression.Query;
+import edu.uci.ics.asterix.aql.base.Statement;
import edu.uci.ics.asterix.aql.parser.AQLParser;
import edu.uci.ics.asterix.aql.parser.ParseException;
+import edu.uci.ics.asterix.aql.translator.AqlTranslator;
+import edu.uci.ics.asterix.aql.translator.QueryResult;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.hyracks.bootstrap.AsterixNodeState;
import edu.uci.ics.asterix.metadata.MetadataManager;
import edu.uci.ics.asterix.metadata.api.IAsterixStateProxy;
import edu.uci.ics.asterix.metadata.bootstrap.AsterixProperties;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
import edu.uci.ics.hyracks.api.application.ICCApplicationContext;
import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
-import edu.uci.ics.hyracks.api.job.JobSpecification;
/**
* This class is the client handler for the APIServer. The AQLJ protocol is used
* for communicating with the client. The client, for example, may send a
- * message to execute an AQL statement. It is up to this class to process that
- * AQL statement and pass back the results, if any, to the client.
+ * message to execute a set containing one or more AQL statements. It is up to this class to process each
+ * AQL statement (in the original order) and pass back the results, if any, to the client.
*
* @author zheilbron
*/
@@ -111,10 +107,7 @@
}
// the "write output..." clause is inserted into incoming AQL statements
- binaryOutputClause = "write output to "
- + outputNodeName
- + ":\""
- + outputFilePath
+ binaryOutputClause = "write output to " + outputNodeName + ":\"" + outputFilePath
+ "\" using \"edu.uci.ics.hyracks.algebricks.runtime.writers.SerializedDataWriterFactory\";";
}
@@ -221,27 +214,19 @@
}
private String executeStatement(String stmt) throws IOException, AQLJException {
+ List<QueryResult> executionResults = null;
PrintWriter out = new PrintWriter(System.out);
- AqlCompiledMetadataDeclarations metadata = null;
try {
AQLParser parser = new AQLParser(new StringReader(stmt));
- Query q = (Query) parser.Statement();
+ List<Statement> statements = parser.Statement();
SessionConfig pc = new SessionConfig(AsterixHyracksIntegrationUtil.DEFAULT_HYRACKS_CC_CLIENT_PORT, true,
- false, false, false, false, false, false);
- pc.setGenerateJobSpec(true);
+ false, false, false, false, false, true, false);
MetadataManager.INSTANCE.init();
- if (q != null) {
- String dataverse = APIFramework.compileDdlStatements(hcc, q, out, pc, DisplayFormat.TEXT);
- Job[] dmlJobs = APIFramework.compileDmlStatements(dataverse, q, out, pc, DisplayFormat.TEXT);
- APIFramework.executeJobArray(hcc, dmlJobs, out, DisplayFormat.TEXT);
+ if (statements != null && statements.size() > 0) {
+ AqlTranslator translator = new AqlTranslator(statements, out, pc, DisplayFormat.TEXT);
+ executionResults = translator.compileAndExecute(hcc);
}
-
- Pair<AqlCompiledMetadataDeclarations, JobSpecification> metadataAndSpec = APIFramework.compileQuery(
- dataverse, q, parser.getVarCounter(), null, metadata, pc, out, DisplayFormat.TEXT, null);
- JobSpecification spec = metadataAndSpec.second;
- metadata = metadataAndSpec.first;
- APIFramework.executeJobArray(hcc, new JobSpecification[] { spec }, out, DisplayFormat.TEXT);
} catch (ParseException e) {
e.printStackTrace();
throw new AQLJException(e);
@@ -251,19 +236,12 @@
} catch (AlgebricksException e) {
e.printStackTrace();
throw new AQLJException(e);
- } catch (JSONException e) {
- e.printStackTrace();
- throw new AQLJException(e);
} catch (Exception e) {
e.printStackTrace();
sendError(e.getMessage());
}
+ return executionResults.get(0).getResultPath();
- if (metadata == null) {
- return null;
- }
-
- return metadata.getOutputFile().getLocalFile().getFile().getAbsolutePath();
}
private boolean sendResults(String path) throws IOException {
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java
index eae4c46..ac87c4b 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package edu.uci.ics.asterix.api.common;
import java.io.PrintWriter;
@@ -8,11 +22,10 @@
import org.json.JSONException;
import edu.uci.ics.asterix.api.common.Job.SubmissionMode;
-import edu.uci.ics.asterix.aql.base.Statement;
+import edu.uci.ics.asterix.aql.expression.FunctionDecl;
import edu.uci.ics.asterix.aql.expression.Query;
import edu.uci.ics.asterix.aql.expression.visitor.AQLPrintVisitor;
import edu.uci.ics.asterix.aql.rewrites.AqlRewriter;
-import edu.uci.ics.asterix.aql.translator.DdlTranslator;
import edu.uci.ics.asterix.common.api.AsterixAppContextInfoImpl;
import edu.uci.ics.asterix.common.config.GlobalConfig;
import edu.uci.ics.asterix.common.config.OptimizationConfUtil;
@@ -21,30 +34,17 @@
import edu.uci.ics.asterix.dataflow.data.common.AqlMergeAggregationExpressionFactory;
import edu.uci.ics.asterix.dataflow.data.common.AqlNullableTypeComputer;
import edu.uci.ics.asterix.dataflow.data.common.AqlPartialAggregationTypeComputer;
-import edu.uci.ics.asterix.file.DatasetOperations;
-import edu.uci.ics.asterix.file.FeedOperations;
-import edu.uci.ics.asterix.file.IndexOperations;
import edu.uci.ics.asterix.formats.base.IDataFormat;
import edu.uci.ics.asterix.jobgen.AqlLogicalExpressionJobGen;
import edu.uci.ics.asterix.metadata.MetadataManager;
import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
+import edu.uci.ics.asterix.metadata.entities.Dataverse;
import edu.uci.ics.asterix.optimizer.base.RuleCollections;
import edu.uci.ics.asterix.runtime.job.listener.JobEventListenerFactory;
import edu.uci.ics.asterix.transaction.management.exception.ACIDException;
-import edu.uci.ics.asterix.transaction.management.service.transaction.TransactionIDFactory;
-import edu.uci.ics.asterix.transaction.management.service.transaction.TransactionManagementConstants.LockManagerConstants.LockMode;
import edu.uci.ics.asterix.translator.AqlExpressionToPlanTranslator;
-import edu.uci.ics.asterix.translator.DmlTranslator;
-import edu.uci.ics.asterix.translator.DmlTranslator.CompiledBeginFeedStatement;
-import edu.uci.ics.asterix.translator.DmlTranslator.CompiledControlFeedStatement;
-import edu.uci.ics.asterix.translator.DmlTranslator.CompiledCreateIndexStatement;
-import edu.uci.ics.asterix.translator.DmlTranslator.CompiledDeleteStatement;
-import edu.uci.ics.asterix.translator.DmlTranslator.CompiledInsertStatement;
-import edu.uci.ics.asterix.translator.DmlTranslator.CompiledLoadFromFileStatement;
-import edu.uci.ics.asterix.translator.DmlTranslator.CompiledWriteFromQueryResultStatement;
-import edu.uci.ics.asterix.translator.DmlTranslator.ICompiledDmlStatement;
+import edu.uci.ics.asterix.translator.CompiledStatements.ICompiledDmlStatement;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
@@ -53,7 +53,7 @@
import edu.uci.ics.hyracks.algebricks.compiler.api.ICompilerFactory;
import edu.uci.ics.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialFixpointRuleController;
import edu.uci.ics.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialOnceRuleController;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalPlanAndMetadata;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalPlan;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.IOptimizationContext;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IExpressionEvalSizeComputer;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IExpressionTypeComputer;
@@ -71,6 +71,10 @@
import edu.uci.ics.hyracks.api.job.JobId;
import edu.uci.ics.hyracks.api.job.JobSpecification;
+/**
+ * Provides helper methods for compilation of a query into a JobSpec and submission
+ * to Hyracks through the Hyracks client interface.
+ */
public class APIFramework {
private static List<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>> buildDefaultLogicalRewrites() {
@@ -101,7 +105,9 @@
defaultLogicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqCtrlNoDfs,
RuleCollections.buildConsolidationRuleCollection()));
defaultLogicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqCtrlNoDfs,
- RuleCollections.buildOpPushDownRuleCollection()));
+ RuleCollections.buildAccessMethodRuleCollection()));
+ defaultLogicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqCtrlNoDfs,
+ RuleCollections.buildPlanCleanupRuleCollection()));
return defaultLogicalRewrites;
}
@@ -143,200 +149,8 @@
HTML
}
- public static String compileDdlStatements(IHyracksClientConnection hcc, Query query, PrintWriter out,
- SessionConfig pc, DisplayFormat pdf) throws AsterixException, AlgebricksException, JSONException,
- RemoteException, ACIDException {
- // Begin a transaction against the metadata.
- // Lock the metadata in X mode to protect against other DDL and DML.
- MetadataTransactionContext mdTxnCtx = MetadataManager.INSTANCE.beginTransaction();
- MetadataManager.INSTANCE.lock(mdTxnCtx, LockMode.EXCLUSIVE);
- try {
- DdlTranslator ddlt = new DdlTranslator(mdTxnCtx, query.getPrologDeclList(), out, pc, pdf);
- ddlt.translate(hcc, false);
- MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
- return ddlt.getCompiledDeclarations().getDataverseName();
- } catch (Exception e) {
- MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
- e.printStackTrace();
- throw new AlgebricksException(e);
- }
- }
-
- public static Job[] compileDmlStatements(String dataverseName, Query query, PrintWriter out, SessionConfig pc,
- DisplayFormat pdf) throws AsterixException, AlgebricksException, JSONException, RemoteException,
- ACIDException {
-
- // Begin a transaction against the metadata.
- // Lock the metadata in S mode to protect against other DDL
- // modifications.
- MetadataTransactionContext mdTxnCtx = MetadataManager.INSTANCE.beginTransaction();
- MetadataManager.INSTANCE.lock(mdTxnCtx, LockMode.SHARED);
- try {
- DmlTranslator dmlt = new DmlTranslator(mdTxnCtx, query.getPrologDeclList());
- dmlt.translate();
-
- if (dmlt.getCompiledDmlStatements().size() == 0) {
- // There is no DML to run. Consider the transaction against the
- // metadata successful.
- MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
- return new Job[] {};
- }
-
- List<Job> dmlJobs = new ArrayList<Job>();
- AqlCompiledMetadataDeclarations metadata = dmlt.getCompiledDeclarations();
-
- if (!metadata.isConnectedToDataverse())
- metadata.connectToDataverse(metadata.getDataverseName());
-
- for (ICompiledDmlStatement stmt : dmlt.getCompiledDmlStatements()) {
- switch (stmt.getKind()) {
- case LOAD_FROM_FILE: {
- CompiledLoadFromFileStatement stmtLoad = (CompiledLoadFromFileStatement) stmt;
- dmlJobs.add(DatasetOperations.createLoadDatasetJobSpec(stmtLoad, metadata));
- break;
- }
- case WRITE_FROM_QUERY_RESULT: {
- CompiledWriteFromQueryResultStatement stmtLoad = (CompiledWriteFromQueryResultStatement) stmt;
- SessionConfig sc2 = new SessionConfig(pc.getPort(), true, pc.isPrintExprParam(),
- pc.isPrintRewrittenExprParam(), pc.isPrintLogicalPlanParam(),
- pc.isPrintOptimizedLogicalPlanParam(), pc.isPrintPhysicalOpsOnly(), pc.isPrintJob());
- sc2.setGenerateJobSpec(true);
- Pair<AqlCompiledMetadataDeclarations, JobSpecification> mj = compileQueryInternal(mdTxnCtx,
- dataverseName, stmtLoad.getQuery(), stmtLoad.getVarCounter(),
- stmtLoad.getDatasetName(), metadata, sc2, out, pdf,
- Statement.Kind.WRITE_FROM_QUERY_RESULT);
- dmlJobs.add(new Job(mj.second));
- break;
- }
- case INSERT: {
- CompiledInsertStatement stmtLoad = (CompiledInsertStatement) stmt;
- SessionConfig sc2 = new SessionConfig(pc.getPort(), true, pc.isPrintExprParam(),
- pc.isPrintRewrittenExprParam(), pc.isPrintLogicalPlanParam(),
- pc.isPrintOptimizedLogicalPlanParam(), pc.isPrintPhysicalOpsOnly(), pc.isPrintJob());
- sc2.setGenerateJobSpec(true);
- Pair<AqlCompiledMetadataDeclarations, JobSpecification> mj = compileQueryInternal(mdTxnCtx,
- dataverseName, stmtLoad.getQuery(), stmtLoad.getVarCounter(),
- stmtLoad.getDatasetName(), metadata, sc2, out, pdf, Statement.Kind.INSERT);
- dmlJobs.add(new Job(mj.second));
- break;
- }
- case DELETE: {
- CompiledDeleteStatement stmtLoad = (CompiledDeleteStatement) stmt;
- SessionConfig sc2 = new SessionConfig(pc.getPort(), true, pc.isPrintExprParam(),
- pc.isPrintRewrittenExprParam(), pc.isPrintLogicalPlanParam(),
- pc.isPrintOptimizedLogicalPlanParam(), pc.isPrintPhysicalOpsOnly(), pc.isPrintJob());
- sc2.setGenerateJobSpec(true);
- Pair<AqlCompiledMetadataDeclarations, JobSpecification> mj = compileQueryInternal(mdTxnCtx,
- dataverseName, stmtLoad.getQuery(), stmtLoad.getVarCounter(),
- stmtLoad.getDatasetName(), metadata, sc2, out, pdf, Statement.Kind.DELETE);
- dmlJobs.add(new Job(mj.second));
- break;
- }
- case CREATE_INDEX: {
- CompiledCreateIndexStatement cis = (CompiledCreateIndexStatement) stmt;
- JobSpecification jobSpec = IndexOperations.buildSecondaryIndexLoadingJobSpec(cis, metadata);
- dmlJobs.add(new Job(jobSpec));
- break;
- }
-
- case BEGIN_FEED: {
- CompiledBeginFeedStatement cbfs = (CompiledBeginFeedStatement) stmt;
- SessionConfig sc2 = new SessionConfig(pc.getPort(), true, pc.isPrintExprParam(),
- pc.isPrintRewrittenExprParam(), pc.isPrintLogicalPlanParam(),
- pc.isPrintOptimizedLogicalPlanParam(), pc.isPrintPhysicalOpsOnly(), pc.isPrintJob());
- sc2.setGenerateJobSpec(true);
- Pair<AqlCompiledMetadataDeclarations, JobSpecification> mj = compileQueryInternal(mdTxnCtx,
- dataverseName, cbfs.getQuery(), cbfs.getVarCounter(), cbfs.getDatasetName().getValue(),
- metadata, sc2, out, pdf, Statement.Kind.BEGIN_FEED);
- dmlJobs.add(new Job(mj.second));
- break;
-
- }
-
- case CONTROL_FEED: {
- CompiledControlFeedStatement cfs = (CompiledControlFeedStatement) stmt;
- Job job = new Job(FeedOperations.buildControlFeedJobSpec(cfs, metadata),
- SubmissionMode.ASYNCHRONOUS);
- dmlJobs.add(job);
- break;
- }
- default: {
- throw new IllegalArgumentException();
- }
- }
- }
- if (pc.isPrintJob()) {
- int i = 0;
- for (Job js : dmlJobs) {
- out.println("<H1>Hyracks job number " + i + ":</H1>");
- out.println("<PRE>");
- out.println(js.getJobSpec().toJSON().toString(1));
- out.println(js.getJobSpec().getUserConstraints());
- out.println(js.getSubmissionMode());
- out.println("</PRE>");
- i++;
- }
- }
- // close connection to dataverse
- if (metadata.isConnectedToDataverse())
- metadata.disconnectFromDataverse();
-
- Job[] jobs = dmlJobs.toArray(new Job[0]);
- MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
- return jobs;
- } catch (AsterixException e) {
- MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
- throw e;
- } catch (AlgebricksException e) {
- MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
- throw e;
- } catch (JSONException e) {
- MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
- throw e;
- } catch (Exception e) {
- MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
- throw new AsterixException(e);
- }
- }
-
- public static Pair<AqlCompiledMetadataDeclarations, JobSpecification> compileQuery(String dataverseName, Query q,
- int varCounter, String outputDatasetName, AqlCompiledMetadataDeclarations metadataDecls, SessionConfig pc,
- PrintWriter out, DisplayFormat pdf, Statement.Kind dmlKind) throws AsterixException, AlgebricksException,
- JSONException, RemoteException, ACIDException {
- MetadataTransactionContext mdTxnCtx = MetadataManager.INSTANCE.beginTransaction();
- try {
- MetadataManager.INSTANCE.lock(mdTxnCtx, LockMode.SHARED);
- Pair<AqlCompiledMetadataDeclarations, JobSpecification> result = compileQueryInternal(mdTxnCtx,
- dataverseName, q, varCounter, outputDatasetName, metadataDecls, pc, out, pdf, dmlKind);
- MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
- return result;
- } catch (AsterixException e) {
- MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
- throw e;
- } catch (AlgebricksException e) {
- MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
- throw e;
- } catch (JSONException e) {
- MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
- throw e;
- } catch (RemoteException e) {
- MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
- throw e;
- } catch (ACIDException e) {
- MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
- throw e;
- } catch (Exception e) {
- MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
- throw new AsterixException(e);
- }
- }
-
- public static Pair<AqlCompiledMetadataDeclarations, JobSpecification> compileQueryInternal(
- MetadataTransactionContext mdTxnCtx, String dataverseName, Query q, int varCounter,
- String outputDatasetName, AqlCompiledMetadataDeclarations metadataDecls, SessionConfig pc, PrintWriter out,
- DisplayFormat pdf, Statement.Kind dmlKind) throws AsterixException, AlgebricksException, JSONException,
- RemoteException, ACIDException {
-
+ public static Pair<Query, Integer> reWriteQuery(List<FunctionDecl> declaredFunctions, AqlMetadataProvider metadataProvider,
+ Query q, SessionConfig pc, PrintWriter out, DisplayFormat pdf) throws AsterixException {
if (!pc.isPrintPhysicalOpsOnly() && pc.isPrintExprParam()) {
out.println();
switch (pdf) {
@@ -360,9 +174,17 @@
}
}
}
- AqlRewriter rw = new AqlRewriter(q, varCounter, mdTxnCtx, dataverseName);
+ AqlRewriter rw = new AqlRewriter(declaredFunctions, q, metadataProvider.getMetadataTxnContext());
rw.rewrite();
Query rwQ = rw.getExpr();
+ return new Pair(rwQ, rw.getVarCounter());
+ }
+
+ public static JobSpecification compileQuery(List<FunctionDecl> declaredFunctions,
+ AqlMetadataProvider queryMetadataProvider, Query rwQ, int varCounter, String outputDatasetName,
+ SessionConfig pc, PrintWriter out, DisplayFormat pdf, ICompiledDmlStatement statement)
+ throws AsterixException, AlgebricksException, JSONException, RemoteException, ACIDException {
+
if (!pc.isPrintPhysicalOpsOnly() && pc.isPrintRewrittenExprParam()) {
out.println();
@@ -378,7 +200,7 @@
}
}
- if (q != null) {
+ if (rwQ != null) {
rwQ.accept(new AQLPrintVisitor(out), 0);
}
@@ -390,21 +212,12 @@
}
}
- long txnId = TransactionIDFactory.generateTransactionId();
- AqlExpressionToPlanTranslator t = new AqlExpressionToPlanTranslator(txnId, mdTxnCtx, rw.getVarCounter(),
- outputDatasetName, dmlKind);
- ILogicalPlanAndMetadata planAndMetadata = t.translate(rwQ, metadataDecls);
- boolean isWriteTransaction = false;
- AqlMetadataProvider mp = (AqlMetadataProvider) planAndMetadata.getMetadataProvider();
- if (metadataDecls == null) {
- metadataDecls = mp.getMetadataDeclarations();
- }
- isWriteTransaction = mp.isWriteTransaction();
+ AqlExpressionToPlanTranslator t = new AqlExpressionToPlanTranslator(queryMetadataProvider, varCounter,
+ outputDatasetName, statement);
- if (outputDatasetName == null && metadataDecls.getOutputFile() == null) {
- throw new AlgebricksException("Unknown output file: `write output to nc:\"file\"' statement missing.");
- }
+ ILogicalPlan plan = t.translate(rwQ);
+ boolean isWriteTransaction = queryMetadataProvider.isWriteTransaction();
LogicalOperatorPrettyPrintVisitor pvisitor = new LogicalOperatorPrettyPrintVisitor();
if (!pc.isPrintPhysicalOpsOnly() && pc.isPrintLogicalPlanParam()) {
@@ -421,9 +234,9 @@
}
}
- if (q != null) {
+ if (rwQ != null) {
StringBuilder buffer = new StringBuilder();
- PlanPrettyPrinter.printPlan(planAndMetadata.getPlan(), buffer, pvisitor, 0);
+ PlanPrettyPrinter.printPlan(plan, buffer, pvisitor, 0);
out.print(buffer);
}
@@ -455,7 +268,7 @@
AqlOptimizationContextFactory.INSTANCE);
builder.setLogicalRewrites(buildDefaultLogicalRewrites());
builder.setPhysicalRewrites(buildDefaultPhysicalRewrites());
- IDataFormat format = metadataDecls.getFormat();
+ IDataFormat format = queryMetadataProvider.getFormat();
ICompilerFactory compilerFactory = builder.create();
builder.setFrameSize(frameSize);
builder.setExpressionEvalSizeComputer(format.getExpressionEvalSizeComputer());
@@ -466,49 +279,48 @@
OptimizationConfUtil.getPhysicalOptimizationConfig().setFrameSize(frameSize);
builder.setPhysicalOptimizationConfig(OptimizationConfUtil.getPhysicalOptimizationConfig());
- ICompiler compiler = compilerFactory.createCompiler(planAndMetadata.getPlan(),
- planAndMetadata.getMetadataProvider(), t.getVarCounter());
+
+ ICompiler compiler = compilerFactory.createCompiler(plan, queryMetadataProvider, t.getVarCounter());
if (pc.isOptimize()) {
compiler.optimize();
- if (true) {
- StringBuilder buffer = new StringBuilder();
- PlanPrettyPrinter.printPhysicalOps(planAndMetadata.getPlan(), buffer, 0);
- out.print(buffer);
- } else if (pc.isPrintOptimizedLogicalPlanParam()) {
- switch (pdf) {
- case HTML: {
- out.println("<H1>Optimized logical plan:</H1>");
- out.println("<PRE>");
- break;
- }
- case TEXT: {
- out.println("----------Optimized plan ");
- break;
- }
- }
-
- if (q != null) {
+ if (pc.isPrintOptimizedLogicalPlanParam()) {
+ if (pc.isPrintPhysicalOpsOnly()) {
+ // For Optimizer tests.
StringBuilder buffer = new StringBuilder();
- PlanPrettyPrinter.printPlan(planAndMetadata.getPlan(), buffer, pvisitor, 0);
+ PlanPrettyPrinter.printPhysicalOps(plan, buffer, 0);
out.print(buffer);
- }
- switch (pdf) {
- case HTML: {
- out.println("</PRE>");
- break;
+ } else {
+ switch (pdf) {
+ case HTML: {
+ out.println("<H1>Optimized logical plan:</H1>");
+ out.println("<PRE>");
+ break;
+ }
+ case TEXT: {
+ out.println("----------Optimized plan ");
+ break;
+ }
+ }
+ if (rwQ != null) {
+ StringBuilder buffer = new StringBuilder();
+ PlanPrettyPrinter.printPlan(plan, buffer, pvisitor, 0);
+ out.print(buffer);
+ }
+ switch (pdf) {
+ case HTML: {
+ out.println("</PRE>");
+ break;
+ }
}
}
}
}
if (!pc.isGenerateJobSpec()) {
- // Job spec not requested. Consider transaction against metadata
- // committed.
- MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
return null;
}
-
- AlgebricksPartitionConstraint clusterLocs = planAndMetadata.getClusterLocations();
+
+ AlgebricksPartitionConstraint clusterLocs = queryMetadataProvider.getClusterLocations();
builder.setBinaryBooleanInspectorFactory(format.getBinaryBooleanInspectorFactory());
builder.setBinaryIntegerInspectorFactory(format.getBinaryIntegerInspectorFactory());
builder.setClusterLocations(clusterLocs);
@@ -522,9 +334,10 @@
builder.setTypeTraitProvider(format.getTypeTraitProvider());
builder.setNormalizedKeyComputerFactoryProvider(format.getNormalizedKeyComputerFactoryProvider());
- JobSpecification spec = compiler.createJob(AsterixAppContextInfoImpl.INSTANCE);
+ JobSpecification spec = compiler.createJob(AsterixAppContextInfoImpl.getInstance());
// set the job event listener
- spec.setJobletEventListenerFactory(new JobEventListenerFactory(txnId, isWriteTransaction));
+ spec.setJobletEventListenerFactory(new JobEventListenerFactory(queryMetadataProvider.getJobTxnId(),
+ isWriteTransaction));
if (pc.isPrintJob()) {
switch (pdf) {
case HTML: {
@@ -537,7 +350,7 @@
break;
}
}
- if (q != null) {
+ if (rwQ != null) {
out.println(spec.toJSON().toString(1));
out.println(spec.getUserConstraints());
}
@@ -548,7 +361,7 @@
}
}
}
- return new Pair<AqlCompiledMetadataDeclarations, JobSpecification>(metadataDecls, spec);
+ return spec;
}
public static void executeJobArray(IHyracksClientConnection hcc, JobSpecification[] specs, PrintWriter out,
@@ -587,4 +400,16 @@
}
+ private static IDataFormat getDataFormat(MetadataTransactionContext mdTxnCtx, String dataverseName)
+ throws AsterixException {
+ Dataverse dataverse = MetadataManager.INSTANCE.getDataverse(mdTxnCtx, dataverseName);
+ IDataFormat format;
+ try {
+ format = (IDataFormat) Class.forName(dataverse.getDataFormat()).newInstance();
+ } catch (Exception e) {
+ throw new AsterixException(e);
+ }
+ return format;
+ }
+
}
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java
index 541edd0..3c43736 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java
@@ -17,12 +17,12 @@
public static final String NC1_ID = "nc1";
public static final String NC2_ID = "nc2";
+ public static final String[] ASTERIX_DATA_DIRS = new String[] { "nc1data", "nc2data" };
public static final int DEFAULT_HYRACKS_CC_CLIENT_PORT = 1098;
public static final int DEFAULT_HYRACKS_CC_CLUSTER_PORT = 1099;
-
private static ClusterControllerService cc;
private static NodeControllerService nc1;
private static NodeControllerService nc2;
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/SessionConfig.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/SessionConfig.java
index 8050a3f..4ae6edd 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/SessionConfig.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/SessionConfig.java
@@ -1,100 +1,62 @@
-/**
- *
- */
package edu.uci.ics.asterix.api.common;
public class SessionConfig {
- private int port;
- private boolean printExprParam;
- private boolean printRewrittenExprParam;
- private boolean printLogicalPlanParam;
- private boolean printOptimizedLogicalPlanParam;
- private boolean printPhysicalOpsOnly;
- private boolean printJob;
- private boolean optimize;
- private boolean generateJobSpec = true;
+ private final int port;
+ private final boolean optimize;
+ private final boolean printExprParam;
+ private final boolean printRewrittenExprParam;
+ private final boolean printLogicalPlanParam;
+ private final boolean printOptimizedLogicalPlanParam;
+ private final boolean printPhysicalOpsOnly;
+ private final boolean generateJobSpec;
+ private final boolean printJob;
public SessionConfig(int port, boolean optimize, boolean printExprParam, boolean printRewrittenExprParam,
boolean printLogicalPlanParam, boolean printOptimizedLogicalPlanParam, boolean printPhysicalOpsOnly,
- boolean printJob) {
- this.setPort(port);
- this.setOptimize(optimize);
- this.setPrintExprParam(printExprParam);
- this.setPrintRewrittenExprParam(printRewrittenExprParam);
- this.setPrintLogicalPlanParam(printLogicalPlanParam);
- this.setPrintOptimizedLogicalPlanParam(printOptimizedLogicalPlanParam);
- this.setPrintPhysicalOpsOnly(printPhysicalOpsOnly);
- this.setPrintJob(printJob);
- }
-
- public void setPort(int port) {
+ boolean generateJobSpec, boolean printJob) {
this.port = port;
+ this.optimize = optimize;
+ this.printExprParam = printExprParam;
+ this.printRewrittenExprParam = printRewrittenExprParam;
+ this.printLogicalPlanParam = printLogicalPlanParam;
+ this.printOptimizedLogicalPlanParam = printOptimizedLogicalPlanParam;
+ this.printPhysicalOpsOnly = printPhysicalOpsOnly;
+ this.generateJobSpec = generateJobSpec;
+ this.printJob = printJob;
}
public int getPort() {
return port;
}
- public void setPrintExprParam(boolean printExprParam) {
- this.printExprParam = printExprParam;
- }
-
public boolean isPrintExprParam() {
return printExprParam;
}
- public void setPrintRewrittenExprParam(boolean printRewrittenExprParam) {
- this.printRewrittenExprParam = printRewrittenExprParam;
- }
-
public boolean isPrintRewrittenExprParam() {
return printRewrittenExprParam;
}
- public void setPrintLogicalPlanParam(boolean printLogicalPlanParam) {
- this.printLogicalPlanParam = printLogicalPlanParam;
- }
-
public boolean isPrintLogicalPlanParam() {
return printLogicalPlanParam;
}
- public void setPrintOptimizedLogicalPlanParam(boolean printOptimizedLogicalPlanParam) {
- this.printOptimizedLogicalPlanParam = printOptimizedLogicalPlanParam;
- }
-
public boolean isPrintOptimizedLogicalPlanParam() {
return printOptimizedLogicalPlanParam;
}
- public void setPrintJob(boolean printJob) {
- this.printJob = printJob;
- }
-
public boolean isPrintJob() {
return printJob;
}
- public void setPrintPhysicalOpsOnly(boolean prinPhysicalOpsOnly) {
- this.printPhysicalOpsOnly = prinPhysicalOpsOnly;
- }
-
public boolean isPrintPhysicalOpsOnly() {
return printPhysicalOpsOnly;
}
- public void setOptimize(boolean optimize) {
- this.optimize = optimize;
- }
-
public boolean isOptimize() {
return optimize;
}
- public void setGenerateJobSpec(boolean generateJobSpec) {
- this.generateJobSpec = generateJobSpec;
- }
-
public boolean isGenerateJobSpec() {
return generateJobSpec;
}
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/APIServlet.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/APIServlet.java
index 15b959e..034e1f4 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/APIServlet.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/APIServlet.java
@@ -5,27 +5,23 @@
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
-import java.io.StringReader;
+import java.util.List;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import edu.uci.ics.asterix.api.common.APIFramework;
import edu.uci.ics.asterix.api.common.APIFramework.DisplayFormat;
-import edu.uci.ics.asterix.api.common.Job;
import edu.uci.ics.asterix.api.common.SessionConfig;
-import edu.uci.ics.asterix.aql.expression.Query;
+import edu.uci.ics.asterix.aql.base.Statement;
import edu.uci.ics.asterix.aql.parser.AQLParser;
import edu.uci.ics.asterix.aql.parser.ParseException;
-import edu.uci.ics.asterix.common.config.GlobalConfig;
+import edu.uci.ics.asterix.aql.translator.AqlTranslator;
+import edu.uci.ics.asterix.aql.translator.QueryResult;
import edu.uci.ics.asterix.metadata.MetadataManager;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
-import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
import edu.uci.ics.hyracks.api.client.HyracksConnection;
import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
-import edu.uci.ics.hyracks.api.job.JobSpecification;
public class APIServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
@@ -58,59 +54,56 @@
context.setAttribute(HYRACKS_CONNECTION_ATTR, hcc);
}
}
- AQLParser parser = new AQLParser(new StringReader(query));
- Query q = (Query) parser.Statement();
- SessionConfig pc = new SessionConfig(port, true, isSet(printExprParam), isSet(printRewrittenExprParam),
- isSet(printLogicalPlanParam), isSet(printOptimizedLogicalPlanParam), false, isSet(printJob));
- pc.setGenerateJobSpec(true);
-
+ AQLParser parser = new AQLParser(query);
+ List<Statement> aqlStatements = parser.Statement();
+ SessionConfig sessionConfig = new SessionConfig(port, true, isSet(printExprParam),
+ isSet(printRewrittenExprParam), isSet(printLogicalPlanParam),
+ isSet(printOptimizedLogicalPlanParam), false, true, isSet(printJob));
MetadataManager.INSTANCE.init();
- String dataverseName = null;
-
- if (q != null) {
- dataverseName = postDmlStatement(hcc, q, out, pc);
- }
-
- if (q.isDummyQuery()) {
- return;
- }
-
- Pair<AqlCompiledMetadataDeclarations, JobSpecification> metadataAndSpec = APIFramework.compileQuery(
- dataverseName, q, parser.getVarCounter(), null, null, pc, out, DisplayFormat.HTML, null);
- JobSpecification spec = metadataAndSpec.second;
- GlobalConfig.ASTERIX_LOGGER.info(spec.toJSON().toString(1));
- AqlCompiledMetadataDeclarations metadata = metadataAndSpec.first;
+ AqlTranslator aqlTranslator = new AqlTranslator(aqlStatements, out, sessionConfig, DisplayFormat.HTML);
+ List<QueryResult> executionResults = null;
+ double duration = 0;
long startTime = System.currentTimeMillis();
- APIFramework.executeJobArray(hcc, new JobSpecification[] { spec }, out, DisplayFormat.HTML);
+ executionResults = aqlTranslator.compileAndExecute(hcc);
long endTime = System.currentTimeMillis();
- double duration = (endTime - startTime) / 1000.00;
- out.println("<H1>Result:</H1>");
+ duration = (endTime - startTime) / 1000.00;
+ out.println("<PRE>Duration of all jobs: " + duration + "</PRE>");
+ int queryCount = 1;
+ out.println("<H1>Result:</H1>");
out.println("<PRE>");
- out.println(metadata.getOutputFile().getNodeName() + ":"
- + metadata.getOutputFile().getLocalFile().getFile().getPath());
+ for (QueryResult result : executionResults) {
+ out.println("Query:" + queryCount++ + ":" + " " + result.getResultPath());
+ }
out.println("Duration: " + duration);
out.println("</PRE>");
+ queryCount = 1;
if (isSet(strDisplayResult)) {
out.println("<PRE>");
- displayFile(metadata.getOutputFile().getLocalFile().getFile(), out);
+ for (QueryResult result : executionResults) {
+ out.println("Query:" + queryCount++ + ":" + " " + result.getResultPath());
+ displayFile(new File(result.getResultPath()), out);
+ out.println();
+ }
out.println("</PRE>");
}
} catch (ParseException pe) {
String message = pe.getMessage();
message = message.replace("<", "<");
message = message.replace(">", ">");
- int pos = message.indexOf("line");
- int columnPos = message.indexOf(",", pos + 1 + "line".length());
- int lineNo = Integer.parseInt(message.substring(pos + "line".length() + 1, columnPos));
- String line = query.split("\n")[lineNo - 1];
out.println("SyntaxError:" + message);
- out.println("==> " + line);
-
+ int pos = message.indexOf("line");
+ if (pos > 0) {
+ int columnPos = message.indexOf(",", pos + 1 + "line".length());
+ int lineNo = Integer.parseInt(message.substring(pos + "line".length() + 1, columnPos));
+ String line = query.split("\n")[lineNo - 1];
+ out.println("==> " + line);
+ }
} catch (Exception e) {
+ e.printStackTrace();
out.println(e.getMessage());
- }
+ }
}
@Override
@@ -135,20 +128,6 @@
out.println(form);
}
- private String postDmlStatement(IHyracksClientConnection hcc, Query dummyQ, PrintWriter out, SessionConfig pc)
- throws Exception {
-
- String dataverseName = APIFramework.compileDdlStatements(hcc, dummyQ, out, pc, DisplayFormat.TEXT);
- Job[] dmlJobSpecs = APIFramework.compileDmlStatements(dataverseName, dummyQ, out, pc, DisplayFormat.HTML);
-
- long startTime = System.currentTimeMillis();
- APIFramework.executeJobArray(hcc, dmlJobSpecs, out, DisplayFormat.HTML);
- long endTime = System.currentTimeMillis();
- double duration = (endTime - startTime) / 1000.00;
- out.println("<PRE>Duration of all jobs: " + duration + "</PRE>");
- return dataverseName;
- }
-
private static boolean isSet(String requestParameter) {
return (requestParameter != null && requestParameter.equals("true"));
}
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/java/AsterixJavaClient.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/java/AsterixJavaClient.java
index 7ccfdef..7e72d94 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/java/AsterixJavaClient.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/java/AsterixJavaClient.java
@@ -2,24 +2,19 @@
import java.io.PrintWriter;
import java.io.Reader;
-import java.rmi.RemoteException;
-
-import org.json.JSONException;
+import java.util.List;
import edu.uci.ics.asterix.api.common.APIFramework;
import edu.uci.ics.asterix.api.common.APIFramework.DisplayFormat;
import edu.uci.ics.asterix.api.common.AsterixHyracksIntegrationUtil;
import edu.uci.ics.asterix.api.common.Job;
import edu.uci.ics.asterix.api.common.SessionConfig;
-import edu.uci.ics.asterix.aql.expression.Query;
+import edu.uci.ics.asterix.aql.base.Statement;
import edu.uci.ics.asterix.aql.parser.AQLParser;
import edu.uci.ics.asterix.aql.parser.ParseException;
+import edu.uci.ics.asterix.aql.translator.AqlTranslator;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.metadata.MetadataManager;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
-import edu.uci.ics.asterix.transaction.management.exception.ACIDException;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
import edu.uci.ics.hyracks.api.job.JobSpecification;
@@ -47,41 +42,33 @@
public void compile(boolean optimize, boolean printRewrittenExpressions, boolean printLogicalPlan,
boolean printOptimizedPlan, boolean printPhysicalOpsOnly, boolean generateBinaryRuntime, boolean printJob)
- throws AsterixException, AlgebricksException, JSONException, RemoteException, ACIDException {
+ throws Exception {
queryJobSpec = null;
dmlJobs = null;
if (queryText == null) {
return;
}
- AQLParser parser = new AQLParser(queryText);
- Query q;
+ int ch;
+ StringBuilder builder = new StringBuilder();
+ while ((ch = queryText.read()) != -1) {
+ builder.append((char)ch);
+ }
+ AQLParser parser = new AQLParser(builder.toString());
+ List<Statement> aqlStatements;
try {
- q = (Query) parser.Statement();
+ aqlStatements = parser.Statement();
} catch (ParseException pe) {
throw new AsterixException(pe);
}
MetadataManager.INSTANCE.init();
SessionConfig pc = new SessionConfig(AsterixHyracksIntegrationUtil.DEFAULT_HYRACKS_CC_CLIENT_PORT, optimize,
- false, printRewrittenExpressions, printLogicalPlan, printOptimizedPlan, printPhysicalOpsOnly, printJob);
- pc.setGenerateJobSpec(generateBinaryRuntime);
+ false, printRewrittenExpressions, printLogicalPlan, printOptimizedPlan, printPhysicalOpsOnly,
+ generateBinaryRuntime, printJob);
- String dataverseName = null;
- if (q != null) {
- dataverseName = APIFramework.compileDdlStatements(hcc, q, writer, pc, DisplayFormat.TEXT);
- dmlJobs = APIFramework.compileDmlStatements(dataverseName, q, writer, pc, DisplayFormat.TEXT);
- }
-
- if (q.isDummyQuery()) {
- return;
- }
-
- Pair<AqlCompiledMetadataDeclarations, JobSpecification> metadataAndSpec = APIFramework.compileQuery(
- dataverseName, q, parser.getVarCounter(), null, null, pc, writer, DisplayFormat.TEXT, null);
- if (metadataAndSpec != null) {
- queryJobSpec = metadataAndSpec.second;
- }
+ AqlTranslator aqlTranslator = new AqlTranslator(aqlStatements, writer, pc, DisplayFormat.TEXT);
+ aqlTranslator.compileAndExecute(hcc);
writer.flush();
}
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
new file mode 100644
index 0000000..508126f
--- /dev/null
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java
@@ -0,0 +1,850 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.aql.translator;
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.json.JSONException;
+
+import edu.uci.ics.asterix.api.common.APIFramework;
+import edu.uci.ics.asterix.api.common.APIFramework.DisplayFormat;
+import edu.uci.ics.asterix.api.common.Job;
+import edu.uci.ics.asterix.api.common.SessionConfig;
+import edu.uci.ics.asterix.aql.base.Statement;
+import edu.uci.ics.asterix.aql.expression.BeginFeedStatement;
+import edu.uci.ics.asterix.aql.expression.ControlFeedStatement;
+import edu.uci.ics.asterix.aql.expression.CreateDataverseStatement;
+import edu.uci.ics.asterix.aql.expression.CreateFunctionStatement;
+import edu.uci.ics.asterix.aql.expression.CreateIndexStatement;
+import edu.uci.ics.asterix.aql.expression.DatasetDecl;
+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.DropStatement;
+import edu.uci.ics.asterix.aql.expression.ExternalDetailsDecl;
+import edu.uci.ics.asterix.aql.expression.FeedDetailsDecl;
+import edu.uci.ics.asterix.aql.expression.FunctionDecl;
+import edu.uci.ics.asterix.aql.expression.FunctionDropStatement;
+import edu.uci.ics.asterix.aql.expression.Identifier;
+import edu.uci.ics.asterix.aql.expression.IndexDropStatement;
+import edu.uci.ics.asterix.aql.expression.InsertStatement;
+import edu.uci.ics.asterix.aql.expression.InternalDetailsDecl;
+import edu.uci.ics.asterix.aql.expression.LoadFromFileStatement;
+import edu.uci.ics.asterix.aql.expression.NodeGroupDropStatement;
+import edu.uci.ics.asterix.aql.expression.NodegroupDecl;
+import edu.uci.ics.asterix.aql.expression.Query;
+import edu.uci.ics.asterix.aql.expression.SetStatement;
+import edu.uci.ics.asterix.aql.expression.TypeDecl;
+import edu.uci.ics.asterix.aql.expression.TypeDropStatement;
+import edu.uci.ics.asterix.aql.expression.WriteFromQueryResultStatement;
+import edu.uci.ics.asterix.aql.expression.WriteStatement;
+import edu.uci.ics.asterix.common.config.DatasetConfig.DatasetType;
+import edu.uci.ics.asterix.common.config.GlobalConfig;
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
+import edu.uci.ics.asterix.file.DatasetOperations;
+import edu.uci.ics.asterix.file.FeedOperations;
+import edu.uci.ics.asterix.file.IndexOperations;
+import edu.uci.ics.asterix.formats.base.IDataFormat;
+import edu.uci.ics.asterix.metadata.IDatasetDetails;
+import edu.uci.ics.asterix.metadata.MetadataException;
+import edu.uci.ics.asterix.metadata.MetadataManager;
+import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
+import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
+import edu.uci.ics.asterix.metadata.entities.Dataset;
+import edu.uci.ics.asterix.metadata.entities.Datatype;
+import edu.uci.ics.asterix.metadata.entities.Dataverse;
+import edu.uci.ics.asterix.metadata.entities.ExternalDatasetDetails;
+import edu.uci.ics.asterix.metadata.entities.FeedDatasetDetails;
+import edu.uci.ics.asterix.metadata.entities.Function;
+import edu.uci.ics.asterix.metadata.entities.Index;
+import edu.uci.ics.asterix.metadata.entities.InternalDatasetDetails;
+import edu.uci.ics.asterix.metadata.entities.NodeGroup;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.types.TypeSignature;
+import edu.uci.ics.asterix.transaction.management.exception.ACIDException;
+import edu.uci.ics.asterix.transaction.management.service.transaction.TransactionIDFactory;
+import edu.uci.ics.asterix.translator.AbstractAqlTranslator;
+import edu.uci.ics.asterix.translator.CompiledStatements.CompiledBeginFeedStatement;
+import edu.uci.ics.asterix.translator.CompiledStatements.CompiledControlFeedStatement;
+import edu.uci.ics.asterix.translator.CompiledStatements.CompiledCreateIndexStatement;
+import edu.uci.ics.asterix.translator.CompiledStatements.CompiledDatasetDropStatement;
+import edu.uci.ics.asterix.translator.CompiledStatements.CompiledDeleteStatement;
+import edu.uci.ics.asterix.translator.CompiledStatements.CompiledIndexDropStatement;
+import edu.uci.ics.asterix.translator.CompiledStatements.CompiledInsertStatement;
+import edu.uci.ics.asterix.translator.CompiledStatements.CompiledLoadFromFileStatement;
+import edu.uci.ics.asterix.translator.CompiledStatements.CompiledWriteFromQueryResultStatement;
+import edu.uci.ics.asterix.translator.CompiledStatements.ICompiledDmlStatement;
+import edu.uci.ics.asterix.translator.TypeTranslator;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression.FunctionKind;
+import edu.uci.ics.hyracks.algebricks.data.IAWriterFactory;
+import edu.uci.ics.hyracks.algebricks.runtime.writers.PrinterBasedWriterFactory;
+import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
+import edu.uci.ics.hyracks.api.io.FileReference;
+import edu.uci.ics.hyracks.api.job.JobId;
+import edu.uci.ics.hyracks.api.job.JobSpecification;
+import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
+
+/*
+ * Provides functionality for executing a batch of AQL statements (queries included)
+ * sequentially.
+ */
+public class AqlTranslator extends AbstractAqlTranslator {
+
+ private final List<Statement> aqlStatements;
+ private final PrintWriter out;
+ private final SessionConfig sessionConfig;
+ private final DisplayFormat pdf;
+ private Dataverse activeDefaultDataverse;
+ private List<FunctionDecl> declaredFunctions;
+
+ public AqlTranslator(List<Statement> aqlStatements, PrintWriter out, SessionConfig pc, DisplayFormat pdf)
+ throws MetadataException, AsterixException {
+ this.aqlStatements = aqlStatements;
+ this.out = out;
+ this.sessionConfig = pc;
+ this.pdf = pdf;
+ declaredFunctions = getDeclaredFunctions(aqlStatements);
+ }
+
+ private List<FunctionDecl> getDeclaredFunctions(List<Statement> statements) {
+ List<FunctionDecl> functionDecls = new ArrayList<FunctionDecl>();
+ for (Statement st : statements) {
+ if (st.getKind().equals(Statement.Kind.FUNCTION_DECL)) {
+ functionDecls.add((FunctionDecl) st);
+ }
+ }
+ return functionDecls;
+ }
+
+ /**
+ * Compiles and submits for execution a list of AQL statements.
+ * @param hcc AHyracks client connection that is used to submit a jobspec to Hyracks.
+ * @return A List<QueryResult> containing a QueryResult instance corresponding to each submitted query.
+ * @throws Exception
+ */
+ public List<QueryResult> compileAndExecute(IHyracksClientConnection hcc) throws Exception {
+ List<QueryResult> executionResult = new ArrayList<QueryResult>();
+ FileSplit outputFile = null;
+ IAWriterFactory writerFactory = PrinterBasedWriterFactory.INSTANCE;
+ Map<String, String> config = new HashMap<String, String>();
+ List<JobSpecification> jobsToExecute = new ArrayList<JobSpecification>();
+
+ for (Statement stmt : aqlStatements) {
+ validateOperation(activeDefaultDataverse, stmt);
+ MetadataTransactionContext mdTxnCtx = MetadataManager.INSTANCE.beginTransaction();
+ AqlMetadataProvider metadataProvider = new AqlMetadataProvider(mdTxnCtx, activeDefaultDataverse);
+ metadataProvider.setWriterFactory(writerFactory);
+ metadataProvider.setOutputFile(outputFile);
+ metadataProvider.setConfig(config);
+ jobsToExecute.clear();
+ try {
+ switch (stmt.getKind()) {
+ case SET: {
+ handleSetStatement(metadataProvider, stmt, config, jobsToExecute);
+ break;
+ }
+ case DATAVERSE_DECL: {
+ activeDefaultDataverse = handleUseDataverseStatement(metadataProvider, stmt, jobsToExecute);
+ break;
+ }
+ case CREATE_DATAVERSE: {
+ handleCreateDataverseStatement(metadataProvider, stmt, jobsToExecute);
+ break;
+ }
+ case DATASET_DECL: {
+ handleCreateDatasetStatement(metadataProvider, stmt, hcc, jobsToExecute);
+ break;
+ }
+ case CREATE_INDEX: {
+ handleCreateIndexStatement(metadataProvider, stmt, hcc, jobsToExecute);
+ break;
+ }
+ case TYPE_DECL: {
+ handleCreateTypeStatement(metadataProvider, stmt, jobsToExecute);
+ break;
+ }
+ case NODEGROUP_DECL: {
+ handleCreateNodeGroupStatement(metadataProvider, stmt, jobsToExecute);
+ break;
+ }
+ case DATAVERSE_DROP: {
+ handleDataverseDropStatement(metadataProvider, stmt, hcc, jobsToExecute);
+ break;
+ }
+ case DATASET_DROP: {
+ handleDatasetDropStatement(metadataProvider, stmt, hcc, jobsToExecute);
+ break;
+ }
+ case INDEX_DROP: {
+ handleIndexDropStatement(metadataProvider, stmt, hcc, jobsToExecute);
+ break;
+ }
+ case TYPE_DROP: {
+ handleTypeDropStatement(metadataProvider, stmt, jobsToExecute);
+ break;
+ }
+ case NODEGROUP_DROP: {
+ handleNodegroupDropStatement(metadataProvider, stmt, jobsToExecute);
+ break;
+ }
+
+ case CREATE_FUNCTION: {
+ handleCreateFunctionStatement(metadataProvider, stmt, jobsToExecute);
+ break;
+ }
+
+ case FUNCTION_DROP: {
+ handleFunctionDropStatement(metadataProvider, stmt, jobsToExecute);
+ break;
+ }
+
+ case LOAD_FROM_FILE: {
+ handleLoadFromFileStatement(metadataProvider, stmt, hcc, jobsToExecute);
+ break;
+ }
+ case WRITE_FROM_QUERY_RESULT: {
+ handleWriteFromQueryResultStatement(metadataProvider, stmt, hcc, jobsToExecute);
+ break;
+ }
+ case INSERT: {
+ handleInsertStatement(metadataProvider, stmt, hcc, jobsToExecute);
+ break;
+ }
+ case DELETE: {
+ handleDeleteStatement(metadataProvider, stmt, hcc, jobsToExecute);
+ break;
+ }
+
+ case BEGIN_FEED: {
+ handleBeginFeedStatement(metadataProvider, stmt, hcc, jobsToExecute);
+ break;
+ }
+
+ case CONTROL_FEED: {
+ handleControlFeedStatement(metadataProvider, stmt, hcc, jobsToExecute);
+ break;
+ }
+
+ case QUERY: {
+ executionResult.add(handleQuery(metadataProvider, (Query) stmt, hcc, jobsToExecute));
+ break;
+ }
+
+ case WRITE: {
+ Pair<IAWriterFactory, FileSplit> result = handleWriteStatement(metadataProvider, stmt,
+ jobsToExecute);
+ if (result.first != null) {
+ writerFactory = result.first;
+ }
+ outputFile = result.second;
+ break;
+ }
+
+ }
+ MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
+ } catch (Exception e) {
+ MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
+ throw new AlgebricksException(e);
+ }
+ // Following jobs are run under a separate transaction, that is committed/aborted by the JobEventListener
+ for (JobSpecification jobspec : jobsToExecute) {
+ runJob(hcc, jobspec);
+ }
+ }
+ return executionResult;
+ }
+
+ private void handleSetStatement(AqlMetadataProvider metadataProvider, Statement stmt, Map<String, String> config,
+ List<JobSpecification> jobsToExecute) throws RemoteException, ACIDException {
+ SetStatement ss = (SetStatement) stmt;
+ String pname = ss.getPropName();
+ String pvalue = ss.getPropValue();
+ config.put(pname, pvalue);
+ }
+
+ private Pair<IAWriterFactory, FileSplit> handleWriteStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ List<JobSpecification> jobsToExecute) throws InstantiationException, IllegalAccessException,
+ ClassNotFoundException {
+ WriteStatement ws = (WriteStatement) stmt;
+ File f = new File(ws.getFileName());
+ FileSplit outputFile = new FileSplit(ws.getNcName().getValue(), new FileReference(f));
+ IAWriterFactory writerFactory = null;
+ if (ws.getWriterClassName() != null) {
+ writerFactory = (IAWriterFactory) Class.forName(ws.getWriterClassName()).newInstance();
+ }
+ return new Pair<IAWriterFactory, FileSplit>(writerFactory, outputFile);
+ }
+
+ private Dataverse handleUseDataverseStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ List<JobSpecification> jobsToExecute) throws MetadataException, RemoteException, ACIDException {
+ DataverseDecl dvd = (DataverseDecl) stmt;
+ String dvName = dvd.getDataverseName().getValue();
+ Dataverse dv = MetadataManager.INSTANCE.getDataverse(metadataProvider.getMetadataTxnContext(), dvName);
+ if (dv == null) {
+ throw new MetadataException("Unknown dataverse " + dvName);
+ }
+ return dv;
+ }
+
+ private void handleCreateDataverseStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ List<JobSpecification> jobsToExecute) throws MetadataException, AlgebricksException, RemoteException,
+ ACIDException {
+ CreateDataverseStatement stmtCreateDataverse = (CreateDataverseStatement) stmt;
+ String dvName = stmtCreateDataverse.getDataverseName().getValue();
+ Dataverse dv = MetadataManager.INSTANCE.getDataverse(metadataProvider.getMetadataTxnContext(), dvName);
+ if (dv != null && !stmtCreateDataverse.getIfNotExists()) {
+ throw new AlgebricksException("A dataverse with this name " + dvName + " already exists.");
+ }
+ MetadataManager.INSTANCE.addDataverse(metadataProvider.getMetadataTxnContext(), new Dataverse(dvName,
+ stmtCreateDataverse.getFormat()));
+ }
+
+ private void handleCreateDatasetStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ IHyracksClientConnection hcc, List<JobSpecification> jobsToExecute) throws AsterixException, Exception {
+ DatasetDecl dd = (DatasetDecl) stmt;
+ String dataverseName = dd.getDataverse() != null ? dd.getDataverse().getValue()
+ : activeDefaultDataverse != null ? activeDefaultDataverse.getDataverseName() : null;
+ if (dataverseName == null) {
+ throw new AlgebricksException(" dataverse not specified ");
+ }
+ String datasetName = dd.getName().getValue();
+ DatasetType dsType = dd.getDatasetType();
+ String itemTypeName = dd.getItemTypeName().getValue();
+
+ IDatasetDetails datasetDetails = null;
+ Dataset ds = MetadataManager.INSTANCE.getDataset(metadataProvider.getMetadataTxnContext(), dataverseName,
+ datasetName);
+ if (ds != null) {
+ if (dd.getIfNotExists()) {
+ return;
+ } else {
+ throw new AlgebricksException("A dataset with this name " + datasetName + " already exists.");
+ }
+ }
+ Datatype dt = MetadataManager.INSTANCE.getDatatype(metadataProvider.getMetadataTxnContext(), dataverseName,
+ itemTypeName);
+ if (dt == null) {
+ throw new AlgebricksException(": type " + itemTypeName + " could not be found.");
+ }
+ switch (dd.getDatasetType()) {
+ case INTERNAL: {
+ IAType itemType = dt.getDatatype();
+ if (itemType.getTypeTag() != ATypeTag.RECORD) {
+ throw new AlgebricksException("Can only partition ARecord's.");
+ }
+ List<String> partitioningExprs = ((InternalDetailsDecl) dd.getDatasetDetailsDecl())
+ .getPartitioningExprs();
+ String ngName = ((InternalDetailsDecl) dd.getDatasetDetailsDecl()).getNodegroupName().getValue();
+ datasetDetails = new InternalDatasetDetails(InternalDatasetDetails.FileStructure.BTREE,
+ InternalDatasetDetails.PartitioningStrategy.HASH, partitioningExprs, partitioningExprs, ngName);
+ break;
+ }
+ case EXTERNAL: {
+ String adapter = ((ExternalDetailsDecl) dd.getDatasetDetailsDecl()).getAdapter();
+ Map<String, String> properties = ((ExternalDetailsDecl) dd.getDatasetDetailsDecl()).getProperties();
+ datasetDetails = new ExternalDatasetDetails(adapter, properties);
+ break;
+ }
+ case FEED: {
+ IAType itemType = dt.getDatatype();
+ if (itemType.getTypeTag() != ATypeTag.RECORD) {
+ throw new AlgebricksException("Can only partition ARecord's.");
+ }
+ List<String> partitioningExprs = ((FeedDetailsDecl) dd.getDatasetDetailsDecl()).getPartitioningExprs();
+ String ngName = ((FeedDetailsDecl) dd.getDatasetDetailsDecl()).getNodegroupName().getValue();
+ String adapter = ((FeedDetailsDecl) dd.getDatasetDetailsDecl()).getAdapterFactoryClassname();
+ Map<String, String> configuration = ((FeedDetailsDecl) dd.getDatasetDetailsDecl()).getConfiguration();
+ FunctionSignature signature = ((FeedDetailsDecl) dd.getDatasetDetailsDecl()).getFunctionSignature();
+ datasetDetails = new FeedDatasetDetails(InternalDatasetDetails.FileStructure.BTREE,
+ InternalDatasetDetails.PartitioningStrategy.HASH, partitioningExprs, partitioningExprs, ngName,
+ adapter, configuration, signature, FeedDatasetDetails.FeedState.INACTIVE.toString());
+ break;
+ }
+ }
+ MetadataManager.INSTANCE.addDataset(metadataProvider.getMetadataTxnContext(), new Dataset(dataverseName,
+ datasetName, itemTypeName, datasetDetails, dsType));
+ if (dd.getDatasetType() == DatasetType.INTERNAL || dd.getDatasetType() == DatasetType.FEED) {
+ Dataverse dataverse = MetadataManager.INSTANCE.getDataverse(metadataProvider.getMetadataTxnContext(),
+ dataverseName);
+ runJob(hcc, DatasetOperations.createDatasetJobSpec(dataverse, datasetName, metadataProvider));
+ }
+ }
+
+ private void handleCreateIndexStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ IHyracksClientConnection hcc, List<JobSpecification> jobsToExecute) throws Exception {
+ CreateIndexStatement stmtCreateIndex = (CreateIndexStatement) stmt;
+ String dataverseName = stmtCreateIndex.getDataverseName() == null ? activeDefaultDataverse == null ? null
+ : activeDefaultDataverse.getDataverseName() : stmtCreateIndex.getDataverseName().getValue();
+ if (dataverseName == null) {
+ throw new AlgebricksException(" dataverse not specified ");
+ }
+ String datasetName = stmtCreateIndex.getDatasetName().getValue();
+ Dataset ds = MetadataManager.INSTANCE.getDataset(metadataProvider.getMetadataTxnContext(), dataverseName,
+ datasetName);
+ if (ds == null) {
+ throw new AlgebricksException("There is no dataset with this name " + datasetName + " in dataverse "
+ + dataverseName);
+ }
+ String indexName = stmtCreateIndex.getIndexName().getValue();
+ Index idx = MetadataManager.INSTANCE.getIndex(metadataProvider.getMetadataTxnContext(), dataverseName,
+ datasetName, indexName);
+ if (idx != null) {
+ if (!stmtCreateIndex.getIfNotExists()) {
+ throw new AlgebricksException("An index with this name " + indexName + " already exists.");
+ } else {
+ stmtCreateIndex.setNeedToCreate(false);
+ }
+ } else {
+ Index index = new Index(dataverseName, datasetName, indexName, stmtCreateIndex.getIndexType(),
+ stmtCreateIndex.getFieldExprs(), stmtCreateIndex.getGramLength(), false);
+ MetadataManager.INSTANCE.addIndex(metadataProvider.getMetadataTxnContext(), index);
+ runCreateIndexJob(hcc, stmtCreateIndex, metadataProvider);
+
+ CompiledCreateIndexStatement cis = new CompiledCreateIndexStatement(index.getIndexName(), dataverseName,
+ index.getDatasetName(), index.getKeyFieldNames(), index.getGramLength(), index.getIndexType());
+ JobSpecification loadIndexJobSpec = IndexOperations
+ .buildSecondaryIndexLoadingJobSpec(cis, metadataProvider);
+ runJob(hcc, loadIndexJobSpec);
+ }
+ }
+
+ private void handleCreateTypeStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ List<JobSpecification> jobsToExecute) throws AlgebricksException, RemoteException, ACIDException,
+ MetadataException {
+ MetadataTransactionContext mdTxnCtx = metadataProvider.getMetadataTxnContext();
+ TypeDecl stmtCreateType = (TypeDecl) stmt;
+ String dataverseName = stmtCreateType.getDataverseName() == null ? activeDefaultDataverse == null ? null
+ : activeDefaultDataverse.getDataverseName() : stmtCreateType.getDataverseName().getValue();
+ if (dataverseName == null) {
+ throw new AlgebricksException(" dataverse not specified ");
+ }
+ String typeName = stmtCreateType.getIdent().getValue();
+ Dataverse dv = MetadataManager.INSTANCE.getDataverse(mdTxnCtx, dataverseName);
+ if (dv == null) {
+ throw new AlgebricksException("Unknonw dataverse " + dataverseName);
+ }
+ Datatype dt = MetadataManager.INSTANCE.getDatatype(mdTxnCtx, dataverseName, typeName);
+ if (dt != null) {
+ if (!stmtCreateType.getIfNotExists())
+ throw new AlgebricksException("A datatype with this name " + typeName + " already exists.");
+ } else {
+ if (builtinTypeMap.get(typeName) != null) {
+ throw new AlgebricksException("Cannot redefine builtin type " + typeName + ".");
+ } else {
+ Map<TypeSignature, IAType> typeMap = TypeTranslator.computeTypes(mdTxnCtx, (TypeDecl) stmt,
+ dataverseName);
+ TypeSignature typeSignature = new TypeSignature(dataverseName, typeName);
+ IAType type = typeMap.get(typeSignature);
+ MetadataManager.INSTANCE.addDatatype(mdTxnCtx, new Datatype(dataverseName, typeName, type, false));
+ }
+ }
+ }
+
+ private void handleDataverseDropStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ IHyracksClientConnection hcc, List<JobSpecification> jobsToExecute) throws Exception {
+ MetadataTransactionContext mdTxnCtx = metadataProvider.getMetadataTxnContext();
+ DataverseDropStatement stmtDelete = (DataverseDropStatement) stmt;
+ String dvName = stmtDelete.getDataverseName().getValue();
+
+ Dataverse dv = MetadataManager.INSTANCE.getDataverse(mdTxnCtx, dvName);
+ if (dv == null) {
+ if (!stmtDelete.getIfExists()) {
+ throw new AlgebricksException("There is no dataverse with this name " + dvName + ".");
+ }
+ } else {
+ List<Dataset> datasets = MetadataManager.INSTANCE.getDataverseDatasets(mdTxnCtx, dvName);
+ for (int j = 0; j < datasets.size(); j++) {
+ String datasetName = datasets.get(j).getDatasetName();
+ DatasetType dsType = datasets.get(j).getDatasetType();
+ if (dsType == DatasetType.INTERNAL || dsType == DatasetType.FEED) {
+ List<Index> indexes = MetadataManager.INSTANCE.getDatasetIndexes(mdTxnCtx, dvName, datasetName);
+ for (int k = 0; k < indexes.size(); k++) {
+ if (indexes.get(k).isSecondaryIndex()) {
+ compileIndexDropStatement(hcc, dvName, datasetName, indexes.get(k).getIndexName(),
+ metadataProvider);
+ }
+ }
+ }
+ compileDatasetDropStatement(hcc, dvName, datasetName, metadataProvider);
+ }
+
+ MetadataManager.INSTANCE.dropDataverse(mdTxnCtx, dvName);
+ if (activeDefaultDataverse != null && activeDefaultDataverse.getDataverseName() == dvName) {
+ activeDefaultDataverse = null;
+ }
+ }
+ }
+
+ private void handleDatasetDropStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ IHyracksClientConnection hcc, List<JobSpecification> jobsToExecute) throws Exception {
+ MetadataTransactionContext mdTxnCtx = metadataProvider.getMetadataTxnContext();
+ DropStatement stmtDelete = (DropStatement) stmt;
+ String dataverseName = stmtDelete.getDataverseName() == null ? activeDefaultDataverse == null ? null
+ : activeDefaultDataverse.getDataverseName() : stmtDelete.getDataverseName().getValue();
+ if (dataverseName == null) {
+ throw new AlgebricksException(" dataverse not specified ");
+ }
+ String datasetName = stmtDelete.getDatasetName().getValue();
+ Dataset ds = MetadataManager.INSTANCE.getDataset(mdTxnCtx, dataverseName, datasetName);
+ if (ds == null) {
+ if (!stmtDelete.getIfExists())
+ throw new AlgebricksException("There is no dataset with this name " + datasetName + " in dataverse "
+ + dataverseName + ".");
+ } else {
+ if (ds.getDatasetType() == DatasetType.INTERNAL || ds.getDatasetType() == DatasetType.FEED) {
+ List<Index> indexes = MetadataManager.INSTANCE.getDatasetIndexes(mdTxnCtx, dataverseName, datasetName);
+ for (int j = 0; j < indexes.size(); j++) {
+ if (indexes.get(j).isPrimaryIndex()) {
+ compileIndexDropStatement(hcc, dataverseName, datasetName, indexes.get(j).getIndexName(),
+ metadataProvider);
+ }
+ }
+ }
+ compileDatasetDropStatement(hcc, dataverseName, datasetName, metadataProvider);
+ }
+ }
+
+ private void handleIndexDropStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ IHyracksClientConnection hcc, List<JobSpecification> jobsToExecute) throws Exception {
+ MetadataTransactionContext mdTxnCtx = metadataProvider.getMetadataTxnContext();
+ IndexDropStatement stmtIndexDrop = (IndexDropStatement) stmt;
+ String datasetName = stmtIndexDrop.getDatasetName().getValue();
+ String dataverseName = stmtIndexDrop.getDataverseName() == null ? activeDefaultDataverse == null ? null
+ : activeDefaultDataverse.getDataverseName() : stmtIndexDrop.getDataverseName().getValue();
+ if (dataverseName == null) {
+ throw new AlgebricksException(" dataverse not specified ");
+ }
+ Dataset ds = MetadataManager.INSTANCE.getDataset(mdTxnCtx, dataverseName, datasetName);
+ if (ds == null)
+ throw new AlgebricksException("There is no dataset with this name " + datasetName + " in dataverse "
+ + dataverseName);
+ if (ds.getDatasetType() == DatasetType.INTERNAL || ds.getDatasetType() == DatasetType.FEED) {
+ String indexName = stmtIndexDrop.getIndexName().getValue();
+ Index idx = MetadataManager.INSTANCE.getIndex(mdTxnCtx, dataverseName, datasetName, indexName);
+ if (idx == null) {
+ if (!stmtIndexDrop.getIfExists())
+ throw new AlgebricksException("There is no index with this name " + indexName + ".");
+ } else
+ compileIndexDropStatement(hcc, dataverseName, datasetName, indexName, metadataProvider);
+ } else {
+ throw new AlgebricksException(datasetName
+ + " is an external dataset. Indexes are not maintained for external datasets.");
+ }
+ }
+
+ private void handleTypeDropStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ List<JobSpecification> jobsToExecute) throws AlgebricksException, MetadataException, RemoteException,
+ ACIDException {
+ MetadataTransactionContext mdTxnCtx = metadataProvider.getMetadataTxnContext();
+ TypeDropStatement stmtTypeDrop = (TypeDropStatement) stmt;
+ String dataverseName = stmtTypeDrop.getDataverseName() == null ? (activeDefaultDataverse == null ? null
+ : activeDefaultDataverse.getDataverseName()) : stmtTypeDrop.getDataverseName().getValue();
+ if (dataverseName == null) {
+ throw new AlgebricksException(" dataverse not specified ");
+ }
+ String typeName = stmtTypeDrop.getTypeName().getValue();
+ Datatype dt = MetadataManager.INSTANCE.getDatatype(mdTxnCtx, dataverseName, typeName);
+ if (dt == null) {
+ if (!stmtTypeDrop.getIfExists())
+ throw new AlgebricksException("There is no datatype with this name " + typeName + ".");
+ } else {
+ MetadataManager.INSTANCE.dropDatatype(mdTxnCtx, dataverseName, typeName);
+ }
+ }
+
+ private void handleNodegroupDropStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ List<JobSpecification> jobsToExecute) throws MetadataException, AlgebricksException, RemoteException,
+ ACIDException {
+ MetadataTransactionContext mdTxnCtx = metadataProvider.getMetadataTxnContext();
+ NodeGroupDropStatement stmtDelete = (NodeGroupDropStatement) stmt;
+ String nodegroupName = stmtDelete.getNodeGroupName().getValue();
+ NodeGroup ng = MetadataManager.INSTANCE.getNodegroup(mdTxnCtx, nodegroupName);
+ if (ng == null) {
+ if (!stmtDelete.getIfExists())
+ throw new AlgebricksException("There is no nodegroup with this name " + nodegroupName + ".");
+ } else {
+ MetadataManager.INSTANCE.dropNodegroup(mdTxnCtx, nodegroupName);
+ }
+ }
+
+ private void handleCreateFunctionStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ List<JobSpecification> jobsToExecute) throws AlgebricksException, MetadataException, RemoteException,
+ ACIDException {
+ MetadataTransactionContext mdTxnCtx = metadataProvider.getMetadataTxnContext();
+ CreateFunctionStatement cfs = (CreateFunctionStatement) stmt;
+ String dataverse = cfs.getSignature().getNamespace() == null ? activeDefaultDataverse == null ? null
+ : activeDefaultDataverse.getDataverseName() : cfs.getSignature().getNamespace();
+ if (dataverse == null) {
+ throw new AlgebricksException(" dataverse not specified ");
+ }
+ Dataverse dv = MetadataManager.INSTANCE.getDataverse(mdTxnCtx, dataverse);
+ if (dv == null) {
+ throw new AlgebricksException("There is no dataverse with this name " + dataverse + ".");
+ }
+ Function function = new Function(dataverse, cfs.getaAterixFunction().getName(), cfs.getaAterixFunction()
+ .getArity(), cfs.getParamList(), Function.RETURNTYPE_VOID, cfs.getFunctionBody(),
+ Function.LANGUAGE_AQL, FunctionKind.SCALAR.toString());
+ MetadataManager.INSTANCE.addFunction(mdTxnCtx, function);
+ }
+
+ private void handleFunctionDropStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ List<JobSpecification> jobsToExecute) throws MetadataException, RemoteException, ACIDException,
+ AlgebricksException {
+ MetadataTransactionContext mdTxnCtx = metadataProvider.getMetadataTxnContext();
+ FunctionDropStatement stmtDropFunction = (FunctionDropStatement) stmt;
+ FunctionSignature signature = stmtDropFunction.getFunctionSignature();
+ Function function = MetadataManager.INSTANCE.getFunction(mdTxnCtx, signature);
+ if (function == null) {
+ if (!stmtDropFunction.getIfExists())
+ throw new AlgebricksException("Unknonw function " + signature);
+ } else {
+ MetadataManager.INSTANCE.dropFunction(mdTxnCtx, signature);
+ }
+ }
+
+ private void handleLoadFromFileStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ IHyracksClientConnection hcc, List<JobSpecification> jobsToExecute) throws Exception {
+ MetadataTransactionContext mdTxnCtx = metadataProvider.getMetadataTxnContext();
+ LoadFromFileStatement loadStmt = (LoadFromFileStatement) stmt;
+ String dataverseName = loadStmt.getDataverseName() == null ? activeDefaultDataverse == null ? null
+ : activeDefaultDataverse.getDataverseName() : loadStmt.getDataverseName().getValue();
+ CompiledLoadFromFileStatement cls = new CompiledLoadFromFileStatement(dataverseName, loadStmt.getDatasetName()
+ .getValue(), loadStmt.getAdapter(), loadStmt.getProperties(), loadStmt.dataIsAlreadySorted());
+
+ IDataFormat format = getDataFormat(metadataProvider.getMetadataTxnContext(), dataverseName);
+ Job job = DatasetOperations.createLoadDatasetJobSpec(metadataProvider, cls, format);
+ jobsToExecute.add(job.getJobSpec());
+ // Also load the dataset's secondary indexes.
+ List<Index> datasetIndexes = MetadataManager.INSTANCE.getDatasetIndexes(mdTxnCtx, dataverseName, loadStmt
+ .getDatasetName().getValue());
+ for (Index index : datasetIndexes) {
+ if (!index.isSecondaryIndex()) {
+ continue;
+ }
+ // Create CompiledCreateIndexStatement from metadata entity 'index'.
+ CompiledCreateIndexStatement cis = new CompiledCreateIndexStatement(index.getIndexName(), dataverseName,
+ index.getDatasetName(), index.getKeyFieldNames(), index.getGramLength(), index.getIndexType());
+ jobsToExecute.add(IndexOperations.buildSecondaryIndexLoadingJobSpec(cis, metadataProvider));
+ }
+ }
+
+ private void handleWriteFromQueryResultStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ IHyracksClientConnection hcc, List<JobSpecification> jobsToExecute) throws Exception {
+ metadataProvider.setWriteTransaction(true);
+ WriteFromQueryResultStatement st1 = (WriteFromQueryResultStatement) stmt;
+ String dataverseName = st1.getDataverseName() == null ? activeDefaultDataverse == null ? null
+ : activeDefaultDataverse.getDataverseName() : st1.getDataverseName().getValue();
+ CompiledWriteFromQueryResultStatement clfrqs = new CompiledWriteFromQueryResultStatement(dataverseName, st1
+ .getDatasetName().getValue(), st1.getQuery(), st1.getVarCounter());
+
+ Pair<JobSpecification, FileSplit> compiled = rewriteCompileQuery(metadataProvider, clfrqs.getQuery(), clfrqs);
+ if (compiled.first != null) {
+ jobsToExecute.add(compiled.first);
+ }
+ }
+
+ private void handleInsertStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ IHyracksClientConnection hcc, List<JobSpecification> jobsToExecute) throws Exception {
+ metadataProvider.setWriteTransaction(true);
+ InsertStatement stmtInsert = (InsertStatement) stmt;
+ String dataverseName = stmtInsert.getDataverseName() == null ? activeDefaultDataverse == null ? null
+ : activeDefaultDataverse.getDataverseName() : stmtInsert.getDataverseName().getValue();
+ CompiledInsertStatement clfrqs = new CompiledInsertStatement(dataverseName, stmtInsert.getDatasetName()
+ .getValue(), stmtInsert.getQuery(), stmtInsert.getVarCounter());
+ Pair<JobSpecification, FileSplit> compiled = rewriteCompileQuery(metadataProvider, clfrqs.getQuery(), clfrqs);
+ if (compiled.first != null) {
+ jobsToExecute.add(compiled.first);
+ }
+ }
+
+ private void handleDeleteStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ IHyracksClientConnection hcc, List<JobSpecification> jobsToExecute) throws Exception {
+ metadataProvider.setWriteTransaction(true);
+ DeleteStatement stmtDelete = (DeleteStatement) stmt;
+ 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);
+ Pair<JobSpecification, FileSplit> compiled = rewriteCompileQuery(metadataProvider, clfrqs.getQuery(), clfrqs);
+ if (compiled.first != null) {
+ jobsToExecute.add(compiled.first);
+ }
+ }
+
+ private Pair<JobSpecification, FileSplit> rewriteCompileQuery(AqlMetadataProvider metadataProvider, Query query,
+ ICompiledDmlStatement stmt) throws AsterixException, RemoteException, AlgebricksException, JSONException,
+ ACIDException {
+
+ // Query Rewriting (happens under the same ongoing metadata transaction)
+ Pair<Query, Integer> reWrittenQuery = APIFramework.reWriteQuery(declaredFunctions, metadataProvider, query,
+ sessionConfig, out, pdf);
+
+ // Query Compilation (happens under the same ongoing metadata transaction)
+ if (metadataProvider.isWriteTransaction()) {
+ metadataProvider.setJobTxnId(TransactionIDFactory.generateTransactionId());
+ }
+ JobSpecification spec = APIFramework.compileQuery(declaredFunctions, metadataProvider, query,
+ reWrittenQuery.second, stmt == null ? null : stmt.getDatasetName(), sessionConfig, out, pdf, stmt);
+
+ Pair<JobSpecification, FileSplit> compiled = new Pair<JobSpecification, FileSplit>(spec,
+ metadataProvider.getOutputFile());
+ return compiled;
+
+ }
+
+ private void handleBeginFeedStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ IHyracksClientConnection hcc, List<JobSpecification> jobsToExecute) throws Exception {
+ BeginFeedStatement bfs = (BeginFeedStatement) stmt;
+ String dataverseName = bfs.getDataverseName() == null ? activeDefaultDataverse == null ? null
+ : activeDefaultDataverse.getDataverseName() : bfs.getDataverseName().getValue();
+
+ CompiledBeginFeedStatement cbfs = new CompiledBeginFeedStatement(dataverseName,
+ bfs.getDatasetName().getValue(), bfs.getQuery(), bfs.getVarCounter());
+
+ Dataset dataset = MetadataManager.INSTANCE.getDataset(metadataProvider.getMetadataTxnContext(), dataverseName, bfs
+ .getDatasetName().getValue());
+ if(dataset == null) {
+ throw new AsterixException("Unknown dataset :" + bfs.getDatasetName().getValue());
+ }
+ IDatasetDetails datasetDetails = dataset.getDatasetDetails();
+ if (datasetDetails.getDatasetType() != DatasetType.FEED) {
+ throw new IllegalArgumentException("Dataset " + bfs.getDatasetName().getValue() + " is not a feed dataset");
+ }
+ bfs.initialize(metadataProvider.getMetadataTxnContext(), dataset);
+ cbfs.setQuery(bfs.getQuery());
+ Pair<JobSpecification, FileSplit> compiled = rewriteCompileQuery(metadataProvider, bfs.getQuery(), cbfs);
+ if (compiled.first != null) {
+ jobsToExecute.add(compiled.first);
+ }
+ }
+
+ private void handleControlFeedStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ IHyracksClientConnection hcc, List<JobSpecification> jobsToExecute) throws Exception {
+ ControlFeedStatement cfs = (ControlFeedStatement) stmt;
+ String dataverseName = cfs.getDataverseName() == null ? activeDefaultDataverse == null ? null
+ : activeDefaultDataverse.getDataverseName() : cfs.getDataverseName().getValue();
+ CompiledControlFeedStatement clcfs = new CompiledControlFeedStatement(cfs.getOperationType(), dataverseName,
+ cfs.getDatasetName().getValue(), cfs.getAlterAdapterConfParams());
+ jobsToExecute.add(FeedOperations.buildControlFeedJobSpec(clcfs, metadataProvider));
+ }
+
+ private QueryResult handleQuery(AqlMetadataProvider metadataProvider, Query query, IHyracksClientConnection hcc,
+ List<JobSpecification> jobsToExecute) throws Exception {
+ Pair<JobSpecification, FileSplit> compiled = rewriteCompileQuery(metadataProvider, query, null);
+ if (compiled.first != null) {
+ GlobalConfig.ASTERIX_LOGGER.info(compiled.first.toJSON().toString(1));
+ jobsToExecute.add(compiled.first);
+ }
+ return new QueryResult(query, compiled.second.getLocalFile().getFile().getAbsolutePath());
+ }
+
+ private void runCreateIndexJob(IHyracksClientConnection hcc, CreateIndexStatement stmtCreateIndex,
+ AqlMetadataProvider metadataProvider) throws Exception {
+ // TODO: Eventually CreateIndexStatement and
+ // CompiledCreateIndexStatement should be replaced by the corresponding
+ // metadata entity.
+ // For now we must still convert to a CompiledCreateIndexStatement here.
+ String dataverseName = stmtCreateIndex.getDataverseName() == null ? activeDefaultDataverse == null ? null
+ : activeDefaultDataverse.getDataverseName() : stmtCreateIndex.getDataverseName().getValue();
+ CompiledCreateIndexStatement createIndexStmt = new CompiledCreateIndexStatement(stmtCreateIndex.getIndexName()
+ .getValue(), dataverseName, stmtCreateIndex.getDatasetName().getValue(),
+ stmtCreateIndex.getFieldExprs(), stmtCreateIndex.getGramLength(), stmtCreateIndex.getIndexType());
+ JobSpecification spec = IndexOperations.buildSecondaryIndexCreationJobSpec(createIndexStmt, metadataProvider);
+ if (spec == null) {
+ throw new AsterixException("Failed to create job spec for creating index '"
+ + stmtCreateIndex.getDatasetName() + "." + stmtCreateIndex.getIndexName() + "'");
+ }
+ runJob(hcc, spec);
+ }
+
+ private void handleCreateNodeGroupStatement(AqlMetadataProvider metadataProvider, Statement stmt,
+ List<JobSpecification> jobsToExecute) throws MetadataException, AlgebricksException, RemoteException,
+ ACIDException {
+ MetadataTransactionContext mdTxnCtx = metadataProvider.getMetadataTxnContext();
+ NodegroupDecl stmtCreateNodegroup = (NodegroupDecl) stmt;
+ String ngName = stmtCreateNodegroup.getNodegroupName().getValue();
+ NodeGroup ng = MetadataManager.INSTANCE.getNodegroup(mdTxnCtx, ngName);
+ if (ng != null) {
+ if (!stmtCreateNodegroup.getIfNotExists())
+ throw new AlgebricksException("A nodegroup with this name " + ngName + " already exists.");
+ } else {
+ List<Identifier> ncIdentifiers = stmtCreateNodegroup.getNodeControllerNames();
+ List<String> ncNames = new ArrayList<String>(ncIdentifiers.size());
+ for (Identifier id : ncIdentifiers) {
+ ncNames.add(id.getValue());
+ }
+ MetadataManager.INSTANCE.addNodegroup(mdTxnCtx, new NodeGroup(ngName, ncNames));
+ }
+ }
+
+ private void runJob(IHyracksClientConnection hcc, JobSpecification spec) throws Exception {
+ executeJobArray(hcc, new Job[] { new Job(spec) }, out, pdf);
+ }
+
+ private void compileIndexDropStatement(IHyracksClientConnection hcc, String dataverseName, String datasetName,
+ String indexName, AqlMetadataProvider metadataProvider) throws Exception {
+ CompiledIndexDropStatement cds = new CompiledIndexDropStatement(dataverseName, datasetName, indexName);
+ runJob(hcc, IndexOperations.buildDropSecondaryIndexJobSpec(cds, metadataProvider));
+ MetadataManager.INSTANCE.dropIndex(metadataProvider.getMetadataTxnContext(), dataverseName, datasetName,
+ indexName);
+ }
+
+ private void compileDatasetDropStatement(IHyracksClientConnection hcc, String dataverseName, String datasetName,
+ AqlMetadataProvider metadataProvider) throws Exception {
+ MetadataTransactionContext mdTxnCtx = metadataProvider.getMetadataTxnContext();
+ CompiledDatasetDropStatement cds = new CompiledDatasetDropStatement(dataverseName, datasetName);
+ Dataset ds = MetadataManager.INSTANCE.getDataset(mdTxnCtx, dataverseName, datasetName);
+ if (ds.getDatasetType() == DatasetType.INTERNAL || ds.getDatasetType() == DatasetType.FEED) {
+ JobSpecification[] jobSpecs = DatasetOperations.createDropDatasetJobSpec(cds, metadataProvider);
+ for (JobSpecification spec : jobSpecs)
+ runJob(hcc, spec);
+ }
+ MetadataManager.INSTANCE.dropDataset(mdTxnCtx, dataverseName, datasetName);
+ }
+
+ public void executeJobArray(IHyracksClientConnection hcc, Job[] jobs, PrintWriter out, DisplayFormat pdf)
+ throws Exception {
+ for (int i = 0; i < jobs.length; i++) {
+ JobSpecification spec = jobs[i].getJobSpec();
+ spec.setMaxReattempts(0);
+ JobId jobId = hcc.startJob(GlobalConfig.HYRACKS_APP_NAME, spec);
+ hcc.waitForCompletion(jobId);
+ }
+ }
+
+ private static IDataFormat getDataFormat(MetadataTransactionContext mdTxnCtx, String dataverseName)
+ throws AsterixException {
+ Dataverse dataverse = MetadataManager.INSTANCE.getDataverse(mdTxnCtx, dataverseName);
+ IDataFormat format;
+ try {
+ format = (IDataFormat) Class.forName(dataverse.getDataFormat()).newInstance();
+ } catch (Exception e) {
+ throw new AsterixException(e);
+ }
+ return format;
+ }
+
+}
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/DdlTranslator.java b/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/DdlTranslator.java
deleted file mode 100644
index c68817c..0000000
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/DdlTranslator.java
+++ /dev/null
@@ -1,1182 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.aql.translator;
-
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import edu.uci.ics.asterix.api.common.APIFramework.DisplayFormat;
-import edu.uci.ics.asterix.api.common.SessionConfig;
-import edu.uci.ics.asterix.aql.base.Statement;
-import edu.uci.ics.asterix.aql.base.Statement.Kind;
-import edu.uci.ics.asterix.aql.expression.CreateDataverseStatement;
-import edu.uci.ics.asterix.aql.expression.CreateFunctionStatement;
-import edu.uci.ics.asterix.aql.expression.CreateIndexStatement;
-import edu.uci.ics.asterix.aql.expression.DatasetDecl;
-import edu.uci.ics.asterix.aql.expression.DataverseDecl;
-import edu.uci.ics.asterix.aql.expression.DataverseDropStatement;
-import edu.uci.ics.asterix.aql.expression.DropStatement;
-import edu.uci.ics.asterix.aql.expression.ExternalDetailsDecl;
-import edu.uci.ics.asterix.aql.expression.FeedDetailsDecl;
-import edu.uci.ics.asterix.aql.expression.FunctionDropStatement;
-import edu.uci.ics.asterix.aql.expression.Identifier;
-import edu.uci.ics.asterix.aql.expression.IndexDropStatement;
-import edu.uci.ics.asterix.aql.expression.InternalDetailsDecl;
-import edu.uci.ics.asterix.aql.expression.NodeGroupDropStatement;
-import edu.uci.ics.asterix.aql.expression.NodegroupDecl;
-import edu.uci.ics.asterix.aql.expression.OrderedListTypeDefinition;
-import edu.uci.ics.asterix.aql.expression.Query;
-import edu.uci.ics.asterix.aql.expression.RecordTypeDefinition;
-import edu.uci.ics.asterix.aql.expression.RecordTypeDefinition.RecordKind;
-import edu.uci.ics.asterix.aql.expression.TypeDecl;
-import edu.uci.ics.asterix.aql.expression.TypeDropStatement;
-import edu.uci.ics.asterix.aql.expression.TypeExpression;
-import edu.uci.ics.asterix.aql.expression.TypeReferenceExpression;
-import edu.uci.ics.asterix.aql.expression.UnorderedListTypeDefinition;
-import edu.uci.ics.asterix.aql.util.FunctionUtils;
-import edu.uci.ics.asterix.common.config.DatasetConfig.DatasetType;
-import edu.uci.ics.asterix.common.config.GlobalConfig;
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
-import edu.uci.ics.asterix.common.parse.IParseFileSplitsDecl;
-import edu.uci.ics.asterix.file.DatasetOperations;
-import edu.uci.ics.asterix.file.IndexOperations;
-import edu.uci.ics.asterix.metadata.IDatasetDetails;
-import edu.uci.ics.asterix.metadata.MetadataException;
-import edu.uci.ics.asterix.metadata.MetadataManager;
-import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
-import edu.uci.ics.asterix.metadata.entities.AsterixBuiltinArtifactMap;
-import edu.uci.ics.asterix.metadata.entities.AsterixBuiltinArtifactMap.ARTIFACT_KIND;
-import edu.uci.ics.asterix.metadata.entities.AsterixBuiltinTypeMap;
-import edu.uci.ics.asterix.metadata.entities.Dataset;
-import edu.uci.ics.asterix.metadata.entities.Datatype;
-import edu.uci.ics.asterix.metadata.entities.Dataverse;
-import edu.uci.ics.asterix.metadata.entities.ExternalDatasetDetails;
-import edu.uci.ics.asterix.metadata.entities.FeedDatasetDetails;
-import edu.uci.ics.asterix.metadata.entities.Function;
-import edu.uci.ics.asterix.metadata.entities.Index;
-import edu.uci.ics.asterix.metadata.entities.InternalDatasetDetails;
-import edu.uci.ics.asterix.metadata.entities.NodeGroup;
-import edu.uci.ics.asterix.om.types.AOrderedListType;
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.AUnionType;
-import edu.uci.ics.asterix.om.types.AUnorderedListType;
-import edu.uci.ics.asterix.om.types.AbstractCollectionType;
-import edu.uci.ics.asterix.om.types.BuiltinType;
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.translator.AbstractAqlTranslator;
-import edu.uci.ics.asterix.translator.DmlTranslator.CompiledCreateIndexStatement;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
-import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
-import edu.uci.ics.hyracks.api.job.JobId;
-import edu.uci.ics.hyracks.api.job.JobSpecification;
-import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
-
-public class DdlTranslator extends AbstractAqlTranslator {
-
- private final MetadataTransactionContext mdTxnCtx;
- private final List<Statement> aqlStatements;
- private final PrintWriter out;
- private final SessionConfig pc;
- private final DisplayFormat pdf;
- private AqlCompiledMetadataDeclarations compiledDeclarations;
-
- private static Map<String, BuiltinType> builtinTypeMap;
-
- public DdlTranslator(MetadataTransactionContext mdTxnCtx,
- List<Statement> aqlStatements, PrintWriter out, SessionConfig pc,
- DisplayFormat pdf) {
- this.mdTxnCtx = mdTxnCtx;
- this.aqlStatements = aqlStatements;
- this.out = out;
- this.pc = pc;
- this.pdf = pdf;
- builtinTypeMap = AsterixBuiltinTypeMap.getBuiltinTypes();
- }
-
- public void translate(IHyracksClientConnection hcc,
- boolean disconnectFromDataverse) throws AlgebricksException {
- try {
- compiledDeclarations = compileMetadata(mdTxnCtx, aqlStatements,
- true);
- compileAndExecuteDDLstatements(hcc, mdTxnCtx,
- disconnectFromDataverse);
- } catch (Exception e) {
- throw new AlgebricksException(e);
- }
- }
-
- private void compileAndExecuteDDLstatements(IHyracksClientConnection hcc,
- MetadataTransactionContext mdTxnCtx, boolean disconnectFromDataverse)
- throws Exception {
- for (Statement stmt : aqlStatements) {
- validateOperation(compiledDeclarations, stmt);
- switch (stmt.getKind()) {
- case DATAVERSE_DECL: {
- checkForDataverseConnection(false);
- DataverseDecl dvd = (DataverseDecl) stmt;
- String dataverseName = dvd.getDataverseName().getValue();
- compiledDeclarations.connectToDataverse(dataverseName);
- break;
- }
-
- case CREATE_DATAVERSE: {
- checkForDataverseConnection(false);
- CreateDataverseStatement stmtCreateDataverse = (CreateDataverseStatement) stmt;
- String dvName = stmtCreateDataverse.getDataverseName()
- .getValue();
- Dataverse dv = MetadataManager.INSTANCE.getDataverse(mdTxnCtx,
- dvName);
- if (dv != null && !stmtCreateDataverse.getIfNotExists()) {
- throw new AlgebricksException("A dataverse with this name "
- + dvName + " already exists.");
- }
- MetadataManager.INSTANCE.addDataverse(mdTxnCtx, new Dataverse(
- dvName, stmtCreateDataverse.getFormat()));
- break;
- }
-
- case DATASET_DECL: {
- checkForDataverseConnection(true);
- DatasetDecl dd = (DatasetDecl) stmt;
- String datasetName = dd.getName().getValue();
- DatasetType dsType = dd.getDatasetType();
- String itemTypeName = null;
- IDatasetDetails datasetDetails = null;
- Dataset ds = MetadataManager.INSTANCE.getDataset(mdTxnCtx,
- compiledDeclarations.getDataverseName(), datasetName);
- if (ds != null) {
- if (dd.getIfNotExists()) {
- continue;
- } else {
- throw new AlgebricksException(
- "A dataset with this name " + datasetName
- + " already exists.");
- }
- }
- itemTypeName = dd.getItemTypeName().getValue();
- Datatype dt = MetadataManager.INSTANCE.getDatatype(mdTxnCtx,
- compiledDeclarations.getDataverseName(), itemTypeName);
- if (dt == null) {
- throw new AlgebricksException(": type " + itemTypeName
- + " could not be found.");
- }
- switch (dd.getDatasetType()) {
- case INTERNAL: {
- IAType itemType = dt.getDatatype();
- if (itemType.getTypeTag() != ATypeTag.RECORD) {
- throw new AlgebricksException(
- "Can only partition ARecord's.");
- }
- List<String> partitioningExprs = ((InternalDetailsDecl) dd
- .getDatasetDetailsDecl()).getPartitioningExprs();
- String ngName = ((InternalDetailsDecl) dd
- .getDatasetDetailsDecl()).getNodegroupName()
- .getValue();
- datasetDetails = new InternalDatasetDetails(
- InternalDatasetDetails.FileStructure.BTREE,
- InternalDatasetDetails.PartitioningStrategy.HASH,
- partitioningExprs, partitioningExprs, ngName);
- break;
- }
- case EXTERNAL: {
- String adapter = ((ExternalDetailsDecl) dd
- .getDatasetDetailsDecl()).getAdapter();
- Map<String, String> properties = ((ExternalDetailsDecl) dd
- .getDatasetDetailsDecl()).getProperties();
- datasetDetails = new ExternalDatasetDetails(adapter,
- properties);
- break;
- }
- case FEED: {
- IAType itemType = dt.getDatatype();
- if (itemType.getTypeTag() != ATypeTag.RECORD) {
- throw new AlgebricksException(
- "Can only partition ARecord's.");
- }
- List<String> partitioningExprs = ((FeedDetailsDecl) dd
- .getDatasetDetailsDecl()).getPartitioningExprs();
- String ngName = ((FeedDetailsDecl) dd
- .getDatasetDetailsDecl()).getNodegroupName()
- .getValue();
- String adapter = ((FeedDetailsDecl) dd
- .getDatasetDetailsDecl()).getAdapterClassname();
- Map<String, String> properties = ((FeedDetailsDecl) dd
- .getDatasetDetailsDecl()).getProperties();
- String functionIdentifier = ((FeedDetailsDecl) dd
- .getDatasetDetailsDecl()).getFunctionIdentifier();
- datasetDetails = new FeedDatasetDetails(
- InternalDatasetDetails.FileStructure.BTREE,
- InternalDatasetDetails.PartitioningStrategy.HASH,
- partitioningExprs, partitioningExprs, ngName,
- adapter, properties, functionIdentifier,
- FeedDatasetDetails.FeedState.INACTIVE.toString());
- break;
- }
- }
- MetadataManager.INSTANCE.addDataset(mdTxnCtx, new Dataset(
- compiledDeclarations.getDataverseName(), datasetName,
- itemTypeName, datasetDetails, dsType));
- if (dd.getDatasetType() == DatasetType.INTERNAL
- || dd.getDatasetType() == DatasetType.FEED) {
- runCreateDatasetJob(hcc, datasetName);
- }
- break;
- }
-
- case CREATE_INDEX: {
- checkForDataverseConnection(true);
- CreateIndexStatement stmtCreateIndex = (CreateIndexStatement) stmt;
- String datasetName = stmtCreateIndex.getDatasetName()
- .getValue();
- Dataset ds = MetadataManager.INSTANCE.getDataset(mdTxnCtx,
- compiledDeclarations.getDataverseName(), datasetName);
- if (ds == null) {
- throw new AlgebricksException(
- "There is no dataset with this name " + datasetName);
- }
- String indexName = stmtCreateIndex.getIndexName().getValue();
- Index idx = MetadataManager.INSTANCE.getIndex(mdTxnCtx,
- compiledDeclarations.getDataverseName(), datasetName,
- indexName);
- if (idx != null) {
- if (!stmtCreateIndex.getIfNotExists()) {
- throw new AlgebricksException(
- "An index with this name " + indexName
- + " already exists.");
- } else {
- stmtCreateIndex.setNeedToCreate(false);
- }
- } else {
- MetadataManager.INSTANCE.addIndex(
- mdTxnCtx,
- new Index(compiledDeclarations.getDataverseName(),
- datasetName, indexName, stmtCreateIndex
- .getIndexType(), stmtCreateIndex
- .getFieldExprs(), stmtCreateIndex
- .getGramLength(), false));
- runCreateIndexJob(hcc, stmtCreateIndex);
- }
- break;
- }
- case TYPE_DECL: {
- checkForDataverseConnection(true);
- TypeDecl stmtCreateType = (TypeDecl) stmt;
- String typeName = stmtCreateType.getIdent().getValue();
- Datatype dt = MetadataManager.INSTANCE.getDatatype(mdTxnCtx,
- compiledDeclarations.getDataverseName(), typeName);
- if (dt != null) {
- if (!stmtCreateType.getIfNotExists())
- throw new AlgebricksException(
- "A datatype with this name " + typeName
- + " already exists.");
- } else {
- if (builtinTypeMap.get(typeName) != null) {
- throw new AlgebricksException(
- "Cannot redefine builtin type " + typeName
- + ".");
- } else {
- Map<String, IAType> typeMap = computeTypes(mdTxnCtx,
- (TypeDecl) stmt);
- IAType type = typeMap.get(typeName);
- MetadataManager.INSTANCE.addDatatype(
- mdTxnCtx,
- new Datatype(compiledDeclarations
- .getDataverseName(), typeName, type,
- false));
- }
- }
- break;
- }
- case NODEGROUP_DECL: {
- NodegroupDecl stmtCreateNodegroup = (NodegroupDecl) stmt;
- String ngName = stmtCreateNodegroup.getNodegroupName()
- .getValue();
- NodeGroup ng = MetadataManager.INSTANCE.getNodegroup(mdTxnCtx,
- ngName);
- if (ng != null) {
- if (!stmtCreateNodegroup.getIfNotExists())
- throw new AlgebricksException(
- "A nodegroup with this name " + ngName
- + " already exists.");
- } else {
- List<Identifier> ncIdentifiers = stmtCreateNodegroup
- .getNodeControllerNames();
- List<String> ncNames = new ArrayList<String>(
- ncIdentifiers.size());
- for (Identifier id : ncIdentifiers) {
- ncNames.add(id.getValue());
- }
- MetadataManager.INSTANCE.addNodegroup(mdTxnCtx,
- new NodeGroup(ngName, ncNames));
- }
- break;
- }
- // drop statements
- case DATAVERSE_DROP: {
- DataverseDropStatement stmtDelete = (DataverseDropStatement) stmt;
- String dvName = stmtDelete.getDataverseName().getValue();
- if (AsterixBuiltinArtifactMap.isSystemProtectedArtifact(
- ARTIFACT_KIND.DATAVERSE, dvName)) {
- throw new AsterixException(
- "Invalid Operation cannot drop dataverse " + dvName
- + " (protected by system)");
- }
-
- if (compiledDeclarations.isConnectedToDataverse())
- compiledDeclarations.disconnectFromDataverse();
- checkForDataverseConnection(false);
-
- Dataverse dv = MetadataManager.INSTANCE.getDataverse(mdTxnCtx,
- dvName);
- if (dv == null) {
- if (!stmtDelete.getIfExists()) {
- throw new AlgebricksException(
- "There is no dataverse with this name "
- + dvName + ".");
- }
- } else {
- compiledDeclarations.connectToDataverse(dvName);
- List<Dataset> datasets = MetadataManager.INSTANCE
- .getDataverseDatasets(mdTxnCtx, dvName);
- for (int j = 0; j < datasets.size(); j++) {
- String datasetName = datasets.get(j).getDatasetName();
- DatasetType dsType = datasets.get(j).getDatasetType();
- if (dsType == DatasetType.INTERNAL
- || dsType == DatasetType.FEED) {
- List<Index> indexes = MetadataManager.INSTANCE
- .getDatasetIndexes(mdTxnCtx, dvName,
- datasetName);
- for (int k = 0; k < indexes.size(); k++) {
- if (indexes.get(k).isSecondaryIndex()) {
- compileIndexDropStatement(hcc, mdTxnCtx,
- datasetName, indexes.get(k)
- .getIndexName());
- }
- }
- }
- compileDatasetDropStatement(hcc, mdTxnCtx, datasetName);
- }
- MetadataManager.INSTANCE.dropDataverse(mdTxnCtx, dvName);
- if (compiledDeclarations.isConnectedToDataverse())
- compiledDeclarations.disconnectFromDataverse();
- }
- break;
- }
- case DATASET_DROP: {
- checkForDataverseConnection(true);
- DropStatement stmtDelete = (DropStatement) stmt;
- String datasetName = stmtDelete.getDatasetName().getValue();
- if (AsterixBuiltinArtifactMap.isSystemProtectedArtifact(
- ARTIFACT_KIND.DATASET, datasetName)) {
- throw new AsterixException(
- "Invalid Operation cannot drop dataset "
- + datasetName + " (protected by system)");
- }
- Dataset ds = MetadataManager.INSTANCE.getDataset(mdTxnCtx,
- compiledDeclarations.getDataverseName(), datasetName);
- if (ds == null) {
- if (!stmtDelete.getIfExists())
- throw new AlgebricksException(
- "There is no dataset with this name "
- + datasetName + ".");
- } else {
- if (ds.getDatasetType() == DatasetType.INTERNAL
- || ds.getDatasetType() == DatasetType.FEED) {
- List<Index> indexes = MetadataManager.INSTANCE
- .getDatasetIndexes(
- mdTxnCtx,
- compiledDeclarations.getDataverseName(),
- datasetName);
- for (int j = 0; j < indexes.size(); j++) {
- if (indexes.get(j).isPrimaryIndex()) {
- compileIndexDropStatement(hcc, mdTxnCtx,
- datasetName, indexes.get(j)
- .getIndexName());
- }
- }
- }
- compileDatasetDropStatement(hcc, mdTxnCtx, datasetName);
- }
- break;
- }
- case INDEX_DROP: {
- checkForDataverseConnection(true);
- IndexDropStatement stmtDelete = (IndexDropStatement) stmt;
- String datasetName = stmtDelete.getDatasetName().getValue();
- Dataset ds = MetadataManager.INSTANCE.getDataset(mdTxnCtx,
- compiledDeclarations.getDataverseName(), datasetName);
- if (ds == null)
- throw new AlgebricksException(
- "There is no dataset with this name " + datasetName
- + ".");
- if (ds.getDatasetType() == DatasetType.INTERNAL
- || ds.getDatasetType() == DatasetType.FEED) {
- String indexName = stmtDelete.getIndexName().getValue();
- Index idx = MetadataManager.INSTANCE.getIndex(mdTxnCtx,
- compiledDeclarations.getDataverseName(),
- datasetName, indexName);
- if (idx == null) {
- if (!stmtDelete.getIfExists())
- throw new AlgebricksException(
- "There is no index with this name "
- + indexName + ".");
- } else
- compileIndexDropStatement(hcc, mdTxnCtx, datasetName,
- indexName);
- } else {
- throw new AlgebricksException(
- datasetName
- + " is an external dataset. Indexes are not maintained for external datasets.");
- }
- break;
- }
- case TYPE_DROP: {
- checkForDataverseConnection(true);
- TypeDropStatement stmtDelete = (TypeDropStatement) stmt;
- String typeName = stmtDelete.getTypeName().getValue();
- Datatype dt = MetadataManager.INSTANCE.getDatatype(mdTxnCtx,
- compiledDeclarations.getDataverseName(), typeName);
- if (dt == null) {
- if (!stmtDelete.getIfExists())
- throw new AlgebricksException(
- "There is no datatype with this name "
- + typeName + ".");
- } else
- MetadataManager.INSTANCE.dropDatatype(mdTxnCtx,
- compiledDeclarations.getDataverseName(), typeName);
- break;
- }
- case NODEGROUP_DROP: {
- NodeGroupDropStatement stmtDelete = (NodeGroupDropStatement) stmt;
- String nodegroupName = stmtDelete.getNodeGroupName().getValue();
- if (AsterixBuiltinArtifactMap.isSystemProtectedArtifact(
- ARTIFACT_KIND.NODEGROUP, nodegroupName)) {
- throw new AsterixException(
- "Invalid Operation cannot drop nodegroup "
- + nodegroupName + " (protected by system)");
- }
- NodeGroup ng = MetadataManager.INSTANCE.getNodegroup(mdTxnCtx,
- nodegroupName);
- if (ng == null) {
- if (!stmtDelete.getIfExists())
- throw new AlgebricksException(
- "There is no nodegroup with this name "
- + nodegroupName + ".");
- } else
- MetadataManager.INSTANCE.dropNodegroup(mdTxnCtx,
- nodegroupName);
- break;
- }
-
- case CREATE_FUNCTION: {
- CreateFunctionStatement cfs = (CreateFunctionStatement) stmt;
- Function function = new Function(
- compiledDeclarations.getDataverseName(), cfs
- .getFunctionIdentifier().getFunctionName(), cfs
- .getFunctionIdentifier().getArity(),
- cfs.getParamList(), cfs.getFunctionBody());
- try {
- FunctionUtils.getFunctionDecl(function);
- } catch (Exception e) {
- throw new AsterixException(
- "Unable to compile function definition", e);
- }
- MetadataManager.INSTANCE
- .addFunction(mdTxnCtx, new Function(
- compiledDeclarations.getDataverseName(), cfs
- .getFunctionIdentifier()
- .getFunctionName(), cfs
- .getFunctionIdentifier().getArity(),
- cfs.getParamList(), cfs.getFunctionBody()));
- break;
- }
-
- case FUNCTION_DROP: {
- checkForDataverseConnection(true);
- FunctionDropStatement stmtDropFunction = (FunctionDropStatement) stmt;
- String functionName = stmtDropFunction.getFunctionName()
- .getValue();
- FunctionIdentifier fId = new FunctionIdentifier(
- FunctionConstants.ASTERIX_NS, functionName,
- stmtDropFunction.getArity());
- if (AsterixBuiltinArtifactMap.isSystemProtectedArtifact(
- ARTIFACT_KIND.FUNCTION, fId)) {
- throw new AsterixException(
- "Invalid Operation cannot drop function "
- + functionName + " (protected by system)");
- }
- Function function = MetadataManager.INSTANCE.getFunction(
- mdTxnCtx, compiledDeclarations.getDataverseName(),
- functionName, stmtDropFunction.getArity());
- if (function == null) {
- if (!stmtDropFunction.getIfExists())
- throw new AlgebricksException(
- "There is no function with this name "
- + functionName + ".");
- } else {
- MetadataManager.INSTANCE.dropFunction(mdTxnCtx,
- compiledDeclarations.getDataverseName(),
- functionName, stmtDropFunction.getArity());
- }
- break;
- }
- }
- }
-
- if (disconnectFromDataverse) {
- if (compiledDeclarations.isConnectedToDataverse()) {
- compiledDeclarations.disconnectFromDataverse();
- }
- }
- }
-
- private void checkForDataverseConnection(boolean needConnection)
- throws AlgebricksException {
- if (compiledDeclarations.isConnectedToDataverse() != needConnection) {
- if (needConnection)
- throw new AlgebricksException(
- "You need first to connect to a dataverse.");
- else
- throw new AlgebricksException(
- "You need first to disconnect from the dataverse.");
- }
- }
-
- private void runJob(IHyracksClientConnection hcc, JobSpecification jobSpec)
- throws Exception {
- System.out.println(jobSpec.toString());
- executeJobArray(hcc, new JobSpecification[] { jobSpec }, out, pdf);
- }
-
- public void executeJobArray(IHyracksClientConnection hcc,
- JobSpecification[] specs, PrintWriter out, DisplayFormat pdf)
- throws Exception {
- for (int i = 0; i < specs.length; i++) {
- specs[i].setMaxReattempts(0);
- JobId jobId = hcc.startJob(GlobalConfig.HYRACKS_APP_NAME, specs[i]);
- hcc.waitForCompletion(jobId);
- }
- }
-
- private void runCreateDatasetJob(IHyracksClientConnection hcc,
- String datasetName) throws AsterixException, AlgebricksException,
- Exception {
- runJob(hcc, DatasetOperations.createDatasetJobSpec(datasetName,
- compiledDeclarations));
- }
-
- private void runCreateIndexJob(IHyracksClientConnection hcc,
- CreateIndexStatement stmtCreateIndex) throws Exception {
- // TODO: Eventually CreateIndexStatement and
- // CompiledCreateIndexStatement should be replaced by the corresponding
- // metadata entity.
- // For now we must still convert to a CompiledCreateIndexStatement here.
- CompiledCreateIndexStatement createIndexStmt = new CompiledCreateIndexStatement(
- stmtCreateIndex.getIndexName().getValue(), stmtCreateIndex
- .getDatasetName().getValue(),
- stmtCreateIndex.getFieldExprs(),
- stmtCreateIndex.getGramLength(), stmtCreateIndex.getIndexType());
- JobSpecification spec = IndexOperations
- .buildSecondaryIndexCreationJobSpec(createIndexStmt,
- compiledDeclarations);
- if (spec == null) {
- throw new AsterixException(
- "Failed to create job spec for creating index '"
- + stmtCreateIndex.getDatasetName() + "."
- + stmtCreateIndex.getIndexName() + "'");
- }
- runJob(hcc, spec);
- }
-
- private void compileDatasetDropStatement(IHyracksClientConnection hcc,
- MetadataTransactionContext mdTxnCtx, String datasetName)
- throws Exception {
- CompiledDatasetDropStatement cds = new CompiledDatasetDropStatement(
- datasetName);
- Dataset ds = MetadataManager.INSTANCE.getDataset(mdTxnCtx,
- compiledDeclarations.getDataverseName(), datasetName);
- if (ds.getDatasetType() == DatasetType.INTERNAL
- || ds.getDatasetType() == DatasetType.FEED) {
- JobSpecification[] jobs = DatasetOperations
- .createDropDatasetJobSpec(cds, compiledDeclarations);
- for (JobSpecification job : jobs)
- runJob(hcc, job);
- }
- MetadataManager.INSTANCE.dropDataset(mdTxnCtx,
- compiledDeclarations.getDataverseName(), datasetName);
- }
-
- public AqlCompiledMetadataDeclarations getCompiledDeclarations() {
- return compiledDeclarations;
- }
-
- private void compileIndexDropStatement(IHyracksClientConnection hcc,
- MetadataTransactionContext mdTxnCtx, String datasetName,
- String indexName) throws Exception {
- CompiledIndexDropStatement cds = new CompiledIndexDropStatement(
- datasetName, indexName);
- runJob(hcc, IndexOperations.buildDropSecondaryIndexJobSpec(cds,
- compiledDeclarations));
- MetadataManager.INSTANCE
- .dropIndex(mdTxnCtx, compiledDeclarations.getDataverseName(),
- datasetName, indexName);
- }
-
- private Map<String, IAType> computeTypes(
- MetadataTransactionContext mdTxnCtx, TypeDecl tDec)
- throws AlgebricksException, MetadataException {
- Map<String, IAType> typeMap = new HashMap<String, IAType>();
- Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes = new HashMap<String, Map<ARecordType, List<Integer>>>();
- Map<String, List<AbstractCollectionType>> incompleteItemTypes = new HashMap<String, List<AbstractCollectionType>>();
- Map<String, List<String>> incompleteTopLevelTypeReferences = new HashMap<String, List<String>>();
-
- firstPass(tDec, typeMap, incompleteFieldTypes, incompleteItemTypes,
- incompleteTopLevelTypeReferences);
- secondPass(mdTxnCtx, typeMap, incompleteFieldTypes,
- incompleteItemTypes, incompleteTopLevelTypeReferences);
-
- return typeMap;
- }
-
- private void secondPass(MetadataTransactionContext mdTxnCtx,
- Map<String, IAType> typeMap,
- Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes,
- Map<String, List<AbstractCollectionType>> incompleteItemTypes,
- Map<String, List<String>> incompleteTopLevelTypeReferences)
- throws AlgebricksException, MetadataException {
- // solve remaining top level references
- for (String trefName : incompleteTopLevelTypeReferences.keySet()) {
- IAType t;// = typeMap.get(trefName);
- Datatype dt = MetadataManager.INSTANCE.getDatatype(mdTxnCtx,
- compiledDeclarations.getDataverseName(), trefName);
- if (dt == null) {
- throw new AlgebricksException("Could not resolve type "
- + trefName);
- } else
- t = dt.getDatatype();
- for (String tname : incompleteTopLevelTypeReferences.get(trefName)) {
- typeMap.put(tname, t);
- }
- }
- // solve remaining field type references
- for (String trefName : incompleteFieldTypes.keySet()) {
- IAType t;// = typeMap.get(trefName);
- Datatype dt = MetadataManager.INSTANCE.getDatatype(mdTxnCtx,
- compiledDeclarations.getDataverseName(), trefName);
- if (dt == null) {
- throw new AlgebricksException("Could not resolve type "
- + trefName);
- } else
- t = dt.getDatatype();
- Map<ARecordType, List<Integer>> fieldsToFix = incompleteFieldTypes
- .get(trefName);
- for (ARecordType recType : fieldsToFix.keySet()) {
- List<Integer> positions = fieldsToFix.get(recType);
- IAType[] fldTypes = recType.getFieldTypes();
- for (Integer pos : positions) {
- if (fldTypes[pos] == null) {
- fldTypes[pos] = t;
- } else { // nullable
- AUnionType nullableUnion = (AUnionType) fldTypes[pos];
- nullableUnion.setTypeAtIndex(t, 1);
- }
- }
- }
- }
- // solve remaining item type references
- for (String trefName : incompleteItemTypes.keySet()) {
- IAType t;// = typeMap.get(trefName);
- Datatype dt = MetadataManager.INSTANCE.getDatatype(mdTxnCtx,
- compiledDeclarations.getDataverseName(), trefName);
- if (dt == null) {
- throw new AlgebricksException("Could not resolve type "
- + trefName);
- } else
- t = dt.getDatatype();
- for (AbstractCollectionType act : incompleteItemTypes.get(trefName)) {
- act.setItemType(t);
- }
- }
- }
-
- private void firstPass(TypeDecl td, Map<String, IAType> typeMap,
- Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes,
- Map<String, List<AbstractCollectionType>> incompleteItemTypes,
- Map<String, List<String>> incompleteTopLevelTypeReferences)
- throws AlgebricksException {
-
- TypeExpression texpr = td.getTypeDef();
- String tdname = td.getIdent().getValue();
- if (builtinTypeMap.get(tdname) != null) {
- throw new AlgebricksException("Cannot redefine builtin type "
- + tdname + " .");
- }
- switch (texpr.getTypeKind()) {
- case TYPEREFERENCE: {
- TypeReferenceExpression tre = (TypeReferenceExpression) texpr;
- IAType t = solveTypeReference(tre, typeMap);
- if (t != null) {
- typeMap.put(tdname, t);
- } else {
- addIncompleteTopLevelTypeReference(tdname, tre,
- incompleteTopLevelTypeReferences);
- }
- break;
- }
- case RECORD: {
- RecordTypeDefinition rtd = (RecordTypeDefinition) texpr;
- ARecordType recType = computeRecordType(tdname, rtd, typeMap,
- incompleteFieldTypes, incompleteItemTypes);
- typeMap.put(tdname, recType);
- break;
- }
- case ORDEREDLIST: {
- OrderedListTypeDefinition oltd = (OrderedListTypeDefinition) texpr;
- AOrderedListType olType = computeOrderedListType(tdname, oltd,
- typeMap, incompleteItemTypes, incompleteFieldTypes);
- typeMap.put(tdname, olType);
- break;
- }
- case UNORDEREDLIST: {
- UnorderedListTypeDefinition ultd = (UnorderedListTypeDefinition) texpr;
- AUnorderedListType ulType = computeUnorderedListType(tdname, ultd,
- typeMap, incompleteItemTypes, incompleteFieldTypes);
- typeMap.put(tdname, ulType);
- break;
- }
- default: {
- throw new IllegalStateException();
- }
- }
- }
-
- private AOrderedListType computeOrderedListType(String typeName,
- OrderedListTypeDefinition oltd, Map<String, IAType> typeMap,
- Map<String, List<AbstractCollectionType>> incompleteItemTypes,
- Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes) {
- TypeExpression tExpr = oltd.getItemTypeExpression();
- AOrderedListType aolt = new AOrderedListType(null, typeName);
- setCollectionItemType(tExpr, typeMap, incompleteItemTypes,
- incompleteFieldTypes, aolt);
- return aolt;
- }
-
- private AUnorderedListType computeUnorderedListType(String typeName,
- UnorderedListTypeDefinition ultd, Map<String, IAType> typeMap,
- Map<String, List<AbstractCollectionType>> incompleteItemTypes,
- Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes) {
- TypeExpression tExpr = ultd.getItemTypeExpression();
- AUnorderedListType ault = new AUnorderedListType(null, typeName);
- setCollectionItemType(tExpr, typeMap, incompleteItemTypes,
- incompleteFieldTypes, ault);
- return ault;
- }
-
- private void setCollectionItemType(TypeExpression tExpr,
- Map<String, IAType> typeMap,
- Map<String, List<AbstractCollectionType>> incompleteItemTypes,
- Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes,
- AbstractCollectionType act) {
- switch (tExpr.getTypeKind()) {
- case ORDEREDLIST: {
- OrderedListTypeDefinition oltd = (OrderedListTypeDefinition) tExpr;
- IAType t = computeOrderedListType(null, oltd, typeMap,
- incompleteItemTypes, incompleteFieldTypes);
- act.setItemType(t);
- break;
- }
- case UNORDEREDLIST: {
- UnorderedListTypeDefinition ultd = (UnorderedListTypeDefinition) tExpr;
- IAType t = computeUnorderedListType(null, ultd, typeMap,
- incompleteItemTypes, incompleteFieldTypes);
- act.setItemType(t);
- break;
- }
- case RECORD: {
- RecordTypeDefinition rtd = (RecordTypeDefinition) tExpr;
- IAType t = computeRecordType(null, rtd, typeMap,
- incompleteFieldTypes, incompleteItemTypes);
- act.setItemType(t);
- break;
- }
- case TYPEREFERENCE: {
- TypeReferenceExpression tre = (TypeReferenceExpression) tExpr;
- IAType tref = solveTypeReference(tre, typeMap);
- if (tref != null) {
- act.setItemType(tref);
- } else {
- addIncompleteCollectionTypeReference(act, tre,
- incompleteItemTypes);
- }
- break;
- }
- default: {
- throw new IllegalStateException();
- }
- }
- }
-
- private ARecordType computeRecordType(String typeName,
- RecordTypeDefinition rtd, Map<String, IAType> typeMap,
- Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes,
- Map<String, List<AbstractCollectionType>> incompleteItemTypes) {
- List<String> names = rtd.getFieldNames();
- int n = names.size();
- String[] fldNames = new String[n];
- IAType[] fldTypes = new IAType[n];
- int i = 0;
- for (String s : names) {
- fldNames[i++] = s;
- }
- boolean isOpen = rtd.getRecordKind() == RecordKind.OPEN;
- ARecordType recType = new ARecordType(typeName, fldNames, fldTypes,
- isOpen);
- for (int j = 0; j < n; j++) {
- TypeExpression texpr = rtd.getFieldTypes().get(j);
- switch (texpr.getTypeKind()) {
- case TYPEREFERENCE: {
- TypeReferenceExpression tre = (TypeReferenceExpression) texpr;
- IAType tref = solveTypeReference(tre, typeMap);
- if (tref != null) {
- if (!rtd.getNullableFields().get(j)) { // not nullable
- fldTypes[j] = tref;
- } else { // nullable
- fldTypes[j] = makeUnionWithNull(null, tref);
- }
- } else {
- addIncompleteFieldTypeReference(recType, j, tre,
- incompleteFieldTypes);
- if (rtd.getNullableFields().get(j)) {
- fldTypes[j] = makeUnionWithNull(null, null);
- }
- }
- break;
- }
- case RECORD: {
- RecordTypeDefinition recTypeDef2 = (RecordTypeDefinition) texpr;
- IAType t2 = computeRecordType(null, recTypeDef2, typeMap,
- incompleteFieldTypes, incompleteItemTypes);
- if (!rtd.getNullableFields().get(j)) { // not nullable
- fldTypes[j] = t2;
- } else { // nullable
- fldTypes[j] = makeUnionWithNull(null, t2);
- }
- break;
- }
- case ORDEREDLIST: {
- OrderedListTypeDefinition oltd = (OrderedListTypeDefinition) texpr;
- IAType t2 = computeOrderedListType(null, oltd, typeMap,
- incompleteItemTypes, incompleteFieldTypes);
- fldTypes[j] = (rtd.getNullableFields().get(j)) ? makeUnionWithNull(
- null, t2) : t2;
- break;
- }
- case UNORDEREDLIST: {
- UnorderedListTypeDefinition ultd = (UnorderedListTypeDefinition) texpr;
- IAType t2 = computeUnorderedListType(null, ultd, typeMap,
- incompleteItemTypes, incompleteFieldTypes);
- fldTypes[j] = (rtd.getNullableFields().get(j)) ? makeUnionWithNull(
- null, t2) : t2;
- break;
- }
- default: {
- throw new IllegalStateException();
- }
- }
-
- }
-
- return recType;
- }
-
- private AUnionType makeUnionWithNull(String unionTypeName, IAType type) {
- ArrayList<IAType> unionList = new ArrayList<IAType>(2);
- unionList.add(BuiltinType.ANULL);
- unionList.add(type);
- return new AUnionType(unionList, unionTypeName);
- }
-
- private void addIncompleteCollectionTypeReference(
- AbstractCollectionType collType, TypeReferenceExpression tre,
- Map<String, List<AbstractCollectionType>> incompleteItemTypes) {
- String typeName = tre.getIdent().getValue();
- List<AbstractCollectionType> typeList = incompleteItemTypes
- .get(typeName);
- if (typeList == null) {
- typeList = new LinkedList<AbstractCollectionType>();
- incompleteItemTypes.put(typeName, typeList);
- }
- typeList.add(collType);
- }
-
- private void addIncompleteFieldTypeReference(ARecordType recType,
- int fldPosition, TypeReferenceExpression tre,
- Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes) {
- String typeName = tre.getIdent().getValue();
- Map<ARecordType, List<Integer>> refMap = incompleteFieldTypes
- .get(typeName);
- if (refMap == null) {
- refMap = new HashMap<ARecordType, List<Integer>>();
- incompleteFieldTypes.put(typeName, refMap);
- }
- List<Integer> typeList = refMap.get(recType);
- if (typeList == null) {
- typeList = new ArrayList<Integer>();
- refMap.put(recType, typeList);
- }
- typeList.add(fldPosition);
- }
-
- private void addIncompleteTopLevelTypeReference(String tdeclName,
- TypeReferenceExpression tre,
- Map<String, List<String>> incompleteTopLevelTypeReferences) {
- String name = tre.getIdent().getValue();
- List<String> refList = incompleteTopLevelTypeReferences.get(name);
- if (refList == null) {
- refList = new LinkedList<String>();
- incompleteTopLevelTypeReferences.put(name, refList);
- }
- refList.add(tdeclName);
- }
-
- private IAType solveTypeReference(TypeReferenceExpression tre,
- Map<String, IAType> typeMap) {
- String name = tre.getIdent().getValue();
- IAType builtin = builtinTypeMap.get(name);
- if (builtin != null) {
- return builtin;
- } else {
- return typeMap.get(name);
- }
- }
-
- public static interface ICompiledStatement {
-
- public abstract Kind getKind();
- }
-
- public static class CompiledLoadFromFileStatement implements
- ICompiledStatement, IParseFileSplitsDecl {
- private String datasetName;
- private FileSplit[] splits;
- private boolean alreadySorted;
- private Character delimChar;
-
- public CompiledLoadFromFileStatement(String datasetName,
- FileSplit[] splits, Character delimChar, boolean alreadySorted) {
- this.datasetName = datasetName;
- this.splits = splits;
- this.delimChar = delimChar;
- this.alreadySorted = alreadySorted;
- }
-
- public String getDatasetName() {
- return datasetName;
- }
-
- @Override
- public FileSplit[] getSplits() {
- return splits;
- }
-
- @Override
- public Character getDelimChar() {
- return delimChar;
- }
-
- public boolean alreadySorted() {
- return alreadySorted;
- }
-
- @Override
- public boolean isDelimitedFileFormat() {
- return delimChar != null;
- }
-
- @Override
- public Kind getKind() {
- return Kind.LOAD_FROM_FILE;
- }
- }
-
- public static class CompiledWriteFromQueryResultStatement implements
- ICompiledStatement {
-
- private String datasetName;
- private Query query;
- private int varCounter;
-
- public CompiledWriteFromQueryResultStatement(String datasetName,
- Query query, int varCounter) {
- this.datasetName = datasetName;
- this.query = query;
- this.varCounter = varCounter;
- }
-
- public String getDatasetName() {
- return datasetName;
- }
-
- public int getVarCounter() {
- return varCounter;
- }
-
- public Query getQuery() {
- return query;
- }
-
- @Override
- public Kind getKind() {
- return Kind.WRITE_FROM_QUERY_RESULT;
- }
-
- }
-
- public static class CompiledDatasetDropStatement implements
- ICompiledStatement {
- private String datasetName;
-
- public CompiledDatasetDropStatement(String datasetName) {
- this.datasetName = datasetName;
- }
-
- public String getDatasetName() {
- return datasetName;
- }
-
- @Override
- public Kind getKind() {
- return Kind.DATASET_DROP;
- }
- }
-
- // 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 String getDataverseName() {
- return dataverseName;
- }
-
- public String getFormat() {
- return format;
- }
-
- @Override
- public Kind getKind() {
- return Kind.CREATE_DATAVERSE;
- }
- }
-
- public static class CompiledNodeGroupDropStatement implements
- ICompiledStatement {
- private String nodeGroupName;
-
- public CompiledNodeGroupDropStatement(String nodeGroupName) {
- this.nodeGroupName = nodeGroupName;
- }
-
- public String getNodeGroupName() {
- return nodeGroupName;
- }
-
- @Override
- public Kind getKind() {
- return Kind.NODEGROUP_DROP;
- }
- }
-
- public static class CompiledIndexDropStatement implements
- ICompiledStatement {
- private String datasetName;
- private String indexName;
-
- public CompiledIndexDropStatement(String datasetName, String indexName) {
- this.datasetName = datasetName;
- this.indexName = indexName;
- }
-
- public String getDatasetName() {
- return datasetName;
- }
-
- public String getIndexName() {
- return indexName;
- }
-
- @Override
- public Kind getKind() {
- return Kind.INDEX_DROP;
- }
- }
-
- 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 String getDataverseName() {
- return dataverseName;
- }
-
- public boolean getIfExists() {
- return ifExists;
- }
-
- @Override
- public Kind getKind() {
- return Kind.DATAVERSE_DROP;
- }
- }
-
- public static class CompiledTypeDropStatement implements ICompiledStatement {
- private String typeName;
-
- public CompiledTypeDropStatement(String nodeGroupName) {
- this.typeName = nodeGroupName;
- }
-
- public String getTypeName() {
- return typeName;
- }
-
- @Override
- public Kind getKind() {
- return Kind.TYPE_DROP;
- }
- }
-}
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/QueryResult.java b/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/QueryResult.java
new file mode 100644
index 0000000..0b4a2cf
--- /dev/null
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/QueryResult.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.aql.translator;
+
+import edu.uci.ics.asterix.aql.base.Statement;
+import edu.uci.ics.asterix.aql.expression.Query;
+
+public class QueryResult {
+
+ private final Query query;
+ private final String resultPath;
+
+ public QueryResult(Query statement, String resultPath) {
+ this.query = statement;
+ this.resultPath = resultPath;
+ }
+
+ public Statement getStatement() {
+ return query;
+ }
+
+ public String getResultPath() {
+ return resultPath;
+ }
+
+}
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/file/DatasetOperations.java b/asterix-app/src/main/java/edu/uci/ics/asterix/file/DatasetOperations.java
index b028e06..8d804a4 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/file/DatasetOperations.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/file/DatasetOperations.java
@@ -14,12 +14,12 @@
*/
package edu.uci.ics.asterix.file;
+import java.io.File;
import java.rmi.RemoteException;
import java.util.List;
import java.util.logging.Logger;
import edu.uci.ics.asterix.api.common.Job;
-import edu.uci.ics.asterix.aql.translator.DdlTranslator.CompiledDatasetDropStatement;
import edu.uci.ics.asterix.common.config.DatasetConfig.DatasetType;
import edu.uci.ics.asterix.common.config.GlobalConfig;
import edu.uci.ics.asterix.common.config.OptimizationConfUtil;
@@ -27,16 +27,19 @@
import edu.uci.ics.asterix.common.context.AsterixStorageManagerInterface;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.formats.base.IDataFormat;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
+import edu.uci.ics.asterix.metadata.MetadataManager;
+import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
import edu.uci.ics.asterix.metadata.entities.Dataset;
+import edu.uci.ics.asterix.metadata.entities.Dataverse;
import edu.uci.ics.asterix.metadata.entities.ExternalDatasetDetails;
import edu.uci.ics.asterix.metadata.entities.Index;
import edu.uci.ics.asterix.metadata.utils.DatasetUtils;
import edu.uci.ics.asterix.om.types.ARecordType;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.transaction.management.exception.ACIDException;
-import edu.uci.ics.asterix.translator.DmlTranslator.CompiledLoadFromFileStatement;
+import edu.uci.ics.asterix.translator.CompiledStatements.CompiledDatasetDropStatement;
+import edu.uci.ics.asterix.translator.CompiledStatements.CompiledLoadFromFileStatement;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraintHelper;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -83,19 +86,26 @@
private static Logger LOGGER = Logger.getLogger(DatasetOperations.class.getName());
- public static JobSpecification[] createDropDatasetJobSpec(CompiledDatasetDropStatement deleteStmt,
- AqlCompiledMetadataDeclarations metadata) throws AlgebricksException, HyracksDataException,
- RemoteException, ACIDException, AsterixException {
+ public static JobSpecification[] createDropDatasetJobSpec(CompiledDatasetDropStatement datasetDropStmt,
+ AqlMetadataProvider metadataProvider) throws AlgebricksException, HyracksDataException, RemoteException,
+ ACIDException, AsterixException {
- String datasetName = deleteStmt.getDatasetName();
- String datasetPath = metadata.getRelativePath(datasetName);
+ String dataverseName = null;
+ if (datasetDropStmt.getDataverseName() != null) {
+ dataverseName = datasetDropStmt.getDataverseName();
+ } else if (metadataProvider.getDefaultDataverse() != null) {
+ dataverseName = metadataProvider.getDefaultDataverse().getDataverseName();
+ }
+
+ String datasetName = datasetDropStmt.getDatasetName();
+ String datasetPath = dataverseName + File.separator + datasetName;
LOGGER.info("DROP DATASETPATH: " + datasetPath);
IIndexRegistryProvider<IIndex> indexRegistryProvider = AsterixIndexRegistryProvider.INSTANCE;
IStorageManagerInterface storageManager = AsterixStorageManagerInterface.INSTANCE;
- Dataset dataset = metadata.findDataset(datasetName);
+ Dataset dataset = metadataProvider.findDataset(dataverseName, datasetName);
if (dataset == null) {
throw new AlgebricksException("DROP DATASET: No metadata for dataset " + datasetName);
}
@@ -103,7 +113,8 @@
return new JobSpecification[0];
}
- List<Index> datasetIndexes = metadata.getDatasetIndexes(dataset.getDataverseName(), dataset.getDatasetName());
+ List<Index> datasetIndexes = metadataProvider.getDatasetIndexes(dataset.getDataverseName(),
+ dataset.getDatasetName());
int numSecondaryIndexes = 0;
for (Index index : datasetIndexes) {
if (index.isSecondaryIndex()) {
@@ -118,9 +129,9 @@
for (Index index : datasetIndexes) {
if (index.isSecondaryIndex()) {
specs[i] = new JobSpecification();
- Pair<IFileSplitProvider, AlgebricksPartitionConstraint> idxSplitsAndConstraint = metadata
- .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(datasetName,
- index.getIndexName());
+ Pair<IFileSplitProvider, AlgebricksPartitionConstraint> idxSplitsAndConstraint = metadataProvider
+ .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(dataset.getDataverseName(),
+ datasetName, index.getIndexName());
TreeIndexDropOperatorDescriptor secondaryBtreeDrop = new TreeIndexDropOperatorDescriptor(specs[i],
storageManager, indexRegistryProvider, idxSplitsAndConstraint.first);
AlgebricksPartitionConstraintHelper.setPartitionConstraintInJobSpec(specs[i], secondaryBtreeDrop,
@@ -134,8 +145,9 @@
JobSpecification specPrimary = new JobSpecification();
specs[specs.length - 1] = specPrimary;
- Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitsAndConstraint = metadata
- .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(datasetName, datasetName);
+ Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitsAndConstraint = metadataProvider
+ .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(dataset.getDataverseName(), datasetName,
+ datasetName);
TreeIndexDropOperatorDescriptor primaryBtreeDrop = new TreeIndexDropOperatorDescriptor(specPrimary,
storageManager, indexRegistryProvider, splitsAndConstraint.first);
AlgebricksPartitionConstraintHelper.setPartitionConstraintInJobSpec(specPrimary, primaryBtreeDrop,
@@ -146,19 +158,26 @@
return specs;
}
- public static JobSpecification createDatasetJobSpec(String datasetName, AqlCompiledMetadataDeclarations metadata)
- throws AsterixException, AlgebricksException {
- Dataset dataset = metadata.findDataset(datasetName);
- if (dataset == null) {
- throw new AsterixException("Could not find dataset " + datasetName);
+ public static JobSpecification createDatasetJobSpec(Dataverse dataverse, String datasetName,
+ AqlMetadataProvider metadata) throws AsterixException, AlgebricksException {
+ String dataverseName = dataverse.getDataverseName();
+ IDataFormat format;
+ try {
+ format = (IDataFormat) Class.forName(dataverse.getDataFormat()).newInstance();
+ } catch (Exception e) {
+ throw new AsterixException(e);
}
- ARecordType itemType = (ARecordType) metadata.findType(dataset.getItemTypeName());
+ Dataset dataset = metadata.findDataset(dataverseName, datasetName);
+ if (dataset == null) {
+ throw new AsterixException("Could not find dataset " + datasetName + " in datavetse " + dataverseName);
+ }
+ ARecordType itemType = (ARecordType) metadata.findType(dataverseName, dataset.getItemTypeName());
JobSpecification spec = new JobSpecification();
IBinaryComparatorFactory[] comparatorFactories = DatasetUtils.computeKeysBinaryComparatorFactories(dataset,
- itemType, metadata.getFormat().getBinaryComparatorFactoryProvider());
+ itemType, format.getBinaryComparatorFactoryProvider());
ITypeTraits[] typeTraits = DatasetUtils.computeTupleTypeTraits(dataset, itemType);
Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitsAndConstraint = metadata
- .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(datasetName, datasetName);
+ .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(dataverseName, datasetName, datasetName);
FileSplit[] fs = splitsAndConstraint.first.getFileSplits();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < fs.length; i++) {
@@ -177,12 +196,14 @@
}
@SuppressWarnings("rawtypes")
- public static Job createLoadDatasetJobSpec(CompiledLoadFromFileStatement loadStmt,
- AqlCompiledMetadataDeclarations metadata) throws AsterixException, AlgebricksException {
+ public static Job createLoadDatasetJobSpec(AqlMetadataProvider metadataProvider,
+ CompiledLoadFromFileStatement loadStmt, IDataFormat format) throws AsterixException, AlgebricksException {
+ MetadataTransactionContext mdTxnCtx = metadataProvider.getMetadataTxnContext();
+ String dataverseName = loadStmt.getDataverseName();
String datasetName = loadStmt.getDatasetName();
- Dataset dataset = metadata.findDataset(datasetName);
+ Dataset dataset = MetadataManager.INSTANCE.getDataset(mdTxnCtx, dataverseName, datasetName);
if (dataset == null) {
- throw new AsterixException("Could not find dataset " + datasetName);
+ throw new AsterixException("Could not find dataset " + datasetName + " in dataverse " + dataverseName);
}
if (dataset.getDatasetType() != DatasetType.INTERNAL && dataset.getDatasetType() != DatasetType.FEED) {
throw new AsterixException("Cannot load data into dataset (" + datasetName + ")" + "of type "
@@ -190,27 +211,27 @@
}
JobSpecification spec = new JobSpecification();
- ARecordType itemType = (ARecordType) metadata.findType(dataset.getItemTypeName());
- IDataFormat format = metadata.getFormat();
+ ARecordType itemType = (ARecordType) MetadataManager.INSTANCE.getDatatype(mdTxnCtx, dataverseName,
+ dataset.getItemTypeName()).getDatatype();
ISerializerDeserializer payloadSerde = format.getSerdeProvider().getSerializerDeserializer(itemType);
IBinaryHashFunctionFactory[] hashFactories = DatasetUtils.computeKeysBinaryHashFunFactories(dataset, itemType,
- metadata.getFormat().getBinaryHashFunctionFactoryProvider());
+ format.getBinaryHashFunctionFactoryProvider());
IBinaryComparatorFactory[] comparatorFactories = DatasetUtils.computeKeysBinaryComparatorFactories(dataset,
- itemType, metadata.getFormat().getBinaryComparatorFactoryProvider());
+ itemType, format.getBinaryComparatorFactoryProvider());
ITypeTraits[] typeTraits = DatasetUtils.computeTupleTypeTraits(dataset, itemType);
ExternalDatasetDetails externalDatasetDetails = new ExternalDatasetDetails(loadStmt.getAdapter(),
loadStmt.getProperties());
- Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> p = AqlMetadataProvider
- .buildExternalDataScannerRuntime(spec, itemType, externalDatasetDetails, format);
+
+ Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> p = metadataProvider.buildExternalDataScannerRuntime(
+ spec, itemType, externalDatasetDetails, format);
IOperatorDescriptor scanner = p.first;
AlgebricksPartitionConstraint scannerPc = p.second;
- RecordDescriptor recDesc = computePayloadKeyRecordDescriptor(dataset, itemType, payloadSerde,
- metadata.getFormat());
+ RecordDescriptor recDesc = computePayloadKeyRecordDescriptor(dataset, itemType, payloadSerde, format);
AlgebricksPartitionConstraintHelper.setPartitionConstraintInJobSpec(spec, scanner, scannerPc);
- AssignRuntimeFactory assign = makeAssignRuntimeFactory(dataset, itemType, metadata.getFormat());
+ AssignRuntimeFactory assign = makeAssignRuntimeFactory(dataset, itemType, format);
AlgebricksMetaOperatorDescriptor asterixOp = new AlgebricksMetaOperatorDescriptor(spec, 1, 1,
new IPushRuntimeFactory[] { assign }, new RecordDescriptor[] { recDesc });
@@ -228,8 +249,8 @@
}
fieldPermutation[numKeys] = 0;
- Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitsAndConstraint = metadata
- .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(datasetName, datasetName);
+ Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitsAndConstraint = metadataProvider
+ .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(dataverseName, datasetName, datasetName);
FileSplit[] fs = splitsAndConstraint.first.getFileSplits();
StringBuilder sb = new StringBuilder();
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/file/FeedOperations.java b/asterix-app/src/main/java/edu/uci/ics/asterix/file/FeedOperations.java
index 66a5d56..f9bd2d5 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/file/FeedOperations.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/file/FeedOperations.java
@@ -14,21 +14,21 @@
*/
package edu.uci.ics.asterix.file;
+import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
import edu.uci.ics.asterix.common.config.DatasetConfig.DatasetType;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.feed.comm.AlterFeedMessage;
-import edu.uci.ics.asterix.feed.comm.FeedMessage;
-import edu.uci.ics.asterix.feed.comm.IFeedMessage;
-import edu.uci.ics.asterix.feed.comm.IFeedMessage.MessageType;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
+import edu.uci.ics.asterix.external.feed.lifecycle.AlterFeedMessage;
+import edu.uci.ics.asterix.external.feed.lifecycle.FeedMessage;
+import edu.uci.ics.asterix.external.feed.lifecycle.IFeedMessage;
+import edu.uci.ics.asterix.external.feed.lifecycle.IFeedMessage.MessageType;
import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
import edu.uci.ics.asterix.metadata.entities.Dataset;
import edu.uci.ics.asterix.metadata.entities.FeedDatasetDetails;
-import edu.uci.ics.asterix.translator.DmlTranslator.CompiledControlFeedStatement;
+import edu.uci.ics.asterix.translator.CompiledStatements.CompiledControlFeedStatement;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraintHelper;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -38,18 +38,31 @@
import edu.uci.ics.hyracks.dataflow.std.connectors.OneToOneConnectorDescriptor;
import edu.uci.ics.hyracks.dataflow.std.misc.NullSinkOperatorDescriptor;
+/**
+ * Provides helper method(s) for creating JobSpec for operations on a feed.
+ */
public class FeedOperations {
private static final Logger LOGGER = Logger.getLogger(IndexOperations.class.getName());
+ /**
+ * @param controlFeedStatement
+ * The statement representing the action that describes the
+ * action that needs to be taken on the feed. E.g. of actions are
+ * stop feed or alter feed.
+ * @param metadataProvider
+ * An instance of the MetadataProvider
+ * @return An instance of JobSpec for the job that would send an appropriate
+ * control message to the running feed.
+ * @throws AsterixException
+ * @throws AlgebricksException
+ */
public static JobSpecification buildControlFeedJobSpec(CompiledControlFeedStatement controlFeedStatement,
- AqlCompiledMetadataDeclarations datasetDecls) throws AsterixException, AlgebricksException {
+ AqlMetadataProvider metadataProvider) throws AsterixException, AlgebricksException {
switch (controlFeedStatement.getOperationType()) {
case ALTER:
- case SUSPEND:
- case RESUME:
case END: {
- return createSendMessageToFeedJobSpec(controlFeedStatement, datasetDecls);
+ return createSendMessageToFeedJobSpec(controlFeedStatement, metadataProvider);
}
default: {
throw new AsterixException("Unknown Operation Type: " + controlFeedStatement.getOperationType());
@@ -59,15 +72,17 @@
}
private static JobSpecification createSendMessageToFeedJobSpec(CompiledControlFeedStatement controlFeedStatement,
- AqlCompiledMetadataDeclarations metadata) throws AsterixException {
- String datasetName = controlFeedStatement.getDatasetName().getValue();
- String datasetPath = metadata.getRelativePath(datasetName);
+ AqlMetadataProvider metadataProvider) throws AsterixException {
+ String dataverseName = controlFeedStatement.getDataverseName() == null ? metadataProvider
+ .getDefaultDataverseName() : controlFeedStatement.getDataverseName();
+ String datasetName = controlFeedStatement.getDatasetName();
+ String datasetPath = dataverseName + File.separator + datasetName;
LOGGER.info(" DATASETPATH: " + datasetPath);
Dataset dataset;
try {
- dataset = metadata.findDataset(datasetName);
+ dataset = metadataProvider.findDataset(dataverseName, datasetName);
} catch (AlgebricksException e) {
throw new AsterixException(e);
}
@@ -84,23 +99,17 @@
List<IFeedMessage> feedMessages = new ArrayList<IFeedMessage>();
switch (controlFeedStatement.getOperationType()) {
- case SUSPEND:
- feedMessages.add(new FeedMessage(MessageType.SUSPEND));
- break;
case END:
feedMessages.add(new FeedMessage(MessageType.STOP));
break;
- case RESUME:
- feedMessages.add(new FeedMessage(MessageType.RESUME));
- break;
case ALTER:
feedMessages.add(new AlterFeedMessage(controlFeedStatement.getProperties()));
break;
}
try {
- Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> p = AqlMetadataProvider.buildFeedMessengerRuntime(
- spec, metadata, (FeedDatasetDetails) dataset.getDatasetDetails(), metadata.getDataverseName(),
+ Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> p = metadataProvider.buildFeedMessengerRuntime(
+ metadataProvider, spec, (FeedDatasetDetails) dataset.getDatasetDetails(), dataverseName,
datasetName, feedMessages);
feedMessenger = p.first;
messengerPc = p.second;
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/file/IndexOperations.java b/asterix-app/src/main/java/edu/uci/ics/asterix/file/IndexOperations.java
index 7bd7ae6..a8f18ec 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/file/IndexOperations.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/file/IndexOperations.java
@@ -1,13 +1,13 @@
package edu.uci.ics.asterix.file;
-import edu.uci.ics.asterix.aql.translator.DdlTranslator.CompiledIndexDropStatement;
import edu.uci.ics.asterix.common.config.OptimizationConfUtil;
import edu.uci.ics.asterix.common.context.AsterixIndexRegistryProvider;
import edu.uci.ics.asterix.common.context.AsterixStorageManagerInterface;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.metadata.MetadataException;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
-import edu.uci.ics.asterix.translator.DmlTranslator.CompiledCreateIndexStatement;
+import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
+import edu.uci.ics.asterix.translator.CompiledStatements.CompiledCreateIndexStatement;
+import edu.uci.ics.asterix.translator.CompiledStatements.CompiledIndexDropStatement;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraintHelper;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -26,30 +26,32 @@
.getPhysicalOptimizationConfig();
public static JobSpecification buildSecondaryIndexCreationJobSpec(CompiledCreateIndexStatement createIndexStmt,
- AqlCompiledMetadataDeclarations metadata) throws AsterixException, AlgebricksException {
+ AqlMetadataProvider metadataProvider) throws AsterixException, AlgebricksException {
SecondaryIndexCreator secondaryIndexCreator = SecondaryIndexCreator.createIndexCreator(createIndexStmt,
- metadata, physicalOptimizationConfig);
+ metadataProvider, physicalOptimizationConfig);
return secondaryIndexCreator.buildCreationJobSpec();
}
public static JobSpecification buildSecondaryIndexLoadingJobSpec(CompiledCreateIndexStatement createIndexStmt,
- AqlCompiledMetadataDeclarations metadata) throws AsterixException, AlgebricksException {
+ AqlMetadataProvider metadataProvider) throws AsterixException, AlgebricksException {
SecondaryIndexCreator secondaryIndexCreator = SecondaryIndexCreator.createIndexCreator(createIndexStmt,
- metadata, physicalOptimizationConfig);
+ metadataProvider, physicalOptimizationConfig);
return secondaryIndexCreator.buildLoadingJobSpec();
}
- public static JobSpecification buildDropSecondaryIndexJobSpec(CompiledIndexDropStatement deleteStmt,
- AqlCompiledMetadataDeclarations datasetDecls) throws AlgebricksException, MetadataException {
- String datasetName = deleteStmt.getDatasetName();
- String indexName = deleteStmt.getIndexName();
+ public static JobSpecification buildDropSecondaryIndexJobSpec(CompiledIndexDropStatement indexDropStmt,
+ AqlMetadataProvider metadataProvider) throws AlgebricksException, MetadataException {
+ String dataverseName = indexDropStmt.getDataverseName() == null ? metadataProvider.getDefaultDataverseName()
+ : indexDropStmt.getDataverseName();
+ String datasetName = indexDropStmt.getDatasetName();
+ String indexName = indexDropStmt.getIndexName();
JobSpecification spec = new JobSpecification();
IIndexRegistryProvider<IIndex> indexRegistryProvider = AsterixIndexRegistryProvider.INSTANCE;
IStorageManagerInterface storageManager = AsterixStorageManagerInterface.INSTANCE;
- Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitsAndConstraint = datasetDecls
- .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(datasetName, indexName);
+ Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitsAndConstraint = metadataProvider
+ .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(dataverseName, datasetName, indexName);
TreeIndexDropOperatorDescriptor btreeDrop = new TreeIndexDropOperatorDescriptor(spec, storageManager,
indexRegistryProvider, splitsAndConstraint.first);
AlgebricksPartitionConstraintHelper
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/file/SecondaryIndexCreator.java b/asterix-app/src/main/java/edu/uci/ics/asterix/file/SecondaryIndexCreator.java
index 65f6f5e..34ba208 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/file/SecondaryIndexCreator.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/file/SecondaryIndexCreator.java
@@ -12,7 +12,7 @@
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.formats.nontagged.AqlTypeTraitProvider;
import edu.uci.ics.asterix.metadata.MetadataException;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
+import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
import edu.uci.ics.asterix.metadata.entities.Dataset;
import edu.uci.ics.asterix.metadata.entities.Index;
import edu.uci.ics.asterix.metadata.utils.DatasetUtils;
@@ -21,7 +21,7 @@
import edu.uci.ics.asterix.runtime.evaluators.functions.AndDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.IsNullDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.NotDescriptor;
-import edu.uci.ics.asterix.translator.DmlTranslator.CompiledCreateIndexStatement;
+import edu.uci.ics.asterix.translator.CompiledStatements.CompiledCreateIndexStatement;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraintHelper;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -64,7 +64,8 @@
protected int numPrimaryKeys;
protected int numSecondaryKeys;
- protected AqlCompiledMetadataDeclarations metadata;
+ protected AqlMetadataProvider metadataProvider;
+ protected String dataverseName;
protected String datasetName;
protected Dataset dataset;
protected ARecordType itemType;
@@ -88,7 +89,7 @@
}
public static SecondaryIndexCreator createIndexCreator(CompiledCreateIndexStatement createIndexStmt,
- AqlCompiledMetadataDeclarations metadata, PhysicalOptimizationConfig physOptConf) throws AsterixException,
+ AqlMetadataProvider metadataProvider, PhysicalOptimizationConfig physOptConf) throws AsterixException,
AlgebricksException {
SecondaryIndexCreator indexCreator = null;
switch (createIndexStmt.getIndexType()) {
@@ -109,7 +110,7 @@
throw new AsterixException("Unknown Index Type: " + createIndexStmt.getIndexType());
}
}
- indexCreator.init(createIndexStmt, metadata);
+ indexCreator.init(createIndexStmt, metadataProvider);
return indexCreator;
}
@@ -117,33 +118,37 @@
public abstract JobSpecification buildLoadingJobSpec() throws AsterixException, AlgebricksException;
- protected void init(CompiledCreateIndexStatement createIndexStmt, AqlCompiledMetadataDeclarations metadata)
+ protected void init(CompiledCreateIndexStatement createIndexStmt, AqlMetadataProvider metadataProvider)
throws AsterixException, AlgebricksException {
- this.metadata = metadata;
+ this.metadataProvider = metadataProvider;
+ dataverseName = createIndexStmt.getDataverseName() == null ? metadataProvider.getDefaultDataverseName()
+ : createIndexStmt.getDataverseName();
datasetName = createIndexStmt.getDatasetName();
secondaryIndexName = createIndexStmt.getIndexName();
- dataset = metadata.findDataset(datasetName);
+ dataset = metadataProvider.findDataset(dataverseName, datasetName);
if (dataset == null) {
throw new AsterixException("Unknown dataset " + datasetName);
}
if (dataset.getDatasetType() == DatasetType.EXTERNAL) {
throw new AsterixException("Cannot index an external dataset (" + datasetName + ").");
}
- itemType = (ARecordType) metadata.findType(dataset.getItemTypeName());
+ itemType = (ARecordType) metadataProvider.findType(dataset.getDataverseName(), dataset.getItemTypeName());
payloadSerde = AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(itemType);
numPrimaryKeys = DatasetUtils.getPartitioningKeys(dataset).size();
numSecondaryKeys = createIndexStmt.getKeyFields().size();
- Pair<IFileSplitProvider, AlgebricksPartitionConstraint> primarySplitsAndConstraint = metadata
- .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(datasetName, datasetName);
+ Pair<IFileSplitProvider, AlgebricksPartitionConstraint> primarySplitsAndConstraint = metadataProvider
+ .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(
+ dataverseName, datasetName, datasetName);
primaryFileSplitProvider = primarySplitsAndConstraint.first;
primaryPartitionConstraint = primarySplitsAndConstraint.second;
- Pair<IFileSplitProvider, AlgebricksPartitionConstraint> secondarySplitsAndConstraint = metadata
- .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(datasetName, secondaryIndexName);
+ Pair<IFileSplitProvider, AlgebricksPartitionConstraint> secondarySplitsAndConstraint = metadataProvider
+ .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(
+ dataverseName, datasetName, secondaryIndexName);
secondaryFileSplitProvider = secondarySplitsAndConstraint.first;
secondaryPartitionConstraint = secondarySplitsAndConstraint.second;
// Must be called in this order.
setPrimaryRecDescAndComparators();
- setSecondaryRecDescAndComparators(createIndexStmt);
+ setSecondaryRecDescAndComparators(createIndexStmt, metadataProvider);
}
protected void setPrimaryRecDescAndComparators() throws AlgebricksException {
@@ -152,7 +157,7 @@
ISerializerDeserializer[] primaryRecFields = new ISerializerDeserializer[numPrimaryKeys + 1];
ITypeTraits[] primaryTypeTraits = new ITypeTraits[numPrimaryKeys + 1];
primaryComparatorFactories = new IBinaryComparatorFactory[numPrimaryKeys];
- ISerializerDeserializerProvider serdeProvider = metadata.getFormat().getSerdeProvider();
+ ISerializerDeserializerProvider serdeProvider = metadataProvider.getFormat().getSerdeProvider();
for (int i = 0; i < numPrimaryKeys; i++) {
IAType keyType = itemType.getFieldType(partitioningKeys.get(i));
primaryRecFields[i] = serdeProvider.getSerializerDeserializer(keyType);
@@ -165,20 +170,20 @@
primaryRecDesc = new RecordDescriptor(primaryRecFields, primaryTypeTraits);
}
- protected void setSecondaryRecDescAndComparators(CompiledCreateIndexStatement createIndexStmt)
- throws AlgebricksException, AsterixException {
+ protected void setSecondaryRecDescAndComparators(CompiledCreateIndexStatement createIndexStmt,
+ AqlMetadataProvider metadataProvider) throws AlgebricksException, AsterixException {
List<String> secondaryKeyFields = createIndexStmt.getKeyFields();
secondaryFieldAccessEvalFactories = new ICopyEvaluatorFactory[numSecondaryKeys];
secondaryComparatorFactories = new IBinaryComparatorFactory[numSecondaryKeys + numPrimaryKeys];
ISerializerDeserializer[] secondaryRecFields = new ISerializerDeserializer[numPrimaryKeys + numSecondaryKeys];
ITypeTraits[] secondaryTypeTraits = new ITypeTraits[numSecondaryKeys + numPrimaryKeys];
- ISerializerDeserializerProvider serdeProvider = metadata.getFormat().getSerdeProvider();
- ITypeTraitProvider typeTraitProvider = metadata.getFormat().getTypeTraitProvider();
- IBinaryComparatorFactoryProvider comparatorFactoryProvider = metadata.getFormat()
+ ISerializerDeserializerProvider serdeProvider = metadataProvider.getFormat().getSerdeProvider();
+ ITypeTraitProvider typeTraitProvider = metadataProvider.getFormat().getTypeTraitProvider();
+ IBinaryComparatorFactoryProvider comparatorFactoryProvider = metadataProvider.getFormat()
.getBinaryComparatorFactoryProvider();
for (int i = 0; i < numSecondaryKeys; i++) {
- secondaryFieldAccessEvalFactories[i] = metadata.getFormat().getFieldAccessEvaluatorFactory(itemType,
- secondaryKeyFields.get(i), numPrimaryKeys);
+ secondaryFieldAccessEvalFactories[i] = metadataProvider.getFormat().getFieldAccessEvaluatorFactory(
+ itemType, secondaryKeyFields.get(i), numPrimaryKeys);
Pair<IAType, Boolean> keyTypePair = Index.getNonNullableKeyFieldType(secondaryKeyFields.get(i), itemType);
IAType keyType = keyTypePair.first;
anySecondaryKeyIsNullable = anySecondaryKeyIsNullable || keyTypePair.second;
@@ -280,8 +285,9 @@
for (int i = 0; i < numSecondaryKeyFields + numPrimaryKeys; i++) {
fieldPermutation[i] = i;
}
- Pair<IFileSplitProvider, AlgebricksPartitionConstraint> secondarySplitsAndConstraint = metadata
- .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(datasetName, secondaryIndexName);
+ Pair<IFileSplitProvider, AlgebricksPartitionConstraint> secondarySplitsAndConstraint = metadataProvider
+ .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(
+ dataverseName, datasetName, secondaryIndexName);
TreeIndexBulkLoadOperatorDescriptor treeIndexBulkLoadOp = new TreeIndexBulkLoadOperatorDescriptor(spec,
AsterixStorageManagerInterface.INSTANCE, AsterixIndexRegistryProvider.INSTANCE,
secondarySplitsAndConstraint.first, secondaryRecDesc.getTypeTraits(), secondaryComparatorFactories,
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/file/SecondaryInvertedIndexCreator.java b/asterix-app/src/main/java/edu/uci/ics/asterix/file/SecondaryInvertedIndexCreator.java
index d5e8222..dc12814 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/file/SecondaryInvertedIndexCreator.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/file/SecondaryInvertedIndexCreator.java
@@ -5,10 +5,12 @@
import edu.uci.ics.asterix.common.context.AsterixIndexRegistryProvider;
import edu.uci.ics.asterix.common.context.AsterixStorageManagerInterface;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
import edu.uci.ics.asterix.metadata.entities.Index;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.optimizer.rules.am.InvertedIndexAccessMethod;
-import edu.uci.ics.asterix.translator.DmlTranslator.CompiledCreateIndexStatement;
+import edu.uci.ics.asterix.runtime.formats.FormatUtils;
+import edu.uci.ics.asterix.translator.CompiledStatements.CompiledCreateIndexStatement;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraintHelper;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
@@ -54,7 +56,7 @@
@Override
@SuppressWarnings("rawtypes")
- protected void setSecondaryRecDescAndComparators(CompiledCreateIndexStatement createIndexStmt)
+ protected void setSecondaryRecDescAndComparators(CompiledCreateIndexStatement createIndexStmt, AqlMetadataProvider metadata)
throws AlgebricksException, AsterixException {
// Sanity checks.
if (numPrimaryKeys > 1) {
@@ -68,11 +70,11 @@
secondaryFieldAccessEvalFactories = new ICopyEvaluatorFactory[numSecondaryKeys];
ISerializerDeserializer[] secondaryRecFields = new ISerializerDeserializer[numPrimaryKeys + numSecondaryKeys];
ITypeTraits[] secondaryTypeTraits = new ITypeTraits[numSecondaryKeys + numPrimaryKeys];
- ISerializerDeserializerProvider serdeProvider = metadata.getFormat().getSerdeProvider();
- ITypeTraitProvider typeTraitProvider = metadata.getFormat().getTypeTraitProvider();
+ ISerializerDeserializerProvider serdeProvider = FormatUtils.getDefaultFormat().getSerdeProvider();
+ ITypeTraitProvider typeTraitProvider = FormatUtils.getDefaultFormat().getTypeTraitProvider();
for (int i = 0; i < numSecondaryKeys; i++) {
- secondaryFieldAccessEvalFactories[i] = metadata.getFormat().getFieldAccessEvaluatorFactory(itemType,
- secondaryKeyFields.get(i), numPrimaryKeys);
+ secondaryFieldAccessEvalFactories[i] = FormatUtils.getDefaultFormat().getFieldAccessEvaluatorFactory(
+ itemType, secondaryKeyFields.get(i), numPrimaryKeys);
Pair<IAType, Boolean> keyTypePair = Index.getNonNullableKeyFieldType(secondaryKeyFields.get(i), itemType);
secondaryKeyType = keyTypePair.first;
anySecondaryKeyIsNullable = anySecondaryKeyIsNullable || keyTypePair.second;
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/file/SecondaryRTreeCreator.java b/asterix-app/src/main/java/edu/uci/ics/asterix/file/SecondaryRTreeCreator.java
index 3127573..ba8f6cd 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/file/SecondaryRTreeCreator.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/file/SecondaryRTreeCreator.java
@@ -9,10 +9,11 @@
import edu.uci.ics.asterix.formats.nontagged.AqlBinaryComparatorFactoryProvider;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.formats.nontagged.AqlTypeTraitProvider;
+import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
import edu.uci.ics.asterix.metadata.entities.Index;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
-import edu.uci.ics.asterix.translator.DmlTranslator.CompiledCreateIndexStatement;
+import edu.uci.ics.asterix.translator.CompiledStatements.CompiledCreateIndexStatement;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraintHelper;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
@@ -59,7 +60,7 @@
}
@Override
- protected void setSecondaryRecDescAndComparators(CompiledCreateIndexStatement createIndexStmt)
+ protected void setSecondaryRecDescAndComparators(CompiledCreateIndexStatement createIndexStmt, AqlMetadataProvider metadata)
throws AlgebricksException, AsterixException {
List<String> secondaryKeyFields = createIndexStmt.getKeyFields();
int numSecondaryKeys = secondaryKeyFields.size();
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/hyracks/bootstrap/CCBootstrapImpl.java b/asterix-app/src/main/java/edu/uci/ics/asterix/hyracks/bootstrap/CCBootstrapImpl.java
index ccba498..434f44c 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/hyracks/bootstrap/CCBootstrapImpl.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/hyracks/bootstrap/CCBootstrapImpl.java
@@ -29,6 +29,7 @@
import edu.uci.ics.asterix.api.aqlj.server.APIClientThreadFactory;
import edu.uci.ics.asterix.api.aqlj.server.ThreadedServer;
import edu.uci.ics.asterix.api.http.servlet.APIServlet;
+import edu.uci.ics.asterix.common.api.AsterixAppContextInfoImpl;
import edu.uci.ics.asterix.common.config.GlobalConfig;
import edu.uci.ics.asterix.metadata.MetadataManager;
import edu.uci.ics.asterix.metadata.api.IAsterixStateProxy;
@@ -37,6 +38,10 @@
import edu.uci.ics.hyracks.api.application.ICCApplicationContext;
import edu.uci.ics.hyracks.api.application.ICCBootstrap;
+/**
+ * The bootstrap class of the application that will manage its
+ * life cycle at the Cluster Controller.
+ */
public class CCBootstrapImpl implements ICCBootstrap {
private static final Logger LOGGER = Logger.getLogger(CCBootstrapImpl.class.getName());
@@ -71,6 +76,9 @@
// Setup and start the API server
setupAPIServer();
apiServer.start();
+
+ //Initialize AsterixAppContext
+ AsterixAppContextInfoImpl.initialize(appCtx);
}
@Override
@@ -79,7 +87,7 @@
LOGGER.info("Stopping Asterix cluster controller");
}
AsterixStateProxy.unregisterRemoteObject();
-
+
webServer.stop();
apiServer.shutdown();
}
@@ -107,11 +115,7 @@
// set the APINodeDataServer ports
int startPort = DEFAULT_API_NODEDATA_SERVER_PORT;
Map<String, Set<String>> nodeNameMap = new HashMap<String, Set<String>>();
- try {
- appCtx.getCCContext().getIPAddressNodeMap(nodeNameMap);
- } catch (Exception e) {
- throw new IOException("Unable to obtain IP address node map", e);
- }
+ getIPAddressNodeMap(nodeNameMap);
for (Map.Entry<String, Set<String>> entry : nodeNameMap.entrySet()) {
Set<String> nodeNames = entry.getValue();
@@ -122,7 +126,15 @@
proxy.setAsterixNodeState(it.next(), ns);
}
}
-
apiServer = new ThreadedServer(DEFAULT_API_SERVER_PORT, new APIClientThreadFactory(appCtx));
}
+
+ private void getIPAddressNodeMap(Map<String, Set<String>> nodeNameMap) throws IOException {
+ nodeNameMap.clear();
+ try {
+ appCtx.getCCContext().getIPAddressNodeMap(nodeNameMap);
+ } catch (Exception e) {
+ throw new IOException("Unable to obtain IP address node map", e);
+ }
+ }
}
\ No newline at end of file
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/aql/AQLTestCase.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/aql/AQLTestCase.java
index bfd6f13..f58dcb0 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/aql/AQLTestCase.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/aql/AQLTestCase.java
@@ -9,13 +9,13 @@
import java.io.Reader;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
+import java.util.List;
import junit.framework.TestCase;
import org.junit.Test;
import edu.uci.ics.asterix.aql.base.Statement;
-import edu.uci.ics.asterix.aql.expression.visitor.AQLPrintVisitor;
import edu.uci.ics.asterix.aql.parser.AQLParser;
import edu.uci.ics.asterix.aql.parser.ParseException;
import edu.uci.ics.asterix.common.config.GlobalConfig;
@@ -36,11 +36,10 @@
AlgebricksException {
Reader fis = new BufferedReader(new InputStreamReader(new FileInputStream(queryFile), "UTF-8"));
AQLParser parser = new AQLParser(fis);
- Statement st;
+ List<Statement> statements;
GlobalConfig.ASTERIX_LOGGER.info(queryFile.toString());
try {
- st = parser.Statement();
- st.accept(new AQLPrintVisitor(), 0);
+ statements = parser.Statement();
} catch (ParseException e) {
GlobalConfig.ASTERIX_LOGGER.warning("Failed while testing file " + fis);
StringWriter sw = new StringWriter();
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java
index 6fec201..3505b23 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java
@@ -1,16 +1,27 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package edu.uci.ics.asterix.test.metadata;
-import java.io.BufferedReader;
import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
import java.io.PrintWriter;
-import java.io.Reader;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
import java.util.logging.Logger;
+import org.apache.commons.io.FileUtils;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -19,156 +30,99 @@
import org.junit.runners.Parameterized.Parameters;
import edu.uci.ics.asterix.api.common.AsterixHyracksIntegrationUtil;
-import edu.uci.ics.asterix.api.java.AsterixJavaClient;
import edu.uci.ics.asterix.common.config.GlobalConfig;
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.test.aql.TestsUtils;
-import edu.uci.ics.asterix.test.runtime.RuntimeTest;
+import edu.uci.ics.asterix.testframework.context.TestCaseContext;
+import edu.uci.ics.asterix.testframework.xml.TestCase.CompilationUnit;
+/**
+ * Executes the Metadata tests.
+ */
@RunWith(Parameterized.class)
public class MetadataTest {
- private static final Logger LOGGER = Logger.getLogger(RuntimeTest.class.getName());
+ private TestCaseContext tcCtx;
- private static final PrintWriter ERR = new PrintWriter(System.err);
- private static final String EXTENSION_QUERY = "aql";
- private static final String EXTENSION_RESULT = "adm";
- private static final String PATH_ACTUAL = "rttest/";
+ private static final Logger LOGGER = Logger.getLogger(MetadataTest.class.getName());
+ private static final String PATH_ACTUAL = "mdtest/";
private static final String PATH_BASE = "src/test/resources/metadata/";
- private static final String PATH_EXPECTED = PATH_BASE + "results/";
- private static final String PATH_QUERIES = PATH_BASE + "queries/";
- private static final String QUERIES_FILE = PATH_BASE + "queries.txt";
- private static final String SEPARATOR = System.getProperty("file.separator");
+ private static final String TEST_CONFIG_FILE_NAME = "test.properties";
+ private static final String WEB_SERVER_PORT = "19002";
- private static String _oldConfigFileName;
- private static final String TEST_CONFIG_FILE_NAME = "asterix-metadata.properties";
- private static final String[] ASTERIX_DATA_DIRS = new String[] { "nc1data", "nc2data" };
+ public MetadataTest(TestCaseContext tcCtx) {
+ this.tcCtx = tcCtx;
+ }
- private static String aqlExtToResExt(String fname) {
- int dot = fname.lastIndexOf('.');
- return fname.substring(0, dot + 1) + EXTENSION_RESULT;
+ @Test
+ public void test() throws Exception {
+ List<CompilationUnit> cUnits = tcCtx.getTestCase().getCompilationUnit();
+ for (CompilationUnit cUnit : cUnits) {
+ File testFile = tcCtx.getTestFile(cUnit);
+ File expectedResultFile = tcCtx.getExpectedResultFile(cUnit);
+ File actualFile = new File(PATH_ACTUAL + File.separator
+ + tcCtx.getTestCase().getFilePath().replace(File.separator, "_") + "_" + cUnit.getName() + ".adm");
+
+ File actualResultFile = tcCtx.getActualResultFile(cUnit, new File(PATH_ACTUAL));
+ actualResultFile.getParentFile().mkdirs();
+ try {
+ TestsUtils.runScriptAndCompareWithResult(AsterixHyracksIntegrationUtil.getHyracksClientConnection(),
+ testFile, new PrintWriter(System.err), expectedResultFile, actualFile);
+ } catch (Exception e) {
+ LOGGER.severe("Test \"" + testFile + "\" FAILED!");
+ e.printStackTrace();
+ if (cUnit.getExpectedError().isEmpty()) {
+ throw new Exception("Test \"" + testFile + "\" FAILED!", e);
+ }
+ }
+ }
}
@BeforeClass
public static void setUp() throws Exception {
- _oldConfigFileName = System.getProperty(GlobalConfig.CONFIG_FILE_PROPERTY);
System.setProperty(GlobalConfig.CONFIG_FILE_PROPERTY, TEST_CONFIG_FILE_NAME);
+ System.setProperty(GlobalConfig.WEB_SERVER_PORT_PROPERTY, WEB_SERVER_PORT);
File outdir = new File(PATH_ACTUAL);
outdir.mkdirs();
+
+ File log = new File("asterix_logs");
+ if (log.exists())
+ FileUtils.deleteDirectory(log);
+ File lsn = new File("last_checkpoint_lsn");
+ lsn.deleteOnExit();
+
AsterixHyracksIntegrationUtil.init();
+
}
@AfterClass
public static void tearDown() throws Exception {
- // _bootstrap.stop();
AsterixHyracksIntegrationUtil.deinit();
File outdir = new File(PATH_ACTUAL);
File[] files = outdir.listFiles();
if (files == null || files.length == 0) {
outdir.delete();
}
- if (_oldConfigFileName != null) {
- System.setProperty(GlobalConfig.CONFIG_FILE_PROPERTY, _oldConfigFileName);
- }
+
// clean up the files written by the ASTERIX storage manager
- for (String d : ASTERIX_DATA_DIRS) {
+ for (String d : AsterixHyracksIntegrationUtil.ASTERIX_DATA_DIRS) {
TestsUtils.deleteRec(new File(d));
}
- }
- private static void suiteBuild(File f, Collection<Object[]> testArgs, String path) throws IOException {
- BufferedReader br = null;
- try {
- br = new BufferedReader(new InputStreamReader(new FileInputStream(f), "UTF-8"));
- String strLine;
- File file;
- while ((strLine = br.readLine()) != null) {
- // Ignore commented out lines.
- if (strLine.startsWith("//")) {
- continue;
- }
- file = new File(PATH_QUERIES + SEPARATOR + strLine);
- if (file.getName().endsWith(EXTENSION_QUERY)) {
- String resultFileName = aqlExtToResExt(file.getName());
- File expectedFile = new File(PATH_EXPECTED + path + resultFileName);
- File actualFile = new File(PATH_ACTUAL + SEPARATOR + path.replace(SEPARATOR, "_") + resultFileName);
- testArgs.add(new Object[] { file, expectedFile, actualFile });
- }
- }
-
- } catch (IOException e) {
- e.printStackTrace();
- } finally {
- if (br != null) {
- br.close();
- }
- }
+ File log = new File("asterix_logs");
+ if (log.exists())
+ FileUtils.deleteDirectory(log);
+ File lsn = new File("last_checkpoint_lsn");
+ lsn.deleteOnExit();
}
@Parameters
- public static Collection<Object[]> tests() throws IOException {
+ public static Collection<Object[]> tests() throws Exception {
Collection<Object[]> testArgs = new ArrayList<Object[]>();
- suiteBuild(new File(QUERIES_FILE), testArgs, "");
+ TestCaseContext.Builder b = new TestCaseContext.Builder();
+ for (TestCaseContext ctx : b.build(new File(PATH_BASE))) {
+ testArgs.add(new Object[] { ctx });
+ }
return testArgs;
}
- private File actualFile;
- private File expectedFile;
- private File queryFile;
-
- public MetadataTest(File queryFile, File expectedFile, File actualFile) {
- this.queryFile = queryFile;
- this.expectedFile = expectedFile;
- this.actualFile = actualFile;
- }
-
- @Test
- public void test() throws Exception {
- Reader query = new BufferedReader(new InputStreamReader(new FileInputStream(queryFile), "UTF-8"));
- AsterixJavaClient asterix = new AsterixJavaClient(AsterixHyracksIntegrationUtil.getHyracksClientConnection(),
- query, ERR);
- try {
- LOGGER.info("Query is: " + queryFile);
- asterix.compile(true, false, false, false, false, true, false);
- asterix.compile();
- } catch (AsterixException e) {
- throw new Exception("Compile ERROR for " + queryFile + ": " + e.getMessage(), e);
- } finally {
- query.close();
- }
- asterix.execute();
- query.close();
-
- if (actualFile.exists()) {
- BufferedReader readerExpected = new BufferedReader(new InputStreamReader(new FileInputStream(expectedFile),
- "UTF-8"));
- BufferedReader readerActual = new BufferedReader(new InputStreamReader(new FileInputStream(actualFile),
- "UTF-8"));
- String lineExpected, lineActual;
- int num = 1;
- try {
- while ((lineExpected = readerExpected.readLine()) != null) {
- lineActual = readerActual.readLine();
- if (lineActual == null) {
- throw new Exception("Result for " + queryFile + " changed at line " + num + ":\n< "
- + lineExpected + "\n> ");
- }
- if (!lineExpected.split("Timestamp")[0].equals(lineActual.split("Timestamp")[0])) {
- throw new Exception("Result for " + queryFile + " changed at line " + num + ":\n< "
- + lineExpected + "\n> " + lineActual);
- }
- ++num;
- }
- lineActual = readerActual.readLine();
- if (lineActual != null) {
- throw new Exception("Result for " + queryFile + " changed at line " + num + ":\n< \n> "
- + lineActual);
- }
- actualFile.delete();
- } finally {
- readerExpected.close();
- readerActual.close();
- }
- }
- }
}
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTransactionsTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTransactionsTest.java
deleted file mode 100644
index 1645a96..0000000
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTransactionsTest.java
+++ /dev/null
@@ -1,253 +0,0 @@
-package edu.uci.ics.asterix.test.metadata;
-
-import static org.junit.Assert.fail;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.logging.Logger;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
-import edu.uci.ics.asterix.api.common.AsterixHyracksIntegrationUtil;
-import edu.uci.ics.asterix.api.java.AsterixJavaClient;
-import edu.uci.ics.asterix.common.config.GlobalConfig;
-import edu.uci.ics.asterix.test.aql.TestsUtils;
-
-@RunWith(Parameterized.class)
-public class MetadataTransactionsTest {
-
- private static final Logger LOGGER = Logger.getLogger(MetadataTransactionsTest.class.getName());
-
- private static final PrintWriter ERR = new PrintWriter(System.err);
- private static final String EXTENSION_QUERY = "aql";
- private static final String EXTENSION_RESULT = "adm";
- private static final String PATH_ACTUAL = "rttest/";
- private static final String PATH_BASE = "src/test/resources/metadata-transactions/";
- private static final String CHECK_STATE_QUERIES_PATH = PATH_BASE + "check-state-queries/";
- private static final String CHECK_STATE_RESULTS_PATH = PATH_BASE + "check-state-results/";
- private static final String CHECK_STATE_FILE = PATH_BASE + "check-state-queries.txt";
- private static final String INIT_STATE_QUERIES_PATH = PATH_BASE + "init-state-queries/";
- private static final String INIT_STATE_FILE = PATH_BASE + "init-state-queries.txt";
- private static final String TEST_QUERIES_PATH = PATH_BASE + "queries/";
- private static final String QUERIES_FILE = PATH_BASE + "queries.txt";
-
- private static String _oldConfigFileName;
- private static final String TEST_CONFIG_FILE_NAME = "asterix-metadata.properties";
- private static final String[] ASTERIX_DATA_DIRS = new String[] { "nc1data", "nc2data" };
-
- private static String aqlExtToResExt(String fname) {
- int dot = fname.lastIndexOf('.');
- return fname.substring(0, dot + 1) + EXTENSION_RESULT;
- }
-
- private static void executeQueryTuple(Object[] queryTuple, boolean expectFailure, boolean executeQuery) {
- String queryFileName = (String) queryTuple[0];
- String expectedFileName = (String) queryTuple[1];
- String actualFileName = (String) queryTuple[2];
- try {
- Reader query = new BufferedReader(new InputStreamReader(new FileInputStream(queryFileName), "UTF-8"));
- AsterixJavaClient asterix = new AsterixJavaClient(
- AsterixHyracksIntegrationUtil.getHyracksClientConnection(), query, ERR);
- LOGGER.info("Query is: " + queryFileName);
- try {
- asterix.compile(true, false, false, false, false, executeQuery, false);
- } finally {
- query.close();
- }
- // We don't want to execute a query if we expect only DDL
- // modifications.
- if (executeQuery) {
- asterix.execute();
- }
- query.close();
- } catch (Exception e) {
- if (!expectFailure) {
- fail("Unexpected failure of AQL query in file: " + queryFileName + "\n" + e.getMessage());
- }
- return;
- }
- // Do we expect failure?
- if (expectFailure) {
- fail("Unexpected success of AQL query in file: " + queryFileName);
- }
- // If no expected or actual file names were given, then we don't want to
- // compare them.
- if (expectedFileName == null || actualFileName == null) {
- return;
- }
- // Compare actual and expected results.
- try {
- File actualFile = new File(actualFileName);
- File expectedFile = new File(expectedFileName);
- if (actualFile.exists()) {
- BufferedReader readerExpected = new BufferedReader(new InputStreamReader(new FileInputStream(
- expectedFile), "UTF-8"));
- BufferedReader readerActual = new BufferedReader(new InputStreamReader(new FileInputStream(actualFile),
- "UTF-8"));
- String lineExpected, lineActual;
- int num = 1;
- try {
- while ((lineExpected = readerExpected.readLine()) != null) {
- lineActual = readerActual.readLine();
- if (lineActual == null) {
- fail("Result for " + queryFileName + " changed at line " + num + ":\n< " + lineExpected
- + "\n> ");
- }
- if (!lineExpected.split("Timestamp")[0].equals(lineActual.split("Timestamp")[0])) {
- fail("Result for " + queryFileName + " changed at line " + num + ":\n< " + lineExpected
- + "\n> " + lineActual);
- }
- ++num;
- }
- lineActual = readerActual.readLine();
- if (lineActual != null) {
- fail("Result for " + queryFileName + " changed at line " + num + ":\n< \n> " + lineActual);
- }
- // actualFile.delete();
- } finally {
- readerExpected.close();
- readerActual.close();
- }
- }
- } catch (Exception e) {
- fail("Execption occurred while comparing expected and actual results: " + e.getMessage());
- }
- }
-
- // Collection of object arrays. Each object array contains exactly 3 string
- // elements:
- // 1. String QueryFile
- // 2. String expectedFile
- // 3. String actualFile
- private static Collection<Object[]> checkQuerySuite = new ArrayList<Object[]>();
-
- private static void checkMetadataState() {
- for (Object[] checkTuple : checkQuerySuite) {
- executeQueryTuple(checkTuple, false, true);
- }
- }
-
- @BeforeClass
- public static void setUp() throws Exception {
- _oldConfigFileName = System.getProperty(GlobalConfig.CONFIG_FILE_PROPERTY);
- System.setProperty(GlobalConfig.CONFIG_FILE_PROPERTY, TEST_CONFIG_FILE_NAME);
- File outdir = new File(PATH_ACTUAL);
- outdir.mkdirs();
- AsterixHyracksIntegrationUtil.init();
-
- // Create initial metadata state by adding the customers and orders
- // metadata.
- Collection<Object[]> initQuerySuite = new ArrayList<Object[]>();
- prepareQuerySuite(INIT_STATE_FILE, INIT_STATE_QUERIES_PATH, null, null, initQuerySuite);
- for (Object[] queryTuple : initQuerySuite) {
- executeQueryTuple(queryTuple, false, false);
- }
-
- // Prepare the query suite for checking the metadata state is still
- // correct.
- prepareQuerySuite(CHECK_STATE_FILE, CHECK_STATE_QUERIES_PATH, CHECK_STATE_RESULTS_PATH, PATH_ACTUAL,
- checkQuerySuite);
-
- // Make sure the initial metadata state is set up correctly.
- checkMetadataState();
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- // _bootstrap.stop();
- AsterixHyracksIntegrationUtil.deinit();
- File outdir = new File(PATH_ACTUAL);
- File[] files = outdir.listFiles();
- if (files == null || files.length == 0) {
- // outdir.delete();
- }
- if (_oldConfigFileName != null) {
- System.setProperty(GlobalConfig.CONFIG_FILE_PROPERTY, _oldConfigFileName);
- }
- // clean up the files written by the ASTERIX storage manager
- for (String d : ASTERIX_DATA_DIRS) {
- TestsUtils.deleteRec(new File(d));
- }
- }
-
- private static void prepareQuerySuite(String queryListPath, String queryPath, String expectedPath,
- String actualPath, Collection<Object[]> output) throws IOException {
- BufferedReader br = null;
- try {
- File queryListFile = new File(queryListPath);
- br = new BufferedReader(new InputStreamReader(new FileInputStream(queryListFile), "UTF-8"));
- String strLine;
- String queryFileName;
- File queryFile;
- while ((strLine = br.readLine()) != null) {
- // Ignore commented test files.
- if (strLine.startsWith("//")) {
- continue;
- }
- queryFileName = queryPath + strLine;
- queryFile = new File(queryPath + strLine);
- // If no expected or actual path was given, just add the
- // queryFile.
- if (expectedPath == null || actualPath == null) {
- output.add(new Object[] { queryFileName, null, null });
- continue;
- }
- // We want to compare expected and actual results. Construct the
- // expected and actual files.
- if (queryFile.getName().endsWith(EXTENSION_QUERY)) {
- String resultFileName = aqlExtToResExt(queryFile.getName());
- String expectedFileName = expectedPath + resultFileName;
- String actualFileName = actualPath + resultFileName;
- output.add(new Object[] { queryFileName, expectedFileName, actualFileName });
- }
- }
- } catch (IOException e) {
- e.printStackTrace();
- } finally {
- if (br != null) {
- br.close();
- }
- }
- }
-
- @Parameters
- public static Collection<Object[]> tests() throws IOException {
- Collection<Object[]> testArgs = new ArrayList<Object[]>();
- prepareQuerySuite(QUERIES_FILE, TEST_QUERIES_PATH, null, null, testArgs);
- return testArgs;
- }
-
- private String actualFileName;
- private String expectedFileName;
- private String queryFileName;
-
- public MetadataTransactionsTest(String queryFileName, String expectedFileName, String actualFileName) {
- this.queryFileName = queryFileName;
- this.expectedFileName = expectedFileName;
- this.actualFileName = actualFileName;
- }
-
- @Test
- public void test() throws Exception {
- // Re-create query tuple.
- Object[] queryTuple = new Object[] { queryFileName, expectedFileName, actualFileName };
-
- // Execute query tuple, expecting failure.
- executeQueryTuple(queryTuple, true, false);
-
- // Validate metadata state after failed query above.
- checkMetadataState();
- }
-}
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
index d60971b..43c6c0c 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
@@ -3,7 +3,6 @@
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
-import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.Reader;
@@ -22,7 +21,8 @@
import edu.uci.ics.asterix.api.common.AsterixHyracksIntegrationUtil;
import edu.uci.ics.asterix.api.java.AsterixJavaClient;
-import edu.uci.ics.asterix.common.config.GlobalConfig;import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.common.config.GlobalConfig;
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.test.base.AsterixTestHelper;
import edu.uci.ics.asterix.test.common.TestHelper;
@@ -126,7 +126,7 @@
AsterixJavaClient asterix = new AsterixJavaClient(
AsterixHyracksIntegrationUtil.getHyracksClientConnection(), query, plan);
try {
- asterix.compile(true, false, false, false, true, true, false);
+ asterix.compile(true, false, false, true, true, false, false);
} catch (AsterixException e) {
plan.close();
query.close();
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
new file mode 100644
index 0000000..8eafd02
--- /dev/null
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
@@ -0,0 +1,119 @@
+package edu.uci.ics.asterix.test.runtime;
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.apache.commons.io.FileUtils;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import edu.uci.ics.asterix.api.common.AsterixHyracksIntegrationUtil;
+import edu.uci.ics.asterix.common.config.GlobalConfig;
+import edu.uci.ics.asterix.test.aql.TestsUtils;
+import edu.uci.ics.asterix.testframework.context.TestCaseContext;
+import edu.uci.ics.asterix.testframework.xml.TestCase.CompilationUnit;
+
+/**
+ * Runs the runtime test cases under 'src/test/resources/runtimets'.
+ */
+@RunWith(Parameterized.class)
+public class ExecutionTest {
+ private static final String PATH_ACTUAL = "rttest/";
+ private static final String PATH_BASE = "src/test/resources/runtimets/";
+
+ private static final String TEST_CONFIG_FILE_NAME = "test.properties";
+ private static final String[] ASTERIX_DATA_DIRS = new String[] { "nc1data", "nc2data" };
+
+ private static final Logger LOGGER = Logger.getLogger(ExecutionTest.class.getName());
+
+ // private static NCBootstrapImpl _bootstrap = new NCBootstrapImpl();
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ System.setProperty(GlobalConfig.CONFIG_FILE_PROPERTY, TEST_CONFIG_FILE_NAME);
+ System.setProperty(GlobalConfig.WEB_SERVER_PORT_PROPERTY, "19002");
+ File outdir = new File(PATH_ACTUAL);
+ outdir.mkdirs();
+
+ File log = new File("asterix_logs");
+ if (log.exists())
+ FileUtils.deleteDirectory(log);
+ File lsn = new File("last_checkpoint_lsn");
+ lsn.deleteOnExit();
+
+ AsterixHyracksIntegrationUtil.init();
+
+ // TODO: Uncomment when hadoop version is upgraded and adapters are ported
+ HDFSCluster.getInstance().setup();
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ AsterixHyracksIntegrationUtil.deinit();
+ File outdir = new File(PATH_ACTUAL);
+ File[] files = outdir.listFiles();
+ if (files == null || files.length == 0) {
+ outdir.delete();
+ }
+ // clean up the files written by the ASTERIX storage manager
+ for (String d : ASTERIX_DATA_DIRS) {
+ TestsUtils.deleteRec(new File(d));
+ }
+
+ File log = new File("asterix_logs");
+ if (log.exists())
+ FileUtils.deleteDirectory(log);
+ File lsn = new File("last_checkpoint_lsn");
+ lsn.deleteOnExit();
+ HDFSCluster.getInstance().cleanup();
+ }
+
+ @Parameters
+ public static Collection<Object[]> tests() throws Exception {
+ Collection<Object[]> testArgs = new ArrayList<Object[]>();
+ TestCaseContext.Builder b = new TestCaseContext.Builder();
+ for (TestCaseContext ctx : b.build(new File(PATH_BASE))) {
+ testArgs.add(new Object[] { ctx });
+ }
+ return testArgs;
+ }
+
+ private TestCaseContext tcCtx;
+
+ public ExecutionTest(TestCaseContext tcCtx) {
+ this.tcCtx = tcCtx;
+ }
+
+ @Test
+ public void test() throws Exception {
+ List<CompilationUnit> cUnits = tcCtx.getTestCase().getCompilationUnit();
+ for (CompilationUnit cUnit : cUnits) {
+ File testFile = tcCtx.getTestFile(cUnit);
+ File expectedResultFile = tcCtx.getExpectedResultFile(cUnit);
+ File actualFile = new File(PATH_ACTUAL + File.separator
+ + tcCtx.getTestCase().getFilePath().replace(File.separator, "_") + "_" + cUnit.getName() + ".adm");
+
+ File actualResultFile = tcCtx.getActualResultFile(cUnit, new File(PATH_ACTUAL));
+ actualResultFile.getParentFile().mkdirs();
+ try {
+ TestsUtils.runScriptAndCompareWithResult(AsterixHyracksIntegrationUtil.getHyracksClientConnection(),
+ testFile, new PrintWriter(System.err), expectedResultFile, actualFile);
+ } catch (Exception e) {
+ LOGGER.severe("Test \"" + testFile + "\" FAILED!");
+ e.printStackTrace();
+ if (cUnit.getExpectedError().isEmpty()) {
+ throw new Exception("Test \"" + testFile + "\" FAILED!", e);
+ }
+ }
+ }
+ }
+
+}
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/HDFSCluster.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/HDFSCluster.java
index c07cff2..20df118 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/HDFSCluster.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/HDFSCluster.java
@@ -1,5 +1,20 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package edu.uci.ics.asterix.test.runtime;
+import java.io.File;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
@@ -7,20 +22,29 @@
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hdfs.MiniDFSCluster;
import org.apache.hadoop.hdfs.server.common.HdfsConstants.StartupOption;
+import org.apache.hadoop.mapred.InputSplit;
import org.apache.hadoop.mapred.JobConf;
+import edu.uci.ics.asterix.external.dataset.adapter.HDFSAdapter;
+
+/**
+ * Manages a Mini (local VM) HDFS cluster with a configured number of datanodes.
+ *
+ * @author ramangrover29
+ */
@SuppressWarnings("deprecation")
public class HDFSCluster {
private static final String PATH_TO_HADOOP_CONF = "src/test/resources/hadoop/conf";
- private static final int nameNodePort = 10009;
- private static final String DATA_PATH = "data/tpch0.001";
- private static final String HDFS_PATH = "/tpch";
+ private static final int nameNodePort = 31888;
+ private static final String DATA_PATH = "data/hdfs";
+ private static final String HDFS_PATH = "/asterix";
private static final HDFSCluster INSTANCE = new HDFSCluster();
private MiniDFSCluster dfsCluster;
private int numDataNodes = 2;
private JobConf conf = new JobConf();
+ private FileSystem dfs;
public static HDFSCluster getInstance() {
return INSTANCE;
@@ -30,16 +54,30 @@
}
+ /**
+ * Instantiates the (Mini) DFS Cluster with the configured number of datanodes.
+ * Post instantiation, data is laoded to HDFS.
+ * Called prior to running the Runtime test suite.
+ */
public void setup() throws Exception {
conf.addResource(new Path(PATH_TO_HADOOP_CONF + "/core-site.xml"));
conf.addResource(new Path(PATH_TO_HADOOP_CONF + "/mapred-site.xml"));
conf.addResource(new Path(PATH_TO_HADOOP_CONF + "/hdfs-site.xml"));
cleanupLocal();
dfsCluster = new MiniDFSCluster(nameNodePort, conf, numDataNodes, true, true, StartupOption.REGULAR, null);
- FileSystem dfs = FileSystem.get(conf);
- Path src = new Path(DATA_PATH);
- Path dest = new Path(HDFS_PATH);
- dfs.copyFromLocalFile(src, dest);
+ dfs = FileSystem.get(conf);
+ loadData();
+ }
+
+ private void loadData() throws IOException {
+ Path destDir = new Path(HDFS_PATH);
+ dfs.mkdirs(destDir);
+ File srcDir = new File(DATA_PATH);
+ File[] listOfFiles = srcDir.listFiles();
+ for (File srcFile : listOfFiles) {
+ Path path = new Path(srcFile.getAbsolutePath());
+ dfs.copyFromLocalFile(path, destDir);
+ }
}
private void cleanupLocal() throws IOException {
@@ -57,7 +95,25 @@
public static void main(String[] args) throws Exception {
HDFSCluster cluster = new HDFSCluster();
cluster.setup();
- cluster.cleanup();
+ JobConf conf = configureJobConf();
+ FileSystem fs = FileSystem.get(conf);
+ InputSplit[] inputSplits = conf.getInputFormat().getSplits(conf, 0);
+ for (InputSplit split : inputSplits) {
+ System.out.println("split :" + split);
+ }
+ // cluster.cleanup();
+ }
+
+ private static JobConf configureJobConf() throws Exception {
+ JobConf conf = new JobConf();
+ String hdfsUrl = "hdfs://127.0.0.1:31888";
+ String hdfsPath = "/asterix/extrasmalltweets.txt";
+ conf.set("fs.default.name", hdfsUrl);
+ conf.set("fs.hdfs.impl", "org.apache.hadoop.hdfs.DistributedFileSystem");
+ conf.setClassLoader(HDFSAdapter.class.getClassLoader());
+ conf.set("mapred.input.dir", hdfsPath);
+ conf.set("mapred.input.format.class", "org.apache.hadoop.mapred.TextInputFormat");
+ return conf;
}
}
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/RuntimeTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/RuntimeTest.java
deleted file mode 100644
index b7877a3..0000000
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/RuntimeTest.java
+++ /dev/null
@@ -1,176 +0,0 @@
-package edu.uci.ics.asterix.test.runtime;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.logging.Logger;
-
-import org.apache.commons.io.FileUtils;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Assume;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.internal.AssumptionViolatedException;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
-import edu.uci.ics.asterix.api.common.AsterixHyracksIntegrationUtil;
-import edu.uci.ics.asterix.common.config.GlobalConfig;
-import edu.uci.ics.asterix.test.aql.TestsUtils;
-import edu.uci.ics.asterix.test.common.TestHelper;
-
-@RunWith(Parameterized.class)
-public class RuntimeTest {
-
- private static final PrintWriter ERR = new PrintWriter(System.err);
- private static final String EXTENSION_QUERY = "aql";
- private static final String FILENAME_IGNORE = "ignore.txt";
- private static final String FILENAME_ONLY = "only.txt";
- private static final ArrayList<String> ignore = readFile(FILENAME_IGNORE);
- private static final ArrayList<String> only = readFile(FILENAME_ONLY);
- private static final String PATH_ACTUAL = "rttest/";
- private static final String PATH_BASE = "src/test/resources/runtimets/";
- private static final String PATH_EXPECTED = PATH_BASE + "results/";
- private static final String PATH_QUERIES = PATH_BASE + "queries/";
- private static final String SEPARATOR = System.getProperty("file.separator");
-
- private static final String TEST_CONFIG_FILE_NAME = "test.properties";
- private static final String[] ASTERIX_DATA_DIRS = new String[] { "nc1data", "nc2data" };
-
- private static final Logger LOGGER = Logger.getLogger(RuntimeTest.class.getName());
-
- // private static NCBootstrapImpl _bootstrap = new NCBootstrapImpl();
-
- private static ArrayList<String> readFile(String fileName) {
- ArrayList<String> list = new ArrayList<String>();
- BufferedReader result;
- try {
- result = new BufferedReader(new InputStreamReader(new FileInputStream(PATH_BASE + fileName), "UTF-8"));
- while (true) {
- String line = result.readLine();
- if (line == null) {
- break;
- } else {
- String s = line.trim();
- if (s.length() > 0) {
- list.add(s);
- }
- }
- }
- result.close();
- } catch (FileNotFoundException e) {
- } catch (IOException e) {
- }
- return list;
- }
-
- @BeforeClass
- public static void setUp() throws Exception {
- System.setProperty(GlobalConfig.CONFIG_FILE_PROPERTY, TEST_CONFIG_FILE_NAME);
- System.setProperty(GlobalConfig.WEB_SERVER_PORT_PROPERTY, "19002");
- File outdir = new File(PATH_ACTUAL);
- outdir.mkdirs();
-
- File log = new File("asterix_logs");
- if (log.exists())
- FileUtils.deleteDirectory(log);
- File lsn = new File("last_checkpoint_lsn");
- lsn.deleteOnExit();
-
- AsterixHyracksIntegrationUtil.init();
-
- // TODO: Uncomment when hadoop version is upgraded and adapters are ported
- //HDFSCluster.getInstance().setup();
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- AsterixHyracksIntegrationUtil.deinit();
- File outdir = new File(PATH_ACTUAL);
- File[] files = outdir.listFiles();
- if (files == null || files.length == 0) {
- outdir.delete();
- }
- // clean up the files written by the ASTERIX storage manager
- for (String d : ASTERIX_DATA_DIRS) {
- TestsUtils.deleteRec(new File(d));
- }
-
- File log = new File("asterix_logs");
- if (log.exists())
- FileUtils.deleteDirectory(log);
- File lsn = new File("last_checkpoint_lsn");
- lsn.deleteOnExit();
-
- // TODO: Uncomment when hadoop version is upgraded and adapters are ported
- //HDFSCluster.getInstance().cleanup();
- }
-
- private static void suiteBuild(File dir, Collection<Object[]> testArgs, String path) {
- for (File file : dir.listFiles()) {
- if (file.isDirectory() && !file.getName().startsWith(".")) {
- suiteBuild(file, testArgs, path + file.getName() + SEPARATOR);
- }
- if (file.isFile() && file.getName().endsWith(EXTENSION_QUERY)
- // && !ignore.contains(path + file.getName())
- ) {
- String resultFileName = TestsUtils.aqlExtToResExt(file.getName());
- File expectedFile = new File(PATH_EXPECTED + path + resultFileName);
- File actualFile = new File(PATH_ACTUAL + SEPARATOR + path.replace(SEPARATOR, "_") + resultFileName);
- testArgs.add(new Object[] { file, expectedFile, actualFile });
- }
- }
- }
-
- @Parameters
- public static Collection<Object[]> tests() {
- Collection<Object[]> testArgs = new ArrayList<Object[]>();
- suiteBuild(new File(PATH_QUERIES), testArgs, "");
- return testArgs;
- }
-
- private File actualFile;
- private File expectedFile;
- private File queryFile;
-
- public RuntimeTest(File queryFile, File expectedFile, File actualFile) {
- this.queryFile = queryFile;
- this.expectedFile = expectedFile;
- this.actualFile = actualFile;
- }
-
- @Test
- public void test() throws Exception {
- try {
- String queryFileShort = queryFile.getPath().substring(PATH_QUERIES.length())
- .replace(SEPARATOR.charAt(0), '/');
-
- if (!only.isEmpty()) {
- Assume.assumeTrue(TestHelper.isInPrefixList(only, queryFileShort));
- }
- Assume.assumeTrue(!TestHelper.isInPrefixList(ignore, queryFileShort));
- System.out.println("RUNNING TEST: " + queryFile + " \n");
- LOGGER.severe("RUNNING TEST: " + queryFile + " \n");
- TestsUtils.runScriptAndCompareWithResult(AsterixHyracksIntegrationUtil.getHyracksClientConnection(),
- queryFile, ERR, expectedFile, actualFile);
- } catch (Exception e) {
- if (!(e instanceof AssumptionViolatedException)) {
- LOGGER.severe("Test \"" + queryFile.getPath() + "\" FAILED!");
- e.printStackTrace();
- throw new Exception("Test \"" + queryFile.getPath() + "\" FAILED!", e);
- } else {
- throw e;
- }
- }
- }
-
-}
diff --git a/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_dataset.adm b/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_dataset.adm
index b1007e3..f96be6c 100644
--- a/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_dataset.adm
+++ b/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_dataset.adm
@@ -1,9 +1,10 @@
-{ "DataverseName": "Metadata", "DatasetName": "Dataset", "DataTypeName": "DatasetRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName" ], "PrimaryKey": [ "DataverseName", "DatasetName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Tue Feb 14 12:55:07 PST 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Datatype", "DataTypeName": "DatatypeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatatypeName" ], "PrimaryKey": [ "DataverseName", "DatatypeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Tue Feb 14 12:55:07 PST 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Dataverse", "DataTypeName": "DataverseRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName" ], "PrimaryKey": [ "DataverseName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Tue Feb 14 12:55:07 PST 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Function", "DataTypeName": "FunctionRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "FunctionName", "FunctionArity" ], "PrimaryKey": [ "DataverseName", "FunctionName", "FunctionArity" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Tue Feb 14 12:55:07 PST 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Index", "DataTypeName": "IndexRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName", "IndexName" ], "PrimaryKey": [ "DataverseName", "DatasetName", "IndexName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Tue Feb 14 12:55:07 PST 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Node", "DataTypeName": "NodeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "NodeName" ], "PrimaryKey": [ "NodeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Tue Feb 14 12:55:07 PST 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Nodegroup", "DataTypeName": "NodeGroupRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "GroupName" ], "PrimaryKey": [ "GroupName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Tue Feb 14 12:55:07 PST 2012" }
-{ "DataverseName": "custord", "DatasetName": "Customers", "DataTypeName": "CustomerType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "cid", "name" ], "PrimaryKey": [ "cid", "name" ], "GroupName": "group1" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Tue Feb 14 12:55:12 PST 2012" }
-{ "DataverseName": "custord", "DatasetName": "Orders", "DataTypeName": "OrderType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "oid" ], "PrimaryKey": [ "oid" ], "GroupName": "group1" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Tue Feb 14 12:55:12 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Adapter", "DataTypeName": "AdapterRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "Name" ], "PrimaryKey": [ "DataverseName", "Name" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Aug 30 15:07:10 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataset", "DataTypeName": "DatasetRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName" ], "PrimaryKey": [ "DataverseName", "DatasetName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Aug 30 15:07:10 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Datatype", "DataTypeName": "DatatypeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatatypeName" ], "PrimaryKey": [ "DataverseName", "DatatypeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Aug 30 15:07:10 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataverse", "DataTypeName": "DataverseRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName" ], "PrimaryKey": [ "DataverseName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Aug 30 15:07:10 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Function", "DataTypeName": "FunctionRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "Name", "Arity" ], "PrimaryKey": [ "DataverseName", "Name", "Arity" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Aug 30 15:07:10 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Index", "DataTypeName": "IndexRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName", "IndexName" ], "PrimaryKey": [ "DataverseName", "DatasetName", "IndexName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Aug 30 15:07:10 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Node", "DataTypeName": "NodeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "NodeName" ], "PrimaryKey": [ "NodeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Aug 30 15:07:10 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Nodegroup", "DataTypeName": "NodeGroupRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "GroupName" ], "PrimaryKey": [ "GroupName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Aug 30 15:07:10 PDT 2012" }
+{ "DataverseName": "custord", "DatasetName": "Customers", "DataTypeName": "CustomerType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "cid", "name" ], "PrimaryKey": [ "cid", "name" ], "GroupName": "group1" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Aug 30 15:07:11 PDT 2012" }
+{ "DataverseName": "custord", "DatasetName": "Orders", "DataTypeName": "OrderType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "oid" ], "PrimaryKey": [ "oid" ], "GroupName": "group1" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Aug 30 15:07:11 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_datatype.adm b/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_datatype.adm
index e084f41..016f3a9 100644
--- a/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_datatype.adm
+++ b/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_datatype.adm
@@ -1,68 +1,69 @@
-{ "DataverseName": "Metadata", "DatatypeName": "DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DatasetName", "FieldType": "string" }, { "FieldName": "DataTypeName", "FieldType": "string" }, { "FieldName": "DatasetType", "FieldType": "string" }, { "FieldName": "InternalDetails", "FieldType": "Field_InternalDetails_in_DatasetRecordType" }, { "FieldName": "ExternalDetails", "FieldType": "Field_ExternalDetails_in_DatasetRecordType" }, { "FieldName": "FeedDetails", "FieldType": "Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "DatatypeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DatatypeName", "FieldType": "string" }, { "FieldName": "Derived", "FieldType": "Field_Derived_in_DatatypeRecordType" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "DataverseRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DataFormat", "FieldType": "string" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_ExternalDetails_in_DatasetRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType_ItemType" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "FieldName", "FieldType": "string" }, { "FieldName": "FieldType", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_FunctionParams_in_FunctionRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_NodeNames_in_NodeGroupRecordType", "Derived": { "Tag": "UNORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": "string", "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_OrderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "string" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_PartitioningKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_PartitioningKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_PrimaryKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_PrimaryKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType_ItemType" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Name", "FieldType": "string" }, { "FieldName": "Value", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType_ItemType" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Name", "FieldType": "string" }, { "FieldName": "Value", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_SearchKey_in_IndexRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_UnorderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "string" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "FunctionRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "FunctionName", "FieldType": "string" }, { "FieldName": "FunctionArity", "FieldType": "string" }, { "FieldName": "FunctionParams", "FieldType": "Field_FunctionParams_in_FunctionRecordType" }, { "FieldName": "FunctionBody", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "IndexRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DatasetName", "FieldType": "string" }, { "FieldName": "IndexName", "FieldType": "string" }, { "FieldName": "IndexStructure", "FieldType": "string" }, { "FieldName": "SearchKey", "FieldType": "Field_SearchKey_in_IndexRecordType" }, { "FieldName": "IsPrimary", "FieldType": "boolean" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "NodeGroupRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "GroupName", "FieldType": "string" }, { "FieldName": "NodeNames", "FieldType": "Field_NodeNames_in_NodeGroupRecordType" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "NodeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "NodeName", "FieldType": "string" }, { "FieldName": "NumberOfCores", "FieldType": "int32" }, { "FieldName": "WorkingMemorySize", "FieldType": "int32" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Tag", "FieldType": "string" }, { "FieldName": "IsAnonymous", "FieldType": "boolean" }, { "FieldName": "EnumValues", "FieldType": "Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "Record", "FieldType": "Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "Union", "FieldType": "Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "UnorderedList", "FieldType": "Field_UnorderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "OrderedList", "FieldType": "Field_OrderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Adapter", "FieldType": "string" }, { "FieldName": "Properties", "FieldType": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "FileStructure", "FieldType": "string" }, { "FieldName": "PartitioningStrategy", "FieldType": "string" }, { "FieldName": "PartitioningKey", "FieldType": "Field_PartitioningKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "PrimaryKey", "FieldType": "Field_PrimaryKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "GroupName", "FieldType": "string" }, { "FieldName": "Adapter", "FieldType": "string" }, { "FieldName": "Properties", "FieldType": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "Function", "FieldType": "string" }, { "FieldName": "Status", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "FileStructure", "FieldType": "string" }, { "FieldName": "PartitioningStrategy", "FieldType": "string" }, { "FieldName": "PartitioningKey", "FieldType": "Field_PartitioningKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType" }, { "FieldName": "PrimaryKey", "FieldType": "Field_PrimaryKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType" }, { "FieldName": "GroupName", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "IsOpen", "FieldType": "boolean" }, { "FieldName": "Fields", "FieldType": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "boolean", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "circle", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "date", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "datetime", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "double", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "duration", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "float", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "int16", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "int32", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "int64", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "int8", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "line", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "null", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "point", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "point3d", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "polygon", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "rectangle", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "string", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "Metadata", "DatatypeName": "time", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
-{ "DataverseName": "custord", "DatatypeName": "AddressType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "street", "FieldType": "StreetType" }, { "FieldName": "city", "FieldType": "string" }, { "FieldName": "state", "FieldType": "string" }, { "FieldName": "zip", "FieldType": "int16" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
-{ "DataverseName": "custord", "DatatypeName": "CustomerType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": false, "Fields": [ { "FieldName": "cid", "FieldType": "int32" }, { "FieldName": "name", "FieldType": "string" }, { "FieldName": "age", "FieldType": "Field_age_in_CustomerType" }, { "FieldName": "address", "FieldType": "Field_address_in_CustomerType" }, { "FieldName": "interests", "FieldType": "Field_interests_in_CustomerType" }, { "FieldName": "children", "FieldType": "Field_children_in_CustomerType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
-{ "DataverseName": "custord", "DatatypeName": "Field_address_in_CustomerType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "AddressType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
-{ "DataverseName": "custord", "DatatypeName": "Field_age_in_CustomerType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "int32" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
-{ "DataverseName": "custord", "DatatypeName": "Field_children_in_CustomerType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_children_in_CustomerType_ItemType" }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
-{ "DataverseName": "custord", "DatatypeName": "Field_children_in_CustomerType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "name", "FieldType": "string" }, { "FieldName": "dob", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
-{ "DataverseName": "custord", "DatatypeName": "Field_interests_in_CustomerType", "Derived": { "Tag": "UNORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": "string", "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
-{ "DataverseName": "custord", "DatatypeName": "Field_items_in_OrderType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_items_in_OrderType_ItemType" }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
-{ "DataverseName": "custord", "DatatypeName": "Field_items_in_OrderType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "number", "FieldType": "int64" }, { "FieldName": "storeIds", "FieldType": "Field_storeIds_in_Field_items_in_OrderType_ItemType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
-{ "DataverseName": "custord", "DatatypeName": "Field_number_in_StreetType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "int32" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
-{ "DataverseName": "custord", "DatatypeName": "Field_storeIds_in_Field_items_in_OrderType_ItemType", "Derived": { "Tag": "UNORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": "int8", "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
-{ "DataverseName": "custord", "DatatypeName": "OrderType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "oid", "FieldType": "int32" }, { "FieldName": "cid", "FieldType": "int32" }, { "FieldName": "orderstatus", "FieldType": "string" }, { "FieldName": "orderpriority", "FieldType": "string" }, { "FieldName": "clerk", "FieldType": "string" }, { "FieldName": "total", "FieldType": "float" }, { "FieldName": "items", "FieldType": "Field_items_in_OrderType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
-{ "DataverseName": "custord", "DatatypeName": "StreetType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": false, "Fields": [ { "FieldName": "number", "FieldType": "Field_number_in_StreetType" }, { "FieldName": "name", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "AdapterRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "Name", "FieldType": "string" }, { "FieldName": "Classname", "FieldType": "string" }, { "FieldName": "Type", "FieldType": "string" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DatasetName", "FieldType": "string" }, { "FieldName": "DataTypeName", "FieldType": "string" }, { "FieldName": "DatasetType", "FieldType": "string" }, { "FieldName": "InternalDetails", "FieldType": "Field_InternalDetails_in_DatasetRecordType" }, { "FieldName": "ExternalDetails", "FieldType": "Field_ExternalDetails_in_DatasetRecordType" }, { "FieldName": "FeedDetails", "FieldType": "Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "DatatypeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DatatypeName", "FieldType": "string" }, { "FieldName": "Derived", "FieldType": "Field_Derived_in_DatatypeRecordType" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "DataverseRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DataFormat", "FieldType": "string" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_ExternalDetails_in_DatasetRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType_ItemType" }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "FieldName", "FieldType": "string" }, { "FieldName": "FieldType", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_NodeNames_in_NodeGroupRecordType", "Derived": { "Tag": "UNORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": "string", "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_OrderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "string" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Params_in_FunctionRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_PartitioningKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_PartitioningKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_PrimaryKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_PrimaryKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType_ItemType" }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Name", "FieldType": "string" }, { "FieldName": "Value", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType_ItemType" }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Name", "FieldType": "string" }, { "FieldName": "Value", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_SearchKey_in_IndexRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_UnorderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "string" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "FunctionRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "Name", "FieldType": "string" }, { "FieldName": "Arity", "FieldType": "string" }, { "FieldName": "Params", "FieldType": "Field_Params_in_FunctionRecordType" }, { "FieldName": "ReturnType", "FieldType": "string" }, { "FieldName": "Definition", "FieldType": "string" }, { "FieldName": "Language", "FieldType": "string" }, { "FieldName": "Kind", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "IndexRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DatasetName", "FieldType": "string" }, { "FieldName": "IndexName", "FieldType": "string" }, { "FieldName": "IndexStructure", "FieldType": "string" }, { "FieldName": "SearchKey", "FieldType": "Field_SearchKey_in_IndexRecordType" }, { "FieldName": "IsPrimary", "FieldType": "boolean" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "NodeGroupRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "GroupName", "FieldType": "string" }, { "FieldName": "NodeNames", "FieldType": "Field_NodeNames_in_NodeGroupRecordType" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "NodeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "NodeName", "FieldType": "string" }, { "FieldName": "NumberOfCores", "FieldType": "int32" }, { "FieldName": "WorkingMemorySize", "FieldType": "int32" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Tag", "FieldType": "string" }, { "FieldName": "IsAnonymous", "FieldType": "boolean" }, { "FieldName": "EnumValues", "FieldType": "Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "Record", "FieldType": "Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "Union", "FieldType": "Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "UnorderedList", "FieldType": "Field_UnorderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "OrderedList", "FieldType": "Field_OrderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Adapter", "FieldType": "string" }, { "FieldName": "Properties", "FieldType": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "FileStructure", "FieldType": "string" }, { "FieldName": "PartitioningStrategy", "FieldType": "string" }, { "FieldName": "PartitioningKey", "FieldType": "Field_PartitioningKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "PrimaryKey", "FieldType": "Field_PrimaryKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "GroupName", "FieldType": "string" }, { "FieldName": "Adapter", "FieldType": "string" }, { "FieldName": "Properties", "FieldType": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "Function", "FieldType": "string" }, { "FieldName": "Status", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "FileStructure", "FieldType": "string" }, { "FieldName": "PartitioningStrategy", "FieldType": "string" }, { "FieldName": "PartitioningKey", "FieldType": "Field_PartitioningKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType" }, { "FieldName": "PrimaryKey", "FieldType": "Field_PrimaryKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType" }, { "FieldName": "GroupName", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "IsOpen", "FieldType": "boolean" }, { "FieldName": "Fields", "FieldType": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "boolean", "Derived": null, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "circle", "Derived": null, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "date", "Derived": null, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "datetime", "Derived": null, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "double", "Derived": null, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "duration", "Derived": null, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "float", "Derived": null, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "int16", "Derived": null, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "int32", "Derived": null, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "int64", "Derived": null, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "int8", "Derived": null, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "line", "Derived": null, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "null", "Derived": null, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "point", "Derived": null, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "point3d", "Derived": null, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "polygon", "Derived": null, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "rectangle", "Derived": null, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "string", "Derived": null, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "time", "Derived": null, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "custord", "DatatypeName": "AddressType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "street", "FieldType": "StreetType" }, { "FieldName": "city", "FieldType": "string" }, { "FieldName": "state", "FieldType": "string" }, { "FieldName": "zip", "FieldType": "int16" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "custord", "DatatypeName": "CustomerType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": false, "Fields": [ { "FieldName": "cid", "FieldType": "int32" }, { "FieldName": "name", "FieldType": "string" }, { "FieldName": "age", "FieldType": "Field_age_in_CustomerType" }, { "FieldName": "address", "FieldType": "Field_address_in_CustomerType" }, { "FieldName": "interests", "FieldType": "Field_interests_in_CustomerType" }, { "FieldName": "children", "FieldType": "Field_children_in_CustomerType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_address_in_CustomerType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "AddressType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_age_in_CustomerType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "int32" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_children_in_CustomerType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_children_in_CustomerType_ItemType" }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_children_in_CustomerType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "name", "FieldType": "string" }, { "FieldName": "dob", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_interests_in_CustomerType", "Derived": { "Tag": "UNORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": "string", "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_items_in_OrderType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_items_in_OrderType_ItemType" }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_items_in_OrderType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "number", "FieldType": "int64" }, { "FieldName": "storeIds", "FieldType": "Field_storeIds_in_Field_items_in_OrderType_ItemType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_number_in_StreetType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "int32" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_storeIds_in_Field_items_in_OrderType_ItemType", "Derived": { "Tag": "UNORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": "int8", "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "custord", "DatatypeName": "OrderType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "oid", "FieldType": "int32" }, { "FieldName": "cid", "FieldType": "int32" }, { "FieldName": "orderstatus", "FieldType": "string" }, { "FieldName": "orderpriority", "FieldType": "string" }, { "FieldName": "clerk", "FieldType": "string" }, { "FieldName": "total", "FieldType": "float" }, { "FieldName": "items", "FieldType": "Field_items_in_OrderType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
+{ "DataverseName": "custord", "DatatypeName": "StreetType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": false, "Fields": [ { "FieldName": "number", "FieldType": "Field_number_in_StreetType" }, { "FieldName": "name", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Thu Aug 30 15:15:48 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_index.adm b/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_index.adm
index efdf0bb..1f9a865 100644
--- a/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_index.adm
+++ b/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_index.adm
@@ -1,15 +1,16 @@
-{ "DataverseName": "Metadata", "DatasetName": "Dataset", "IndexName": "Dataset", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatasetName" ], "IsPrimary": true, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Dataset", "IndexName": "DatatypeName", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatatypeName", "DatasetName" ], "IsPrimary": false, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Dataset", "IndexName": "GroupName", "IndexStructure": "BTREE", "SearchKey": [ "GroupName", "DataverseName", "DatasetName" ], "IsPrimary": false, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Datatype", "IndexName": "Datatype", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatatypeName" ], "IsPrimary": true, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Datatype", "IndexName": "DatatypeName", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "NestedDatatypeName", "TopDatatypeName" ], "IsPrimary": false, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Dataverse", "IndexName": "Dataverse", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName" ], "IsPrimary": true, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Function", "IndexName": "Function", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "FunctionName", "FunctionArity" ], "IsPrimary": true, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Index", "IndexName": "Index", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatasetName", "IndexName" ], "IsPrimary": true, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Node", "IndexName": "Node", "IndexStructure": "BTREE", "SearchKey": [ "NodeName" ], "IsPrimary": true, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Nodegroup", "IndexName": "Nodegroup", "IndexStructure": "BTREE", "SearchKey": [ "GroupName" ], "IsPrimary": true, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
-{ "DataverseName": "custord", "DatasetName": "Customers", "IndexName": "Customers", "IndexStructure": "BTREE", "SearchKey": [ "cid", "name" ], "IsPrimary": true, "Timestamp": "Tue Feb 14 13:32:04 PST 2012" }
-{ "DataverseName": "custord", "DatasetName": "Customers", "IndexName": "custName", "IndexStructure": "BTREE", "SearchKey": [ "name", "cid" ], "IsPrimary": false, "Timestamp": "Tue Feb 14 13:32:04 PST 2012" }
-{ "DataverseName": "custord", "DatasetName": "Orders", "IndexName": "Orders", "IndexStructure": "BTREE", "SearchKey": [ "oid" ], "IsPrimary": true, "Timestamp": "Tue Feb 14 13:32:04 PST 2012" }
-{ "DataverseName": "custord", "DatasetName": "Orders", "IndexName": "ordClerkTotal", "IndexStructure": "BTREE", "SearchKey": [ "clerk", "total" ], "IsPrimary": false, "Timestamp": "Tue Feb 14 13:32:04 PST 2012" }
-{ "DataverseName": "custord", "DatasetName": "Orders", "IndexName": "ordCustId", "IndexStructure": "BTREE", "SearchKey": [ "cid" ], "IsPrimary": false, "Timestamp": "Tue Feb 14 13:32:04 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Adapter", "IndexName": "Adapter", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "Name" ], "IsPrimary": true, "Timestamp": "Thu Aug 30 16:15:59 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataset", "IndexName": "Dataset", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatasetName" ], "IsPrimary": true, "Timestamp": "Thu Aug 30 16:15:59 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataset", "IndexName": "DatatypeName", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatatypeName", "DatasetName" ], "IsPrimary": false, "Timestamp": "Thu Aug 30 16:15:59 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataset", "IndexName": "GroupName", "IndexStructure": "BTREE", "SearchKey": [ "GroupName", "DataverseName", "DatasetName" ], "IsPrimary": false, "Timestamp": "Thu Aug 30 16:15:59 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Datatype", "IndexName": "Datatype", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatatypeName" ], "IsPrimary": true, "Timestamp": "Thu Aug 30 16:15:59 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Datatype", "IndexName": "DatatypeName", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "NestedDatatypeName", "TopDatatypeName" ], "IsPrimary": false, "Timestamp": "Thu Aug 30 16:15:59 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataverse", "IndexName": "Dataverse", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName" ], "IsPrimary": true, "Timestamp": "Thu Aug 30 16:15:59 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Function", "IndexName": "Function", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "Name", "Arity" ], "IsPrimary": true, "Timestamp": "Thu Aug 30 16:15:59 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Index", "IndexName": "Index", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatasetName", "IndexName" ], "IsPrimary": true, "Timestamp": "Thu Aug 30 16:15:59 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Node", "IndexName": "Node", "IndexStructure": "BTREE", "SearchKey": [ "NodeName" ], "IsPrimary": true, "Timestamp": "Thu Aug 30 16:15:59 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Nodegroup", "IndexName": "Nodegroup", "IndexStructure": "BTREE", "SearchKey": [ "GroupName" ], "IsPrimary": true, "Timestamp": "Thu Aug 30 16:15:59 PDT 2012" }
+{ "DataverseName": "custord", "DatasetName": "Customers", "IndexName": "Customers", "IndexStructure": "BTREE", "SearchKey": [ "cid", "name" ], "IsPrimary": true, "Timestamp": "Thu Aug 30 16:15:59 PDT 2012" }
+{ "DataverseName": "custord", "DatasetName": "Customers", "IndexName": "custName", "IndexStructure": "BTREE", "SearchKey": [ "name", "cid" ], "IsPrimary": false, "Timestamp": "Thu Aug 30 16:15:59 PDT 2012" }
+{ "DataverseName": "custord", "DatasetName": "Orders", "IndexName": "Orders", "IndexStructure": "BTREE", "SearchKey": [ "oid" ], "IsPrimary": true, "Timestamp": "Thu Aug 30 16:15:59 PDT 2012" }
+{ "DataverseName": "custord", "DatasetName": "Orders", "IndexName": "ordClerkTotal", "IndexStructure": "BTREE", "SearchKey": [ "clerk", "total" ], "IsPrimary": false, "Timestamp": "Thu Aug 30 16:16:00 PDT 2012" }
+{ "DataverseName": "custord", "DatasetName": "Orders", "IndexName": "ordCustId", "IndexStructure": "BTREE", "SearchKey": [ "cid" ], "IsPrimary": false, "Timestamp": "Thu Aug 30 16:15:59 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/rollback_drop_dataset.aql b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_drop_dataset.aql
index 860a714..8dfe072 100644
--- a/asterix-app/src/test/resources/metadata-transactions/queries/rollback_drop_dataset.aql
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_drop_dataset.aql
@@ -1,3 +1,5 @@
+drop dataverse custord if exists;
+create dataverse custord;
use dataverse custord;
drop dataset Customers;
diff --git a/asterix-app/src/test/resources/metadata/queries.txt b/asterix-app/src/test/resources/metadata/queries.txt
deleted file mode 100644
index fedfeb6..0000000
--- a/asterix-app/src/test/resources/metadata/queries.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-metadata_dataverse.aql
-metadata_dataset.aql
-metadata_index.aql
-metadata_datatype.aql
-metadata_node.aql
-metadata_nodegroup.aql
-custord_q1.aql
-custord_q2.aql
-custord_q3.aql
-custord_q4.aql
-custord_dataverse.aql
-custord_dataset.aql
-custord_index.aql
-custord_datatype.aql
-custord_nodegroup.aql
-custord_q5.aql
-exceptions.aql
-custord_q7.aql
-custord_q8.aql
-metadata_dataverse.aql
-metadata_dataset.aql
-metadata_index.aql
-metadata_datatype.aql
-metadata_node.aql
-metadata_nodegroup.aql
-custord_q9.aql
-custord_q10.aql
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta01.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta01.aql
new file mode 100644
index 0000000..5ce47ad
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta01.aql
@@ -0,0 +1,15 @@
+/*
+ * Description : Create dataverse & query Metadata dataset Dataverse to verify.
+ * Expected Res : Success
+ * Date : 15 Sep 2012
+ */
+
+drop dataverse testdv if exists;
+create dataverse testdv;
+
+write output to nc1:"mdtest/basic_meta01.adm";
+
+for $l in dataset('Metadata.Dataverse')
+return $l
+
+drop dataverse testdv;
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta02.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta02.aql
new file mode 100644
index 0000000..8bfc240
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta02.aql
@@ -0,0 +1,22 @@
+/*
+ * Description : Create dataset & query Metadata dataset Dataset to verify.
+ * Expected Res : Success
+ * Date : 15 Sep 2012
+ */
+
+drop dataverse testdv if exists;
+create dataverse testdv;
+
+write output to nc1:"mdtest/basic_meta02.adm";
+
+create type testdv.testtype as open {
+id : int32
+}
+
+create dataset testdv.dst01(testtype) partitioned by key id;
+
+for $l in dataset('Metadata.Dataset')
+where $l.DataverseName = 'testdv' and $l.DatasetName = 'dst01'
+return $l
+
+drop dataverse testdv;
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta03.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta03.aql
new file mode 100644
index 0000000..0b876f2
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta03.aql
@@ -0,0 +1,21 @@
+/*
+ * Description : Create closed type & query Metadata dataset Datatype to verify.
+ * Expected Res : Success
+ * Date : 15 Sep 2012
+ */
+
+drop dataverse testdv if exists;
+create dataverse testdv;
+
+write output to nc1:"mdtest/basic_meta03.adm";
+
+create type testdv.testtype as closed {
+id : int32
+}
+
+for $l in dataset('Metadata.Datatype')
+where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
+return $l
+
+drop dataverse testdv;
+
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta04.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta04.aql
new file mode 100644
index 0000000..b2e7304
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta04.aql
@@ -0,0 +1,20 @@
+/*
+ * Description : Create open type & query Metadata dataset Datatype to verify.
+ * Expected Res : Success
+ * Date : 15 Sep 2012
+ */
+
+drop dataverse testdv if exists;
+create dataverse testdv;
+
+write output to nc1:"mdtest/basic_meta04.adm";
+
+create type testdv.testtype as open {
+id : int32
+}
+
+for $l in dataset('Metadata.Datatype')
+where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
+return $l
+
+drop dataverse testdv;
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta05.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta05.aql
new file mode 100644
index 0000000..9eb129d
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta05.aql
@@ -0,0 +1,25 @@
+/*
+ * Description : Create primary & secondary indexes & query Metadata dataset to verify.
+ * Expected Res : Success
+ * Date : 15 Sep 2012
+ */
+
+drop dataverse testdv if exists;
+create dataverse testdv;
+
+write output to nc1:"mdtest/basic_meta05.adm";
+
+create type testdv.testtype as open {
+id : int32,
+name : string
+}
+
+create dataset testdv.t1(testtype) partitioned by key id;
+
+create index idx1 on testdv.t1(name);
+
+for $l in dataset('Metadata.Index')
+where $l.DataverseName='testdv'
+return $l
+
+drop dataverse testdv;
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta06.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta06.aql
new file mode 100644
index 0000000..6297561
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta06.aql
@@ -0,0 +1,19 @@
+/*
+ * Description : Create AQL bodied UDFs and verify that there are related entries in metadata Function dataset
+ * Expected Res : Success
+ * Date : Sep 17 2012
+ */
+
+drop dataverse testdv if exists;
+create dataverse testdv;
+
+write output to nc1:"mdtest/basic_meta06.adm";
+
+create function testdv.fun01(){
+"This is an AQL Bodied UDF"
+}
+
+for $l in dataset('Metadata.Function')
+return $l
+
+drop dataverse testdv;
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta07.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta07.aql
new file mode 100644
index 0000000..6544bca
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta07.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : Verify default entries for Node dataset in Metadata dataverse
+ * Expected Res : Success
+ * Date : Sep 17 2012
+ */
+
+// Please note this query was run on two nodes, i.e; two NCs
+
+write output to nc1:"mdtest/basic_meta07.adm";
+
+for $l in dataset('Metadata.Node')
+return $l
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta08.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta08.aql
new file mode 100644
index 0000000..a7d536f
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta08.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : Verify default entries for Nodegroup dataset in Metadata dataverse
+ * Expected Res : Success
+ * Date : Sep 17 2012
+ */
+
+// Please note this query was run on two nodes, i.e; two NCs
+
+write output to nc1:"mdtest/basic_meta08.adm";
+
+for $l in dataset('Metadata.Nodegroup')
+return $l
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta09.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta09.aql
new file mode 100644
index 0000000..28a3794
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta09.aql
@@ -0,0 +1,33 @@
+/*
+ * Description : Create internal dataset, insert data and query metadata Dataset to verify entries for that dataset.
+ * Expected Res : Success
+ * Date : Sep 17 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"mdtest/basic_meta09.adm";
+
+create type test.testtype as open {
+id:int32
+}
+
+create dataset test.t1(testtype) partitioned by key id;
+
+insert into dataset test.t1({"id":123});
+insert into dataset test.t1({"id":133});
+insert into dataset test.t1({"id":223});
+insert into dataset test.t1({"id":127});
+insert into dataset test.t1({"id":423});
+insert into dataset test.t1({"id":183});
+insert into dataset test.t1({"id":193});
+insert into dataset test.t1({"id":129});
+insert into dataset test.t1({"id":373});
+insert into dataset test.t1({"id":282});
+
+for $l in dataset('Metadata.Dataset')
+where $l.DataverseName='test' and $l.DatasetName='t1'
+return $l
+
+drop dataverse test;
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta10.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta10.aql
new file mode 100644
index 0000000..452dcc3
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta10.aql
@@ -0,0 +1,17 @@
+/*
+ * Description : Create dataverse and drop that dataverse and verify dataverse entries in metadata
+ * Expected Res : Success
+ * Date : Sep 17 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+drop dataverse test if exists;
+
+write output to nc1:"mdtest/basic_meta10.adm";
+
+count(
+for $l in dataset('Metadata.Dataverse')
+where $l.DataverseName='test'
+return $l
+)
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta11.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta11.aql
new file mode 100644
index 0000000..d781114
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta11.aql
@@ -0,0 +1,27 @@
+/*
+ * Description : Create dataset and drop that dataset and query Metadata Dataset to verify the drop.
+ * Expected Res : Success
+ * Date : Sep 17 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"mdtest/basic_meta11.adm";
+
+create type test.testtype as open {
+id : int32
+}
+
+create dataset test.dst01(testtype) partitioned by key id;
+
+drop dataset test.dst01;
+
+count(
+for $l in dataset('Metadata.Dataset')
+where $l.DataverseName='test' and $l.DatasetName='dst01'
+return $l
+)
+
+drop dataverse test;
+
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta12.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta12.aql
new file mode 100644
index 0000000..1de7ac5
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta12.aql
@@ -0,0 +1,27 @@
+/*
+ * Description : Create secondary index and drop the secondary index and query metadata to verify drop index.
+ * Expected Res : Success
+ * Date : Sep 17 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"mdtest/basic_meta12.adm";
+
+create type test.testtype as open {
+id : int32,
+name : string
+}
+
+create dataset test.dst01(testtype) partitioned by key id;
+
+create index idx1 on test.dst01(name);
+
+drop index test.dst01.idx1;
+
+for $l in dataset('Metadata.Index')
+where $l.DatasetName = 'dst01'
+return $l
+
+drop dataverse test;
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta13.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta13.aql
new file mode 100644
index 0000000..0c0f627
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta13.aql
@@ -0,0 +1,24 @@
+/*
+ * Description : Create functions and drop that function and query metadata
+ * : to verify entries in Function dataset for the dropped UDF.
+ * Expected Res : Success
+ * Date : Sep 17 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"mdtest/basic_meta13.adm";
+
+create function test.foo(){
+"drop this function"
+}
+
+drop function test.foo@0;
+
+count(
+for $l in dataset('Metadata.Function')
+where $l.DataverseName='test' and $l.Name='foo' and $l.Arity=0
+return $l);
+
+drop dataverse test;
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta14.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta14.aql
new file mode 100644
index 0000000..9103614
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta14.aql
@@ -0,0 +1,27 @@
+/*
+ * Description : Test that a synthetically created content type is dropped with its parent type.
+ * Guards against regression to issue 188.
+ * Expected Result : Success
+ */
+
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type FooType as closed {
+ bar: int32?
+};
+
+
+drop type FooType;
+
+write output to nc1:"mdtest/basic_meta14.adm";
+
+count(
+for $x in dataset('Metadata.Datatype')
+where $x.DataverseName='test'
+return $x
+)
+
+drop dataverse test;
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta15.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta15.aql
new file mode 100644
index 0000000..91827ef
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta15.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : Query Metadata dataset Adapter to verify to contents.
+ * Expected Res : Success
+ * Date : 25 Nov 2012
+ */
+
+write output to nc1:"mdtest/basic_meta15.adm";
+
+for $l in dataset('Metadata.DatasourceAdapter')
+return $l
+
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta16.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta16.aql
new file mode 100644
index 0000000..8b69b4f
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta16.aql
@@ -0,0 +1,9 @@
+use dataverse Metadata;
+
+write output to nc1:"mdtest/basic_meta16.adm";
+
+for $c in dataset('Dataset')
+return $c
+
+
+
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta17.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta17.aql
new file mode 100644
index 0000000..2cd25ee
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta17.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"mdtest/basic_meta17.adm";
+
+for $c in dataset('Datatype')
+return $c
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta18.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta18.aql
new file mode 100644
index 0000000..45f065a
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta18.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"mdtest/basic_meta18.adm";
+
+for $c in dataset('Dataverse')
+return $c
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta19.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta19.aql
new file mode 100644
index 0000000..21de582
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta19.aql
@@ -0,0 +1,7 @@
+use dataverse Metadata;
+
+write output to nc1:"mdtest/basic_meta19.adm";
+
+for $c in dataset('Index')
+where $c.DataverseName='Metadata'
+return $c
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta20.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta20.aql
new file mode 100644
index 0000000..259f23e
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta20.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"mdtest/basic_meta20.adm";
+
+for $c in dataset('Node')
+return $c
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta21.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta21.aql
new file mode 100644
index 0000000..b5f8110
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta21.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"mdtest/basic_meta21.adm";
+
+for $c in dataset('Nodegroup')
+return $c
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset.aql b/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset.aql
new file mode 100644
index 0000000..94f7a58
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset.aql
@@ -0,0 +1,9 @@
+use dataverse Metadata;
+
+write output to nc1:"rttest/basic_metadata_dataset.adm";
+
+for $c in dataset('Dataset')
+return $c
+
+
+
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/metadata_datatype.aql b/asterix-app/src/test/resources/metadata/queries/basic/metadata_datatype.aql
new file mode 100644
index 0000000..4cc94de
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/metadata_datatype.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"rttest/basic_metadata_datatype.adm";
+
+for $c in dataset('Datatype')
+return $c
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataverse.aql b/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataverse.aql
new file mode 100644
index 0000000..d3edfed
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataverse.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"rttest/basic_metadata_dataverse.adm";
+
+for $c in dataset('Dataverse')
+return $c
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/metadata_index.aql b/asterix-app/src/test/resources/metadata/queries/basic/metadata_index.aql
new file mode 100644
index 0000000..cb78758
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/metadata_index.aql
@@ -0,0 +1,7 @@
+use dataverse Metadata;
+
+write output to nc1:"rttest/basic_metadata_index.adm";
+
+for $c in dataset('Index')
+where $c.DataverseName='Metadata'
+return $c
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/metadata_node.aql b/asterix-app/src/test/resources/metadata/queries/basic/metadata_node.aql
new file mode 100644
index 0000000..2d28ed6
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/metadata_node.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"rttest/basic_metadata_node.adm";
+
+for $c in dataset('Node')
+return $c
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/metadata_nodegroup.aql b/asterix-app/src/test/resources/metadata/queries/basic/metadata_nodegroup.aql
new file mode 100644
index 0000000..86615e6
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/metadata_nodegroup.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"rttest/basic_metadata_nodegroup.adm";
+
+for $c in dataset('Nodegroup')
+return $c
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_dataset.aql b/asterix-app/src/test/resources/metadata/queries/custord_dataset.aql
deleted file mode 100644
index 530c6c9..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_dataset.aql
+++ /dev/null
@@ -1,10 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/custord_dataset.adm";
-
-for $c in dataset('Dataset')
-where $c.DataverseName = "custord"
-return $c
-
-
-
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_datatype.aql b/asterix-app/src/test/resources/metadata/queries/custord_datatype.aql
deleted file mode 100644
index 1525b93..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_datatype.aql
+++ /dev/null
@@ -1,7 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/custord_datatype.adm";
-
-for $c in dataset('Datatype')
-where $c.DataverseName = "custord"
-return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_dataverse.aql b/asterix-app/src/test/resources/metadata/queries/custord_dataverse.aql
deleted file mode 100644
index 277bf62..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_dataverse.aql
+++ /dev/null
@@ -1,8 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/custord_dataverse.adm";
-
-for $c in dataset('Dataverse')
-where $c.DataverseName = "custord"
-return $c
-
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_index.aql b/asterix-app/src/test/resources/metadata/queries/custord_index.aql
deleted file mode 100644
index 95450da..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_index.aql
+++ /dev/null
@@ -1,7 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/custord_index.adm";
-
-for $c in dataset('Index')
-where $c.DataverseName = "custord"
-return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_nodegroup.aql b/asterix-app/src/test/resources/metadata/queries/custord_nodegroup.aql
deleted file mode 100644
index 090c739..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_nodegroup.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/metadata_nodegroup.adm";
-
-for $c in dataset('Nodegroup')
-return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q1.aql b/asterix-app/src/test/resources/metadata/queries/custord_q1.aql
deleted file mode 100644
index 4ba02b9..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_q1.aql
+++ /dev/null
@@ -1,65 +0,0 @@
-drop dataverse custord if exists;
-
-create dataverse custord;
-
-use dataverse custord;
-
-create type StreetType as closed {
- number: int32?,
- name: string
-}
-
-create type AddressType as open {
- street: StreetType,
- city: string,
- state: string,
- zip: int16
-}
-
-create type CustomerType as closed {
- cid: int32,
- name: string,
- age: int32?,
- address: AddressType?,
- interests: {{string}},
- children: [ {
- name : string,
- dob : string
- } ]
-}
-
-create type OrderType as open {
- oid: int32,
- cid: int32,
- orderstatus: string,
- orderpriority: string,
- clerk: string,
- total: float,
- items: [ {
- number: int64,
- storeIds: {{int8}}
- } ]
-}
-
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset Customers(CustomerType)
- partitioned by key cid, name on group1;
-
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/metadata/customerData.json"),("format"="adm"));
-
-create dataset Orders(OrderType)
- partitioned by key oid on group1;
-
-load dataset Orders
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/metadata/orderData.json"),("format"="adm"));
-
-create index ordCustId if not exists on Orders(cid);
-
-create index custName if not exists on Customers(name, cid);
-
-create index ordClerkTotal if not exists on Orders(clerk, total);
-
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q10.aql b/asterix-app/src/test/resources/metadata/queries/custord_q10.aql
deleted file mode 100644
index abe6041..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_q10.aql
+++ /dev/null
@@ -1,7 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/custord_q10.adm";
-
-for $c in dataset('Dataset')
-return $c
-
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q2.aql b/asterix-app/src/test/resources/metadata/queries/custord_q2.aql
deleted file mode 100644
index d99bed6..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_q2.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-use dataverse custord;
-
-write output to nc1:"rttest/custord_q2.adm";
-
-for $c in dataset('Customers')
-return $c.address
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q3.aql b/asterix-app/src/test/resources/metadata/queries/custord_q3.aql
deleted file mode 100644
index c093baa..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_q3.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-use dataverse custord;
-
-write output to nc1:"rttest/custord_q3.adm";
-
-for $o in dataset('Orders')
-return {"id" : $o.oid, "total": $o.total}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q4.aql b/asterix-app/src/test/resources/metadata/queries/custord_q4.aql
deleted file mode 100644
index 03114b7..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_q4.aql
+++ /dev/null
@@ -1,8 +0,0 @@
-use dataverse custord;
-
-write output to nc1:"rttest/custord_q4.adm";
-
-for $c in dataset('Customers')
-for $o in dataset('Orders')
-where $c.cid = $o.cid
-return {"cust_name":$c.name, "cust_age": $c.age, "order_total":$o.total}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q5.aql b/asterix-app/src/test/resources/metadata/queries/custord_q5.aql
deleted file mode 100644
index 716cce7..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_q5.aql
+++ /dev/null
@@ -1,21 +0,0 @@
-drop nodegroup fuzzynodegroup if exists;
-
-drop dataverse fuzzyjoin if exists;
-
-use dataverse custord;
-
-create dataset Customers if not exists (CustomerType)
- partitioned by key cid, name on group1;
-
-drop dataset employees if exists;
-
-create index custName if not exists on Customers(name, cid);
-
-drop index Customers.custAddress if exists;
-
-create type StreetType if not exists as closed {
- number: int32?,
- name: string
-}
-
-drop type DBLPType if exists;
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q6.aql b/asterix-app/src/test/resources/metadata/queries/custord_q6.aql
deleted file mode 100644
index 231c410..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_q6.aql
+++ /dev/null
@@ -1,7 +0,0 @@
-use dataverse custord;
-
-drop index Orders.ordClerkTotal;
-
-drop dataset Orders;
-
-drop type OrderType;
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q7.aql b/asterix-app/src/test/resources/metadata/queries/custord_q7.aql
deleted file mode 100644
index 247ed78..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_q7.aql
+++ /dev/null
@@ -1,2 +0,0 @@
-drop dataverse custord;
-
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q8.aql b/asterix-app/src/test/resources/metadata/queries/custord_q8.aql
deleted file mode 100644
index bb4225d..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_q8.aql
+++ /dev/null
@@ -1,2 +0,0 @@
-drop nodegroup group1;
-
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q9.aql b/asterix-app/src/test/resources/metadata/queries/custord_q9.aql
deleted file mode 100644
index 2d3f960..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_q9.aql
+++ /dev/null
@@ -1,52 +0,0 @@
-drop dataverse custord if exists;
-
-create dataverse custord;
-
-use dataverse custord;
-
-create type StreetType as closed {
- number: int32?,
- name: string
-}
-
-create type AddressType as open {
- street: StreetType,
- city: string,
- state: string,
- zip: int16
-}
-
-create type CustomerType as closed {
- cid: int32,
- name: string,
- age: int32?,
- address: AddressType?,
- interests: {{string}},
- children: [ {
- name : string,
- dob : string
- } ]
-}
-
-create type OrderType as open {
- oid: int32,
- cid: int32,
- orderstatus: string,
- orderpriority: string,
- clerk: string,
- total: float,
- items: [ {
- number: int64,
- storeIds: {{int8}}
- } ]
-}
-
-create external dataset Customers(CustomerType)
-using "edu.uci.ics.asterix.external.dataset.adapter.HDFSAdapter"
- (("hdfs"="hdfs://temp1/data1"),("n1"="v1"),("n2"="v2"), ("n3"="v3"));
-
-create external dataset Orders(OrderType)
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1:///tmp1/data1,nc2:///tmp2/data2"));
-
-
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataset.aql b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataset.aql
new file mode 100644
index 0000000..4cce09a
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataset.aql
@@ -0,0 +1 @@
+drop dataset DBLP;
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataverse.aql b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataverse.aql
new file mode 100644
index 0000000..b92618e
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataverse.aql
@@ -0,0 +1 @@
+drop dataverse fuzzyjoin;
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql
new file mode 100644
index 0000000..386a71d
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql
@@ -0,0 +1 @@
+drop index Cust.ord;
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_nodegroup.aql b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_nodegroup.aql
new file mode 100644
index 0000000..664f52f
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_nodegroup.aql
@@ -0,0 +1 @@
+drop nodegroup group1;
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type1.aql b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type1.aql
new file mode 100644
index 0000000..4c6c7ae
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type1.aql
@@ -0,0 +1 @@
+drop type AddressType;
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type2.aql b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type2.aql
new file mode 100644
index 0000000..b97b812
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type2.aql
@@ -0,0 +1 @@
+drop type CustomerType;
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type3.aql b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type3.aql
new file mode 100644
index 0000000..3812745
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type3.aql
@@ -0,0 +1 @@
+drop type StreetType;
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_1.aql b/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_1.aql
new file mode 100644
index 0000000..f4547d6
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_1.aql
@@ -0,0 +1,8 @@
+/*
+ * Description : Drop a system dataset- Metadata.Dataset
+ * Expected Res : Failure
+ * Date : 13 Jan 2013
+ * Issue : 239
+ */
+
+drop dataset Metadata.Dataset;
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_2.aql b/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_2.aql
new file mode 100644
index 0000000..d62bb49
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_2.aql
@@ -0,0 +1,8 @@
+/*
+ * Description : Drop a system dataset- Metadata.Dataset
+ * Expected Res : Failure
+ * Date : 13 Jan 2013
+ * Issue : 239
+ */
+
+drop dataset Metadata.Dataverse;
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_3.aql b/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_3.aql
new file mode 100644
index 0000000..96dd8cc
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_3.aql
@@ -0,0 +1,8 @@
+/*
+ * Description : Drop a system dataset- Metadata.Nodegroup
+ * Expected Res : Failure
+ * Date : 13 Jan 2013
+ * Issue : 239
+ */
+
+drop dataset Metadata.Nodegroup;
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_4.aql b/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_4.aql
new file mode 100644
index 0000000..7685427
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_4.aql
@@ -0,0 +1,8 @@
+/*
+ * Description : Drop a system dataset- Metadata.Index
+ * Expected Res : Failure
+ * Date : 13 Jan 2013
+ * Issue : 239
+ */
+
+drop dataset Metadata.Index;
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_5.aql b/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_5.aql
new file mode 100644
index 0000000..5e6e468
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_5.aql
@@ -0,0 +1,8 @@
+/*
+ * Description : Drop a system dataset- Metadata.DatasourceAdapter
+ * Expected Res : Failure
+ * Date : 13 Jan 2013
+ * Issue : 239
+ */
+
+drop dataset Metadata.DatasourceAdapter;
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_6.aql b/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_6.aql
new file mode 100644
index 0000000..0eb863f
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_6.aql
@@ -0,0 +1,8 @@
+/*
+ * Description : Drop a system dataset- Metadata.Function
+ * Expected Res : Failure
+ * Date : 13 Jan 2013
+ * Issue : 239
+ */
+
+drop dataset Metadata.Function;
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_7.aql b/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_7.aql
new file mode 100644
index 0000000..6794d04
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_7.aql
@@ -0,0 +1,8 @@
+/*
+ * Description : Drop a system dataset- Metadata.Datatype
+ * Expected Res : Failure
+ * Date : 13 Jan 2013
+ * Issue : 239
+ */
+
+drop dataset Metadata.Datatype;
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_8.aql b/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_8.aql
new file mode 100644
index 0000000..d75e27a
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_8.aql
@@ -0,0 +1,8 @@
+/*
+ * Description : Drop a system dataset- Metadata.Node
+ * Expected Res : Failure
+ * Date : 13 Jan 2013
+ * Issue : 239
+ */
+
+drop dataset Metadata.Node;
diff --git a/asterix-app/src/test/resources/metadata/queries/exceptions.aql b/asterix-app/src/test/resources/metadata/queries/exceptions.aql
deleted file mode 100644
index b6ec188..0000000
--- a/asterix-app/src/test/resources/metadata/queries/exceptions.aql
+++ /dev/null
@@ -1,21 +0,0 @@
-// Each statement (except for the second "use" statement) should throw an exception.
-
-//drop nodegroup group1;
-
-//drop dataverse fuzzyjoin;
-
-//use dataverse fuzzy;
-
-//use dataverse custord;
-
-//drop index Cust.ord;
-
-//drop index Customers.ord;
-
-//drop type AddressType;
-
-//drop type CustomerType;
-
-//drop type StreetType;
-
-//drop dataset DBLP;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/metadata_dataset.aql b/asterix-app/src/test/resources/metadata/queries/metadata_dataset.aql
deleted file mode 100644
index 723e65c..0000000
--- a/asterix-app/src/test/resources/metadata/queries/metadata_dataset.aql
+++ /dev/null
@@ -1,9 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/metadata_dataset.adm";
-
-for $c in dataset('Dataset')
-return $c
-
-
-
diff --git a/asterix-app/src/test/resources/metadata/queries/metadata_datatype.aql b/asterix-app/src/test/resources/metadata/queries/metadata_datatype.aql
deleted file mode 100644
index a144f4f..0000000
--- a/asterix-app/src/test/resources/metadata/queries/metadata_datatype.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/metadata_datatype.adm";
-
-for $c in dataset('Datatype')
-return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/metadata_dataverse.aql b/asterix-app/src/test/resources/metadata/queries/metadata_dataverse.aql
deleted file mode 100644
index e7e1249..0000000
--- a/asterix-app/src/test/resources/metadata/queries/metadata_dataverse.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/metadata_dataverse.adm";
-
-for $c in dataset('Dataverse')
-return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/metadata_index.aql b/asterix-app/src/test/resources/metadata/queries/metadata_index.aql
deleted file mode 100644
index 6ff3185..0000000
--- a/asterix-app/src/test/resources/metadata/queries/metadata_index.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/metadata_index.adm";
-
-for $c in dataset('Index')
-return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/metadata_node.aql b/asterix-app/src/test/resources/metadata/queries/metadata_node.aql
deleted file mode 100644
index ce28ac8..0000000
--- a/asterix-app/src/test/resources/metadata/queries/metadata_node.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/metadata_node.adm";
-
-for $c in dataset('Node')
-return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/metadata_nodegroup.aql b/asterix-app/src/test/resources/metadata/queries/metadata_nodegroup.aql
deleted file mode 100644
index 090c739..0000000
--- a/asterix-app/src/test/resources/metadata/queries/metadata_nodegroup.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/metadata_nodegroup.adm";
-
-for $c in dataset('Nodegroup')
-return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/regress_01_create_type.aql b/asterix-app/src/test/resources/metadata/queries/regress_01_create_type.aql
deleted file mode 100644
index e978572..0000000
--- a/asterix-app/src/test/resources/metadata/queries/regress_01_create_type.aql
+++ /dev/null
@@ -1,12 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-create nodegroup group1 if not exists on nc1, nc2;
-
-// Create a type in test dataverse.
-// This type will be referred to in a subsequent script.
-create type TestType as closed {
- id: int32,
- name: string
-}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/regress_02_refer_existing_type.aql b/asterix-app/src/test/resources/metadata/queries/regress_02_refer_existing_type.aql
deleted file mode 100644
index aeed866..0000000
--- a/asterix-app/src/test/resources/metadata/queries/regress_02_refer_existing_type.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-use dataverse test;
-
-// Refer to existing type in test dataverse.
-create type UseTestType as closed {
- test: TestType
-}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/regress_03_repeated_create_drop.aql b/asterix-app/src/test/resources/metadata/queries/regress_03_repeated_create_drop.aql
deleted file mode 100644
index 02009da..0000000
--- a/asterix-app/src/test/resources/metadata/queries/regress_03_repeated_create_drop.aql
+++ /dev/null
@@ -1,34 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-create type TypeOne as open {
- f: int32
-}
-create nodegroup group1 if not exists on nc1, nc2;
-create dataset typeonedataset(TypeOne)
-partitioned by key f on group1;
-
-
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-create type TypeTwo as open {
- f: int32
-}
-create nodegroup group1 if not exists on nc1, nc2;
-create dataset typetwodataset(TypeTwo)
-partitioned by key f on group1;
-
-
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-create type TypeThree as open {
- f: int32
-}
-create nodegroup group1 if not exists on nc1, nc2;
-create dataset typethreedataset(TypeThree)
-partitioned by key f on group1;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success.aql b/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success.aql
new file mode 100644
index 0000000..5250eef
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success.aql
@@ -0,0 +1,54 @@
+/*
+ * Description : Cause a failure by creating an existing type. Verify that rollback does not affect the pre-existing types.
+ * Verification is done in a separate session (compilation unit).
+ * Expected Res : Success
+ * Date : 24 Nov 2012
+ */
+drop dataverse custord if exists;
+
+create dataverse custord;
+
+use dataverse custord;
+
+create type StreetType as closed {
+ number: int32?,
+ name: string
+}
+
+create type AddressType as open {
+ street: StreetType,
+ city: string,
+ state: string,
+ zip: int16
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: {{string}},
+ children: [ {
+ name : string,
+ dob : string
+ } ]
+}
+
+create type OrderType as open {
+ oid: int32,
+ cid: int32,
+ orderstatus: string,
+ orderpriority: string,
+ clerk: string,
+ total: float,
+ items: [ {
+ number: int64,
+ storeIds: {{int8}}
+ } ]
+}
+
+
+create type StreetType as closed {
+ number: int32?,
+ name: string
+}
diff --git a/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution.aql b/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution.aql
new file mode 100644
index 0000000..d4678f2
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution.aql
@@ -0,0 +1,47 @@
+/*
+ * Description : Create dataverse, types, nodegroup and a dataset. Cause exception by re-creating nodegroup.
+ * Subsequent statement(s) should not executed. This is verified in a separate session (compilation unit)
+ * Expected Res : Exception
+ * Date : 24 Nov 2012
+ */
+drop dataverse custord if exists;
+
+create dataverse custord;
+
+use dataverse custord;
+
+create type StreetType as closed {
+ number: int32?,
+ name: string
+}
+
+create type AddressType as open {
+ street: StreetType,
+ city: string,
+ state: string,
+ zip: int16
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: {{string}},
+ children: [ {
+ name : string,
+ dob : string
+ } ]
+}
+
+create nodegroup group1 if not exists on nc1, nc2;
+
+create dataset Customers(CustomerType)
+ partitioned by key cid, name on group1;
+
+create nodegroup group1 on nc1, nc2;
+
+// the following statement should not get executed
+// as the above statement causes an exception
+create index custName on Customers(name, cid);
+
diff --git a/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_previous_success.aql b/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_previous_success.aql
new file mode 100644
index 0000000..351a9e4
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_previous_success.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : Verify the state of the Metadata adter the failure caused in failure_previous_success.aql
+ * Expected Res : Success
+ * Date : 24 Nov 2012
+ */
+use dataverse custord;
+
+write output to nc1:"mdtest/transaction_verify_failure_previous_success.adm";
+
+for $x in dataset('Metadata.Datatype')
+where $x.DataverseName='custord'
+return $x
diff --git a/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_subsequent_no_execution.aql b/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_subsequent_no_execution.aql
new file mode 100644
index 0000000..6505903
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_subsequent_no_execution.aql
@@ -0,0 +1,13 @@
+/*
+ * Description : Verify the state of the metadata after the failure caused by failure_subsequent_no_execution.aql
+ * Expected Res : Success
+ * Date : 24 Nov 2012
+ */
+
+use dataverse custord;
+
+write output to nc1:"mdtest/transaction_verify_failure_subsequent_no_execution.adm";
+
+for $x in dataset('Metadata.Index')
+where $x.DataverseName='custord'
+return $x
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta01.adm b/asterix-app/src/test/resources/metadata/results/basic/meta01.adm
new file mode 100644
index 0000000..e878a54
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta01.adm
@@ -0,0 +1,2 @@
+{ "DataverseName": "Metadata", "DataFormat": "edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat", "Timestamp": "Sat Nov 24 14:44:45 PST 2012" }
+{ "DataverseName": "testdv", "DataFormat": "edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat", "Timestamp": "Sat Nov 24 14:45:14 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta02.adm b/asterix-app/src/test/resources/metadata/results/basic/meta02.adm
new file mode 100644
index 0000000..2424676
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta02.adm
@@ -0,0 +1 @@
+{ "DataverseName": "testdv", "DatasetName": "dst01", "DataTypeName": "testtype", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Sat Sep 15 14:44:58 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta03.adm b/asterix-app/src/test/resources/metadata/results/basic/meta03.adm
new file mode 100644
index 0000000..df41a35
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta03.adm
@@ -0,0 +1 @@
+{ "DataverseName": "testdv", "DatatypeName": "testtype", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": false, "Fields": [ { "FieldName": "id", "FieldType": "int32" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Sep 17 23:18:30 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta04.adm b/asterix-app/src/test/resources/metadata/results/basic/meta04.adm
new file mode 100644
index 0000000..8f892be
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta04.adm
@@ -0,0 +1 @@
+{ "DataverseName": "testdv", "DatatypeName": "testtype", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "id", "FieldType": "int32" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 14:27:13 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta05.adm b/asterix-app/src/test/resources/metadata/results/basic/meta05.adm
new file mode 100644
index 0000000..811e871
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta05.adm
@@ -0,0 +1,2 @@
+{ "DataverseName": "testdv", "DatasetName": "t1", "IndexName": "idx1", "IndexStructure": "BTREE", "SearchKey": [ "name" ], "IsPrimary": false, "Timestamp": "Mon Sep 17 23:21:46 PDT 2012" }
+{ "DataverseName": "testdv", "DatasetName": "t1", "IndexName": "t1", "IndexStructure": "BTREE", "SearchKey": [ "id" ], "IsPrimary": true, "Timestamp": "Mon Sep 17 23:21:46 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta06.adm b/asterix-app/src/test/resources/metadata/results/basic/meta06.adm
new file mode 100644
index 0000000..58f5b77
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta06.adm
@@ -0,0 +1 @@
+{ "DataverseName": "testdv", "Name": "fun01", "Arity": "0", "Params": [ ], "ReturnType": "VOID", "Definition": "\"This is an AQL Bodied UDF\"", "Language": "AQL", "Kind": "SCALAR" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta07.adm b/asterix-app/src/test/resources/metadata/results/basic/meta07.adm
new file mode 100644
index 0000000..f0a6e1d
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta07.adm
@@ -0,0 +1,2 @@
+{ "NodeName": "nc1", "NumberOfCores": 0, "WorkingMemorySize": 0 }
+{ "NodeName": "nc2", "NumberOfCores": 0, "WorkingMemorySize": 0 }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta08.adm b/asterix-app/src/test/resources/metadata/results/basic/meta08.adm
new file mode 100644
index 0000000..cadf1c4
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta08.adm
@@ -0,0 +1,2 @@
+{ "GroupName": "DEFAULT_NG_ALL_NODES", "NodeNames": {{ "nc1", "nc2" }}, "Timestamp": "Mon Sep 17 12:31:45 PDT 2012" }
+{ "GroupName": "MetadataGroup", "NodeNames": {{ "nc1" }}, "Timestamp": "Mon Sep 17 12:31:45 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta09.adm b/asterix-app/src/test/resources/metadata/results/basic/meta09.adm
new file mode 100644
index 0000000..b85737d
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta09.adm
@@ -0,0 +1 @@
+{ "DataverseName": "test", "DatasetName": "t1", "DataTypeName": "testtype", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Sat Nov 24 14:28:44 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta10.adm b/asterix-app/src/test/resources/metadata/results/basic/meta10.adm
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta10.adm
@@ -0,0 +1 @@
+0
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta11.adm b/asterix-app/src/test/resources/metadata/results/basic/meta11.adm
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta11.adm
@@ -0,0 +1 @@
+0
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta12.adm b/asterix-app/src/test/resources/metadata/results/basic/meta12.adm
new file mode 100644
index 0000000..6cf9685
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta12.adm
@@ -0,0 +1 @@
+{ "DataverseName": "test", "DatasetName": "dst01", "IndexName": "dst01", "IndexStructure": "BTREE", "SearchKey": [ "id" ], "IsPrimary": true, "Timestamp": "Mon Sep 17 23:40:44 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta13.adm b/asterix-app/src/test/resources/metadata/results/basic/meta13.adm
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta13.adm
@@ -0,0 +1 @@
+0
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta14.adm b/asterix-app/src/test/resources/metadata/results/basic/meta14.adm
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta14.adm
@@ -0,0 +1 @@
+0
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta15.adm b/asterix-app/src/test/resources/metadata/results/basic/meta15.adm
new file mode 100644
index 0000000..4414ed0
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta15.adm
@@ -0,0 +1,6 @@
+{ "DataverseName": "Metadata", "Name": "cnn_feed", "Classname": "edu.uci.ics.asterix.external.adapter.factory.CNNFeedAdapterFactory", "Type": "INTERNAL", "Timestamp": "Sun Nov 25 20:55:22 PST 2012" }
+{ "DataverseName": "Metadata", "Name": "hdfs", "Classname": "edu.uci.ics.asterix.external.adapter.factory.HDFSAdapterFactory", "Type": "INTERNAL", "Timestamp": "Sun Nov 25 20:55:22 PST 2012" }
+{ "DataverseName": "Metadata", "Name": "hive", "Classname": "edu.uci.ics.asterix.external.adapter.factory.HiveAdapterFactory", "Type": "INTERNAL", "Timestamp": "Sun Nov 25 20:55:22 PST 2012" }
+{ "DataverseName": "Metadata", "Name": "localfs", "Classname": "edu.uci.ics.asterix.external.adapter.factory.NCFileSystemAdapterFactory", "Type": "INTERNAL", "Timestamp": "Sun Nov 25 20:55:22 PST 2012" }
+{ "DataverseName": "Metadata", "Name": "pull_twitter", "Classname": "edu.uci.ics.asterix.external.adapter.factory.PullBasedTwitterAdapterFactory", "Type": "INTERNAL", "Timestamp": "Sun Nov 25 20:55:22 PST 2012" }
+{ "DataverseName": "Metadata", "Name": "rss_feed", "Classname": "edu.uci.ics.asterix.external.adapter.factory.RSSFeedAdapterFactory", "Type": "INTERNAL", "Timestamp": "Sun Nov 25 20:55:22 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta16.adm b/asterix-app/src/test/resources/metadata/results/basic/meta16.adm
new file mode 100644
index 0000000..8abc339
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta16.adm
@@ -0,0 +1,8 @@
+{ "DataverseName": "Metadata", "DatasetName": "Dataset", "DataTypeName": "DatasetRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName" ], "PrimaryKey": [ "DataverseName", "DatasetName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "DatasourceAdapter", "DataTypeName": "DatasourceAdapterRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "Name" ], "PrimaryKey": [ "DataverseName", "Name" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Datatype", "DataTypeName": "DatatypeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatatypeName" ], "PrimaryKey": [ "DataverseName", "DatatypeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataverse", "DataTypeName": "DataverseRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName" ], "PrimaryKey": [ "DataverseName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Function", "DataTypeName": "FunctionRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "Name", "Arity" ], "PrimaryKey": [ "DataverseName", "Name", "Arity" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Index", "DataTypeName": "IndexRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName", "IndexName" ], "PrimaryKey": [ "DataverseName", "DatasetName", "IndexName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Node", "DataTypeName": "NodeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "NodeName" ], "PrimaryKey": [ "NodeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Nodegroup", "DataTypeName": "NodeGroupRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "GroupName" ], "PrimaryKey": [ "GroupName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta17.adm b/asterix-app/src/test/resources/metadata/results/basic/meta17.adm
new file mode 100644
index 0000000..8e7251b
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta17.adm
@@ -0,0 +1,58 @@
+{ "DataverseName": "Metadata", "DatatypeName": "DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DatasetName", "FieldType": "string" }, { "FieldName": "DataTypeName", "FieldType": "string" }, { "FieldName": "DatasetType", "FieldType": "string" }, { "FieldName": "InternalDetails", "FieldType": "Field_InternalDetails_in_DatasetRecordType" }, { "FieldName": "ExternalDetails", "FieldType": "Field_ExternalDetails_in_DatasetRecordType" }, { "FieldName": "FeedDetails", "FieldType": "Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "DatasourceAdapterRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "Name", "FieldType": "string" }, { "FieldName": "Classname", "FieldType": "string" }, { "FieldName": "Type", "FieldType": "string" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "DatatypeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DatatypeName", "FieldType": "string" }, { "FieldName": "Derived", "FieldType": "Field_Derived_in_DatatypeRecordType" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "DataverseRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DataFormat", "FieldType": "string" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_ExternalDetails_in_DatasetRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType_ItemType" }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "FieldName", "FieldType": "string" }, { "FieldName": "FieldType", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Function_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "string" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_NodeNames_in_NodeGroupRecordType", "Derived": { "Tag": "UNORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": "string", "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_OrderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "string" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Params_in_FunctionRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_PartitioningKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_PartitioningKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_PrimaryKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_PrimaryKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType_ItemType" }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Name", "FieldType": "string" }, { "FieldName": "Value", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType_ItemType" }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Name", "FieldType": "string" }, { "FieldName": "Value", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_SearchKey_in_IndexRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_UnorderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "string" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "FunctionRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "Name", "FieldType": "string" }, { "FieldName": "Arity", "FieldType": "string" }, { "FieldName": "Params", "FieldType": "Field_Params_in_FunctionRecordType" }, { "FieldName": "ReturnType", "FieldType": "string" }, { "FieldName": "Definition", "FieldType": "string" }, { "FieldName": "Language", "FieldType": "string" }, { "FieldName": "Kind", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "IndexRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DatasetName", "FieldType": "string" }, { "FieldName": "IndexName", "FieldType": "string" }, { "FieldName": "IndexStructure", "FieldType": "string" }, { "FieldName": "SearchKey", "FieldType": "Field_SearchKey_in_IndexRecordType" }, { "FieldName": "IsPrimary", "FieldType": "boolean" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "NodeGroupRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "GroupName", "FieldType": "string" }, { "FieldName": "NodeNames", "FieldType": "Field_NodeNames_in_NodeGroupRecordType" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "NodeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "NodeName", "FieldType": "string" }, { "FieldName": "NumberOfCores", "FieldType": "int32" }, { "FieldName": "WorkingMemorySize", "FieldType": "int32" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Tag", "FieldType": "string" }, { "FieldName": "IsAnonymous", "FieldType": "boolean" }, { "FieldName": "EnumValues", "FieldType": "Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "Record", "FieldType": "Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "Union", "FieldType": "Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "UnorderedList", "FieldType": "Field_UnorderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "OrderedList", "FieldType": "Field_OrderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DatasourceAdapter", "FieldType": "string" }, { "FieldName": "Properties", "FieldType": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "FileStructure", "FieldType": "string" }, { "FieldName": "PartitioningStrategy", "FieldType": "string" }, { "FieldName": "PartitioningKey", "FieldType": "Field_PartitioningKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "PrimaryKey", "FieldType": "Field_PrimaryKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "GroupName", "FieldType": "string" }, { "FieldName": "DatasourceAdapter", "FieldType": "string" }, { "FieldName": "Properties", "FieldType": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "Function", "FieldType": "Field_Function_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "Status", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "FileStructure", "FieldType": "string" }, { "FieldName": "PartitioningStrategy", "FieldType": "string" }, { "FieldName": "PartitioningKey", "FieldType": "Field_PartitioningKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType" }, { "FieldName": "PrimaryKey", "FieldType": "Field_PrimaryKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType" }, { "FieldName": "GroupName", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "IsOpen", "FieldType": "boolean" }, { "FieldName": "Fields", "FieldType": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "boolean", "Derived": null, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "circle", "Derived": null, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "date", "Derived": null, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "datetime", "Derived": null, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "double", "Derived": null, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "duration", "Derived": null, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "float", "Derived": null, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "int16", "Derived": null, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "int32", "Derived": null, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "int64", "Derived": null, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "int8", "Derived": null, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "interval", "Derived": null, "Timestamp": "Thu Jan 31 23:28:54 PST 2013" }
+{ "DataverseName": "Metadata", "DatatypeName": "line", "Derived": null, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "null", "Derived": null, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "point", "Derived": null, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "point3d", "Derived": null, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "polygon", "Derived": null, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "rectangle", "Derived": null, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "string", "Derived": null, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "time", "Derived": null, "Timestamp": "Mon Dec 24 14:01:42 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta18.adm b/asterix-app/src/test/resources/metadata/results/basic/meta18.adm
new file mode 100644
index 0000000..f6d8a37
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta18.adm
@@ -0,0 +1 @@
+{ "DataverseName": "Metadata", "DataFormat": "edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat", "Timestamp": "Thu Sep 13 13:03:11 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta19.adm b/asterix-app/src/test/resources/metadata/results/basic/meta19.adm
new file mode 100644
index 0000000..607bfd1
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta19.adm
@@ -0,0 +1,11 @@
+{ "DataverseName": "Metadata", "DatasetName": "Dataset", "IndexName": "Dataset", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatasetName" ], "IsPrimary": true, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataset", "IndexName": "DatatypeName", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatatypeName", "DatasetName" ], "IsPrimary": false, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataset", "IndexName": "GroupName", "IndexStructure": "BTREE", "SearchKey": [ "GroupName", "DataverseName", "DatasetName" ], "IsPrimary": false, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "DatasourceAdapter", "IndexName": "DatasourceAdapter", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "Name" ], "IsPrimary": true, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Datatype", "IndexName": "Datatype", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatatypeName" ], "IsPrimary": true, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Datatype", "IndexName": "DatatypeName", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "NestedDatatypeName", "TopDatatypeName" ], "IsPrimary": false, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataverse", "IndexName": "Dataverse", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName" ], "IsPrimary": true, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Function", "IndexName": "Function", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "Name", "Arity" ], "IsPrimary": true, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Index", "IndexName": "Index", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatasetName", "IndexName" ], "IsPrimary": true, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Node", "IndexName": "Node", "IndexStructure": "BTREE", "SearchKey": [ "NodeName" ], "IsPrimary": true, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Nodegroup", "IndexName": "Nodegroup", "IndexStructure": "BTREE", "SearchKey": [ "GroupName" ], "IsPrimary": true, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta20.adm b/asterix-app/src/test/resources/metadata/results/basic/meta20.adm
new file mode 100644
index 0000000..f0a6e1d
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta20.adm
@@ -0,0 +1,2 @@
+{ "NodeName": "nc1", "NumberOfCores": 0, "WorkingMemorySize": 0 }
+{ "NodeName": "nc2", "NumberOfCores": 0, "WorkingMemorySize": 0 }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta21.adm b/asterix-app/src/test/resources/metadata/results/basic/meta21.adm
new file mode 100644
index 0000000..d7e8460
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta21.adm
@@ -0,0 +1,2 @@
+{ "GroupName": "DEFAULT_NG_ALL_NODES", "NodeNames": {{ "nc1", "nc2" }}, "Timestamp": "Thu Sep 13 11:42:20 PDT 2012" }
+{ "GroupName": "MetadataGroup", "NodeNames": {{ "nc1" }}, "Timestamp": "Thu Sep 13 11:42:20 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/metadata_dataset.adm b/asterix-app/src/test/resources/metadata/results/basic/metadata_dataset.adm
new file mode 100644
index 0000000..8abc339
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/metadata_dataset.adm
@@ -0,0 +1,8 @@
+{ "DataverseName": "Metadata", "DatasetName": "Dataset", "DataTypeName": "DatasetRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName" ], "PrimaryKey": [ "DataverseName", "DatasetName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "DatasourceAdapter", "DataTypeName": "DatasourceAdapterRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "Name" ], "PrimaryKey": [ "DataverseName", "Name" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Datatype", "DataTypeName": "DatatypeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatatypeName" ], "PrimaryKey": [ "DataverseName", "DatatypeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataverse", "DataTypeName": "DataverseRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName" ], "PrimaryKey": [ "DataverseName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Function", "DataTypeName": "FunctionRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "Name", "Arity" ], "PrimaryKey": [ "DataverseName", "Name", "Arity" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Index", "DataTypeName": "IndexRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName", "IndexName" ], "PrimaryKey": [ "DataverseName", "DatasetName", "IndexName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Node", "DataTypeName": "NodeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "NodeName" ], "PrimaryKey": [ "NodeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Nodegroup", "DataTypeName": "NodeGroupRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "GroupName" ], "PrimaryKey": [ "GroupName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/metadata_datatype.adm b/asterix-app/src/test/resources/metadata/results/basic/metadata_datatype.adm
new file mode 100644
index 0000000..b351cfb
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/metadata_datatype.adm
@@ -0,0 +1,56 @@
+{ "DataverseName": "Metadata", "DatatypeName": "DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DatasetName", "FieldType": "string" }, { "FieldName": "DataTypeName", "FieldType": "string" }, { "FieldName": "DatasetType", "FieldType": "string" }, { "FieldName": "InternalDetails", "FieldType": "Field_InternalDetails_in_DatasetRecordType" }, { "FieldName": "ExternalDetails", "FieldType": "Field_ExternalDetails_in_DatasetRecordType" }, { "FieldName": "FeedDetails", "FieldType": "Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "DatasourceAdapterRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "Name", "FieldType": "string" }, { "FieldName": "Classname", "FieldType": "string" }, { "FieldName": "Type", "FieldType": "string" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "DatatypeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DatatypeName", "FieldType": "string" }, { "FieldName": "Derived", "FieldType": "Field_Derived_in_DatatypeRecordType" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "DataverseRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DataFormat", "FieldType": "string" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_ExternalDetails_in_DatasetRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType_ItemType" }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "FieldName", "FieldType": "string" }, { "FieldName": "FieldType", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_NodeNames_in_NodeGroupRecordType", "Derived": { "Tag": "UNORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": "string", "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_OrderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "string" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Params_in_FunctionRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_PartitioningKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_PartitioningKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_PrimaryKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_PrimaryKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType_ItemType" }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Name", "FieldType": "string" }, { "FieldName": "Value", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType_ItemType" }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Name", "FieldType": "string" }, { "FieldName": "Value", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_SearchKey_in_IndexRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_UnorderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "string" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "FunctionRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "Name", "FieldType": "string" }, { "FieldName": "Arity", "FieldType": "string" }, { "FieldName": "Params", "FieldType": "Field_Params_in_FunctionRecordType" }, { "FieldName": "ReturnType", "FieldType": "string" }, { "FieldName": "Definition", "FieldType": "string" }, { "FieldName": "Language", "FieldType": "string" }, { "FieldName": "Kind", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "IndexRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DatasetName", "FieldType": "string" }, { "FieldName": "IndexName", "FieldType": "string" }, { "FieldName": "IndexStructure", "FieldType": "string" }, { "FieldName": "SearchKey", "FieldType": "Field_SearchKey_in_IndexRecordType" }, { "FieldName": "IsPrimary", "FieldType": "boolean" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "NodeGroupRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "GroupName", "FieldType": "string" }, { "FieldName": "NodeNames", "FieldType": "Field_NodeNames_in_NodeGroupRecordType" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "NodeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "NodeName", "FieldType": "string" }, { "FieldName": "NumberOfCores", "FieldType": "int32" }, { "FieldName": "WorkingMemorySize", "FieldType": "int32" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Tag", "FieldType": "string" }, { "FieldName": "IsAnonymous", "FieldType": "boolean" }, { "FieldName": "EnumValues", "FieldType": "Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "Record", "FieldType": "Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "Union", "FieldType": "Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "UnorderedList", "FieldType": "Field_UnorderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "OrderedList", "FieldType": "Field_OrderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DatasourceAdapter", "FieldType": "string" }, { "FieldName": "Properties", "FieldType": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "FileStructure", "FieldType": "string" }, { "FieldName": "PartitioningStrategy", "FieldType": "string" }, { "FieldName": "PartitioningKey", "FieldType": "Field_PartitioningKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "PrimaryKey", "FieldType": "Field_PrimaryKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "GroupName", "FieldType": "string" }, { "FieldName": "DatasourceAdapter", "FieldType": "string" }, { "FieldName": "Properties", "FieldType": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "Function", "FieldType": "string" }, { "FieldName": "Status", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "FileStructure", "FieldType": "string" }, { "FieldName": "PartitioningStrategy", "FieldType": "string" }, { "FieldName": "PartitioningKey", "FieldType": "Field_PartitioningKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType" }, { "FieldName": "PrimaryKey", "FieldType": "Field_PrimaryKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType" }, { "FieldName": "GroupName", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "IsOpen", "FieldType": "boolean" }, { "FieldName": "Fields", "FieldType": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "boolean", "Derived": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "circle", "Derived": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "date", "Derived": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "datetime", "Derived": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "double", "Derived": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "duration", "Derived": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "float", "Derived": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "int16", "Derived": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "int32", "Derived": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "int64", "Derived": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "int8", "Derived": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "line", "Derived": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "null", "Derived": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "point", "Derived": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "point3d", "Derived": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "polygon", "Derived": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "rectangle", "Derived": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "string", "Derived": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "time", "Derived": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/metadata_dataverse.adm b/asterix-app/src/test/resources/metadata/results/basic/metadata_dataverse.adm
new file mode 100644
index 0000000..f6d8a37
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/metadata_dataverse.adm
@@ -0,0 +1 @@
+{ "DataverseName": "Metadata", "DataFormat": "edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat", "Timestamp": "Thu Sep 13 13:03:11 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/metadata_index.adm b/asterix-app/src/test/resources/metadata/results/basic/metadata_index.adm
new file mode 100644
index 0000000..607bfd1
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/metadata_index.adm
@@ -0,0 +1,11 @@
+{ "DataverseName": "Metadata", "DatasetName": "Dataset", "IndexName": "Dataset", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatasetName" ], "IsPrimary": true, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataset", "IndexName": "DatatypeName", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatatypeName", "DatasetName" ], "IsPrimary": false, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataset", "IndexName": "GroupName", "IndexStructure": "BTREE", "SearchKey": [ "GroupName", "DataverseName", "DatasetName" ], "IsPrimary": false, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "DatasourceAdapter", "IndexName": "DatasourceAdapter", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "Name" ], "IsPrimary": true, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Datatype", "IndexName": "Datatype", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatatypeName" ], "IsPrimary": true, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Datatype", "IndexName": "DatatypeName", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "NestedDatatypeName", "TopDatatypeName" ], "IsPrimary": false, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataverse", "IndexName": "Dataverse", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName" ], "IsPrimary": true, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Function", "IndexName": "Function", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "Name", "Arity" ], "IsPrimary": true, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Index", "IndexName": "Index", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatasetName", "IndexName" ], "IsPrimary": true, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Node", "IndexName": "Node", "IndexStructure": "BTREE", "SearchKey": [ "NodeName" ], "IsPrimary": true, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Nodegroup", "IndexName": "Nodegroup", "IndexStructure": "BTREE", "SearchKey": [ "GroupName" ], "IsPrimary": true, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/metadata_node.adm b/asterix-app/src/test/resources/metadata/results/basic/metadata_node.adm
new file mode 100644
index 0000000..f0a6e1d
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/metadata_node.adm
@@ -0,0 +1,2 @@
+{ "NodeName": "nc1", "NumberOfCores": 0, "WorkingMemorySize": 0 }
+{ "NodeName": "nc2", "NumberOfCores": 0, "WorkingMemorySize": 0 }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/metadata_nodegroup.adm b/asterix-app/src/test/resources/metadata/results/basic/metadata_nodegroup.adm
new file mode 100644
index 0000000..d7e8460
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/metadata_nodegroup.adm
@@ -0,0 +1,2 @@
+{ "GroupName": "DEFAULT_NG_ALL_NODES", "NodeNames": {{ "nc1", "nc2" }}, "Timestamp": "Thu Sep 13 11:42:20 PDT 2012" }
+{ "GroupName": "MetadataGroup", "NodeNames": {{ "nc1" }}, "Timestamp": "Thu Sep 13 11:42:20 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/custord/custord_dataset.adm b/asterix-app/src/test/resources/metadata/results/custord/custord_dataset.adm
new file mode 100644
index 0000000..ca2737c
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/custord/custord_dataset.adm
@@ -0,0 +1,2 @@
+{ "DataverseName": "custord", "DatasetName": "Customers", "DataTypeName": "CustomerType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "cid", "name" ], "PrimaryKey": [ "cid", "name" ], "GroupName": "group1" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Sep 13 14:20:57 PDT 2012" }
+{ "DataverseName": "custord", "DatasetName": "Orders", "DataTypeName": "OrderType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "oid" ], "PrimaryKey": [ "oid" ], "GroupName": "group1" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Sep 13 14:20:57 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/custord_datatype.adm b/asterix-app/src/test/resources/metadata/results/custord/custord_datatype.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/custord_datatype.adm
rename to asterix-app/src/test/resources/metadata/results/custord/custord_datatype.adm
diff --git a/asterix-app/src/test/resources/metadata/results/custord_dataverse.adm b/asterix-app/src/test/resources/metadata/results/custord/custord_dataverse.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/custord_dataverse.adm
rename to asterix-app/src/test/resources/metadata/results/custord/custord_dataverse.adm
diff --git a/asterix-app/src/test/resources/metadata/results/custord/custord_index.adm b/asterix-app/src/test/resources/metadata/results/custord/custord_index.adm
new file mode 100644
index 0000000..06f6bd5
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/custord/custord_index.adm
@@ -0,0 +1,5 @@
+{ "DataverseName": "custord", "DatasetName": "Customers", "IndexName": "Customers", "IndexStructure": "BTREE", "SearchKey": [ "cid", "name" ], "IsPrimary": true, "Timestamp": "Thu Sep 13 14:20:57 PDT 2012" }
+{ "DataverseName": "custord", "DatasetName": "Customers", "IndexName": "custName", "IndexStructure": "BTREE", "SearchKey": [ "name", "cid" ], "IsPrimary": false, "Timestamp": "Thu Sep 13 14:20:57 PDT 2012" }
+{ "DataverseName": "custord", "DatasetName": "Orders", "IndexName": "Orders", "IndexStructure": "BTREE", "SearchKey": [ "oid" ], "IsPrimary": true, "Timestamp": "Thu Sep 13 14:20:57 PDT 2012" }
+{ "DataverseName": "custord", "DatasetName": "Orders", "IndexName": "ordClerkTotal", "IndexStructure": "BTREE", "SearchKey": [ "clerk", "total" ], "IsPrimary": false, "Timestamp": "Thu Sep 13 14:20:57 PDT 2012" }
+{ "DataverseName": "custord", "DatasetName": "Orders", "IndexName": "ordCustId", "IndexStructure": "BTREE", "SearchKey": [ "cid" ], "IsPrimary": false, "Timestamp": "Thu Sep 13 14:20:57 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/custord_nodegroup.adm b/asterix-app/src/test/resources/metadata/results/custord/custord_nodegroup.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/custord_nodegroup.adm
rename to asterix-app/src/test/resources/metadata/results/custord/custord_nodegroup.adm
diff --git a/asterix-app/src/test/resources/metadata/results/custord/custord_q10.adm b/asterix-app/src/test/resources/metadata/results/custord/custord_q10.adm
new file mode 100644
index 0000000..c0869bf
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/custord/custord_q10.adm
@@ -0,0 +1,9 @@
+{ "DataverseName": "Metadata", "DatasetName": "Dataset", "DataTypeName": "DatasetRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName" ], "PrimaryKey": [ "DataverseName", "DatasetName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Sep 13 15:12:43 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Datatype", "DataTypeName": "DatatypeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatatypeName" ], "PrimaryKey": [ "DataverseName", "DatatypeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Sep 13 15:12:43 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataverse", "DataTypeName": "DataverseRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName" ], "PrimaryKey": [ "DataverseName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Sep 13 15:12:43 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Function", "DataTypeName": "FunctionRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "FunctionName", "FunctionArity" ], "PrimaryKey": [ "DataverseName", "FunctionName", "FunctionArity" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Sep 13 15:12:43 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Index", "DataTypeName": "IndexRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName", "IndexName" ], "PrimaryKey": [ "DataverseName", "DatasetName", "IndexName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Sep 13 15:12:43 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Node", "DataTypeName": "NodeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "NodeName" ], "PrimaryKey": [ "NodeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Sep 13 15:12:43 PDT 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Nodegroup", "DataTypeName": "NodeGroupRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "GroupName" ], "PrimaryKey": [ "GroupName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Sep 13 15:12:43 PDT 2012" }
+{ "DataverseName": "custord", "DatasetName": "Customers", "DataTypeName": "CustomerType", "DatasetType": "EXTERNAL", "InternalDetails": null, "ExternalDetails": { "Adapter": "edu.uci.ics.asterix.external.dataset.adapter.HDFSAdapter", "Properties": [ { "Name": "n1", "Value": "v1" }, { "Name": "n3", "Value": "v3" }, { "Name": "n2", "Value": "v2" }, { "Name": "hdfs", "Value": "hdfs://temp1/data1" } ] }, "FeedDetails": null, "Timestamp": "Thu Sep 13 15:13:43 PDT 2012" }
+{ "DataverseName": "custord", "DatasetName": "Orders", "DataTypeName": "OrderType", "DatasetType": "EXTERNAL", "InternalDetails": null, "ExternalDetails": { "Adapter": "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter", "Properties": [ { "Name": "path", "Value": "nc1:///tmp1/data1,nc2:///tmp2/data2" } ] }, "FeedDetails": null, "Timestamp": "Thu Sep 13 15:13:43 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/custord_q2.adm b/asterix-app/src/test/resources/metadata/results/custord/custord_q2.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/custord_q2.adm
rename to asterix-app/src/test/resources/metadata/results/custord/custord_q2.adm
diff --git a/asterix-app/src/test/resources/metadata/results/custord_q3.adm b/asterix-app/src/test/resources/metadata/results/custord/custord_q3.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/custord_q3.adm
rename to asterix-app/src/test/resources/metadata/results/custord/custord_q3.adm
diff --git a/asterix-app/src/test/resources/metadata/results/custord/custord_q4.adm b/asterix-app/src/test/resources/metadata/results/custord/custord_q4.adm
new file mode 100644
index 0000000..70255eb
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/custord/custord_q4.adm
@@ -0,0 +1,4 @@
+{ "cust_name": "Mike Rotruck", "cust_age": null, "order_total": 124.26f }
+{ "cust_name": "Mike Rotruck", "cust_age": null, "order_total": 97.20656f }
+{ "cust_name": "Jodi Alex", "cust_age": 19, "order_total": 14.2326f }
+{ "cust_name": "Jodi Alex", "cust_age": 19, "order_total": 7.206f }
diff --git a/asterix-app/src/test/resources/metadata/results/custord_dataset.adm b/asterix-app/src/test/resources/metadata/results/custord_dataset.adm
deleted file mode 100644
index 68e8f41..0000000
--- a/asterix-app/src/test/resources/metadata/results/custord_dataset.adm
+++ /dev/null
@@ -1,2 +0,0 @@
-{ "DataverseName": "custord", "DatasetName": "Customers", "DataTypeName": "CustomerType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "cid", "name" ], "PrimaryKey": [ "cid", "name" ], "GroupName": "group1" }, "ExternalDetails": null, "Timestamp": "Thu Sep 01 15:45:33 PDT 2011" }
-{ "DataverseName": "custord", "DatasetName": "Orders", "DataTypeName": "OrderType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "oid" ], "PrimaryKey": [ "oid" ], "GroupName": "group1" }, "ExternalDetails": null, "Timestamp": "Mon Jul 11 09:30:35 PDT 2011" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/results/custord_index.adm b/asterix-app/src/test/resources/metadata/results/custord_index.adm
deleted file mode 100644
index 2e0f166..0000000
--- a/asterix-app/src/test/resources/metadata/results/custord_index.adm
+++ /dev/null
@@ -1,5 +0,0 @@
-{ "DataverseName": "custord", "DatasetName": "Customers", "IndexName": "$Customers", "IndexStructure": "BTREE", "SearchKey": [ "cid", "name" ], "Timestamp": "Mon Jul 11 10:42:48 PDT 2011" }
-{ "DataverseName": "custord", "DatasetName": "Customers", "IndexName": "custName", "IndexStructure": "BTREE", "SearchKey": [ "name", "cid" ], "Timestamp": "Mon Jul 11 10:44:32 PDT 2011" }
-{ "DataverseName": "custord", "DatasetName": "Orders", "IndexName": "$Orders", "IndexStructure": "BTREE", "SearchKey": [ "oid" ], "Timestamp": "Mon Jul 11 10:44:58 PDT 2011" }
-{ "DataverseName": "custord", "DatasetName": "Orders", "IndexName": "ordClerkTotal", "IndexStructure": "BTREE", "SearchKey": [ "clerk", "total" ], "Timestamp": "Mon Jul 11 17:18:08 PDT 2011" }
-{ "DataverseName": "custord", "DatasetName": "Orders", "IndexName": "ordCustId", "IndexStructure": "BTREE", "SearchKey": [ "cid" ], "Timestamp": "Mon Jul 11 10:46:25 PDT 2011" }
diff --git a/asterix-app/src/test/resources/metadata/results/custord_q10.adm b/asterix-app/src/test/resources/metadata/results/custord_q10.adm
deleted file mode 100644
index ed1df70..0000000
--- a/asterix-app/src/test/resources/metadata/results/custord_q10.adm
+++ /dev/null
@@ -1,8 +0,0 @@
-{ "DataverseName": "Metadata", "DatasetName": "Dataset", "DataTypeName": "DatasetRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName" ], "PrimaryKey": [ "DataverseName", "DatasetName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "Timestamp": "Thu Sep 01 15:52:00 PDT 2011" }
-{ "DataverseName": "Metadata", "DatasetName": "Datatype", "DataTypeName": "DatatypeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatatypeName" ], "PrimaryKey": [ "DataverseName", "DatatypeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "Timestamp": "Thu Sep 01 15:52:00 PDT 2011" }
-{ "DataverseName": "Metadata", "DatasetName": "Dataverse", "DataTypeName": "DataverseRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName" ], "PrimaryKey": [ "DataverseName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "Timestamp": "Thu Sep 01 15:52:00 PDT 2011" }
-{ "DataverseName": "Metadata", "DatasetName": "Index", "DataTypeName": "IndexRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName", "IndexName" ], "PrimaryKey": [ "DataverseName", "DatasetName", "IndexName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "Timestamp": "Thu Sep 01 15:52:00 PDT 2011" }
-{ "DataverseName": "Metadata", "DatasetName": "Node", "DataTypeName": "NodeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "NodeName" ], "PrimaryKey": [ "NodeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "Timestamp": "Thu Sep 01 15:52:00 PDT 2011" }
-{ "DataverseName": "Metadata", "DatasetName": "Nodegroup", "DataTypeName": "NodeGroupRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "GroupName" ], "PrimaryKey": [ "GroupName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "Timestamp": "Tue Sep 06 09:29:34 PDT 2011" }
-{ "DataverseName": "custord", "DatasetName": "Customers", "DataTypeName": "CustomerType", "DatasetType": "EXTERNAL", "InternalDetails": null, "ExternalDetails": { "Adapter": "adapter.java", "HdfsPath": "hdfs://temp1/data1", "Splits": [ ], "Properties": [ { "Name": "n1", "Value": "v1" }, { "Name": "n3", "Value": "v3" }, { "Name": "n2", "Value": "v2" } ], "IsAtHdfs": true }, "Timestamp": "Mon Sep 12 17:07:35 PDT 2011" }
-{ "DataverseName": "custord", "DatasetName": "Orders", "DataTypeName": "OrderType", "DatasetType": "EXTERNAL", "InternalDetails": null, "ExternalDetails": { "Adapter": "adapter.java", "HdfsPath": "null", "Splits": [ { "NodeName": "nc1", "FileName": "/tmp1/data1" }, { "NodeName": "nc2", "FileName": "/tmp2/data2" } ], "Properties": [ ], "IsAtHdfs": false }, "Timestamp": "Mon Sep 12 17:08:14 PDT 2011" }
diff --git a/asterix-app/src/test/resources/metadata/results/custord_q4.adm b/asterix-app/src/test/resources/metadata/results/custord_q4.adm
deleted file mode 100644
index 652ad79..0000000
--- a/asterix-app/src/test/resources/metadata/results/custord_q4.adm
+++ /dev/null
@@ -1,4 +0,0 @@
-{ "cust_name": "Mike Rotruck", "cust_age": null, "order_total": 124.26f }
-{ "cust_name": "Mike Rotruck", "cust_age": null, "order_total": 97.20656f }
-{ "cust_name": "Jodi Alex", "cust_age": 19, "order_total": 14.2326f }
-{ "cust_name": "Jodi Alex", "cust_age": 19, "order_total": 7.206f }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/results/metadata_dataset.adm b/asterix-app/src/test/resources/metadata/results/metadata_dataset.adm
deleted file mode 100644
index 85a8973..0000000
--- a/asterix-app/src/test/resources/metadata/results/metadata_dataset.adm
+++ /dev/null
@@ -1,6 +0,0 @@
-{ "DataverseName": "Metadata", "DatasetName": "Dataset", "DataTypeName": "DatasetRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName" ], "PrimaryKey": [ "DataverseName", "DatasetName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "Timestamp": "Thu Sep 01 15:52:00 PDT 2011" }
-{ "DataverseName": "Metadata", "DatasetName": "Datatype", "DataTypeName": "DatatypeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatatypeName" ], "PrimaryKey": [ "DataverseName", "DatatypeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "Timestamp": "Thu Sep 01 15:52:00 PDT 2011" }
-{ "DataverseName": "Metadata", "DatasetName": "Dataverse", "DataTypeName": "DataverseRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName" ], "PrimaryKey": [ "DataverseName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "Timestamp": "Thu Sep 01 15:52:00 PDT 2011" }
-{ "DataverseName": "Metadata", "DatasetName": "Index", "DataTypeName": "IndexRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName", "IndexName" ], "PrimaryKey": [ "DataverseName", "DatasetName", "IndexName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "Timestamp": "Thu Sep 01 15:52:00 PDT 2011" }
-{ "DataverseName": "Metadata", "DatasetName": "Node", "DataTypeName": "NodeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "NodeName" ], "PrimaryKey": [ "NodeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "Timestamp": "Thu Sep 01 15:52:00 PDT 2011" }
-{ "DataverseName": "Metadata", "DatasetName": "Nodegroup", "DataTypeName": "NodeGroupRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "GroupName" ], "PrimaryKey": [ "GroupName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "Timestamp": "Tue Sep 06 09:29:34 PDT 2011" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/results/metadata_datatype.adm b/asterix-app/src/test/resources/metadata/results/metadata_datatype.adm
deleted file mode 100644
index 1ae69c3..0000000
--- a/asterix-app/src/test/resources/metadata/results/metadata_datatype.adm
+++ /dev/null
@@ -1,49 +0,0 @@
-{ "DataverseName": "Metadata", "DatatypeName": "DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DatasetName", "FieldType": "string" }, { "FieldName": "DataTypeName", "FieldType": "string" }, { "FieldName": "DatasetType", "FieldType": "string" }, { "FieldName": "InternalDetails", "FieldType": "Field_InternalDetails_in_DatasetRecordType" }, { "FieldName": "ExternalDetails", "FieldType": "Field_ExternalDetails_in_DatasetRecordType" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Sep 06 08:42:36 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "DatatypeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DatatypeName", "FieldType": "string" }, { "FieldName": "Derived", "FieldType": "Field_Derived_in_DatatypeRecordType" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "DataverseRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DataFormat", "FieldType": "string" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }\
-{ "DataverseName": "Metadata", "DatatypeName": "Field_ExternalDetails_in_DatasetRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Wed Sep 07 15:54:21 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType_ItemType" }, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "FieldName", "FieldType": "string" }, { "FieldName": "FieldType", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Wed Sep 07 19:02:47 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_NodeNames_in_NodeGroupRecordType", "Derived": { "Tag": "UNORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": "string", "OrderedList": null }, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_NodeStores_in_NodeRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Mon Sep 12 16:56:20 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_OrderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "string" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_PartitioningKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Wed Sep 07 19:03:39 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_PrimaryKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Wed Sep 07 19:11:05 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType_ItemType" }, "Timestamp": "Wed Sep 07 19:25:06 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Name", "FieldType": "string" }, { "FieldName": "Value", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Wed Sep 07 19:15:49 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_SearchKey_in_IndexRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_Splits_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_Splits_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType_ItemType" }, "Timestamp": "Wed Sep 07 19:27:12 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_Splits_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "NodeName", "FieldType": "string" }, { "FieldName": "FileName", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Wed Sep 07 19:27:59 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Field_UnorderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "string" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "IndexRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DatasetName", "FieldType": "string" }, { "FieldName": "IndexName", "FieldType": "string" }, { "FieldName": "IndexStructure", "FieldType": "string" }, { "FieldName": "SearchKey", "FieldType": "Field_SearchKey_in_IndexRecordType" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "NodeGroupRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "GroupName", "FieldType": "string" }, { "FieldName": "NodeNames", "FieldType": "Field_NodeNames_in_NodeGroupRecordType" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "NodeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "NodeName", "FieldType": "string" }, { "FieldName": "NumberOfCores", "FieldType": "int32" }, { "FieldName": "WorkingMemorySize", "FieldType": "int32" }, { "FieldName": "NodeStores", "FieldType": "Field_NodeStores_in_NodeRecordType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Mon Sep 12 16:58:48 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Tag", "FieldType": "string" }, { "FieldName": "IsAnonymous", "FieldType": "boolean" }, { "FieldName": "EnumValues", "FieldType": "Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "Record", "FieldType": "Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "Union", "FieldType": "Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "UnorderedList", "FieldType": "Field_UnorderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "OrderedList", "FieldType": "Field_OrderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Adapter", "FieldType": "string" }, { "FieldName": "HdfsPath", "FieldType": "string" }, { "FieldName": "Splits", "FieldType": "Field_Splits_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType" }, { "FieldName": "Properties", "FieldType": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType" }, { "FieldName": "IsAtHdfs", "FieldType": "boolean" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Wed Sep 07 19:28:39 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "FileStructure", "FieldType": "string" }, { "FieldName": "PartitioningStrategy", "FieldType": "string" }, { "FieldName": "PartitioningKey", "FieldType": "Field_PartitioningKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType" }, { "FieldName": "PrimaryKey", "FieldType": "Field_PrimaryKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType" }, { "FieldName": "GroupName", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Wed Sep 07 19:29:41 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "IsOpen", "FieldType": "boolean" }, { "FieldName": "Fields", "FieldType": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "boolean", "Derived": null, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "circle", "Derived": null, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "date", "Derived": null, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "datetime", "Derived": null, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "double", "Derived": null, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "duration", "Derived": null, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "float", "Derived": null, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "int16", "Derived": null, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "int32", "Derived": null, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "int64", "Derived": null, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "int8", "Derived": null, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "line2d", "Derived": null, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "null", "Derived": null, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "point2d", "Derived": null, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "point3d", "Derived": null, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "polygon2d", "Derived": null, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "string", "Derived": null, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
-{ "DataverseName": "Metadata", "DatatypeName": "time", "Derived": null, "Timestamp": "Sun May 08 16:32:43 PDT 2011" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/results/metadata_dataverse.adm b/asterix-app/src/test/resources/metadata/results/metadata_dataverse.adm
deleted file mode 100644
index e7e194f..0000000
--- a/asterix-app/src/test/resources/metadata/results/metadata_dataverse.adm
+++ /dev/null
@@ -1 +0,0 @@
-{ "DataverseName": "Metadata", "DataFormat": "edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat", "Timestamp": "Tue Sep 06 09:27:54 PDT 2011" }
diff --git a/asterix-app/src/test/resources/metadata/results/metadata_index.adm b/asterix-app/src/test/resources/metadata/results/metadata_index.adm
deleted file mode 100644
index a800f08..0000000
--- a/asterix-app/src/test/resources/metadata/results/metadata_index.adm
+++ /dev/null
@@ -1,9 +0,0 @@
-{ "DataverseName": "Metadata", "DatasetName": "Dataset", "IndexName": "$Dataset", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatasetName" ], "Timestamp": "Sun May 08 16:32:43 PDT 2011"}
-{ "DataverseName": "Metadata", "DatasetName": "Dataset", "IndexName": "DatatypeName", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatatypeName", "DatasetName" ], "Timestamp": "Sun May 08 16:32:43 PDT 2011"}
-{ "DataverseName": "Metadata", "DatasetName": "Dataset", "IndexName": "GroupName", "IndexStructure": "BTREE", "SearchKey": [ "GroupName", "DataverseName", "DatasetName" ], "Timestamp": "Sun May 08 16:32:43 PDT 2011"}
-{ "DataverseName": "Metadata", "DatasetName": "Datatype", "IndexName": "$Datatype", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatatypeName" ], "Timestamp": "Sun May 08 16:32:43 PDT 2011"}
-{ "DataverseName": "Metadata", "DatasetName": "Datatype", "IndexName": "DatatypeName", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "NestedDatatypeName", "TopDatatypeName" ], "Timestamp": "Sun May 08 16:32:43 PDT 2011"}
-{ "DataverseName": "Metadata", "DatasetName": "Dataverse", "IndexName": "$Dataverse", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName" ], "Timestamp": "Sun May 08 16:32:43 PDT 2011"}
-{ "DataverseName": "Metadata", "DatasetName": "Index", "IndexName": "$Index", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatasetName", "IndexName" ], "Timestamp": "Sun May 08 16:32:43 PDT 2011"}
-{ "DataverseName": "Metadata", "DatasetName": "Node", "IndexName": "$Node", "IndexStructure": "BTREE", "SearchKey": [ "NodeName" ], "Timestamp": "Sun May 08 16:32:43 PDT 2011"}
-{ "DataverseName": "Metadata", "DatasetName": "Nodegroup", "IndexName": "$Nodegroup", "IndexStructure": "BTREE", "SearchKey": [ "GroupName" ], "Timestamp": "Sun May 08 16:32:43 PDT 2011"}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/results/metadata_node.adm b/asterix-app/src/test/resources/metadata/results/metadata_node.adm
deleted file mode 100644
index eaba201..0000000
--- a/asterix-app/src/test/resources/metadata/results/metadata_node.adm
+++ /dev/null
@@ -1,2 +0,0 @@
-{ "NodeName": "nc1", "NumberOfCores": 0, "WorkingMemorySize": 0, "NodeStores": [ "/tmp/nc1/" ] }
-{ "NodeName": "nc2", "NumberOfCores": 0, "WorkingMemorySize": 0, "NodeStores": [ "/tmp/nc2/" ] }
diff --git a/asterix-app/src/test/resources/metadata/results/metadata_nodegroup.adm b/asterix-app/src/test/resources/metadata/results/metadata_nodegroup.adm
deleted file mode 100644
index d9e1bb0..0000000
--- a/asterix-app/src/test/resources/metadata/results/metadata_nodegroup.adm
+++ /dev/null
@@ -1 +0,0 @@
-{ "GroupName": "MetadataGroup", "NodeNames": {{ "nc1" }}, "Timestamp": "Tue Sep 06 17:10:32 PDT 2011" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/results/transaction/verify_failure_previous_success.adm b/asterix-app/src/test/resources/metadata/results/transaction/verify_failure_previous_success.adm
new file mode 100644
index 0000000..3d0da4d
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/transaction/verify_failure_previous_success.adm
@@ -0,0 +1,13 @@
+{ "DataverseName": "custord", "DatatypeName": "AddressType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "street", "FieldType": "StreetType" }, { "FieldName": "city", "FieldType": "string" }, { "FieldName": "state", "FieldType": "string" }, { "FieldName": "zip", "FieldType": "int16" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "CustomerType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": false, "Fields": [ { "FieldName": "cid", "FieldType": "int32" }, { "FieldName": "name", "FieldType": "string" }, { "FieldName": "age", "FieldType": "Field_age_in_CustomerType" }, { "FieldName": "address", "FieldType": "Field_address_in_CustomerType" }, { "FieldName": "interests", "FieldType": "Field_interests_in_CustomerType" }, { "FieldName": "children", "FieldType": "Field_children_in_CustomerType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_address_in_CustomerType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "AddressType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_age_in_CustomerType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "int32" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_children_in_CustomerType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_children_in_CustomerType_ItemType" }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_children_in_CustomerType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "name", "FieldType": "string" }, { "FieldName": "dob", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_interests_in_CustomerType", "Derived": { "Tag": "UNORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": "string", "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_items_in_OrderType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_items_in_OrderType_ItemType" }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_items_in_OrderType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "number", "FieldType": "int64" }, { "FieldName": "storeIds", "FieldType": "Field_storeIds_in_Field_items_in_OrderType_ItemType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_number_in_StreetType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "int32" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_storeIds_in_Field_items_in_OrderType_ItemType", "Derived": { "Tag": "UNORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": "int8", "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "OrderType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "oid", "FieldType": "int32" }, { "FieldName": "cid", "FieldType": "int32" }, { "FieldName": "orderstatus", "FieldType": "string" }, { "FieldName": "orderpriority", "FieldType": "string" }, { "FieldName": "clerk", "FieldType": "string" }, { "FieldName": "total", "FieldType": "float" }, { "FieldName": "items", "FieldType": "Field_items_in_OrderType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "StreetType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": false, "Fields": [ { "FieldName": "number", "FieldType": "Field_number_in_StreetType" }, { "FieldName": "name", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/transaction/verify_failure_subsequent_no_execution.adm b/asterix-app/src/test/resources/metadata/results/transaction/verify_failure_subsequent_no_execution.adm
new file mode 100644
index 0000000..7ba26bd
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/transaction/verify_failure_subsequent_no_execution.adm
@@ -0,0 +1 @@
+{ "DataverseName": "custord", "DatasetName": "Customers", "IndexName": "Customers", "IndexStructure": "BTREE", "SearchKey": [ "cid", "name" ], "IsPrimary": true, "Timestamp": "Sat Nov 24 17:23:18 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata/testsuite.xml b/asterix-app/src/test/resources/metadata/testsuite.xml
new file mode 100644
index 0000000..b1b303e
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/testsuite.xml
@@ -0,0 +1,179 @@
+<test-suite xmlns="urn:xml.testframework.asterix.ics.uci.edu" ResultOffsetPath="results" QueryOffsetPath="queries" QueryFileExtension=".aql">
+ <test-group name="basic">
+ <test-case FilePath="basic">
+ <compilation-unit name="meta01">
+ <output-file compare="Text">meta01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta02">
+ <output-file compare="Text">meta02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta03">
+ <output-file compare="Text">meta03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta04">
+ <output-file compare="Text">meta04.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta05">
+ <output-file compare="Text">meta05.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta06">
+ <output-file compare="Text">meta06.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta07">
+ <output-file compare="Text">meta07.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta08">
+ <output-file compare="Text">meta08.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta09">
+ <output-file compare="Text">meta09.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta10">
+ <output-file compare="Text">meta10.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta11">
+ <output-file compare="Text">meta11.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta12">
+ <output-file compare="Text">meta12.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta13">
+ <output-file compare="Text">meta13.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta14">
+ <output-file compare="Text">meta14.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta15">
+ <output-file compare="Text">meta15.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta16">
+ <output-file compare="Text">meta16.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta17">
+ <output-file compare="Text">meta17.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta18">
+ <output-file compare="Text">meta18.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta19">
+ <output-file compare="Text">meta19.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta20">
+ <output-file compare="Text">meta20.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="basic">
+ <compilation-unit name="meta21">
+ <output-file compare="Text">meta21.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="exception">
+ <test-case FilePath="exception">
+ <compilation-unit name="issue_239_drop_system_dataset_1">
+ <output-file compare="Text">none.adm</output-file>
+ <expected-error>MetadataException</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="exception">
+ <compilation-unit name="issue_239_drop_system_dataset_2">
+ <output-file compare="Text">none.adm</output-file>
+ <expected-error>MetadataException</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="exception">
+ <compilation-unit name="issue_239_drop_system_dataset_3">
+ <output-file compare="Text">none.adm</output-file>
+ <expected-error>MetadataException</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="exception">
+ <compilation-unit name="issue_239_drop_system_dataset_4">
+ <output-file compare="Text">none.adm</output-file>
+ <expected-error>MetadataException</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="exception">
+ <compilation-unit name="issue_239_drop_system_dataset_5">
+ <output-file compare="Text">none.adm</output-file>
+ <expected-error>MetadataException</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="exception">
+ <compilation-unit name="issue_239_drop_system_dataset_6">
+ <output-file compare="Text">none.adm</output-file>
+ <expected-error>MetadataException</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="exception">
+ <compilation-unit name="issue_239_drop_system_dataset_7">
+ <output-file compare="Text">none.adm</output-file>
+ <expected-error>MetadataException</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="exception">
+ <compilation-unit name="issue_239_drop_system_dataset_8">
+ <output-file compare="Text">none.adm</output-file>
+ <expected-error>MetadataException</expected-error>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="transaction">
+ <test-case FilePath="transaction">
+ <compilation-unit name="failure_previous_success">
+ <output-file compare="Text">failure_previous_success.adm</output-file>
+ <expected-error>MetadataException</expected-error>
+ </compilation-unit>
+ <compilation-unit name="verify_failure_previous_success">
+ <output-file compare="Text">verify_failure_previous_success.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="transaction">
+ <compilation-unit name="failure_subsequent_no_execution">
+ <output-file compare="Text">failure_subsequent_no_execution.adm</output-file>
+ <expected-error>MetadataException</expected-error>
+ </compilation-unit>
+ <compilation-unit name="verify_failure_subsequent_no_execution">
+ <output-file compare="Text">verify_failure_subsequent_no_execution.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+</test-suite>
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join-multipred.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join-multipred.aql
new file mode 100644
index 0000000..9b83718
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join-multipred.aql
@@ -0,0 +1,48 @@
+/*
+ * Description : Equi joins two datasets, Customers and Orders, based on the customer id.
+ * Given the 'indexnl' hint we expect the join to be transformed
+ * into an indexed nested-loop join using Customers' primary index.
+ * We expect the additional predicates to be put into a select above the
+ * primary index search.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ lastorder: {
+ oid: int32,
+ total: float
+ }
+}
+
+create type OrderType as closed {
+ oid: int32,
+ cid: int32,
+ orderstatus: string,
+ orderpriority: string,
+ clerk: string,
+ total: float
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Orders(OrderType) partitioned by key oid;
+
+write output to nc1:"rttest/btree-index-join_primary-equi-join-multipred.adm";
+
+for $c in dataset('Customers')
+for $o in dataset('Orders')
+where $c.cid /*+ indexnl */ = $o.cid and $c.name < $o.orderstatus and $c.age < $o.cid
+return {"customer":$c, "order": $o}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_01.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_01.aql
new file mode 100644
index 0000000..f7f8d6c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_01.aql
@@ -0,0 +1,46 @@
+/*
+ * Description : Equi joins two datasets, Customers and Orders, based on the customer id.
+ * Given the 'indexnl' hint we expect the join to be transformed
+ * into an indexed nested-loop join using Customers' primary index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ lastorder: {
+ oid: int32,
+ total: float
+ }
+}
+
+create type OrderType as closed {
+ oid: int32,
+ cid: int32,
+ orderstatus: string,
+ orderpriority: string,
+ clerk: string,
+ total: float
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Orders(OrderType) partitioned by key oid;
+
+write output to nc1:"rttest/btree-index-join_primary-equi-join_01.adm";
+
+for $c in dataset('Customers')
+for $o in dataset('Orders')
+where $c.cid /*+ indexnl */ = $o.cid
+return {"customer":$c, "order": $o}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_02.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_02.aql
new file mode 100644
index 0000000..9ac6140
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_02.aql
@@ -0,0 +1,46 @@
+/*
+ * Description : Equi joins two datasets, Customers and Orders, based on the customer id.
+ * Given the 'indexnl' hint we expect the join to be transformed
+ * into an indexed nested-loop join using Customers' primary index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ lastorder: {
+ oid: int32,
+ total: float
+ }
+}
+
+create type OrderType as closed {
+ oid: int32,
+ cid: int32,
+ orderstatus: string,
+ orderpriority: string,
+ clerk: string,
+ total: float
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Orders(OrderType) partitioned by key oid;
+
+write output to nc1:"rttest/btree-index-join_primary-equi-join_02.adm";
+
+for $o in dataset('Orders')
+for $c in dataset('Customers')
+where $o.cid /*+ indexnl */ = $c.cid
+return {"customer":$c, "order": $o}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_03.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_03.aql
new file mode 100644
index 0000000..e33e2a9
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_03.aql
@@ -0,0 +1,36 @@
+/*
+ * Description : Self-equi joins a dataset, Customers, based on the customer id.
+ * Given the 'indexnl' hint we expect the join to be transformed
+ * into an indexed nested-loop join using Customers' primary index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ lastorder: {
+ oid: int32,
+ total: float
+ }
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+write output to nc1:"rttest/btree-index-join_primary-equi-join_03.adm";
+
+for $c1 in dataset('Customers')
+for $c2 in dataset('Customers')
+where $c1.cid /*+ indexnl */ = $c2.cid
+return {"customer1":$c1, "customer2":$c2}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join-multiindex.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join-multiindex.aql
new file mode 100644
index 0000000..44cdef8
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join-multiindex.aql
@@ -0,0 +1,60 @@
+/*
+ * Description : Equi joins two datasets, FacebookUsers and FacebookMessages, based on their user's id.
+ * We first expect FacebookUsers' primary index to be used
+ * to satisfy the range condition on it's primary key.
+ * FacebookMessages has a secondary btree index on author-id-copy, and given the 'indexnl' hint
+ * we expect the join to be transformed into an indexed nested-loop join.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type EmploymentType as closed {
+ organization-name: string,
+ start-date: date,
+ end-date: date?
+}
+
+create type FacebookUserType as closed {
+ id: int32,
+ id-copy: int32,
+ alias: string,
+ name: string,
+ user-since: datetime,
+ user-since-copy: datetime,
+ friend-ids: {{ int32 }},
+ employment: [EmploymentType]
+}
+
+create type FacebookMessageType as closed {
+ message-id: int32,
+ message-id-copy: int32,
+ author-id: int32,
+ author-id-copy: int32,
+ in-response-to: int32?,
+ sender-location: point?,
+ message: string
+}
+
+create dataset FacebookUsers(FacebookUserType)
+partitioned by key id;
+
+create dataset FacebookMessages(FacebookMessageType)
+partitioned by key message-id;
+
+create index fbmIdxAutId if not exists on FacebookMessages(author-id-copy);
+
+write output to nc1:"rttest/btree-index-join_title-secondary-equi-join-multiindex.adm";
+
+for $user in dataset('FacebookUsers')
+for $message in dataset('FacebookMessages')
+where $user.id /*+ indexnl */ = $message.author-id-copy
+and $user.id >= 11000 and $user.id <= 12000
+return {
+ "fbu-ID": $user.id,
+ "fbm-auth-ID": $message.author-id,
+ "uname": $user.name,
+ "message": $message.message
+}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join-multipred.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join-multipred.aql
new file mode 100644
index 0000000..03cbf24
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join-multipred.aql
@@ -0,0 +1,41 @@
+/*
+ * Description : Equi joins two datasets, DBLP and CSX, based on their title.
+ * DBLP has a secondary btree index on title, and given the 'indexnl' hint
+ * we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the additional predicates to be put into a select above the
+ * primary index search.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create type CSXType as closed {
+ id: int32,
+ csxid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create dataset CSX(CSXType) partitioned by key id;
+
+create index title_index on DBLP(title);
+
+write output to nc1:"rttest/btree-index-join_title-secondary-equi-join-multipred.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+where $a.title /*+ indexnl */ = $b.title and $a.authors < $b.authors and $a.misc > $b.misc
+return {"arec": $a, "brec": $b}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_01.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_01.aql
new file mode 100644
index 0000000..e07eee5
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_01.aql
@@ -0,0 +1,39 @@
+/*
+ * Description : Equi joins two datasets, DBLP and CSX, based on their title.
+ * DBLP has a secondary btree index on title, and given the 'indexnl' hint
+ * we expect the join to be transformed into an indexed nested-loop join.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create type CSXType as closed {
+ id: int32,
+ csxid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create dataset CSX(CSXType) partitioned by key id;
+
+create index title_index on DBLP(title);
+
+write output to nc1:"rttest/btree-index-join_title-secondary-equi-join_01.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+where $a.title /*+ indexnl */ = $b.title
+return {"arec": $a, "brec": $b}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_02.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_02.aql
new file mode 100644
index 0000000..2546244
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_02.aql
@@ -0,0 +1,39 @@
+/*
+ * Description : Equi joins two datasets, DBLP and CSX, based on their title.
+ * CSX has a secondary btree index on title, and given the 'indexnl' hint
+ * we expect the join to be transformed into an indexed nested-loop join.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create type CSXType as closed {
+ id: int32,
+ csxid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create dataset CSX(CSXType) partitioned by key id;
+
+create index title_index on CSX(title);
+
+write output to nc1:"rttest/btree-index-join_title-secondary-equi-join_02.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+where $a.title /*+ indexnl */ = $b.title
+return {"arec": $a, "brec": $b}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_03.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_03.aql
new file mode 100644
index 0000000..251c88e
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_03.aql
@@ -0,0 +1,29 @@
+/*
+ * Description : Equi self-joins a dataset, DBLP, based on its title.
+ * DBLP has a secondary btree index on title, and given the 'indexnl' hint
+ * we expect the join to be transformed into an indexed nested-loop join.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create index title_index on DBLP(title);
+
+write output to nc1:"rttest/btree-index-join_title-secondary-equi-join_03.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('DBLP')
+where $a.title /*+ indexnl */ = $b.title
+return {"arec": $a, "brec": $b}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-01.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-01.aql
new file mode 100644
index 0000000..d3d8d69
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-01.aql
@@ -0,0 +1,26 @@
+/*
+ * Description : This test is intended to verify that the primary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// Please note this is a Negative test and the BTree index should NOT be used in the plan.
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-01.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+// create internal dataset with primary index (composite key) defined on fname,lname fields
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.fname > "Roger"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-02.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-02.aql
new file mode 100644
index 0000000..eeded38
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-02.aql
@@ -0,0 +1,26 @@
+/*
+ * Description : This test is intended to verify that the primary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// This is a Negative test - prefix search, BTree index should not be used in the plan.
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-02.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+// create internal dataset with primary index defined on fname,lname fields
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.fname >= "Susan"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-03.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-03.aql
new file mode 100644
index 0000000..1046edd
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-03.aql
@@ -0,0 +1,26 @@
+/*
+ * Description : This test is intended to verify that the primary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// Negative test - prefix search, BTree index should not be used.
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-03.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+// create internal dataset with primary index defined on fname,lname fields
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.fname < "Isa"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-04.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-04.aql
new file mode 100644
index 0000000..2bee1fe
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-04.aql
@@ -0,0 +1,26 @@
+/*
+ * Description : This test is intended to verify that the primary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// Negative test - prefix search, BTree index should not be used in query plan
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-04.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+// create internal dataset with primary index defined on fname,lname fields
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.fname <= "Vanpatten"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-05.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-05.aql
new file mode 100644
index 0000000..0423290
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-05.aql
@@ -0,0 +1,26 @@
+/*
+ * Description : This test is intended to verify that the primary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// Negative test - BTree index should NOT be used in query plan
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-05.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+// create internal dataset with primary index defined on fname,lname fields
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.fname != "Max"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-06.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-06.aql
new file mode 100644
index 0000000..313a4fa
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-06.aql
@@ -0,0 +1,26 @@
+/*
+ * Description : This test is intended to verify that the primary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// Negative test - prefix search, BTree index should NOT be used in the query plan.
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-06.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+// create internal dataset with primary index defined on fname,lname fields
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.fname = "Julio"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-07.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-07.aql
new file mode 100644
index 0000000..e9063eb
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-07.aql
@@ -0,0 +1,27 @@
+/*
+ * Description : This test is intended to verify that the primary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// THE BTREE INDEX IN THIS CASE SHOULD NOT BE PICKED UP!!!!
+// Verify that the optimized query plan does not have the BTree search
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-07.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+// create internal dataset with primary index defined on fname,lname fields
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.lname = "Kim"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-08.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-08.aql
new file mode 100644
index 0000000..9919457
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-08.aql
@@ -0,0 +1,22 @@
+/*
+ * Description : This test is intended to verify that the primary BTree index is used in the optimized query plan
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-08.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.fname = "Young Seok" and $emp.lname = "Kim"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-09.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-09.aql
new file mode 100644
index 0000000..8973d2d
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-09.aql
@@ -0,0 +1,26 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the primary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// Negative test
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-09.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.fname = "Julio" or $emp.lname = "Malaika"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-10.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-10.aql
new file mode 100644
index 0000000..5076e97
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-10.aql
@@ -0,0 +1,24 @@
+/*
+ * Description : BTree Index verification (usage) test
+ * : This test is intended to verify that the primary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-10.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.fname > "Alex" and $emp.lname < "Zach"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-11.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-11.aql
new file mode 100644
index 0000000..feeaaad
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-11.aql
@@ -0,0 +1,24 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the primary BTree index is NOT used
+ * : in the optimized query plan for predicates.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-11.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.fname > "Allan" and $emp.lname < "Zubi"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-12.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-12.aql
new file mode 100644
index 0000000..740cca6
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-12.aql
@@ -0,0 +1,26 @@
+/*
+ * Description : BTree Index verification (usage) test
+ * : This test is intended to verify that the primary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// Negative test - prefix search
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-12.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.fname > "Allan" and $emp.lname = "Xu"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-13.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-13.aql
new file mode 100644
index 0000000..47e81b2
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-13.aql
@@ -0,0 +1,26 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the primary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// Negative test - prefix search
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-13.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.fname = "Julio" and $emp.lname < "Xu"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-14.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-14.aql
new file mode 100644
index 0000000..0ec31aa
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-14.aql
@@ -0,0 +1,24 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the primary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-14.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.fname >= "Michael" and $emp.lname <= "Xu"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-15.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-15.aql
new file mode 100644
index 0000000..f595804
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-15.aql
@@ -0,0 +1,24 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the primary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-15.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.fname > "Craig" and $emp.lname > "Kevin" and $emp.fname < "Mary" and $emp.lname < "Tomes"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-16.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-16.aql
new file mode 100644
index 0000000..022bd50
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-16.aql
@@ -0,0 +1,24 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the primary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-16.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.fname >= "Craig" and $emp.lname >= "Kevin" and $emp.fname <= "Mary" and $emp.lname <= "Tomes"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-17.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-17.aql
new file mode 100644
index 0000000..ad114cd
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-17.aql
@@ -0,0 +1,24 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the primary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-17.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.fname <= "Craig" and $emp.lname > "Kevin"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-18.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-18.aql
new file mode 100644
index 0000000..43b0bd3
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-18.aql
@@ -0,0 +1,24 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the primary BTree index is NOT used
+ * : in the optimized query plan
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-18.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.fname != "Michael" and $emp.lname != "Carey"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-19.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-19.aql
new file mode 100644
index 0000000..fe2dc41
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-19.aql
@@ -0,0 +1,24 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the primary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-19.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.fname > "Craig" and $emp.lname > "Kevin" and $emp.fname <= "Mary" and $emp.lname <= "Tomes"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-20.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-20.aql
new file mode 100644
index 0000000..c817492
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-20.aql
@@ -0,0 +1,24 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the primary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-20.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key fname,lname;
+
+for $emp in dataset('testdst')
+where $emp.fname >= "Craig" and $emp.lname >= "Kevin" and $emp.fname < "Mary" and $emp.lname < "Tomes"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-21.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-21.aql
new file mode 100644
index 0000000..46c107c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-21.aql
@@ -0,0 +1,24 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the primary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-21.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key fname;
+
+for $emp in dataset('testdst')
+where $emp.fname > "Max"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-22.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-22.aql
new file mode 100644
index 0000000..0f74980
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-22.aql
@@ -0,0 +1,24 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the primary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-22.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key fname;
+
+for $emp in dataset('testdst')
+where $emp.fname >= "Sofia"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-23.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-23.aql
new file mode 100644
index 0000000..c942165
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-23.aql
@@ -0,0 +1,24 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the primary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-23.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key fname;
+
+for $emp in dataset('testdst')
+where $emp.fname < "Chen"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-24.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-24.aql
new file mode 100644
index 0000000..0c66008
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-24.aql
@@ -0,0 +1,24 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the primary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-24.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key fname;
+
+for $emp in dataset('testdst')
+where $emp.fname <= "Julio"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-25.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-25.aql
new file mode 100644
index 0000000..770baf5
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-25.aql
@@ -0,0 +1,24 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the primary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-25.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key fname;
+
+for $emp in dataset('testdst')
+where $emp.fname > "Neil" and $emp.fname < "Roger"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-26.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-26.aql
new file mode 100644
index 0000000..ba5de37
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-26.aql
@@ -0,0 +1,24 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the primary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-26.adm";
+
+create type TestType as open {
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key fname;
+
+for $emp in dataset('testdst')
+where $emp.fname >= "Max" and $emp.fname <= "Roger"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-31.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-31.aql
new file mode 100644
index 0000000..5117da4
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-31.aql
@@ -0,0 +1,29 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// Please note this is a Negative test and the BTree index should NOT be used in the plan.
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-31.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname > "Roger"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-32.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-32.aql
new file mode 100644
index 0000000..37b46b3
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-32.aql
@@ -0,0 +1,29 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// This is a Negative test - prefix search, BTree index should not be used in the plan.
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-32.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname >= "Susan"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-33.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-33.aql
new file mode 100644
index 0000000..8f1b4d5
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-33.aql
@@ -0,0 +1,29 @@
+/*
+ * Description : BTree Index verification (usage) test
+ * : This test is intended to verify that the secondary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// Negative test - prefix search, BTree index should not be used.
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-33.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname < "Isa"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-34.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-34.aql
new file mode 100644
index 0000000..5042bd9
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-34.aql
@@ -0,0 +1,29 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// Negative test - prefix search, BTree index should not be used in query plan
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-34.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname <= "Vanpatten"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-35.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-35.aql
new file mode 100644
index 0000000..2e38330
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-35.aql
@@ -0,0 +1,29 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// Negative test - BTree index should NOT be used in query plan
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-35.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname != "Max"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-36.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-36.aql
new file mode 100644
index 0000000..84bdcd4
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-36.aql
@@ -0,0 +1,29 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// Negative test - prefix search, BTree index should NOT be used in the query plan.
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-36.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname = "Julio"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-37.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-37.aql
new file mode 100644
index 0000000..73133c2
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-37.aql
@@ -0,0 +1,29 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is NOT used in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// THE BTREE INDEX IN THIS CASE SHOULD NOT BE PICKED UP!!!!
+// Verify that the optimized query plan does not have the BTree search
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-37.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.lname = "Kim"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-38.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-38.aql
new file mode 100644
index 0000000..3f844ee
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-38.aql
@@ -0,0 +1,26 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is used in the optimized query plan
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-38.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname = "Young Seok" and $emp.lname = "Kim"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-39.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-39.aql
new file mode 100644
index 0000000..3813e48
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-39.aql
@@ -0,0 +1,29 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// Negative test
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-39.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname = "Julio" or $emp.lname = "Malaika"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-40.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-40.aql
new file mode 100644
index 0000000..4e13597
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-40.aql
@@ -0,0 +1,27 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-40.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname > "Alex" and $emp.lname < "Zach"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-41.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-41.aql
new file mode 100644
index 0000000..c724cbe
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-41.aql
@@ -0,0 +1,27 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-41.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname > "Allan" and $emp.lname < "Zubi"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-42.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-42.aql
new file mode 100644
index 0000000..06c93b0
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-42.aql
@@ -0,0 +1,29 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// Negative test - prefix search
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-42.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname > "Allan" and $emp.lname = "Xu"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-43.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-43.aql
new file mode 100644
index 0000000..490becb
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-43.aql
@@ -0,0 +1,29 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+// Negative test - prefix search
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-43.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname = "Julio" and $emp.lname < "Xu"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-44.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-44.aql
new file mode 100644
index 0000000..f75f3de
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-44.aql
@@ -0,0 +1,27 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-44.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname >= "Michael" and $emp.lname <= "Xu"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-45.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-45.aql
new file mode 100644
index 0000000..6717780
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-45.aql
@@ -0,0 +1,27 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-45.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname > "Craig" and $emp.lname > "Kevin" and $emp.fname < "Mary" and $emp.lname < "Tomes"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-46.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-46.aql
new file mode 100644
index 0000000..8a508b3
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-46.aql
@@ -0,0 +1,27 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-46.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname >= "Craig" and $emp.lname >= "Kevin" and $emp.fname <= "Mary" and $emp.lname <= "Tomes"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-47.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-47.aql
new file mode 100644
index 0000000..70e8185
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-47.aql
@@ -0,0 +1,27 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is NOT used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-47.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname <= "Craig" and $emp.lname > "Kevin"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-48.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-48.aql
new file mode 100644
index 0000000..bb6f24d
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-48.aql
@@ -0,0 +1,27 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is NOT used
+ * : in the optimized query plan
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-48.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname != "Michael" and $emp.lname != "Carey"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-49.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-49.aql
new file mode 100644
index 0000000..6d11235
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-49.aql
@@ -0,0 +1,28 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-49.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+// create internal dataset
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname > "Craig" and $emp.lname > "Kevin" and $emp.fname <= "Mary" and $emp.lname <= "Tomes"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-50.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-50.aql
new file mode 100644
index 0000000..3a91c09
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-50.aql
@@ -0,0 +1,27 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-50.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname >= "Craig" and $emp.lname >= "Kevin" and $emp.fname < "Mary" and $emp.lname < "Tomes"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-51.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-51.aql
new file mode 100644
index 0000000..3be3875
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-51.aql
@@ -0,0 +1,27 @@
+/*
+ * Description : BTree Index verification test
+ * : This test is intended to verify that the secondary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-51.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname,lname);
+
+for $emp in dataset('testdst')
+where $emp.fname >= "Craig" and $emp.lname <= "Kevin" and $emp.fname <= "Mary" and $emp.lname >= "Tomes"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-52.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-52.aql
new file mode 100644
index 0000000..7b52ec9
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-52.aql
@@ -0,0 +1,26 @@
+/*
+ * Description : This test is intended to verify that the secondary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-52.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname);
+
+for $emp in dataset('testdst')
+where $emp.fname > "Max"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-53.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-53.aql
new file mode 100644
index 0000000..45536b5
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-53.aql
@@ -0,0 +1,26 @@
+/*
+ * Description : This test is intended to verify that the secondary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-53.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname);
+
+for $emp in dataset('testdst')
+where $emp.fname >= "Sofia"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-54.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-54.aql
new file mode 100644
index 0000000..f1a3cb5
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-54.aql
@@ -0,0 +1,26 @@
+/*
+ * Description : This test is intended to verify that the secondary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-54.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname);
+
+for $emp in dataset('testdst')
+where $emp.fname < "Chen"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-55.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-55.aql
new file mode 100644
index 0000000..bbeca00
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-55.aql
@@ -0,0 +1,26 @@
+/*
+ * Description : This test is intended to verify that the secondary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-55.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname);
+
+for $emp in dataset('testdst')
+where $emp.fname <= "Julio"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-56.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-56.aql
new file mode 100644
index 0000000..7ecfea9
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-56.aql
@@ -0,0 +1,26 @@
+/*
+ * Description : This test is intended to verify that the primary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-56.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname);
+
+for $emp in dataset('testdst')
+where $emp.fname > "Neil" and $emp.fname < "Roger"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-57.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-57.aql
new file mode 100644
index 0000000..2183f69
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-57.aql
@@ -0,0 +1,26 @@
+/*
+ * Description : This test is intended to verify that the secondary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-57.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname);
+
+for $emp in dataset('testdst')
+where $emp.fname >= "Max" and $emp.fname <= "Roger"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-58.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-58.aql
new file mode 100644
index 0000000..bdf16b6
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-58.aql
@@ -0,0 +1,26 @@
+/*
+ * Description : This test is intended to verify that the secondary BTree index is used
+ * : in the optimized query plan.
+ * Expected Result : Success
+ * Date : 13th Aug 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-58.adm";
+
+create type TestType as open {
+ id : int32,
+ fname : string,
+ lname : string
+}
+
+create dataset testdst(TestType) partitioned by key id;
+
+create index sec_Idx on testdst(fname);
+
+for $emp in dataset('testdst')
+where $emp.fname = "Max"
+return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/count-tweets.aql b/asterix-app/src/test/resources/optimizerts/queries/count-tweets.aql
index 5e4cde1..651cf88 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/count-tweets.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/count-tweets.aql
@@ -6,7 +6,7 @@
id: int32,
tweetid: int64,
loc: point,
- time: string,
+ time: datetime,
text: string
}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-contains-panic.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-contains-panic.aql
index 66ef43b..31c0d03 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-contains-panic.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-contains-panic.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(title) type ngram(3);
write output to nc1:"rttest/inverted-index-basic_ngram-contains-panic.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-contains.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-contains.aql
index 0aa8056..9851cd8 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-contains.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-contains.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(title) type ngram(3);
write output to nc1:"rttest/inverted-index-basic_ngram-contains.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-check-panic.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-check-panic.aql
index 21e41f8..4608aeb 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-check-panic.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-check-panic.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(authors) type ngram(3);
write output to nc1:"rttest/inverted-index-basic_ngram-edit-distance-check-panic.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-check.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-check.aql
index ff3728d..7b264b7 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-check.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-check.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(authors) type ngram(3);
write output to nc1:"rttest/inverted-index-basic_ngram-edit-distance-check.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-panic.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-panic.aql
index c993c57..9412cf3 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-panic.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-panic.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(authors) type ngram(3);
write output to nc1:"rttest/inverted-index-basic_ngram-edit-distance-panic.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance.aql
index a143cde..d6be7d4 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(authors) type ngram(3);
write output to nc1:"rttest/inverted-index-basic_ngram-edit-distance.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-fuzzyeq-edit-distance.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-fuzzyeq-edit-distance.aql
index 87de1fb..b241311 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-fuzzyeq-edit-distance.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-fuzzyeq-edit-distance.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(authors) type ngram(3);
write output to nc1:"rttest/inverted-index-basic_ngram-fuzzyeq-edit-distance.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-fuzzyeq-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-fuzzyeq-jaccard.aql
index 3db4c92..33f9d5a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-fuzzyeq-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-fuzzyeq-jaccard.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(title) type ngram(3);
write output to nc1:"rttest/inverted-index-basic_ngram-fuzzyeq-jaccard.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-jaccard-check.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-jaccard-check.aql
index c39d531..376415f 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-jaccard-check.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-jaccard-check.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(title) type ngram(3);
write output to nc1:"rttest/inverted-index-basic_ngram-jaccard-check.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-jaccard.aql
index 3855ade..ef7143a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-jaccard.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(title) type ngram(3);
write output to nc1:"rttest/inverted-index-basic_ngram-jaccard.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-check-panic.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-check-panic.aql
index 6a6700a..8209572 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-check-panic.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-check-panic.aql
@@ -25,10 +25,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-basic_olist-edit-distance-check-panic.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-check.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-check.aql
index f705a4a..b55a516 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-check.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-check.aql
@@ -25,10 +25,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-basic_olist-edit-distance-check.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-panic.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-panic.aql
index 1fc7906..63bead1 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-panic.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-panic.aql
@@ -25,10 +25,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-basic_olist-edit-distance-panic.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance.aql
index 70268f5..7958fb4 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance.aql
@@ -25,10 +25,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-basic_olist-edit-distance.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-fuzzyeq-edit-distance.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-fuzzyeq-edit-distance.aql
index 90ce266..f156bd2 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-fuzzyeq-edit-distance.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-fuzzyeq-edit-distance.aql
@@ -25,10 +25,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-basic_olist-fuzzyeq-edit-distance.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-fuzzyeq-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-fuzzyeq-jaccard.aql
index 09da02e..6632189 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-fuzzyeq-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-fuzzyeq-jaccard.aql
@@ -25,10 +25,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-basic_olist-fuzzyeq-jaccard.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-jaccard-check.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-jaccard-check.aql
index 18721c5..61dcc7f 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-jaccard-check.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-jaccard-check.aql
@@ -25,10 +25,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-basic_olist-jaccard-check.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-jaccard.aql
index fa2291c..7af2161 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-jaccard.aql
@@ -25,10 +25,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-basic_olist-jaccard.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-fuzzyeq-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-fuzzyeq-jaccard.aql
index 89c2dac..d65a517 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-fuzzyeq-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-fuzzyeq-jaccard.aql
@@ -25,10 +25,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-basic_ulist-fuzzyeq-jaccard.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard-check.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard-check.aql
index 8089d6d..9551294 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard-check.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard-check.aql
@@ -25,10 +25,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-basic_ulist-jaccard.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard.aql
index 547f7e2..6580bd0 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard.aql
@@ -25,10 +25,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-basic_ulist-jaccard.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-contains.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-contains.aql
index 0b5367b..eee681a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-contains.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-contains.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index keyword_index on DBLP(title) type keyword;
write output to nc1:"rttest/inverted-index-basic_word-contains.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-fuzzyeq-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-fuzzyeq-jaccard.aql
index 39b247d..fb6d0e8 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-fuzzyeq-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-fuzzyeq-jaccard.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index keyword_index on DBLP(title) type keyword;
write output to nc1:"rttest/inverted-index-basic_word-fuzzyeq-jaccard.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-jaccard-check.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-jaccard-check.aql
index f1d3d4b..10ca5ce 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-jaccard-check.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-jaccard-check.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index keyword_index on DBLP(title) type keyword;
write output to nc1:"rttest/inverted-index-basic_word-jaccard-check.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-jaccard.aql
index 16fb8d3..7f544b6 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-jaccard.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index keyword_index on DBLP(title) type keyword;
write output to nc1:"rttest/inverted-index-basic_word-jaccard.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.aql
index 8c9500f..4d6bfd9 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.aql
@@ -20,10 +20,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(authors) type ngram(3);
write output to nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let-panic-nopanic_01.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.aql
index 55bd024..a4d4163 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.aql
@@ -20,10 +20,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(authors) type ngram(3);
write output to nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let-panic-nopanic_01.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic.aql
index 458425f..d6f58fc 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(authors) type ngram(3);
write output to nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let-panic.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let.aql
index f5c9a18..24d3202 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(authors) type ngram(3);
write output to nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-jaccard-check-let.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-jaccard-check-let.aql
index 5d3758e..de57848 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-jaccard-check-let.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-jaccard-check-let.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(title) type ngram(3);
write output to nc1:"rttest/inverted-index-complex_ngram-jaccard-check-let.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-jaccard-check-multi-let.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-jaccard-check-multi-let.aql
index 30d97b8..2eed598 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-jaccard-check-multi-let.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-jaccard-check-multi-let.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(title) type ngram(3);
write output to nc1:"rttest/inverted-index-complex_ngram-jaccard-check-multi-let.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-edit-distance-check-let-panic.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-edit-distance-check-let-panic.aql
index 51e66a1..337eced 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-edit-distance-check-let-panic.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-edit-distance-check-let-panic.aql
@@ -26,10 +26,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-complex_olist-edit-distance-check-let-panic.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-edit-distance-check-let.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-edit-distance-check-let.aql
index 2d6c4cd..c3be0bd 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-edit-distance-check-let.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-edit-distance-check-let.aql
@@ -26,10 +26,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-complex_olist-edit-distance-check-let.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-jaccard-check-let.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-jaccard-check-let.aql
index ff9d8e6..0652131 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-jaccard-check-let.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-jaccard-check-let.aql
@@ -26,10 +26,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-complex_olist-jaccard-check-let.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ulist-jaccard-check-let.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ulist-jaccard-check-let.aql
index 57d9244..5a3b329 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ulist-jaccard-check-let.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ulist-jaccard-check-let.aql
@@ -26,10 +26,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-complex_ulist-jaccard-check-let.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/word-jaccard-check-let.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/word-jaccard-check-let.aql
index f79e10f..2c45ea8 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/word-jaccard-check-let.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/word-jaccard-check-let.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index keyword_index on DBLP(title) type keyword;
write output to nc1:"rttest/inverted-index-complex_word-jaccard-check-let.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/word-jaccard-check-multi-let.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/word-jaccard-check-multi-let.aql
index 465cb51..8f8f014 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/word-jaccard-check-multi-let.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/word-jaccard-check-multi-let.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index keyword_index on DBLP(title) type keyword;
write output to nc1:"rttest/inverted-index-complex_word-jaccard-check-multi-let.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline.aql
new file mode 100644
index 0000000..78a285a
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline.aql
@@ -0,0 +1,31 @@
+/*
+ * Description : Fuzzy self joins a dataset, DBLP, based on the edit-distance function of its authors.
+ * DBLP has a 3-gram index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create index ngram_index on DBLP(authors) type ngram(3);
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-edit-distance-inline.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('DBLP')
+let $ed := edit-distance($a.authors, $b.authors)
+where $ed < 3 and $a.id < $b.id
+return {"aauthors": $a.authors, "bauthors": $b.authors, "ed": $ed}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-edit-distance.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-edit-distance.aql
new file mode 100644
index 0000000..b05c0d1
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-edit-distance.aql
@@ -0,0 +1,39 @@
+/*
+ * Description : Fuzzy joins two datasets, DBLP and CSX, based on the edit-distance function of their authors.
+ * DBLP has a 3-gram index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create type CSXType as closed {
+ id: int32,
+ csxid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create dataset CSX(CSXType) partitioned by key id;
+
+create index ngram_index on DBLP(authors) type ngram(3);
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-edit-distance.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+where edit-distance($a.authors, $b.authors) < 3 and $a.id < $b.id
+return {"aauthors": $a.authors, "bauthors": $b.authors}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-fuzzyeq-edit-distance.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-fuzzyeq-edit-distance.aql
new file mode 100644
index 0000000..87ebe4a
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-fuzzyeq-edit-distance.aql
@@ -0,0 +1,42 @@
+/*
+ * Description : Fuzzy joins two datasets, DBLP and CSX, based on ~= using edit distance of their authors.
+ * DBLP has a 3-gram index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create type CSXType as closed {
+ id: int32,
+ csxid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create dataset CSX(CSXType) partitioned by key id;
+
+create index ngram_index on CSX(authors) type ngram(3);
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-fuzzyeq-edit-distance.adm";
+
+set simfunction 'edit-distance';
+set simthreshold '3';
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+where $a.authors ~= $b.authors and $a.id < $b.id
+return {"aauthors": $a.authors, "bauthors": $b.authors}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-fuzzyeq-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-fuzzyeq-jaccard.aql
new file mode 100644
index 0000000..77aa691
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-fuzzyeq-jaccard.aql
@@ -0,0 +1,42 @@
+/*
+ * Description : Fuzzy joins two datasets, DBLP and CSX, based on ~= using Jaccard of their titles' 3-gram tokens.
+ * DBLP has a 3-gram index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create type CSXType as closed {
+ id: int32,
+ csxid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create dataset CSX(CSXType) partitioned by key id;
+
+create index ngram_index on DBLP(title) type ngram(3);
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-fuzzyeq-jaccard.adm";
+
+set simfunction 'jaccard';
+set simthreshold '0.5f';
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+where gram-tokens($a.title, 3, false) ~= gram-tokens($b.title, 3, false) and $a.id < $b.id
+return {"atitle": $a.title, "btitle": $b.title}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline.aql
new file mode 100644
index 0000000..9f6e66c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline.aql
@@ -0,0 +1,31 @@
+/*
+ * Description : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard function of its titles' 3-gram tokens.
+ * DBLP has a 3-gram index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create index ngram_index on DBLP(title) type ngram(3);
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-jaccard-inline.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('DBLP')
+let $jacc := similarity-jaccard(gram-tokens($a.title, 3, false), gram-tokens($b.title, 3, false))
+where $jacc >= 0.5f and $a.id < $b.id
+return {"atitle": $a.title, "btitle": $b.title, "jacc": $jacc}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-jaccard.aql
new file mode 100644
index 0000000..1979201
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-jaccard.aql
@@ -0,0 +1,40 @@
+/*
+ * Description : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' 3-gram tokens.
+ * DBLP has a 3-gram index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create type CSXType as closed {
+ id: int32,
+ csxid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create dataset CSX(CSXType) partitioned by key id;
+
+create index ngram_index on DBLP(title) type ngram(3);
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-jaccard.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+where similarity-jaccard(gram-tokens($a.title, 3, false), gram-tokens($b.title, 3, false)) >= 0.5f
+ and $a.id < $b.id
+return {"atitle": $a.title, "btitle": $b.title}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline.aql
new file mode 100644
index 0000000..25cdc53
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline.aql
@@ -0,0 +1,38 @@
+/*
+ * Description : Fuzzy self joins a dataset, Customers, based on the edit-distance function of its interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-edit-distance-inline.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers')
+let $ed := edit-distance($a.interests, $b.interests)
+where $ed <= 2 and $a.cid < $b.cid
+return {"ainterests": $a.interests, "binterests": $b.interests, "ed": $ed}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-edit-distance.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-edit-distance.aql
new file mode 100644
index 0000000..e5dec4f
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-edit-distance.aql
@@ -0,0 +1,38 @@
+/*
+ * Description : Fuzzy joins two datasets, Customer and Customer2, based on the edit-distance function of their interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-edit-distance.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+where edit-distance($a.interests, $b.interests) <= 2 and $a.cid < $b.cid
+return {"ainterests": $a.interests, "binterests": $b.interests}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-fuzzyeq-edit-distance.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-fuzzyeq-edit-distance.aql
new file mode 100644
index 0000000..ae24f13
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-fuzzyeq-edit-distance.aql
@@ -0,0 +1,41 @@
+/*
+ * Description : Fuzzy joins two datasets, Customer and Customer2, based on ~= using edit distance of their interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-fuzzyeq-edit-distance.adm";
+
+set simfunction 'edit-distance';
+set simthreshold '3';
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+where $a.interests ~= $b.interests and $a.cid < $b.cid
+return {"ainterests": $a.interests, "binterests": $b.interests}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-fuzzyeq-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-fuzzyeq-jaccard.aql
new file mode 100644
index 0000000..f7df554
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-fuzzyeq-jaccard.aql
@@ -0,0 +1,41 @@
+/*
+ * Description : Fuzzy joins two datasets, Customer and Customer2, based on ~= using Jaccard of their interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-fuzzyeq-jaccard.adm";
+
+set simfunction 'jaccard';
+set simthreshold '0.7f';
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+where $a.interests /*+ indexnl */ ~= $b.interests and $a.cid < $b.cid
+return {"ainterests": $a.interests, "binterests": $b.interests}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-jaccard-inline.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-jaccard-inline.aql
new file mode 100644
index 0000000..61816b8
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-jaccard-inline.aql
@@ -0,0 +1,38 @@
+/*
+ * Description : Fuzzy self joins a dataset, Customers, based on the similarity-jaccard function of its interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-jaccard-inline.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers')
+let $jacc := /*+ indexnl */ similarity-jaccard($a.interests, $b.interests)
+where $jacc >= 0.7f and $a.cid < $b.cid
+return {"ainterests": $a.interests, "binterests": $b.interests, "jacc": $jacc }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-jaccard.aql
new file mode 100644
index 0000000..d16776a
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-jaccard.aql
@@ -0,0 +1,38 @@
+/*
+ * Description : Fuzzy joins two datasets, Customer and Customer2, based on the similarity-jaccard function of their interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-jaccard.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+where /*+ indexnl */ similarity-jaccard($a.interests, $b.interests) >= 0.7f and $a.cid < $b.cid
+return {"ainterests": $a.interests, "binterests": $b.interests}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-fuzzyeq-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-fuzzyeq-jaccard.aql
new file mode 100644
index 0000000..0d4872b
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-fuzzyeq-jaccard.aql
@@ -0,0 +1,41 @@
+/*
+ * Description : Fuzzy joins two datasets, Customer and Customer2, based on ~= using Jaccard of their interest sets.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: {{string}},
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_ulist-fuzzyeq-jaccard.adm";
+
+set simfunction 'jaccard';
+set simthreshold '0.7f';
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+where $a.interests /*+ indexnl */ ~= $b.interests and $a.cid < $b.cid
+return {"ainterests": $a.interests, "binterests": $b.interests}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline.aql
new file mode 100644
index 0000000..c89fdc3
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline.aql
@@ -0,0 +1,38 @@
+/*
+ * Description : Fuzzy self joins a dataset, Customers, based on the similarity-jaccard function of its interest sets.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: {{string}},
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_ulist-jaccard-inline.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers')
+let $jacc := /*+ indexnl */ similarity-jaccard($a.interests, $b.interests)
+where $jacc >= 0.7f and $a.cid < $b.cid
+return {"ainterests": $a.interests, "binterests": $b.interests, "jacc": $jacc}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-jaccard.aql
new file mode 100644
index 0000000..72d0341
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-jaccard.aql
@@ -0,0 +1,38 @@
+/*
+ * Description : Fuzzy joins two datasets, Customer and Customer2, based on the similarity-jaccard function of their interest sets.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: {{string}},
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_ulist-jaccard.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+where /*+ indexnl */ similarity-jaccard($a.interests, $b.interests) >= 0.7f and $a.cid < $b.cid
+return {"ainterests": $a.interests, "binterests": $b.interests}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-fuzzyeq-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-fuzzyeq-jaccard.aql
new file mode 100644
index 0000000..99a3c79
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-fuzzyeq-jaccard.aql
@@ -0,0 +1,42 @@
+/*
+ * Description : Fuzzy joins two datasets, DBLP and CSX, based on ~= using Jaccard of their titles' word tokens.
+ * DBLP has a keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create type CSXType as closed {
+ id: int32,
+ csxid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create dataset CSX(CSXType) partitioned by key id;
+
+create index keyword_index on DBLP(title) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_word-fuzzyeq-jaccard.adm";
+
+set simfunction 'jaccard';
+set simthreshold '0.5f';
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+where word-tokens($a.title) ~= word-tokens($b.title) and $a.id < $b.id
+return {"atitle": $a.title, "btitle": $b.title}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-jaccard-inline.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-jaccard-inline.aql
new file mode 100644
index 0000000..24c66ac
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-jaccard-inline.aql
@@ -0,0 +1,31 @@
+/*
+ * Description : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard function of its titles' word tokens.
+ * DBLP has a keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create index keyword_index on DBLP(title) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_word-jaccard-inline.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('DBLP')
+let $jacc := similarity-jaccard(word-tokens($a.title), word-tokens($b.title))
+where $jacc >= 0.5f and $a.id < $b.id
+return {"atitle": $a.title, "btitle": $b.title, "jacc": $jacc}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-jaccard.aql
new file mode 100644
index 0000000..ef91b89
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-jaccard.aql
@@ -0,0 +1,41 @@
+/*
+ * Description : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
+ * DBLP has a keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create type CSXType as closed {
+ id: int32,
+ csxid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create dataset CSX(CSXType) partitioned by key id;
+
+create index keyword_index on DBLP(title) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_word-jaccard.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+where similarity-jaccard(word-tokens($a.title), word-tokens($b.title)) >= 0.5f
+ and $a.id < $b.id
+return {"atitle": $a.title, "btitle": $b.title}
+
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_01.aql
index d802dc5..f9cc7e9 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_01.aql
@@ -28,14 +28,6 @@
create dataset CSX(CSXType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
create index ngram_index on DBLP(authors) type ngram(3);
write output to nc1:"rttest/inverted-index-join_ngram-edit-distance-check_01.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_02.aql
index 01003f9..011afea 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_02.aql
@@ -28,14 +28,6 @@
create dataset CSX(CSXType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
create index ngram_index on CSX(authors) type ngram(3);
write output to nc1:"rttest/inverted-index-join_ngram-edit-distance-check_02.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_03.aql
index 890dfa9..649c3b6 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_03.aql
@@ -15,11 +15,8 @@
authors: string,
misc: string
}
-create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+create dataset DBLP(DBLPType) partitioned by key id;
create index ngram_index on DBLP(authors) type ngram(3);
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_04.aql
new file mode 100644
index 0000000..e6a3c56
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_04.aql
@@ -0,0 +1,30 @@
+/*
+ * Description : Fuzzy self joins a dataset, DBLP, based on the edit-distance-check function of its authors.
+ * DBLP has a 3-gram index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create index ngram_index on DBLP(authors) type ngram(3);
+
+write output to nc1:"rttest/inverted-index-join_ngram-edit-distance-check_04.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('DBLP')
+let $ed := edit-distance-check($a.authors, $b.authors, 3)
+where $ed[0] and $a.id < $b.id
+return {"arec": $a, "brec": $b, "ed": $ed[1] }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_01.aql
index 76622d9..a94e84f 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_01.aql
@@ -28,14 +28,6 @@
create dataset CSX(CSXType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
create index ngram_index on DBLP(authors) type ngram(3);
write output to nc1:"rttest/inverted-index-join_ngram-edit-distance_01.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_02.aql
index 4298db1..61edf5c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_02.aql
@@ -28,14 +28,6 @@
create dataset CSX(CSXType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
create index ngram_index on CSX(authors) type ngram(3);
write output to nc1:"rttest/inverted-index-join_ngram-edit-distance_02.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_03.aql
index 72ca9d0..6c61de1 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_03.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(authors) type ngram(3);
write output to nc1:"rttest/inverted-index-join_ngram-edit-distance_03.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_04.aql
new file mode 100644
index 0000000..5925f47
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_04.aql
@@ -0,0 +1,30 @@
+/*
+ * Description : Fuzzy self joins a dataset, DBLP, based on the edit-distance function of its authors.
+ * DBLP has a 3-gram index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create index ngram_index on DBLP(authors) type ngram(3);
+
+write output to nc1:"rttest/inverted-index-join_ngram-edit-distance_03.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('DBLP')
+let $ed := edit-distance($a.authors, $b.authors)
+where $ed < 3 and $a.id < $b.id
+return {"arec": $a, "brec": $b, "ed": $ed}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_01.aql
index 14a4420..f6dd893 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_01.aql
@@ -28,14 +28,6 @@
create dataset CSX(CSXType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
create index ngram_index on CSX(authors) type ngram(3);
write output to nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_02.aql
index 2ad1f2b..d9822aa 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_02.aql
@@ -28,14 +28,6 @@
create dataset CSX(CSXType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
create index ngram_index on DBLP(authors) type ngram(3);
write output to nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_03.aql
index 640b6e1..0431a6c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_03.aql
@@ -17,10 +17,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(authors) type ngram(3);
write output to nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_03.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_01.aql
index 55af0e4..933e5d0 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_01.aql
@@ -28,14 +28,6 @@
create dataset CSX(CSXType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
create index ngram_index on DBLP(title) type ngram(3);
write output to nc1:"rttest/inverted-index-join_ngram-fuzzyeq-jaccard_01.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_02.aql
index c00726e..1213935 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_02.aql
@@ -28,14 +28,6 @@
create dataset CSX(CSXType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
create index ngram_index on CSX(title) type ngram(3);
write output to nc1:"rttest/inverted-index-join_ngram-fuzzyeq-jaccard_02.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_03.aql
index 9d2ce15..70c7640 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_03.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(title) type ngram(3);
write output to nc1:"rttest/inverted-index-join_ngram-fuzzyeq-jaccard_03.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_01.aql
index cb5f92c..4d7939a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_01.aql
@@ -28,14 +28,6 @@
create dataset CSX(CSXType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
create index ngram_index on DBLP(title) type ngram(3);
write output to nc1:"rttest/inverted-index-join_ngram-jaccard-check_01.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_02.aql
index 8f487ed..e0acebb 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_02.aql
@@ -28,14 +28,6 @@
create dataset CSX(CSXType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
create index ngram_index on CSX(title) type ngram(3);
write output to nc1:"rttest/inverted-index-join_ngram-jaccard-check_02.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_03.aql
index 9c57be6..808965d 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_03.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(title) type ngram(3);
write output to nc1:"rttest/inverted-index-join_ngram-jaccard-check_03.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_04.aql
new file mode 100644
index 0000000..e66cdc5
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_04.aql
@@ -0,0 +1,30 @@
+/*
+ * Description : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard-check function of its titles' 3-gram tokens.
+ * DBLP has a 3-gram index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create index ngram_index on DBLP(title) type ngram(3);
+
+write output to nc1:"rttest/inverted-index-join_ngram-jaccard-check_04.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('DBLP')
+let $jacc := similarity-jaccard-check(gram-tokens($a.title, 3, false), gram-tokens($b.title, 3, false), 0.5f)
+where $jacc[0] and $a.id < $b.id
+return {"arec": $a, "brec": $b, "jacc": $jacc[1] }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_01.aql
index 14b52fb..a28a6af 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_01.aql
@@ -28,14 +28,6 @@
create dataset CSX(CSXType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
create index ngram_index on DBLP(title) type ngram(3);
write output to nc1:"rttest/inverted-index-join_ngram-jaccard_01.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_02.aql
index 4c51967..a4ff58d 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_02.aql
@@ -28,14 +28,6 @@
create dataset CSX(CSXType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
create index ngram_index on CSX(title) type ngram(3);
write output to nc1:"rttest/inverted-index-join_ngram-jaccard_02.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_03.aql
index cd84d30..1a90cf9 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_03.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index ngram_index on DBLP(title) type ngram(3);
write output to nc1:"rttest/inverted-index-join_ngram-jaccard_03.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_04.aql
new file mode 100644
index 0000000..7be6773
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_04.aql
@@ -0,0 +1,30 @@
+/*
+ * Description : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard function of its titles' 3-gram tokens.
+ * DBLP has a 3-gram index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create index ngram_index on DBLP(title) type ngram(3);
+
+write output to nc1:"rttest/inverted-index-join_ngram-jaccard_04.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('DBLP')
+let $jacc := similarity-jaccard(gram-tokens($a.title, 3, false), gram-tokens($b.title, 3, false))
+where $jacc >= 0.5f and $a.id < $b.id
+return {"arec": $a, "brec": $b, "jacc": $jacc }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_01.aql
index b4f8b56..84d2f45 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_01.aql
@@ -27,14 +27,6 @@
create dataset Customers2(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_olist-edit-distance-check_01.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_02.aql
index db47ed6b..b0ec650 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_02.aql
@@ -27,14 +27,6 @@
create dataset Customers2(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers2(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_olist-edit-distance-check_02.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_03.aql
index d97c003..03a1a3f 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_03.aql
@@ -25,10 +25,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_olist-edit-distance-check_03.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_04.aql
new file mode 100644
index 0000000..e7814af
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_04.aql
@@ -0,0 +1,37 @@
+/*
+ * Description : Fuzzy self joins a dataset, Customers, based on the edit-distance-check function of its interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join_olist-edit-distance-check_04.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers')
+let $ed := edit-distance-check($a.interests, $b.interests, 3)
+where $ed[0] and $a.cid < $b.cid
+return {"arec": $a, "brec": $b, "ed": $ed[1] }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_01.aql
index 4047e55..ac25ac2 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_01.aql
@@ -27,14 +27,6 @@
create dataset Customers2(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_olist-edit-distance_01.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_02.aql
index 5745565..a160c4d 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_02.aql
@@ -27,14 +27,6 @@
create dataset Customers2(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers2(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_olist-edit-distance_02.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_03.aql
index fc3fc4a..dba92b9 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_03.aql
@@ -25,10 +25,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_olist-edit-distance_03.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_04.aql
new file mode 100644
index 0000000..4835727
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_04.aql
@@ -0,0 +1,37 @@
+/*
+ * Description : Fuzzy self joins a dataset, Customers, based on the edit-distance function of its interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join_olist-edit-distance_04.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers')
+let $ed := edit-distance($a.interests, $b.interests)
+where $ed <= 2 and $a.cid < $b.cid
+return {"arec": $a, "brec": $b, "ed": $ed }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_01.aql
index bf2b8bc..1dddf5e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_01.aql
@@ -27,14 +27,6 @@
create dataset Customers2(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_olist-fuzzyeq-jaccard_01.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_02.aql
index 5314b95..15b1001 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_02.aql
@@ -27,14 +27,6 @@
create dataset Customers2(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers2(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_olist-fuzzyeq-jaccard_02.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_03.aql
index 15a9ab7..af4814f 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_03.aql
@@ -25,10 +25,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_olist-fuzzyeq-jaccard_03.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_01.aql
index f6f2f84..2b46707 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_01.aql
@@ -27,14 +27,6 @@
create dataset Customers2(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_olist-fuzzyeq-jaccard_01.adm";
@@ -44,5 +36,5 @@
for $a in dataset('Customers')
for $b in dataset('Customers2')
-where $a.interests ~= $b.interests and $a.cid < $b.cid
+where $a.interests /*+ indexnl */ ~= $b.interests and $a.cid < $b.cid
return {"arec": $a, "brec": $b }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_02.aql
index 1951e6f..4f188dd 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_02.aql
@@ -27,14 +27,6 @@
create dataset Customers2(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers2(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_olist-fuzzyeq-jaccard_02.adm";
@@ -44,5 +36,5 @@
for $a in dataset('Customers')
for $b in dataset('Customers2')
-where $a.interests ~= $b.interests and $a.cid < $b.cid
+where $a.interests /*+ indexnl */ ~= $b.interests and $a.cid < $b.cid
return {"arec": $a, "brec": $b }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_03.aql
index d791b85..05cf635 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_03.aql
@@ -25,10 +25,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_olist-fuzzyeq-jaccard_03.adm";
@@ -38,5 +34,5 @@
for $a in dataset('Customers')
for $b in dataset('Customers')
-where $a.interests ~= $b.interests and $a.cid < $b.cid
+where $a.interests /*+ indexnl */ ~= $b.interests and $a.cid < $b.cid
return {"arec": $a, "brec": $b }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_01.aql
index 5f6f59b..60fc705 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_01.aql
@@ -27,19 +27,11 @@
create dataset Customers2(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_olist-jaccard-check_01.adm";
for $a in dataset('Customers')
for $b in dataset('Customers2')
-where similarity-jaccard-check($a.interests, $b.interests, 0.7f)[0] and $a.cid < $b.cid
+where /*+ indexnl */ similarity-jaccard-check($a.interests, $b.interests, 0.7f)[0] and $a.cid < $b.cid
return {"arec": $a, "brec": $b }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_02.aql
index 0754282..9cdb78b 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_02.aql
@@ -27,19 +27,11 @@
create dataset Customers2(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers2(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_olist-jaccard-check_02.adm";
for $a in dataset('Customers')
for $b in dataset('Customers2')
-where similarity-jaccard-check($a.interests, $b.interests, 0.7f)[0] and $a.cid < $b.cid
+where /*+ indexnl */ similarity-jaccard-check($a.interests, $b.interests, 0.7f)[0] and $a.cid < $b.cid
return {"arec": $a, "brec": $b }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_03.aql
index 4dbc4d5..b1c4d68 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_03.aql
@@ -25,15 +25,11 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_olist-jaccard-check_03.adm";
for $a in dataset('Customers')
for $b in dataset('Customers')
-where similarity-jaccard-check($a.interests, $b.interests, 0.7f)[0] and $a.cid < $b.cid
+where /*+ indexnl */ similarity-jaccard-check($a.interests, $b.interests, 0.7f)[0] and $a.cid < $b.cid
return {"arec": $a, "brec": $b }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_04.aql
new file mode 100644
index 0000000..a1e1478
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_04.aql
@@ -0,0 +1,37 @@
+/*
+ * Description : Fuzzy self joins a dataset, Customers, based on the similarity-jaccard-check function of its interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join_olist-jaccard-check_04.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers')
+let $jacc := /*+ indexnl */ similarity-jaccard-check($a.interests, $b.interests, 0.7f)
+where $jacc[0] and $a.cid < $b.cid
+return {"arec": $a, "brec": $b, "jacc": $jacc[1] }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_01.aql
index ddf386e..cabdac1 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_01.aql
@@ -27,19 +27,11 @@
create dataset Customers2(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_olist-jaccard_01.adm";
for $a in dataset('Customers')
for $b in dataset('Customers2')
-where similarity-jaccard($a.interests, $b.interests) >= 0.7f and $a.cid < $b.cid
+where /*+ indexnl */ similarity-jaccard($a.interests, $b.interests) >= 0.7f and $a.cid < $b.cid
return {"arec": $a, "brec": $b }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_02.aql
index 50c3db6..49a7411 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_02.aql
@@ -27,19 +27,11 @@
create dataset Customers2(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers2(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_olist-jaccard_02.adm";
for $a in dataset('Customers')
for $b in dataset('Customers2')
-where similarity-jaccard($a.interests, $b.interests) >= 0.7f and $a.cid < $b.cid
+where /*+ indexnl */ similarity-jaccard($a.interests, $b.interests) >= 0.7f and $a.cid < $b.cid
return {"arec": $a, "brec": $b }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_03.aql
index 50729ba..639d782 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_03.aql
@@ -25,15 +25,11 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_olist-jaccard_03.adm";
for $a in dataset('Customers')
for $b in dataset('Customers')
-where similarity-jaccard($a.interests, $b.interests) >= 0.7f and $a.cid < $b.cid
+where /*+ indexnl */ similarity-jaccard($a.interests, $b.interests) >= 0.7f and $a.cid < $b.cid
return {"arec": $a, "brec": $b }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_04.aql
new file mode 100644
index 0000000..c3e34b0
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_04.aql
@@ -0,0 +1,37 @@
+/*
+ * Description : Fuzzy self joins a dataset, Customers, based on the similarity-jaccard function of its interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join_olist-jaccard_04.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers')
+let $jacc := /*+ indexnl */ similarity-jaccard($a.interests, $b.interests)
+where $jacc >= 0.7f and $a.cid < $b.cid
+return {"arec": $a, "brec": $b, "jacc": $jacc }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_01.aql
index 1fa479d..c19ce47 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_01.aql
@@ -27,14 +27,6 @@
create dataset Customers2(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_ulist-fuzzyeq-jaccard_01.adm";
@@ -44,5 +36,5 @@
for $a in dataset('Customers')
for $b in dataset('Customers2')
-where $a.interests ~= $b.interests and $a.cid < $b.cid
+where $a.interests /*+ indexnl */ ~= $b.interests and $a.cid < $b.cid
return {"arec": $a, "brec": $b }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_02.aql
index e5b532f..6e3a274 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_02.aql
@@ -27,14 +27,6 @@
create dataset Customers2(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
create index interests_index on Customers2(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_ulist-fuzzyeq-jaccard_02.adm";
@@ -44,5 +36,5 @@
for $a in dataset('Customers')
for $b in dataset('Customers2')
-where $a.interests ~= $b.interests and $a.cid < $b.cid
+where $a.interests /*+ indexnl */ ~= $b.interests and $a.cid < $b.cid
return {"arec": $a, "brec": $b }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_03.aql
index a881c89..396af09 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_03.aql
@@ -25,10 +25,6 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_ulist-fuzzyeq-jaccard_03.adm";
@@ -38,5 +34,5 @@
for $a in dataset('Customers')
for $b in dataset('Customers')
-where $a.interests ~= $b.interests and $a.cid < $b.cid
+where $a.interests /*+ indexnl */ ~= $b.interests and $a.cid < $b.cid
return {"arec": $a, "brec": $b }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_01.aql
index 5d95894..8792dd2 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_01.aql
@@ -27,19 +27,11 @@
create dataset Customers2(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_ulist-jaccard-check_01.adm";
for $a in dataset('Customers')
for $b in dataset('Customers2')
-where similarity-jaccard-check($a.interests, $b.interests, 0.7f)[0] and $a.cid < $b.cid
+where /*+ indexnl */ similarity-jaccard-check($a.interests, $b.interests, 0.7f)[0] and $a.cid < $b.cid
return {"arec": $a, "brec": $b }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_02.aql
index 561e15f..185df97 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_02.aql
@@ -27,19 +27,11 @@
create dataset Customers2(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
create index interests_index on Customers2(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_ulist-jaccard-check_02.adm";
for $a in dataset('Customers')
for $b in dataset('Customers2')
-where similarity-jaccard-check($a.interests, $b.interests, 0.7f)[0] and $a.cid < $b.cid
+where /*+ indexnl */ similarity-jaccard-check($a.interests, $b.interests, 0.7f)[0] and $a.cid < $b.cid
return {"arec": $a, "brec": $b }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_03.aql
index 87d78e5..4d2b2e7 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_03.aql
@@ -25,15 +25,11 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_ulist-jaccard-check_03.adm";
for $a in dataset('Customers')
for $b in dataset('Customers')
-where similarity-jaccard-check($a.interests, $b.interests, 0.7f)[0] and $a.cid < $b.cid
+where /*+ indexnl */ similarity-jaccard-check($a.interests, $b.interests, 0.7f)[0] and $a.cid < $b.cid
return {"arec": $a, "brec": $b }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_04.aql
new file mode 100644
index 0000000..acf4d71
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_04.aql
@@ -0,0 +1,37 @@
+/*
+ * Description : Fuzzy self joins a dataset, Customers, based on the similarity-jaccard-check function of its interest sets.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: {{string}},
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join_ulist-jaccard-check_04.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers')
+let $jacc := /*+ indexnl */ similarity-jaccard-check($a.interests, $b.interests, 0.7f)
+where $jacc[0] and $a.cid < $b.cid
+return {"arec": $a, "brec": $b, "jacc": $jacc[1] }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_01.aql
index 864ede7..0d5ad31 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_01.aql
@@ -27,19 +27,11 @@
create dataset Customers2(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_ulist-jaccard_01.adm";
for $a in dataset('Customers')
for $b in dataset('Customers2')
-where similarity-jaccard($a.interests, $b.interests) >= 0.7f and $a.cid < $b.cid
+where /*+ indexnl */ similarity-jaccard($a.interests, $b.interests) >= 0.7f and $a.cid < $b.cid
return {"arec": $a, "brec": $b }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_02.aql
index 4d9f89e..8ac631e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_02.aql
@@ -27,19 +27,11 @@
create dataset Customers2(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
create index interests_index on Customers2(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_ulist-jaccard_02.adm";
for $a in dataset('Customers')
for $b in dataset('Customers2')
-where similarity-jaccard($a.interests, $b.interests) >= 0.7f and $a.cid < $b.cid
+where /*+ indexnl */ similarity-jaccard($a.interests, $b.interests) >= 0.7f and $a.cid < $b.cid
return {"arec": $a, "brec": $b }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_03.aql
index 5eae45b..94aedbb 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_03.aql
@@ -25,15 +25,11 @@
create dataset Customers(CustomerType) partitioned by key cid;
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-join_ulist-jaccard_03.adm";
for $a in dataset('Customers')
for $b in dataset('Customers')
-where similarity-jaccard($a.interests, $b.interests) >= 0.7f and $a.cid < $b.cid
+where /*+ indexnl */ similarity-jaccard($a.interests, $b.interests) >= 0.7f and $a.cid < $b.cid
return {"arec": $a, "brec": $b }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_04.aql
new file mode 100644
index 0000000..e30fbcf
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_04.aql
@@ -0,0 +1,37 @@
+/*
+ * Description : Fuzzy self joins a dataset, Customers, based on the similarity-jaccard function of its interest sets.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: {{string}},
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join_ulist-jaccard_04.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers')
+let $jacc := /*+ indexnl */ similarity-jaccard($a.interests, $b.interests)
+where $jacc >= 0.7f and $a.cid < $b.cid
+return {"arec": $a, "brec": $b, "jacc": $jacc }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_01.aql
index 6ea53e9..8438509 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_01.aql
@@ -28,14 +28,6 @@
create dataset CSX(CSXType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
create index keyword_index on DBLP(title) type keyword;
write output to nc1:"rttest/inverted-index-join_word-fuzzyeq-jaccard_01.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_02.aql
index 254a825..6f6c5f6 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_02.aql
@@ -28,14 +28,6 @@
create dataset CSX(CSXType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
create index keyword_index on CSX(title) type keyword;
write output to nc1:"rttest/inverted-index-join_word-fuzzyeq-jaccard_02.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_03.aql
index f553abe..3f3a247 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_03.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index keyword_index on DBLP(title) type keyword;
write output to nc1:"rttest/inverted-index-join_word-fuzzyeq-jaccard_03.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_01.aql
index 63efb89..14f63bf 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_01.aql
@@ -28,14 +28,6 @@
create dataset CSX(CSXType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
create index keyword_index on DBLP(title) type keyword;
write output to nc1:"rttest/inverted-index-join_word-jaccard-check_01.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_02.aql
index 1298833..46932be 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_02.aql
@@ -28,14 +28,6 @@
create dataset CSX(CSXType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
create index keyword_index on CSX(title) type keyword;
write output to nc1:"rttest/inverted-index-join_word-jaccard-check_02.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_03.aql
index c2d6b78..77ac9ba 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_03.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index keyword_index on DBLP(title) type keyword;
write output to nc1:"rttest/inverted-index-join_word-jaccard-check_03.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_04.aql
new file mode 100644
index 0000000..6129c52
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_04.aql
@@ -0,0 +1,30 @@
+/*
+ * Description : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard-check function of its titles' word tokens.
+ * DBLP has a keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create index keyword_index on DBLP(title) type keyword;
+
+write output to nc1:"rttest/inverted-index-join_word-jaccard-check_04.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('DBLP')
+let $jacc := similarity-jaccard-check(word-tokens($a.title), word-tokens($b.title), 0.5f)
+where $jacc[0] and $a.id < $b.id
+return {"arec": $a, "brec": $b, "jacc": $jacc[1] }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_01.aql
index 7c69928..47d1192 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_01.aql
@@ -28,14 +28,6 @@
create dataset CSX(CSXType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
create index keyword_index on DBLP(title) type keyword;
write output to nc1:"rttest/inverted-index-join_word-jaccard_01.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_02.aql
index 1f5c082..ac33cb0 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_02.aql
@@ -28,14 +28,6 @@
create dataset CSX(CSXType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
create index keyword_index on CSX(title) type keyword;
write output to nc1:"rttest/inverted-index-join_word-jaccard_02.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_03.aql
index 94e59c0..128e500 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_03.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
create index keyword_index on DBLP(title) type keyword;
write output to nc1:"rttest/inverted-index-join_word-jaccard_03.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_04.aql
new file mode 100644
index 0000000..325f955
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_04.aql
@@ -0,0 +1,30 @@
+/*
+ * Description : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard function of its titles' word tokens.
+ * DBLP has a keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create index keyword_index on DBLP(title) type keyword;
+
+write output to nc1:"rttest/inverted-index-join_word-jaccard_04.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('DBLP')
+let $jacc := similarity-jaccard(word-tokens($a.title), word-tokens($b.title))
+where $jacc >= 0.5f and $a.id < $b.id
+return {"arec": $a, "brec": $b, "jacc": $jacc }
diff --git a/asterix-app/src/test/resources/optimizerts/queries/orders-composite-index-search.aql b/asterix-app/src/test/resources/optimizerts/queries/orders-composite-index-search.aql
new file mode 100644
index 0000000..d82be3c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/orders-composite-index-search.aql
@@ -0,0 +1,30 @@
+drop dataverse index_search if exists;
+create dataverse index_search;
+use dataverse index_search;
+
+create type OrderType as closed {
+ o_orderkey: int32,
+ o_custkey: int32,
+ o_orderstatus: string,
+ o_totalprice: double,
+ o_orderdate: string,
+ o_orderpriority: string,
+ o_clerk: string,
+ o_shippriority: int32,
+ o_comment: string
+}
+
+create dataset Orders(OrderType) partitioned by key o_orderkey;
+
+create index idx_Custkey_Orderstatus on Orders(o_custkey, o_orderstatus);
+
+write output to nc1:"/tmp/index_search.adm";
+
+for $o in dataset('Orders')
+where
+ $o.o_custkey = 40 and $o.o_orderstatus = "P"
+return {
+ "o_orderkey": $o.o_orderkey,
+ "o_custkey": $o.o_custkey,
+ "o_orderstatus": $o.o_orderstatus
+}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive-open_01.aql b/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive-open_01.aql
index 1815463..150e962 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive-open_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive-open_01.aql
@@ -23,7 +23,7 @@
load dataset Orders
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1:///data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
+(("path"="nc1://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
create index idx_Orders_Custkey on Orders(o_custkey);
diff --git a/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive_01.aql b/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive_01.aql
index f5b5067..0a42fa6 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive_01.aql
@@ -23,7 +23,7 @@
load dataset Orders
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1:///data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
+(("path"="nc1://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
create index idx_Orders_Custkey on Orders(o_custkey);
diff --git a/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_01.aql b/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_01.aql
new file mode 100644
index 0000000..207b5c9
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_01.aql
@@ -0,0 +1,33 @@
+/*
+ * Description : Joins two datasets on the intersection of their point attributes.
+ * The dataset 'MyData1' has an RTree index, and we expect the
+ * join to be transformed into an indexed nested-loop join.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type MyRecord as closed {
+ id: int32,
+ point: point,
+ kwds: string,
+ line1: line,
+ line2: line,
+ poly1: polygon,
+ poly2: polygon,
+ rec: rectangle
+}
+
+create dataset MyData1(MyRecord) partitioned by key id;
+create dataset MyData2(MyRecord) partitioned by key id;
+
+create index rtree_index on MyData1(point) type rtree;
+
+write output to nc1:"rttest/index-join_rtree-spatial-intersect-point.adm";
+
+for $a in dataset('MyData1')
+for $b in dataset('MyData2')
+where spatial-intersect($a.point, $b.point)
+return {"a": $a, "b": $b}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_02.aql b/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_02.aql
new file mode 100644
index 0000000..e70bedf
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_02.aql
@@ -0,0 +1,33 @@
+/*
+ * Description : Joins two datasets on the intersection of their point attributes.
+ * The dataset 'MyData2' has an RTree index, and we expect the
+ * join to be transformed into an indexed nested-loop join.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type MyRecord as closed {
+ id: int32,
+ point: point,
+ kwds: string,
+ line1: line,
+ line2: line,
+ poly1: polygon,
+ poly2: polygon,
+ rec: rectangle
+}
+
+create dataset MyData1(MyRecord) partitioned by key id;
+create dataset MyData2(MyRecord) partitioned by key id;
+
+create index rtree_index on MyData2(point) type rtree;
+
+write output to nc1:"rttest/rtree-index-join_spatial-intersect-point_02.adm";
+
+for $a in dataset('MyData1')
+for $b in dataset('MyData2')
+where spatial-intersect($a.point, $b.point)
+return {"a": $a, "b": $b}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_03.aql b/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_03.aql
new file mode 100644
index 0000000..85fc22b
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_03.aql
@@ -0,0 +1,32 @@
+/*
+ * Description : Self-joins a dataset on the intersection of its point attribute.
+ * The dataset has an RTree index, and we expect the
+ * join to be transformed into an indexed nested-loop join.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type MyRecord as closed {
+ id: int32,
+ point: point,
+ kwds: string,
+ line1: line,
+ line2: line,
+ poly1: polygon,
+ poly2: polygon,
+ rec: rectangle
+}
+
+create dataset MyData(MyRecord) partitioned by key id;
+
+create index rtree_index on MyData(point) type rtree;
+
+write output to nc1:"rttest/rtree-index-join_spatial-intersect-point_03.adm";
+
+for $a in dataset('MyData')
+for $b in dataset('MyData')
+where spatial-intersect($a.point, $b.point)
+return {"a": $a, "b": $b}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/rtree-secondary-index-open.aql b/asterix-app/src/test/resources/optimizerts/queries/rtree-secondary-index-open.aql
index 192b189..14416c8 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/rtree-secondary-index-open.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/rtree-secondary-index-open.aql
@@ -10,7 +10,8 @@
line2: line,
poly1: polygon,
poly2: polygon,
- rec: rectangle
+ rec: rectangle,
+ circle: circle
}
create nodegroup group1 if not exists on nc1, nc2;
diff --git a/asterix-app/src/test/resources/optimizerts/queries/rtree-secondary-index.aql b/asterix-app/src/test/resources/optimizerts/queries/rtree-secondary-index.aql
index d525458..c8525c1 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/rtree-secondary-index.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/rtree-secondary-index.aql
@@ -10,7 +10,8 @@
line2: line,
poly1: polygon,
poly2: polygon,
- rec: rectangle
+ rec: rectangle,
+ circle: circle
}
create nodegroup group1 if not exists on nc1, nc2;
diff --git a/asterix-app/src/test/resources/optimizerts/queries/scan-delete-rtree-secondary-index.aql b/asterix-app/src/test/resources/optimizerts/queries/scan-delete-rtree-secondary-index.aql
index 5f1e8d3..4d5de58 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/scan-delete-rtree-secondary-index.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/scan-delete-rtree-secondary-index.aql
@@ -10,7 +10,8 @@
line2: line,
poly1: polygon,
poly2: polygon,
- rec: rectangle
+ rec: rectangle,
+ circle: circle
}
create nodegroup group1 if not exists on nc1, nc2;
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_01.aql
index a456568..96d3b1a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_01.aql
@@ -20,10 +20,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_edit-distance-let-to-edit-distance-check_01.adm";
for $o in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_02.aql
index be946af..e0ef1aa 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_02.aql
@@ -20,10 +20,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_edit-distance-let-to-edit-distance-check_02.adm";
for $o in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_03.aql
index e709e8c..75a584e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_03.aql
@@ -20,10 +20,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_edit-distance-let-to-edit-distance-check_03.adm";
for $o in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_04.aql
index 8bbd3d6..2f42ab0 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_04.aql
@@ -20,10 +20,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_edit-distance-let-to-edit-distance-check_04.adm";
for $o in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_05.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_05.aql
index b929ef2..73f8ddb 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_05.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_05.aql
@@ -20,10 +20,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_edit-distance-let-to-edit-distance-check_05.adm";
for $o in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_06.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_06.aql
index 3b86bd0..221bfb8 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_06.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_06.aql
@@ -20,10 +20,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_edit-distance-let-to-edit-distance-check_06.adm";
for $o in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_07.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_07.aql
index 9960262..949ed2c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_07.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_07.aql
@@ -20,10 +20,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_edit-distance-let-to-edit-distance-check_07.adm";
for $o in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_08.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_08.aql
index ddb5018..3f899a2 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_08.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_08.aql
@@ -20,10 +20,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_edit-distance-let-to-edit-distance-check_08.adm";
for $o in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_01.aql
index 4a21a3b..0370fff 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_01.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_edit-distance-to-edit-distance-check_01.adm";
for $o in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_02.aql
index 6657bf4..77d78f8 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_02.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_edit-distance-to-edit-distance-check_02.adm";
for $o in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_03.aql
index f1796a1..c34c28a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_03.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_edit-distance-to-edit-distance-check_03.adm";
for $o in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_04.aql
index fb63621..082dc39 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_04.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_edit-distance-to-edit-distance-check_04.adm";
for $o in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_05.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_05.aql
index b421d54..6d892df 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_05.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_05.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_edit-distance-to-edit-distance-check_05.adm";
// We cannot introduce edit-distance-check because the condition is >=
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_06.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_06.aql
index a9372ec..20d4879 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_06.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_06.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_edit-distance-to-edit-distance-check_06.adm";
// We cannot introduce edit-distance-check because the condition is <=
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_07.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_07.aql
index 74959c7..49871f9 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_07.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_07.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_edit-distance-to-edit-distance-check_07.adm";
// We cannot introduce edit-distance-check because the condition is >
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_08.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_08.aql
index 4ac54ed..ed6d406 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_08.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_08.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_edit-distance-to-edit-distance-check_08.adm";
// We cannot introduce edit-distance-check because the condition is <
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/fuzzyeq-to-edit-distance-check.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/fuzzyeq-to-edit-distance-check.aql
index f53435b..702b739 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/fuzzyeq-to-edit-distance-check.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/fuzzyeq-to-edit-distance-check.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_fuzzyeq-to-edit-distance-check.adm";
set simfunction 'edit-distance';
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/fuzzyeq-to-jaccard-check.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/fuzzyeq-to-jaccard-check.aql
index f4da76f..eaacc3e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/fuzzyeq-to-jaccard-check.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/fuzzyeq-to-jaccard-check.aql
@@ -18,10 +18,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_fuzzyeq-to-jaccard-check.adm";
set simfunction 'jaccard';
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_01.aql
index c76f15b..8647565 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_01.aql
@@ -20,10 +20,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_jaccard-let-to-jaccard-check_01.adm";
for $paper in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_02.aql
index 52296d5..b48eb24 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_02.aql
@@ -20,10 +20,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_jaccard-let-to-jaccard-check_01.adm";
for $paper in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_03.aql
index 8251c76..74dcf9d 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_03.aql
@@ -20,10 +20,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_jaccard-let-to-jaccard-check_01.adm";
for $paper in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_04.aql
index 2c53231..e17d458 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_04.aql
@@ -20,10 +20,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_jaccard-let-to-jaccard-check_01.adm";
for $paper in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_05.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_05.aql
index 03a0321..266f369 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_05.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_05.aql
@@ -20,10 +20,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_jaccard-let-to-jaccard-check_01.adm";
for $paper in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_06.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_06.aql
index b1d26da..3beec4b 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_06.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_06.aql
@@ -20,10 +20,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_jaccard-let-to-jaccard-check_01.adm";
for $paper in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_07.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_07.aql
index e008feb..86401ac 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_07.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_07.aql
@@ -20,10 +20,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_jaccard-let-to-jaccard-check_01.adm";
for $paper in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_08.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_08.aql
index 7e93d7f..372a3e8 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_08.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_08.aql
@@ -20,10 +20,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_jaccard-let-to-jaccard-check_01.adm";
for $paper in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_01.aql
index ecc0554..8e8a0f8 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_01.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_jaccard-to-jaccard-check_01.adm";
for $paper in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_02.aql
index 18bf1a3..bee4595 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_02.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_jaccard-to-jaccard-check_02.adm";
for $paper in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_03.aql
index f2f6e77..591c8f0 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_03.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_jaccard-to-jaccard-check_02.adm";
for $paper in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_04.aql
index 8a945bc..2d10e1d 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_04.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_jaccard-to-jaccard-check_03.adm";
for $paper in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_05.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_05.aql
index e9808ff..f091dcd 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_05.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_05.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_jaccard-to-jaccard-check_05.adm";
// We cannot introduce jaccard-check because the condition is <=
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_06.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_06.aql
index 91953fc..7b98eaf 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_06.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_06.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_jaccard-to-jaccard-check_06.adm";
// We cannot introduce jaccard-check because the condition is >=
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_07.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_07.aql
index 2f3b080..71f087e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_07.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_07.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_jaccard-to-jaccard-check_07.adm";
// We cannot introduce jaccard-check because the condition is <
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_08.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_08.aql
index fc61d1f..13d11ed 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_08.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_08.aql
@@ -19,10 +19,6 @@
create dataset DBLP(DBLPType) partitioned by key id;
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
write output to nc1:"rttest/similarity_jaccard-to-jaccard-check_08.adm";
// We cannot introduce jaccard-check because the condition is >
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join-multipred.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join-multipred.plan
new file mode 100644
index 0000000..0f98d59
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join-multipred.plan
@@ -0,0 +1,18 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$15(ASC)] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$15] |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_01.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_01.plan
new file mode 100644
index 0000000..a83e0eb
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_01.plan
@@ -0,0 +1,16 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$11(ASC)] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$11] |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_02.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_02.plan
new file mode 100644
index 0000000..d6d4497
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_02.plan
@@ -0,0 +1,16 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$10(ASC)] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$10] |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_03.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_03.plan
new file mode 100644
index 0000000..c5c0f4f
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_03.plan
@@ -0,0 +1,11 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index-join/secondary-equi-join-multiindex.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/secondary-equi-join-multiindex.plan
new file mode 100644
index 0000000..947404f
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/secondary-equi-join-multiindex.plan
@@ -0,0 +1,22 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$29(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index-join/secondary-equi-join-multipred.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/secondary-equi-join-multipred.plan
new file mode 100644
index 0000000..e767365
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/secondary-equi-join-multipred.plan
@@ -0,0 +1,22 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$24(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index-join/secondary-equi-join_01.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/secondary-equi-join_01.plan
new file mode 100644
index 0000000..7e0c315
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/secondary-equi-join_01.plan
@@ -0,0 +1,20 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$13(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index-join/secondary-equi-join_02.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/secondary-equi-join_02.plan
new file mode 100644
index 0000000..7e0c315
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/secondary-equi-join_02.plan
@@ -0,0 +1,20 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$13(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index-join/secondary-equi-join_03.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/secondary-equi-join_03.plan
new file mode 100644
index 0000000..7e0c315
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/secondary-equi-join_03.plan
@@ -0,0 +1,20 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$13(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-01.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-01.plan
new file mode 100644
index 0000000..46990a8
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-01.plan
@@ -0,0 +1,9 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-02.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-02.plan
new file mode 100644
index 0000000..46990a8
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-02.plan
@@ -0,0 +1,9 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-03.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-03.plan
new file mode 100644
index 0000000..46990a8
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-03.plan
@@ -0,0 +1,9 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-04.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-04.plan
new file mode 100644
index 0000000..46990a8
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-04.plan
@@ -0,0 +1,9 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-05.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-05.plan
new file mode 100644
index 0000000..46990a8
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-05.plan
@@ -0,0 +1,9 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-06.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-06.plan
new file mode 100644
index 0000000..46990a8
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-06.plan
@@ -0,0 +1,9 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-07.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-07.plan
new file mode 100644
index 0000000..46990a8
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-07.plan
@@ -0,0 +1,9 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-08.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-08.plan
new file mode 100644
index 0000000..04e0a6c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-08.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-09.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-09.plan
new file mode 100644
index 0000000..4189498
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-09.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-10.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-10.plan
new file mode 100644
index 0000000..4189498
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-10.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-11.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-11.plan
new file mode 100644
index 0000000..4189498
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-11.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-12.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-12.plan
new file mode 100644
index 0000000..4189498
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-12.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-13.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-13.plan
new file mode 100644
index 0000000..4189498
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-13.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-14.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-14.plan
new file mode 100644
index 0000000..4189498
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-14.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-15.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-15.plan
new file mode 100644
index 0000000..04e0a6c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-15.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-16.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-16.plan
new file mode 100644
index 0000000..04e0a6c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-16.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-17.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-17.plan
new file mode 100644
index 0000000..4189498
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-17.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-18.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-18.plan
new file mode 100644
index 0000000..4189498
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-18.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-19.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-19.plan
new file mode 100644
index 0000000..04e0a6c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-19.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-20.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-20.plan
new file mode 100644
index 0000000..04e0a6c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-20.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-21.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-21.plan
new file mode 100644
index 0000000..04e0a6c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-21.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-22.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-22.plan
new file mode 100644
index 0000000..04e0a6c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-22.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-23.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-23.plan
new file mode 100644
index 0000000..04e0a6c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-23.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-24.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-24.plan
new file mode 100644
index 0000000..04e0a6c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-24.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-25.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-25.plan
new file mode 100644
index 0000000..04e0a6c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-25.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-26.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-26.plan
new file mode 100644
index 0000000..04e0a6c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-primary-26.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-31.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-31.plan
new file mode 100644
index 0000000..1924060
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-31.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-32.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-32.plan
new file mode 100644
index 0000000..1924060
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-32.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-33.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-33.plan
new file mode 100644
index 0000000..1924060
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-33.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-34.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-34.plan
new file mode 100644
index 0000000..1924060
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-34.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-35.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-35.plan
new file mode 100644
index 0000000..1924060
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-35.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-36.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-36.plan
new file mode 100644
index 0000000..1924060
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-36.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-37.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-37.plan
new file mode 100644
index 0000000..1924060
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-37.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-38.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-38.plan
new file mode 100644
index 0000000..7c1c1a3
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-38.plan
@@ -0,0 +1,14 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$16(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-39.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-39.plan
new file mode 100644
index 0000000..1924060
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-39.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-40.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-40.plan
new file mode 100644
index 0000000..1924060
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-40.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-41.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-41.plan
new file mode 100644
index 0000000..1924060
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-41.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-42.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-42.plan
new file mode 100644
index 0000000..1924060
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-42.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-43.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-43.plan
new file mode 100644
index 0000000..1924060
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-43.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-44.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-44.plan
new file mode 100644
index 0000000..1924060
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-44.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-45.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-45.plan
new file mode 100644
index 0000000..35c7ebb
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-45.plan
@@ -0,0 +1,14 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$20(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-46.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-46.plan
new file mode 100644
index 0000000..35c7ebb
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-46.plan
@@ -0,0 +1,14 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$20(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-47.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-47.plan
new file mode 100644
index 0000000..1924060
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-47.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-48.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-48.plan
new file mode 100644
index 0000000..1924060
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-48.plan
@@ -0,0 +1,8 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-49.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-49.plan
new file mode 100644
index 0000000..35c7ebb
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-49.plan
@@ -0,0 +1,14 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$20(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-50.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-50.plan
new file mode 100644
index 0000000..35c7ebb
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-50.plan
@@ -0,0 +1,14 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$20(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-51.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-51.plan
new file mode 100644
index 0000000..35c7ebb
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-51.plan
@@ -0,0 +1,14 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$20(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-52.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-52.plan
new file mode 100644
index 0000000..e6e6ddf
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-52.plan
@@ -0,0 +1,14 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$8(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-53.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-53.plan
new file mode 100644
index 0000000..e6e6ddf
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-53.plan
@@ -0,0 +1,14 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$8(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-54.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-54.plan
new file mode 100644
index 0000000..e6e6ddf
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-54.plan
@@ -0,0 +1,14 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$8(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-55.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-55.plan
new file mode 100644
index 0000000..e6e6ddf
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-55.plan
@@ -0,0 +1,14 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$8(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-56.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-56.plan
new file mode 100644
index 0000000..16e6d6a
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-56.plan
@@ -0,0 +1,14 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$12(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-57.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-57.plan
new file mode 100644
index 0000000..16e6d6a
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-57.plan
@@ -0,0 +1,14 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$12(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-58.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-58.plan
new file mode 100644
index 0000000..edeed53
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-58.plan
@@ -0,0 +1,14 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$9(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/consolidate-selects-complex.plan b/asterix-app/src/test/resources/optimizerts/results/consolidate-selects-complex.plan
index f3e404f..26ea56f 100644
--- a/asterix-app/src/test/resources/optimizerts/results/consolidate-selects-complex.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/consolidate-selects-complex.plan
@@ -2,10 +2,10 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/consolidate-selects-simple.plan b/asterix-app/src/test/resources/optimizerts/results/consolidate-selects-simple.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/consolidate-selects-simple.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/consolidate-selects-simple.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/const-folding.plan b/asterix-app/src/test/resources/optimizerts/results/const-folding.plan
index 70e2daa..413cf0c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/const-folding.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/const-folding.plan
@@ -1,4 +1,3 @@
-- SINK_WRITE |UNPARTITIONED|
- -- STREAM_PROJECT |UNPARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
+ -- ASSIGN |UNPARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/count-tweets.plan b/asterix-app/src/test/resources/optimizerts/results/count-tweets.plan
index 4f1d53f..c769bda 100644
--- a/asterix-app/src/test/resources/optimizerts/results/count-tweets.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/count-tweets.plan
@@ -9,17 +9,17 @@
-- NESTED_TUPLE_SOURCE |LOCAL|
}
-- HASH_PARTITION_MERGE_EXCHANGE MERGE:[$$14(ASC)] HASH:[$$14] |PARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$4] |LOCAL|
+ -- PRE_CLUSTERED_GROUP_BY[$$4] |PARTITIONED|
{
-- AGGREGATE |LOCAL|
-- NESTED_TUPLE_SOURCE |LOCAL|
}
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$4(ASC)] |LOCAL|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$4(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- UNNEST |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/cust_group_no_agg.plan b/asterix-app/src/test/resources/optimizerts/results/cust_group_no_agg.plan
index 6559478..7670428 100644
--- a/asterix-app/src/test/resources/optimizerts/results/cust_group_no_agg.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/cust_group_no_agg.plan
@@ -1,18 +1,17 @@
-- SINK_WRITE |PARTITIONED|
-- SORT_MERGE_EXCHANGE [$$1(ASC) ] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
+ -- PRE_CLUSTERED_GROUP_BY[$$6] |PARTITIONED|
+ {
+ -- AGGREGATE |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$6] |PARTITIONED|
- {
- -- AGGREGATE |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$6(ASC)] |LOCAL|
- -- HASH_PARTITION_EXCHANGE [$$6] |PARTITIONED|
+ -- STABLE_SORT [$$6(ASC)] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$6] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/denorm-cust-order.plan b/asterix-app/src/test/resources/optimizerts/results/denorm-cust-order.plan
index 347a895..b471681 100644
--- a/asterix-app/src/test/resources/optimizerts/results/denorm-cust-order.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/denorm-cust-order.plan
@@ -3,24 +3,24 @@
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$15] |PARTITIONED|
+ -- PRE_CLUSTERED_GROUP_BY[$$16] |PARTITIONED|
{
-- AGGREGATE |LOCAL|
-- NESTED_TUPLE_SOURCE |LOCAL|
}
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$15(ASC)] |LOCAL|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$16(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$15][$$19] |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$16][$$19] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- EMPTY_TUPLE_SOURCE |PARTITIONED|
-- HASH_PARTITION_EXCHANGE [$$19] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/fj-dblp-csx.plan b/asterix-app/src/test/resources/optimizerts/results/fj-dblp-csx.plan
index 3d1699e..9fbd8ff 100644
--- a/asterix-app/src/test/resources/optimizerts/results/fj-dblp-csx.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/fj-dblp-csx.plan
@@ -7,8 +7,8 @@
-- AGGREGATE |LOCAL|
-- NESTED_TUPLE_SOURCE |LOCAL|
}
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$42(ASC), $$44(ASC)] |LOCAL|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$42(ASC), $$44(ASC)] |PARTITIONED|
-- HASH_PARTITION_EXCHANGE [$$42, $$44] |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
@@ -23,8 +23,8 @@
-- STREAM_SELECT |LOCAL|
-- NESTED_TUPLE_SOURCE |LOCAL|
}
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$46(ASC), $$5(ASC)] |LOCAL|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$46(ASC), $$5(ASC)] |PARTITIONED|
-- HASH_PARTITION_EXCHANGE [$$46] |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
@@ -32,7 +32,7 @@
-- HASH_PARTITION_EXCHANGE [$$3] |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- UNNEST |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
@@ -48,10 +48,11 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
-- HASH_PARTITION_EXCHANGE [$$17] |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- UNNEST |PARTITIONED|
@@ -62,8 +63,8 @@
-- STREAM_SELECT |LOCAL|
-- NESTED_TUPLE_SOURCE |LOCAL|
}
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$47(ASC), $$14(ASC)] |LOCAL|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$47(ASC), $$14(ASC)] |PARTITIONED|
-- HASH_PARTITION_EXCHANGE [$$47] |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
@@ -71,7 +72,7 @@
-- HASH_PARTITION_EXCHANGE [$$12] |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- UNNEST |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
@@ -84,7 +85,8 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/fj-phase1.plan b/asterix-app/src/test/resources/optimizerts/results/fj-phase1.plan
index c930bc7..d0479cc 100644
--- a/asterix-app/src/test/resources/optimizerts/results/fj-phase1.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/fj-phase1.plan
@@ -2,51 +2,55 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$23] |PARTITIONED|
- {
- -- AGGREGATE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$23(ASC), $$6(ASC)] |LOCAL|
- -- HASH_PARTITION_EXCHANGE [$$23] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$1][$$6] |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$1] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- UNNEST |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$6] |PARTITIONED|
- -- RUNNING_AGGREGATE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- PRE_CLUSTERED_GROUP_BY[$$23] |PARTITIONED|
+ {
+ -- AGGREGATE |LOCAL|
+ -- STREAM_SELECT |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$23(ASC), $$6(ASC)] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$23] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$1][$$6] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$1] |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
- -- SORT_MERGE_EXCHANGE [$$24(DESC) ] |PARTITIONED|
- -- STABLE_SORT [$$24(DESC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$30] |PARTITIONED|
- {
- -- AGGREGATE |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- HASH_PARTITION_MERGE_EXCHANGE MERGE:[$$30(ASC)] HASH:[$$30] |PARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$5] |LOCAL|
- {
- -- AGGREGATE |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$5(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- UNNEST |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- UNNEST |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$6] |PARTITIONED|
+ -- RUNNING_AGGREGATE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- SORT_MERGE_EXCHANGE [$$24(DESC) ] |PARTITIONED|
+ -- STABLE_SORT [$$24(DESC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- PRE_CLUSTERED_GROUP_BY[$$30] |PARTITIONED|
+ {
+ -- AGGREGATE |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- HASH_PARTITION_MERGE_EXCHANGE MERGE:[$$30(ASC)] HASH:[$$30] |PARTITIONED|
+ -- PRE_CLUSTERED_GROUP_BY[$$5] |PARTITIONED|
+ {
+ -- AGGREGATE |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$5(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- UNNEST |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/fj-phase2-with-hints.plan b/asterix-app/src/test/resources/optimizerts/results/fj-phase2-with-hints.plan
index ef6d4e3..a1dc0d4 100644
--- a/asterix-app/src/test/resources/optimizerts/results/fj-phase2-with-hints.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/fj-phase2-with-hints.plan
@@ -1,53 +1,56 @@
-- SINK_WRITE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- SORT_MERGE_EXCHANGE [$$31(ASC) ] |PARTITIONED|
- -- STABLE_SORT [$$31(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$27] |PARTITIONED|
- {
- -- AGGREGATE |LOCAL|
- -- IN_MEMORY_STABLE_SORT [$$4(ASC)] |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- IN_MEMORY_HASH_JOIN [$$2][$$7] |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- UNNEST |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- RUNNING_AGGREGATE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- SORT_MERGE_EXCHANGE [$$31(ASC) ] |PARTITIONED|
+ -- STABLE_SORT [$$31(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- PRE_CLUSTERED_GROUP_BY[$$27] |PARTITIONED|
+ {
+ -- AGGREGATE |LOCAL|
+ -- IN_MEMORY_STABLE_SORT [$$4(ASC)] |LOCAL|
+ -- STREAM_SELECT |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- IN_MEMORY_HASH_JOIN [$$2][$$7] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
- -- SORT_MERGE_EXCHANGE [$$28(ASC), $$7(ASC) ] |PARTITIONED|
- -- STABLE_SORT [$$28(ASC), $$7(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EXTERNAL_GROUP_BY[$$36] |PARTITIONED|
- {
- -- AGGREGATE |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- HASH_PARTITION_EXCHANGE [$$36] |PARTITIONED|
- -- EXTERNAL_GROUP_BY[$$6] |LOCAL|
- {
- -- AGGREGATE |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- UNNEST |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- UNNEST |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- RUNNING_AGGREGATE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- SORT_MERGE_EXCHANGE [$$28(ASC), $$7(ASC) ] |PARTITIONED|
+ -- STABLE_SORT [$$28(ASC), $$7(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EXTERNAL_GROUP_BY[$$36] |PARTITIONED|
+ {
+ -- AGGREGATE |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- HASH_PARTITION_EXCHANGE [$$36] |PARTITIONED|
+ -- EXTERNAL_GROUP_BY[$$6] |PARTITIONED|
+ {
+ -- AGGREGATE |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- UNNEST |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inline-funs.plan b/asterix-app/src/test/resources/optimizerts/results/inline-funs.plan
index 70e2daa..413cf0c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inline-funs.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inline-funs.plan
@@ -1,4 +1,3 @@
-- SINK_WRITE |UNPARTITIONED|
- -- STREAM_PROJECT |UNPARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
+ -- ASSIGN |UNPARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inlined_q18_large_volume_customer.plan b/asterix-app/src/test/resources/optimizerts/results/inlined_q18_large_volume_customer.plan
index 81b10a9..768954d 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inlined_q18_large_volume_customer.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inlined_q18_large_volume_customer.plan
@@ -3,35 +3,35 @@
-- ASSIGN |UNPARTITIONED|
-- STREAM_LIMIT |UNPARTITIONED|
-- SORT_MERGE_EXCHANGE [$$12(DESC), $$11(ASC) ] |PARTITIONED|
- -- STREAM_LIMIT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$12(DESC), $$11(ASC)] |LOCAL|
+ -- STREAM_LIMIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$12(DESC), $$11(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$73, $$74] |PARTITIONED|
+ -- PRE_CLUSTERED_GROUP_BY[$$72, $$73] |PARTITIONED|
{
-- AGGREGATE |LOCAL|
-- NESTED_TUPLE_SOURCE |LOCAL|
}
- -- HASH_PARTITION_MERGE_EXCHANGE MERGE:[$$73(ASC), $$74(ASC)] HASH:[$$73, $$74] |PARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$54, $$55] |LOCAL|
+ -- HASH_PARTITION_MERGE_EXCHANGE MERGE:[$$72(ASC), $$73(ASC)] HASH:[$$72, $$73] |PARTITIONED|
+ -- PRE_CLUSTERED_GROUP_BY[$$56, $$57] |PARTITIONED|
{
-- AGGREGATE |LOCAL|
-- NESTED_TUPLE_SOURCE |LOCAL|
}
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$54(ASC), $$55(ASC)] |LOCAL|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$56(ASC), $$57(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$55][$$58] |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$57][$$60] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$55][$$4] |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$55] |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$57][$$4] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$57] |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$54][$$63] |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$56][$$64] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
@@ -39,7 +39,7 @@
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$63] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$64] |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
@@ -50,13 +50,13 @@
-- STREAM_PROJECT |PARTITIONED|
-- STREAM_SELECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$70] |PARTITIONED|
+ -- PRE_CLUSTERED_GROUP_BY[$$69] |PARTITIONED|
{
-- AGGREGATE |LOCAL|
-- NESTED_TUPLE_SOURCE |LOCAL|
}
- -- HASH_PARTITION_MERGE_EXCHANGE MERGE:[$$70(ASC)] HASH:[$$70] |PARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$56] |LOCAL|
+ -- HASH_PARTITION_MERGE_EXCHANGE MERGE:[$$69(ASC)] HASH:[$$69] |PARTITIONED|
+ -- PRE_CLUSTERED_GROUP_BY[$$58] |PARTITIONED|
{
-- AGGREGATE |LOCAL|
-- NESTED_TUPLE_SOURCE |LOCAL|
@@ -66,11 +66,12 @@
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$58] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$60] |PARTITIONED|
-- STREAM_PROJECT |UNPARTITIONED|
-- ASSIGN |UNPARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
@@ -78,7 +79,8 @@
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/introhashpartitionmerge.plan b/asterix-app/src/test/resources/optimizerts/results/introhashpartitionmerge.plan
index 097c0df..7c47272 100644
--- a/asterix-app/src/test/resources/optimizerts/results/introhashpartitionmerge.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/introhashpartitionmerge.plan
@@ -1,6 +1,6 @@
-- SINK_WRITE |PARTITIONED|
-- SORT_MERGE_EXCHANGE [$$13(ASC) ] |PARTITIONED|
- -- STABLE_SORT [$$13(ASC)] |LOCAL|
+ -- STABLE_SORT [$$13(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
@@ -8,10 +8,11 @@
-- HASH_PARTITION_EXCHANGE [$$15] |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
-- HASH_PARTITION_MERGE_EXCHANGE MERGE:[$$13(ASC)] HASH:[$$16] |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-contains-panic.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-contains-panic.plan
index 4efec2d..f47d782 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-contains-panic.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-contains-panic.plan
@@ -1,10 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- SORT_MERGE_EXCHANGE [$$5(ASC) ] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-contains.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-contains.plan
index 356b847..a0e113c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-contains.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-contains.plan
@@ -1,17 +1,16 @@
-- SINK_WRITE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- SORT_MERGE_EXCHANGE [$$5(ASC) ] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$9(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$9(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-edit-distance-check-panic.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-edit-distance-check-panic.plan
index 3babdef..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-edit-distance-check-panic.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-edit-distance-check-panic.plan
@@ -1,10 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-edit-distance-check.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-edit-distance-check.plan
index f3b90fe..16df47c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-edit-distance-check.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-edit-distance-check.plan
@@ -1,16 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$8(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$8(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-edit-distance-panic.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-edit-distance-panic.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-edit-distance-panic.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-edit-distance-panic.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-edit-distance.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-edit-distance.plan
index f3b90fe..16df47c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-edit-distance.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-edit-distance.plan
@@ -1,16 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$8(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$8(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-fuzzyeq-edit-distance.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-fuzzyeq-edit-distance.plan
index 77c98be..9b8c02b 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-fuzzyeq-edit-distance.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-fuzzyeq-edit-distance.plan
@@ -1,16 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$7(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$7(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-fuzzyeq-jaccard.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-fuzzyeq-jaccard.plan
index fd84553..eb44a07 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-fuzzyeq-jaccard.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-fuzzyeq-jaccard.plan
@@ -1,16 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$9(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$9(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-jaccard-check.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-jaccard-check.plan
index 5f5331c..efc0c6f 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-jaccard-check.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-jaccard-check.plan
@@ -1,16 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$10(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$10(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-jaccard.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-jaccard.plan
index 5f5331c..efc0c6f 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-jaccard.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ngram-jaccard.plan
@@ -1,16 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$10(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$10(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-edit-distance-check-panic.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-edit-distance-check-panic.plan
index 4c01aae..658c7a7 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-edit-distance-check-panic.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-edit-distance-check-panic.plan
@@ -1,10 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- SORT_MERGE_EXCHANGE [$$7(ASC) ] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-edit-distance-check.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-edit-distance-check.plan
index e0176c7..4616c55 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-edit-distance-check.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-edit-distance-check.plan
@@ -1,17 +1,16 @@
-- SINK_WRITE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- SORT_MERGE_EXCHANGE [$$7(ASC) ] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$11(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$11(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-edit-distance-panic.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-edit-distance-panic.plan
index 4c01aae..658c7a7 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-edit-distance-panic.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-edit-distance-panic.plan
@@ -1,10 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- SORT_MERGE_EXCHANGE [$$7(ASC) ] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-edit-distance.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-edit-distance.plan
index e0176c7..4616c55 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-edit-distance.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-edit-distance.plan
@@ -1,17 +1,16 @@
-- SINK_WRITE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- SORT_MERGE_EXCHANGE [$$7(ASC) ] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$11(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$11(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-fuzzyeq-edit-distance.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-fuzzyeq-edit-distance.plan
index 854f188..04c2b2b 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-fuzzyeq-edit-distance.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-fuzzyeq-edit-distance.plan
@@ -1,17 +1,16 @@
-- SINK_WRITE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- SORT_MERGE_EXCHANGE [$$6(ASC) ] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$10(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$10(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-fuzzyeq-jaccard.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-fuzzyeq-jaccard.plan
index f3b90fe..16df47c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-fuzzyeq-jaccard.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-fuzzyeq-jaccard.plan
@@ -1,16 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$8(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$8(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-jaccard-check.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-jaccard-check.plan
index fd84553..eb44a07 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-jaccard-check.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-jaccard-check.plan
@@ -1,16 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$9(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$9(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-jaccard.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-jaccard.plan
index fd84553..eb44a07 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-jaccard.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/olist-jaccard.plan
@@ -1,16 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$9(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$9(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ulist-fuzzyeq-jaccard.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ulist-fuzzyeq-jaccard.plan
index f3b90fe..16df47c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ulist-fuzzyeq-jaccard.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ulist-fuzzyeq-jaccard.plan
@@ -1,16 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$8(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$8(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ulist-jaccard-check.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ulist-jaccard-check.plan
index fd84553..eb44a07 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ulist-jaccard-check.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ulist-jaccard-check.plan
@@ -1,16 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$9(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$9(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ulist-jaccard.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ulist-jaccard.plan
index fd84553..eb44a07 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ulist-jaccard.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/ulist-jaccard.plan
@@ -1,16 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$9(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$9(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/word-contains.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/word-contains.plan
index 4efec2d..f47d782 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/word-contains.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/word-contains.plan
@@ -1,10 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- SORT_MERGE_EXCHANGE [$$5(ASC) ] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/word-fuzzyeq-jaccard.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/word-fuzzyeq-jaccard.plan
index fd84553..eb44a07 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/word-fuzzyeq-jaccard.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/word-fuzzyeq-jaccard.plan
@@ -1,16 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$9(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$9(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/word-jaccard-check.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/word-jaccard-check.plan
index 5f5331c..efc0c6f 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/word-jaccard-check.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/word-jaccard-check.plan
@@ -1,16 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$10(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$10(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/word-jaccard.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/word-jaccard.plan
index 5f5331c..efc0c6f 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/word-jaccard.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-basic/word-jaccard.plan
@@ -1,16 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$10(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$10(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.plan
index 0e38aba..1d39102 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.plan
@@ -3,11 +3,11 @@
-- STREAM_PROJECT |PARTITIONED|
-- STREAM_SELECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$15(ASC)] |LOCAL|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$14(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.plan
index 0e38aba..1d39102 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.plan
@@ -3,11 +3,11 @@
-- STREAM_PROJECT |PARTITIONED|
-- STREAM_SELECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$15(ASC)] |LOCAL|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$14(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-edit-distance-check-let-panic.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-edit-distance-check-let-panic.plan
index 3babdef..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-edit-distance-check-let-panic.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-edit-distance-check-let-panic.plan
@@ -1,10 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-edit-distance-check-let.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-edit-distance-check-let.plan
index 816c9f0..eb44a07 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-edit-distance-check-let.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-edit-distance-check-let.plan
@@ -1,17 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$9(ASC)] |LOCAL|
+ -- STABLE_SORT [$$9(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-jaccard-check-let.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-jaccard-check-let.plan
index db6d7f0..98bb997 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-jaccard-check-let.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-jaccard-check-let.plan
@@ -1,17 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$11(ASC)] |LOCAL|
+ -- STABLE_SORT [$$11(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-jaccard-check-multi-let.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-jaccard-check-multi-let.plan
index a2ce938..c6292b5 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-jaccard-check-multi-let.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ngram-jaccard-check-multi-let.plan
@@ -3,13 +3,13 @@
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$14(ASC)] |LOCAL|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$16(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/olist-edit-distance-check-let-panic.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/olist-edit-distance-check-let-panic.plan
index 1d1f5ca..b9c935e 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/olist-edit-distance-check-let-panic.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/olist-edit-distance-check-let-panic.plan
@@ -1,11 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- SORT_MERGE_EXCHANGE [$$8(ASC) ] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/olist-edit-distance-check-let.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/olist-edit-distance-check-let.plan
index 543d70d..8ca73c8 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/olist-edit-distance-check-let.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/olist-edit-distance-check-let.plan
@@ -1,18 +1,16 @@
-- SINK_WRITE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- SORT_MERGE_EXCHANGE [$$8(ASC) ] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$12(ASC)] |LOCAL|
+ -- STABLE_SORT [$$12(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/olist-jaccard-check-let.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/olist-jaccard-check-let.plan
index 19748ce..efc0c6f 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/olist-jaccard-check-let.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/olist-jaccard-check-let.plan
@@ -1,17 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$10(ASC)] |LOCAL|
+ -- STABLE_SORT [$$10(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ulist-jaccard-check-let.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ulist-jaccard-check-let.plan
index 19748ce..efc0c6f 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ulist-jaccard-check-let.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/ulist-jaccard-check-let.plan
@@ -1,17 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$10(ASC)] |LOCAL|
+ -- STABLE_SORT [$$10(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/word-jaccard-check-let.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/word-jaccard-check-let.plan
index db6d7f0..98bb997 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/word-jaccard-check-let.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/word-jaccard-check-let.plan
@@ -1,17 +1,15 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$11(ASC)] |LOCAL|
+ -- STABLE_SORT [$$11(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/word-jaccard-check-multi-let.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/word-jaccard-check-multi-let.plan
index a2ce938..c6292b5 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/word-jaccard-check-multi-let.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-complex/word-jaccard-check-multi-let.plan
@@ -3,13 +3,13 @@
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$14(ASC)] |LOCAL|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$16(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ngram-edit-distance-inline.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ngram-edit-distance-inline.plan
new file mode 100644
index 0000000..d076896
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ngram-edit-distance-inline.plan
@@ -0,0 +1,55 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$31(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ngram-edit-distance.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ngram-edit-distance.plan
new file mode 100644
index 0000000..f8c761c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ngram-edit-distance.plan
@@ -0,0 +1,52 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$28(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ngram-fuzzyeq-edit-distance.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ngram-fuzzyeq-edit-distance.plan
new file mode 100644
index 0000000..d85439b
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ngram-fuzzyeq-edit-distance.plan
@@ -0,0 +1,52 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$27(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ngram-fuzzyeq-jaccard.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ngram-fuzzyeq-jaccard.plan
new file mode 100644
index 0000000..f9cd587
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ngram-fuzzyeq-jaccard.plan
@@ -0,0 +1,22 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$26(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ngram-jaccard-inline.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ngram-jaccard-inline.plan
new file mode 100644
index 0000000..68b8344
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ngram-jaccard-inline.plan
@@ -0,0 +1,23 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$30(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ngram-jaccard.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ngram-jaccard.plan
new file mode 100644
index 0000000..c81fb49
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ngram-jaccard.plan
@@ -0,0 +1,22 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$27(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/olist-edit-distance-inline.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/olist-edit-distance-inline.plan
new file mode 100644
index 0000000..d076896
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/olist-edit-distance-inline.plan
@@ -0,0 +1,55 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$31(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/olist-edit-distance.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/olist-edit-distance.plan
new file mode 100644
index 0000000..f8c761c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/olist-edit-distance.plan
@@ -0,0 +1,52 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$28(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/olist-fuzzyeq-edit-distance.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/olist-fuzzyeq-edit-distance.plan
new file mode 100644
index 0000000..d85439b
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/olist-fuzzyeq-edit-distance.plan
@@ -0,0 +1,52 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$27(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/olist-fuzzyeq-jaccard.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/olist-fuzzyeq-jaccard.plan
new file mode 100644
index 0000000..a5ccaf0
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/olist-fuzzyeq-jaccard.plan
@@ -0,0 +1,22 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$24(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/olist-jaccard-inline.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/olist-jaccard-inline.plan
new file mode 100644
index 0000000..d56abde
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/olist-jaccard-inline.plan
@@ -0,0 +1,23 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$28(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/olist-jaccard.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/olist-jaccard.plan
new file mode 100644
index 0000000..7e81b5c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/olist-jaccard.plan
@@ -0,0 +1,22 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ulist-fuzzyeq-jaccard.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ulist-fuzzyeq-jaccard.plan
new file mode 100644
index 0000000..a5ccaf0
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ulist-fuzzyeq-jaccard.plan
@@ -0,0 +1,22 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$24(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ulist-jaccard-inline.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ulist-jaccard-inline.plan
new file mode 100644
index 0000000..d56abde
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ulist-jaccard-inline.plan
@@ -0,0 +1,23 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$28(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ulist-jaccard.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ulist-jaccard.plan
new file mode 100644
index 0000000..7e81b5c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/ulist-jaccard.plan
@@ -0,0 +1,22 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/word-fuzzyeq-jaccard.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/word-fuzzyeq-jaccard.plan
new file mode 100644
index 0000000..f9cd587
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/word-fuzzyeq-jaccard.plan
@@ -0,0 +1,22 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$26(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/word-jaccard-inline.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/word-jaccard-inline.plan
new file mode 100644
index 0000000..68b8344
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/word-jaccard-inline.plan
@@ -0,0 +1,23 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$30(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/word-jaccard.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/word-jaccard.plan
new file mode 100644
index 0000000..c81fb49
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join-noeqjoin/word-jaccard.plan
@@ -0,0 +1,22 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$27(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance-check_01.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance-check_01.plan
index b9f157b..dc0290e 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance-check_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance-check_01.plan
@@ -2,43 +2,54 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- UNION_ALL |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$22(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$14] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$14] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$26(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- NESTED_LOOP |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- DATASOURCE_SCAN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance-check_02.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance-check_02.plan
index b9f157b..8778a91 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance-check_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance-check_02.plan
@@ -2,43 +2,54 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- UNION_ALL |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$22(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$13] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$13] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$26(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- NESTED_LOOP |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- DATASOURCE_SCAN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance-check_03.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance-check_03.plan
index b9f157b..dc0290e 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance-check_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance-check_03.plan
@@ -2,43 +2,54 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- UNION_ALL |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$22(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$14] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$14] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$26(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- NESTED_LOOP |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- DATASOURCE_SCAN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance-check_04.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance-check_04.plan
new file mode 100644
index 0000000..ab51938
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance-check_04.plan
@@ -0,0 +1,59 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$26][$$16] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$16] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$31(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance_01.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance_01.plan
index b9f157b..dc0290e 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance_01.plan
@@ -2,43 +2,54 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- UNION_ALL |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$22(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$14] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$14] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$26(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- NESTED_LOOP |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- DATASOURCE_SCAN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance_02.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance_02.plan
index b9f157b..8778a91 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance_02.plan
@@ -2,43 +2,54 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- UNION_ALL |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$22(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$13] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$13] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$26(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- NESTED_LOOP |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- DATASOURCE_SCAN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance_03.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance_03.plan
index b9f157b..dc0290e 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance_03.plan
@@ -2,43 +2,54 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- UNION_ALL |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$22(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$14] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$14] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$26(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- NESTED_LOOP |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- DATASOURCE_SCAN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance_04.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance_04.plan
new file mode 100644
index 0000000..124683b
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-edit-distance_04.plan
@@ -0,0 +1,59 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$26][$$15] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$15] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$31(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-edit-distance_01.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-edit-distance_01.plan
index 29e7a4f..a303675 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-edit-distance_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-edit-distance_01.plan
@@ -2,43 +2,54 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- UNION_ALL |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$21(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$20][$$12] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$12] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- NESTED_LOOP |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- DATASOURCE_SCAN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-edit-distance_02.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-edit-distance_02.plan
index 29e7a4f..c1684186 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-edit-distance_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-edit-distance_02.plan
@@ -2,43 +2,54 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- UNION_ALL |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$21(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$20][$$13] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$13] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- NESTED_LOOP |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- DATASOURCE_SCAN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-edit-distance_03.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-edit-distance_03.plan
index 29e7a4f..c1684186 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-edit-distance_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-edit-distance_03.plan
@@ -2,43 +2,54 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- UNION_ALL |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$21(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$20][$$13] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$13] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- NESTED_LOOP |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- DATASOURCE_SCAN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-jaccard_01.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-jaccard_01.plan
index 9765cbb..56bdbc0 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-jaccard_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-jaccard_01.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$22][$$15] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$20(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$15] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$24(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-jaccard_02.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-jaccard_02.plan
index 9765cbb..92aeb25 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-jaccard_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-jaccard_02.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$22][$$14] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$20(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$14] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$24(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-jaccard_03.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-jaccard_03.plan
index 9765cbb..56bdbc0 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-jaccard_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-fuzzyeq-jaccard_03.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$22][$$15] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$20(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$15] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$24(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard-check_01.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard-check_01.plan
index 64a8027..118c59d 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard-check_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard-check_01.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$23][$$16] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$21(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$16] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard-check_02.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard-check_02.plan
index 64a8027..5b17b83 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard-check_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard-check_02.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$23][$$15] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$21(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$15] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard-check_03.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard-check_03.plan
index 64a8027..118c59d 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard-check_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard-check_03.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$23][$$16] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$21(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$16] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard-check_04.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard-check_04.plan
new file mode 100644
index 0000000..7008fb5
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard-check_04.plan
@@ -0,0 +1,30 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$28][$$18] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$18] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$30(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard_01.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard_01.plan
index 64a8027..118c59d 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard_01.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$23][$$16] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$21(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$16] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard_02.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard_02.plan
index 64a8027..5b17b83 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard_02.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$23][$$15] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$21(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$15] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard_03.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard_03.plan
index 64a8027..118c59d 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard_03.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$23][$$16] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$21(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$16] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard_04.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard_04.plan
new file mode 100644
index 0000000..e0fb775
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ngram-jaccard_04.plan
@@ -0,0 +1,30 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$28][$$17] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$17] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$30(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance-check_01.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance-check_01.plan
index b9f157b..dc0290e 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance-check_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance-check_01.plan
@@ -2,43 +2,54 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- UNION_ALL |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$22(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$14] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$14] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$26(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- NESTED_LOOP |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- DATASOURCE_SCAN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance-check_02.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance-check_02.plan
index b9f157b..8778a91 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance-check_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance-check_02.plan
@@ -2,43 +2,54 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- UNION_ALL |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$22(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$13] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$13] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$26(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- NESTED_LOOP |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- DATASOURCE_SCAN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance-check_03.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance-check_03.plan
index b9f157b..dc0290e 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance-check_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance-check_03.plan
@@ -2,43 +2,54 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- UNION_ALL |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$22(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$14] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$14] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$26(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- NESTED_LOOP |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- DATASOURCE_SCAN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance-check_04.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance-check_04.plan
new file mode 100644
index 0000000..ab51938
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance-check_04.plan
@@ -0,0 +1,59 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$26][$$16] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$16] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$31(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance_01.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance_01.plan
index b9f157b..dc0290e 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance_01.plan
@@ -2,43 +2,54 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- UNION_ALL |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$22(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$14] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$14] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$26(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- NESTED_LOOP |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- DATASOURCE_SCAN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance_02.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance_02.plan
index b9f157b..8778a91 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance_02.plan
@@ -2,43 +2,54 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- UNION_ALL |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$22(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$13] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$13] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$26(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- NESTED_LOOP |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- DATASOURCE_SCAN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance_03.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance_03.plan
index b9f157b..dc0290e 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance_03.plan
@@ -2,43 +2,54 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- UNION_ALL |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$22(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$14] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$14] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$26(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- NESTED_LOOP |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- DATASOURCE_SCAN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance_04.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance_04.plan
new file mode 100644
index 0000000..124683b
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-edit-distance_04.plan
@@ -0,0 +1,59 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$26][$$15] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$15] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$31(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-edit-distance_01.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-edit-distance_01.plan
index 29e7a4f..c1684186 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-edit-distance_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-edit-distance_01.plan
@@ -2,43 +2,54 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- UNION_ALL |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$21(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$20][$$13] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$13] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- NESTED_LOOP |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- DATASOURCE_SCAN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-edit-distance_02.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-edit-distance_02.plan
index 29e7a4f..a303675 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-edit-distance_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-edit-distance_02.plan
@@ -2,43 +2,54 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- UNION_ALL |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$21(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$20][$$12] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$12] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- NESTED_LOOP |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- DATASOURCE_SCAN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-edit-distance_03.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-edit-distance_03.plan
index 29e7a4f..c1684186 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-edit-distance_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-edit-distance_03.plan
@@ -2,43 +2,54 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- UNION_ALL |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$21(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$20][$$13] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$13] |PARTITIONED|
+ -- UNION_ALL |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- NESTED_LOOP |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- SPLIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- NESTED_LOOP |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- DATASOURCE_SCAN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- SPLIT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-jaccard_01.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-jaccard_01.plan
index 8e5b300..fe21162 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-jaccard_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-jaccard_01.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$20][$$13] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$18(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$13] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$22(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-jaccard_02.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-jaccard_02.plan
index 8e5b300..041c44c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-jaccard_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-jaccard_02.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$20][$$12] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$18(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$12] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$22(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-jaccard_03.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-jaccard_03.plan
index 8e5b300..fe21162 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-jaccard_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-fuzzyeq-jaccard_03.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$20][$$13] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$18(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$13] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$22(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard-check_01.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard-check_01.plan
index 9a4269c..7b94042 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard-check_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard-check_01.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$14] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$19(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$14] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$23(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard-check_02.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard-check_02.plan
index 9a4269c..be2180f 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard-check_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard-check_02.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$13] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$19(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$13] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$23(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard-check_03.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard-check_03.plan
index 9a4269c..7b94042 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard-check_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard-check_03.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$14] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$19(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$14] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$23(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard-check_04.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard-check_04.plan
new file mode 100644
index 0000000..9ba18b3
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard-check_04.plan
@@ -0,0 +1,30 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$26][$$16] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$16] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$28(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard_01.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard_01.plan
index 9a4269c..7b94042 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard_01.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$14] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$19(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$14] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$23(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard_02.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard_02.plan
index 9a4269c..be2180f 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard_02.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$13] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$19(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$13] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$23(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard_03.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard_03.plan
index 9a4269c..7b94042 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard_03.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$14] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$19(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$14] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$23(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard_04.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard_04.plan
new file mode 100644
index 0000000..8fa9f49
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/olist-jaccard_04.plan
@@ -0,0 +1,30 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$26][$$15] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$15] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$28(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-fuzzyeq-jaccard_01.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-fuzzyeq-jaccard_01.plan
index 8e5b300..fe21162 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-fuzzyeq-jaccard_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-fuzzyeq-jaccard_01.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$20][$$13] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$18(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$13] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$22(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-fuzzyeq-jaccard_02.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-fuzzyeq-jaccard_02.plan
index 8e5b300..041c44c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-fuzzyeq-jaccard_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-fuzzyeq-jaccard_02.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$20][$$12] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$18(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$12] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$22(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-fuzzyeq-jaccard_03.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-fuzzyeq-jaccard_03.plan
index 8e5b300..fe21162 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-fuzzyeq-jaccard_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-fuzzyeq-jaccard_03.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$20][$$13] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$18(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$13] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$22(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard-check_01.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard-check_01.plan
index 9a4269c..7b94042 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard-check_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard-check_01.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$14] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$19(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$14] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$23(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard-check_02.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard-check_02.plan
index 9a4269c..be2180f 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard-check_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard-check_02.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$13] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$19(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$13] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$23(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard-check_03.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard-check_03.plan
index 9a4269c..7b94042 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard-check_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard-check_03.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$14] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$19(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$14] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$23(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard-check_04.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard-check_04.plan
new file mode 100644
index 0000000..9ba18b3
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard-check_04.plan
@@ -0,0 +1,30 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$26][$$16] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$16] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$28(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard_01.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard_01.plan
index 9a4269c..7b94042 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard_01.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$14] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$19(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$14] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$23(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard_02.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard_02.plan
index 9a4269c..be2180f 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard_02.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$13] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$19(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$13] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$23(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard_03.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard_03.plan
index 9a4269c..7b94042 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard_03.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$21][$$14] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$19(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$14] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$23(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard_04.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard_04.plan
new file mode 100644
index 0000000..8fa9f49
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/ulist-jaccard_04.plan
@@ -0,0 +1,30 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$26][$$15] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$15] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$28(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-fuzzyeq-jaccard_01.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-fuzzyeq-jaccard_01.plan
index 9765cbb..56bdbc0 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-fuzzyeq-jaccard_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-fuzzyeq-jaccard_01.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$22][$$15] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$20(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$15] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$24(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-fuzzyeq-jaccard_02.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-fuzzyeq-jaccard_02.plan
index 9765cbb..92aeb25 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-fuzzyeq-jaccard_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-fuzzyeq-jaccard_02.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$22][$$14] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$20(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$14] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$24(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-fuzzyeq-jaccard_03.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-fuzzyeq-jaccard_03.plan
index 9765cbb..56bdbc0 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-fuzzyeq-jaccard_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-fuzzyeq-jaccard_03.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$22][$$15] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$20(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$15] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$24(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard-check_01.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard-check_01.plan
index 64a8027..118c59d 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard-check_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard-check_01.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$23][$$16] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$21(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$16] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard-check_02.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard-check_02.plan
index 64a8027..9368e16 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard-check_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard-check_02.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$23][$$15] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$21(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$15] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard-check_03.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard-check_03.plan
index 64a8027..118c59d 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard-check_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard-check_03.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$23][$$16] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$21(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$16] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard-check_04.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard-check_04.plan
new file mode 100644
index 0000000..7008fb5
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard-check_04.plan
@@ -0,0 +1,30 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$28][$$18] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$18] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$30(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard_01.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard_01.plan
index 64a8027..118c59d 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard_01.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$23][$$16] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$21(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$16] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard_02.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard_02.plan
index 64a8027..5b17b83 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard_02.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$23][$$15] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$21(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$15] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard_03.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard_03.plan
index 64a8027..118c59d 100644
--- a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard_03.plan
@@ -2,18 +2,27 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$23][$$16] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$21(ASC)] |LOCAL|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$16] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INVERTED_INDEX_SEARCH |PARTITIONED|
- -- BROADCAST_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard_04.plan b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard_04.plan
new file mode 100644
index 0000000..e0fb775
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/inverted-index-join/word-jaccard_04.plan
@@ -0,0 +1,30 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$28][$$17] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$17] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$30(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INVERTED_INDEX_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/join-super-key_01.plan b/asterix-app/src/test/resources/optimizerts/results/join-super-key_01.plan
index 7f3d6d7..0d301cf 100644
--- a/asterix-app/src/test/resources/optimizerts/results/join-super-key_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/join-super-key_01.plan
@@ -2,19 +2,21 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$20, $$22, $$16][$$19, $$23, $$18] |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$20, $$22, $$16] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$17, $$22, $$24][$$19, $$23, $$20] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$17, $$22, $$24] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$19, $$23, $$18] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$19, $$23, $$20] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/join-super-key_02.plan b/asterix-app/src/test/resources/optimizerts/results/join-super-key_02.plan
index eb5e8c8..f4784ef 100644
--- a/asterix-app/src/test/resources/optimizerts/results/join-super-key_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/join-super-key_02.plan
@@ -2,19 +2,21 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$17, $$23, $$16][$$20, $$22, $$18] |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$17, $$23, $$18][$$19, $$22, $$24] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$19, $$24] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$18, $$20] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/loj-super-key_01.plan b/asterix-app/src/test/resources/optimizerts/results/loj-super-key_01.plan
index 87aac7f..1a9fbdb 100644
--- a/asterix-app/src/test/resources/optimizerts/results/loj-super-key_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/loj-super-key_01.plan
@@ -2,28 +2,29 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$22, $$23] |PARTITIONED|
- {
- -- AGGREGATE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$22(ASC), $$23(ASC)] |LOCAL|
- -- HASH_PARTITION_EXCHANGE [$$22, $$23] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$24, $$22, $$28][$$25, $$19, $$20] |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$24, $$22, $$28] |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$25, $$19, $$20] |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- PRE_CLUSTERED_GROUP_BY[$$22, $$23] |PARTITIONED|
+ {
+ -- AGGREGATE |LOCAL|
+ -- STREAM_SELECT |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$22(ASC), $$23(ASC)] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$22, $$23] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$24, $$22, $$28][$$25, $$19, $$20] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$24, $$22, $$28] |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$25, $$19, $$20] |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/loj-super-key_02.plan b/asterix-app/src/test/resources/optimizerts/results/loj-super-key_02.plan
index 7b0bf69..3926a1a 100644
--- a/asterix-app/src/test/resources/optimizerts/results/loj-super-key_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/loj-super-key_02.plan
@@ -2,29 +2,30 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$22, $$23] |PARTITIONED|
- {
- -- AGGREGATE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$22(ASC), $$23(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$25, $$22, $$23][$$24, $$19, $$28] |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$19, $$28] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- PRE_CLUSTERED_GROUP_BY[$$22, $$23] |PARTITIONED|
+ {
+ -- AGGREGATE |LOCAL|
+ -- STREAM_SELECT |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$22(ASC), $$23(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$25, $$22, $$23][$$24, $$19, $$28] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$19, $$28] |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/nested_loj2.plan b/asterix-app/src/test/resources/optimizerts/results/nested_loj2.plan
index a203f14..c542f97 100644
--- a/asterix-app/src/test/resources/optimizerts/results/nested_loj2.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/nested_loj2.plan
@@ -2,43 +2,44 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$25] |PARTITIONED|
- {
- -- AGGREGATE |LOCAL|
- -- MICRO_PRE_CLUSTERED_GROUP_BY[$$23] |LOCAL|
- {
- -- AGGREGATE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- STREAM_SELECT |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$25(ASC), $$23(ASC)] |LOCAL|
- -- HASH_PARTITION_EXCHANGE [$$25] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$23][$$20] |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$23] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$25][$$26] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- PRE_CLUSTERED_GROUP_BY[$$25] |PARTITIONED|
+ {
+ -- AGGREGATE |LOCAL|
+ -- MICRO_PRE_CLUSTERED_GROUP_BY[$$23] |LOCAL|
+ {
+ -- AGGREGATE |LOCAL|
+ -- STREAM_SELECT |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- STREAM_SELECT |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$25(ASC), $$23(ASC)] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$25] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$23][$$20] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$23] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$25][$$26] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$26] |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$20] |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$26] |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$20] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/nested_loj3.plan b/asterix-app/src/test/resources/optimizerts/results/nested_loj3.plan
index 4c7844e..8f0100c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/nested_loj3.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/nested_loj3.plan
@@ -2,58 +2,59 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$42] |PARTITIONED|
- {
- -- AGGREGATE |LOCAL|
- -- MICRO_PRE_CLUSTERED_GROUP_BY[$$40] |LOCAL|
- {
- -- AGGREGATE |LOCAL|
- -- MICRO_PRE_CLUSTERED_GROUP_BY[$$37, $$38] |LOCAL|
- {
- -- AGGREGATE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- IN_MEMORY_STABLE_SORT [$$37(ASC), $$38(ASC)] |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- IN_MEMORY_STABLE_SORT [$$40(ASC), $$38(ASC)] |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$42(ASC), $$40(ASC)] |LOCAL|
- -- HASH_PARTITION_EXCHANGE [$$42] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$48, $$50][$$34, $$35] |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$48, $$50] |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$40][$$37] |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$40] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$42][$$43] |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$43] |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$37] |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- PRE_CLUSTERED_GROUP_BY[$$42] |PARTITIONED|
+ {
+ -- AGGREGATE |LOCAL|
+ -- MICRO_PRE_CLUSTERED_GROUP_BY[$$40] |LOCAL|
+ {
+ -- AGGREGATE |LOCAL|
+ -- MICRO_PRE_CLUSTERED_GROUP_BY[$$37, $$38] |LOCAL|
+ {
+ -- AGGREGATE |LOCAL|
+ -- STREAM_SELECT |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- IN_MEMORY_STABLE_SORT [$$37(ASC), $$38(ASC)] |LOCAL|
+ -- STREAM_SELECT |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- IN_MEMORY_STABLE_SORT [$$40(ASC), $$38(ASC)] |LOCAL|
+ -- STREAM_SELECT |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$42(ASC), $$40(ASC)] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$42] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$48, $$50][$$34, $$35] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$48, $$50] |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$40][$$37] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$40] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$42][$$43] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$43] |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$37] |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/noncollocated.plan b/asterix-app/src/test/resources/optimizerts/results/noncollocated.plan
index 32a0b06..5e9c657 100644
--- a/asterix-app/src/test/resources/optimizerts/results/noncollocated.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/noncollocated.plan
@@ -2,19 +2,20 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$10][$$11] |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$10] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$11] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$10][$$11] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$10] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$11] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/orderby-desc-using-gby.plan b/asterix-app/src/test/resources/optimizerts/results/orderby-desc-using-gby.plan
index 671187a..3a6718f 100644
--- a/asterix-app/src/test/resources/optimizerts/results/orderby-desc-using-gby.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/orderby-desc-using-gby.plan
@@ -7,12 +7,13 @@
-- AGGREGATE |LOCAL|
-- NESTED_TUPLE_SOURCE |LOCAL|
}
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$9(DESC)] |LOCAL|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$9(DESC)] |PARTITIONED|
-- HASH_PARTITION_EXCHANGE [$$9] |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/orders-aggreg.plan b/asterix-app/src/test/resources/optimizerts/results/orders-aggreg.plan
index df2a96e..a1f97f3 100644
--- a/asterix-app/src/test/resources/optimizerts/results/orders-aggreg.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/orders-aggreg.plan
@@ -9,16 +9,16 @@
-- NESTED_TUPLE_SOURCE |LOCAL|
}
-- HASH_PARTITION_MERGE_EXCHANGE MERGE:[$$24(ASC)] HASH:[$$24] |PARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$16] |LOCAL|
+ -- PRE_CLUSTERED_GROUP_BY[$$16] |PARTITIONED|
{
-- AGGREGATE |LOCAL|
-- NESTED_TUPLE_SOURCE |LOCAL|
}
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$16(ASC)] |LOCAL|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$16(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/orders-composite-index-search.plan b/asterix-app/src/test/resources/optimizerts/results/orders-composite-index-search.plan
new file mode 100644
index 0000000..327253a
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/orders-composite-index-search.plan
@@ -0,0 +1,16 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$21(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/orders-index-search-conjunctive-open_01.plan b/asterix-app/src/test/resources/optimizerts/results/orders-index-search-conjunctive-open_01.plan
index 6e22ff1..69d88b6 100644
--- a/asterix-app/src/test/resources/optimizerts/results/orders-index-search-conjunctive-open_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/orders-index-search-conjunctive-open_01.plan
@@ -1,18 +1,19 @@
-- SINK_WRITE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- SORT_MERGE_EXCHANGE [$$11(ASC) ] |PARTITIONED|
+ -- SORT_MERGE_EXCHANGE [$$12(ASC) ] |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- STREAM_SELECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$20(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$19(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/orders-index-search-conjunctive-open_02.plan b/asterix-app/src/test/resources/optimizerts/results/orders-index-search-conjunctive-open_02.plan
index 2a501cf..dd3990a 100644
--- a/asterix-app/src/test/resources/optimizerts/results/orders-index-search-conjunctive-open_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/orders-index-search-conjunctive-open_02.plan
@@ -1,18 +1,19 @@
-- SINK_WRITE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- SORT_MERGE_EXCHANGE [$$12(ASC) ] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
+ -- SORT_MERGE_EXCHANGE [$$14(ASC) ] |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$22(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$20(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/orders-index-search-conjunctive_01.plan b/asterix-app/src/test/resources/optimizerts/results/orders-index-search-conjunctive_01.plan
index c9d9f78..69d88b6 100644
--- a/asterix-app/src/test/resources/optimizerts/results/orders-index-search-conjunctive_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/orders-index-search-conjunctive_01.plan
@@ -1,18 +1,19 @@
-- SINK_WRITE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- SORT_MERGE_EXCHANGE [$$11(ASC) ] |PARTITIONED|
+ -- SORT_MERGE_EXCHANGE [$$12(ASC) ] |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- STREAM_SELECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$20(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
\ No newline at end of file
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$19(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/orders-index-search-conjunctive_02.plan b/asterix-app/src/test/resources/optimizerts/results/orders-index-search-conjunctive_02.plan
index 85badf2..dd3990a 100644
--- a/asterix-app/src/test/resources/optimizerts/results/orders-index-search-conjunctive_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/orders-index-search-conjunctive_02.plan
@@ -1,18 +1,19 @@
-- SINK_WRITE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- SORT_MERGE_EXCHANGE [$$12(ASC) ] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
+ -- SORT_MERGE_EXCHANGE [$$14(ASC) ] |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$22(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
\ No newline at end of file
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$20(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/orders-index-search-open.plan b/asterix-app/src/test/resources/optimizerts/results/orders-index-search-open.plan
index 754f055..3a6ffad 100644
--- a/asterix-app/src/test/resources/optimizerts/results/orders-index-search-open.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/orders-index-search-open.plan
@@ -2,11 +2,11 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$14(ASC)] |LOCAL|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$13(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/orders-index-search.plan b/asterix-app/src/test/resources/optimizerts/results/orders-index-search.plan
index 754f055..3a6ffad 100644
--- a/asterix-app/src/test/resources/optimizerts/results/orders-index-search.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/orders-index-search.plan
@@ -2,11 +2,11 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$14(ASC)] |LOCAL|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$13(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/prim-idx-search-open.plan b/asterix-app/src/test/resources/optimizerts/results/prim-idx-search-open.plan
index 4ac0fda..6b5f842 100644
--- a/asterix-app/src/test/resources/optimizerts/results/prim-idx-search-open.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/prim-idx-search-open.plan
@@ -2,7 +2,7 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- BTREE_SEARCH |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/prim-idx-search.plan b/asterix-app/src/test/resources/optimizerts/results/prim-idx-search.plan
index 4ac0fda..6b5f842 100644
--- a/asterix-app/src/test/resources/optimizerts/results/prim-idx-search.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/prim-idx-search.plan
@@ -2,7 +2,7 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- BTREE_SEARCH |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/pull_select_above_eq_join.plan b/asterix-app/src/test/resources/optimizerts/results/pull_select_above_eq_join.plan
index a82190a..f242afd 100644
--- a/asterix-app/src/test/resources/optimizerts/results/pull_select_above_eq_join.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/pull_select_above_eq_join.plan
@@ -2,20 +2,22 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_SELECT |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$18][$$19] |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$18] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$18][$$19] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$18] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$19] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$19] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/push-project-through-group.plan b/asterix-app/src/test/resources/optimizerts/results/push-project-through-group.plan
index e74eaee..0431497 100644
--- a/asterix-app/src/test/resources/optimizerts/results/push-project-through-group.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/push-project-through-group.plan
@@ -2,30 +2,32 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$15] |PARTITIONED|
- {
- -- AGGREGATE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$15(ASC)] |LOCAL|
- -- HASH_PARTITION_EXCHANGE [$$15] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$17][$$16] |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$17] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- PRE_CLUSTERED_GROUP_BY[$$15] |PARTITIONED|
+ {
+ -- AGGREGATE |LOCAL|
+ -- STREAM_SELECT |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$15(ASC)] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$15] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$17][$$16] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$17] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$16] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$16] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/push_limit.plan b/asterix-app/src/test/resources/optimizerts/results/push_limit.plan
index 3400b25..0169800 100644
--- a/asterix-app/src/test/resources/optimizerts/results/push_limit.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/push_limit.plan
@@ -2,12 +2,13 @@
-- STREAM_PROJECT |UNPARTITIONED|
-- ASSIGN |UNPARTITIONED|
-- STREAM_LIMIT |UNPARTITIONED|
- -- SORT_MERGE_EXCHANGE [$$8(ASC) ] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- SORT_MERGE_EXCHANGE [$$9(ASC) ] |PARTITIONED|
-- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- STREAM_LIMIT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_LIMIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/q1.plan b/asterix-app/src/test/resources/optimizerts/results/q1.plan
index d723324..82a1c28 100644
--- a/asterix-app/src/test/resources/optimizerts/results/q1.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/q1.plan
@@ -2,17 +2,19 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- SUBPLAN |PARTITIONED|
- {
- -- AGGREGATE |LOCAL|
- -- STREAM_SELECT |LOCAL|
- -- UNNEST |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
+ -- SUBPLAN |PARTITIONED|
+ {
+ -- AGGREGATE |LOCAL|
+ -- STREAM_SELECT |LOCAL|
+ -- UNNEST |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/q2.plan b/asterix-app/src/test/resources/optimizerts/results/q2.plan
index f4cc5ec..c8eb368 100644
--- a/asterix-app/src/test/resources/optimizerts/results/q2.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/q2.plan
@@ -2,39 +2,43 @@
-- STREAM_PROJECT |UNPARTITIONED|
-- ASSIGN |UNPARTITIONED|
-- STREAM_LIMIT |UNPARTITIONED|
- -- SORT_MERGE_EXCHANGE [$$26(DESC) ] |PARTITIONED|
- -- STREAM_LIMIT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$26(DESC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$31] |PARTITIONED|
- {
- -- AGGREGATE |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- {
- -- AGGREGATE |LOCAL|
- -- MICRO_PRE_CLUSTERED_GROUP_BY[$$32] |LOCAL|
- {
- -- AGGREGATE |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
+ -- STREAM_PROJECT |PARTITIONED|
+ -- SORT_MERGE_EXCHANGE [$$26(DESC) ] |PARTITIONED|
+ -- STREAM_LIMIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$26(DESC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- PRE_CLUSTERED_GROUP_BY[$$32] |PARTITIONED|
+ {
+ -- AGGREGATE |LOCAL|
-- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- HASH_PARTITION_MERGE_EXCHANGE MERGE:[$$31(ASC), $$32(ASC)] HASH:[$$31] |PARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$23, $$24] |LOCAL|
- {
- -- AGGREGATE |LOCAL|
+ }
+ {
+ -- AGGREGATE |LOCAL|
+ -- MICRO_PRE_CLUSTERED_GROUP_BY[$$33] |LOCAL|
+ {
+ -- AGGREGATE |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
-- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$23(ASC), $$24(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- UNNEST |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ }
+ -- HASH_PARTITION_MERGE_EXCHANGE MERGE:[$$32(ASC), $$33(ASC)] HASH:[$$32] |PARTITIONED|
+ -- PRE_CLUSTERED_GROUP_BY[$$23, $$24] |PARTITIONED|
+ {
+ -- AGGREGATE |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$23(ASC), $$24(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- UNNEST |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/optimizerts/results/q3_shipping_priority.plan b/asterix-app/src/test/resources/optimizerts/results/q3_shipping_priority.plan
index 80badee..b96afc7 100644
--- a/asterix-app/src/test/resources/optimizerts/results/q3_shipping_priority.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/q3_shipping_priority.plan
@@ -2,52 +2,52 @@
-- STREAM_PROJECT |UNPARTITIONED|
-- ASSIGN |UNPARTITIONED|
-- STREAM_LIMIT |UNPARTITIONED|
- -- SORT_MERGE_EXCHANGE [$$44(DESC), $$4(ASC) ] |PARTITIONED|
- -- STREAM_LIMIT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$44(DESC), $$4(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EXTERNAL_GROUP_BY[$$55, $$56, $$57] |PARTITIONED|
- {
- -- AGGREGATE |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- HASH_PARTITION_EXCHANGE [$$55, $$56, $$57] |PARTITIONED|
- -- EXTERNAL_GROUP_BY[$$42, $$46, $$39] |LOCAL|
- {
- -- AGGREGATE |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$41][$$42] |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$41] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$40][$$48] |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- SORT_MERGE_EXCHANGE [$$46(DESC), $$4(ASC) ] |PARTITIONED|
+ -- STREAM_LIMIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$46(DESC), $$4(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EXTERNAL_GROUP_BY[$$56, $$57, $$58] |PARTITIONED|
+ {
+ -- AGGREGATE |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- HASH_PARTITION_EXCHANGE [$$56, $$57, $$58] |PARTITIONED|
+ -- EXTERNAL_GROUP_BY[$$44, $$41, $$39] |PARTITIONED|
+ {
+ -- AGGREGATE |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$43][$$44] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$43] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$42][$$50] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$48] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$50] |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$42] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$44] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/optimizerts/results/q5_local_supplier_volume.plan b/asterix-app/src/test/resources/optimizerts/results/q5_local_supplier_volume.plan
index d2682d8..5fca854 100644
--- a/asterix-app/src/test/resources/optimizerts/results/q5_local_supplier_volume.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/q5_local_supplier_volume.plan
@@ -1,81 +1,83 @@
-- SINK_WRITE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- SORT_MERGE_EXCHANGE [$$87(DESC) ] |PARTITIONED|
- -- STABLE_SORT [$$87(DESC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EXTERNAL_GROUP_BY[$$121] |PARTITIONED|
- {
- -- AGGREGATE |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- HASH_PARTITION_EXCHANGE [$$121] |PARTITIONED|
- -- EXTERNAL_GROUP_BY[$$93] |LOCAL|
- {
- -- AGGREGATE |LOCAL|
- -- NESTED_TUPLE_SOURCE |LOCAL|
- }
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$80, $$116][$$113, $$95] |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$113] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$81][$$82] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- SORT_MERGE_EXCHANGE [$$89(DESC) ] |PARTITIONED|
+ -- STABLE_SORT [$$89(DESC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EXTERNAL_GROUP_BY[$$120] |PARTITIONED|
+ {
+ -- AGGREGATE |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- HASH_PARTITION_EXCHANGE [$$120] |PARTITIONED|
+ -- EXTERNAL_GROUP_BY[$$94] |PARTITIONED|
+ {
+ -- AGGREGATE |LOCAL|
+ -- NESTED_TUPLE_SOURCE |LOCAL|
+ }
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$81, $$115][$$112, $$88] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$82] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$100][$$84] |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$100] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$84] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$112] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$82][$$83] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$95][$$85] |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$95] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$83] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$99][$$85] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$99] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$85] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- HYBRID_HASH_JOIN [$$91][$$86] |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$91] |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$85] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$88][$$86] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$88] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$86] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- HYBRID_HASH_JOIN [$$92][$$87] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$92] |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/optimizerts/results/record_access.plan b/asterix-app/src/test/resources/optimizerts/results/record_access.plan
index 70e2daa..413cf0c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/record_access.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/record_access.plan
@@ -1,4 +1,3 @@
-- SINK_WRITE |UNPARTITIONED|
- -- STREAM_PROJECT |UNPARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
+ -- ASSIGN |UNPARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/rtree-index-join/spatial-intersect-point_01.plan b/asterix-app/src/test/resources/optimizerts/results/rtree-index-join/spatial-intersect-point_01.plan
new file mode 100644
index 0000000..6f311aa
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/rtree-index-join/spatial-intersect-point_01.plan
@@ -0,0 +1,23 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$20(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- RTREE_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/rtree-index-join/spatial-intersect-point_02.plan b/asterix-app/src/test/resources/optimizerts/results/rtree-index-join/spatial-intersect-point_02.plan
new file mode 100644
index 0000000..6f311aa
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/rtree-index-join/spatial-intersect-point_02.plan
@@ -0,0 +1,23 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$20(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- RTREE_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/rtree-index-join/spatial-intersect-point_03.plan b/asterix-app/src/test/resources/optimizerts/results/rtree-index-join/spatial-intersect-point_03.plan
new file mode 100644
index 0000000..6f311aa
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/rtree-index-join/spatial-intersect-point_03.plan
@@ -0,0 +1,23 @@
+-- SINK_WRITE |PARTITIONED|
+ -- RANDOM_MERGE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$20(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- RTREE_SEARCH |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/rtree-secondary-index-open.plan b/asterix-app/src/test/resources/optimizerts/results/rtree-secondary-index-open.plan
index 87ee225..dc9b260 100644
--- a/asterix-app/src/test/resources/optimizerts/results/rtree-secondary-index-open.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/rtree-secondary-index-open.plan
@@ -2,16 +2,17 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$22(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- RTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$22(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- RTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/rtree-secondary-index.plan b/asterix-app/src/test/resources/optimizerts/results/rtree-secondary-index.plan
index 8bffa2b..dc9b260 100644
--- a/asterix-app/src/test/resources/optimizerts/results/rtree-secondary-index.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/rtree-secondary-index.plan
@@ -2,16 +2,17 @@
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- BTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$22(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- RTREE_SEARCH |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
\ No newline at end of file
+ -- STREAM_PROJECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$22(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- RTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/scan-delete-all.plan b/asterix-app/src/test/resources/optimizerts/results/scan-delete-all.plan
index 3c95e2f..395fec7 100644
--- a/asterix-app/src/test/resources/optimizerts/results/scan-delete-all.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/scan-delete-all.plan
@@ -1,12 +1,12 @@
-- SINK |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INSERT_DELETE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$19(ASC)] |LOCAL|
- -- HASH_PARTITION_EXCHANGE [$$19] |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INSERT_DELETE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$19(ASC)] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$19] |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/scan-delete-rtree-secondary-index.plan b/asterix-app/src/test/resources/optimizerts/results/scan-delete-rtree-secondary-index.plan
index 03fd04e..79daefd 100644
--- a/asterix-app/src/test/resources/optimizerts/results/scan-delete-rtree-secondary-index.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/scan-delete-rtree-secondary-index.plan
@@ -1,22 +1,25 @@
-- SINK |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- INDEX_INSERT_DELETE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$25(ASC), $$26(ASC), $$27(ASC), $$28(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INSERT_DELETE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$13(ASC)] |LOCAL|
- -- HASH_PARTITION_EXCHANGE [$$13] |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INDEX_INSERT_DELETE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$29(ASC), $$30(ASC), $$31(ASC), $$32(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INSERT_DELETE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$14(ASC)] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$14] |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- BTREE_SEARCH |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/scan-delete.plan b/asterix-app/src/test/resources/optimizerts/results/scan-delete.plan
index f1a7172..0e7cf78 100644
--- a/asterix-app/src/test/resources/optimizerts/results/scan-delete.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/scan-delete.plan
@@ -1,12 +1,12 @@
-- SINK |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INSERT_DELETE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$21(ASC)] |LOCAL|
- -- HASH_PARTITION_EXCHANGE [$$21] |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INSERT_DELETE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$21(ASC)] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$21] |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- STREAM_SELECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/scan-insert-secondary-index.plan b/asterix-app/src/test/resources/optimizerts/results/scan-insert-secondary-index.plan
index c1bed36..650f512 100644
--- a/asterix-app/src/test/resources/optimizerts/results/scan-insert-secondary-index.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/scan-insert-secondary-index.plan
@@ -1,27 +1,30 @@
-- SINK |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- INDEX_INSERT_DELETE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$12(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- STREAM_PROJECT |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- INDEX_INSERT_DELETE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$11(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- ASSIGN |UNPARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INDEX_INSERT_DELETE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$11(ASC)] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INDEX_INSERT_DELETE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$10(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INSERT_DELETE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$6(ASC)] |LOCAL|
- -- HASH_PARTITION_EXCHANGE [$$6] |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INSERT_DELETE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$6(ASC)] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$6] |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/scan-insert.plan b/asterix-app/src/test/resources/optimizerts/results/scan-insert.plan
index 2fe55a5..5cfcdf3 100644
--- a/asterix-app/src/test/resources/optimizerts/results/scan-insert.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/scan-insert.plan
@@ -1,14 +1,16 @@
-- SINK |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- INSERT_DELETE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$6(ASC)] |LOCAL|
- -- HASH_PARTITION_EXCHANGE [$$6] |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- INSERT_DELETE |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$6(ASC)] |PARTITIONED|
+ -- HASH_PARTITION_EXCHANGE [$$6] |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_01.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_01.plan
index 170edbd..998e003 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_01.plan
@@ -3,9 +3,10 @@
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_02.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_02.plan
index 170edbd..998e003 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_02.plan
@@ -3,9 +3,10 @@
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_03.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_03.plan
index 170edbd..998e003 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_03.plan
@@ -3,9 +3,10 @@
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_04.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_04.plan
index 170edbd..998e003 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_04.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_04.plan
@@ -3,9 +3,10 @@
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_05.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_05.plan
index 3babdef..ba1c86c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_05.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_05.plan
@@ -1,9 +1,9 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_06.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_06.plan
index 3babdef..ba1c86c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_06.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_06.plan
@@ -1,9 +1,9 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_07.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_07.plan
index 3babdef..ba1c86c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_07.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_07.plan
@@ -1,9 +1,9 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_08.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_08.plan
index 3babdef..ba1c86c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_08.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-let-to-edit-distance-check_08.plan
@@ -1,9 +1,9 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_01.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_01.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_01.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_02.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_02.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_02.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_03.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_03.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_03.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_04.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_04.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_04.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_04.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_05.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_05.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_05.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_05.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_06.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_06.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_06.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_06.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_07.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_07.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_07.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_07.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_08.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_08.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_08.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/edit-distance-to-edit-distance-check_08.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/fuzzyeq-to-edit-distance-check.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/fuzzyeq-to-edit-distance-check.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/fuzzyeq-to-edit-distance-check.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/fuzzyeq-to-edit-distance-check.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/fuzzyeq-to-jaccard-check.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/fuzzyeq-to-jaccard-check.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/fuzzyeq-to-jaccard-check.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/fuzzyeq-to-jaccard-check.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_01.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_01.plan
index 170edbd..998e003 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_01.plan
@@ -3,9 +3,10 @@
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_02.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_02.plan
index 170edbd..998e003 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_02.plan
@@ -3,9 +3,10 @@
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_03.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_03.plan
index 170edbd..998e003 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_03.plan
@@ -3,9 +3,10 @@
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_04.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_04.plan
index 170edbd..998e003 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_04.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_04.plan
@@ -3,9 +3,10 @@
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_05.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_05.plan
index 3babdef..ba1c86c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_05.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_05.plan
@@ -1,9 +1,9 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_06.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_06.plan
index 3babdef..ba1c86c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_06.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_06.plan
@@ -1,9 +1,9 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_07.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_07.plan
index 3babdef..ba1c86c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_07.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_07.plan
@@ -1,9 +1,9 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_08.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_08.plan
index 3babdef..ba1c86c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_08.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-let-to-jaccard-check_08.plan
@@ -1,9 +1,9 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_01.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_01.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_01.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_01.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_02.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_02.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_02.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_03.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_03.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_03.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_04.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_04.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_04.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_04.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_05.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_05.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_05.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_05.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_06.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_06.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_06.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_06.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_07.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_07.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_07.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_07.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_08.plan b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_08.plan
index 467de52..1924060 100644
--- a/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_08.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/similarity/jaccard-to-jaccard-check_08.plan
@@ -1,9 +1,8 @@
-- SINK_WRITE |PARTITIONED|
-- RANDOM_MERGE_EXCHANGE |PARTITIONED|
- -- STREAM_PROJECT |PARTITIONED|
- -- STREAM_SELECT |PARTITIONED|
- -- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_SELECT |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/sort-cust.plan b/asterix-app/src/test/resources/optimizerts/results/sort-cust.plan
index f790019..5f29f85 100644
--- a/asterix-app/src/test/resources/optimizerts/results/sort-cust.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/sort-cust.plan
@@ -3,13 +3,14 @@
-- ASSIGN |UNPARTITIONED|
-- STREAM_LIMIT |UNPARTITIONED|
-- SORT_MERGE_EXCHANGE [$$7(ASC) ] |PARTITIONED|
- -- STREAM_LIMIT |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$7(ASC)] |LOCAL|
+ -- STREAM_LIMIT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$7(ASC)] |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- DATASOURCE_SCAN |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- DATASOURCE_SCAN |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/unnest-to-join_02.plan b/asterix-app/src/test/resources/optimizerts/results/unnest-to-join_02.plan
index bfb15c7..bd2eb3d 100644
--- a/asterix-app/src/test/resources/optimizerts/results/unnest-to-join_02.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/unnest-to-join_02.plan
@@ -1,21 +1,10 @@
-- SINK_WRITE |UNPARTITIONED|
- -- STREAM_PROJECT |UNPARTITIONED|
+ -- AGGREGATE |UNPARTITIONED|
-- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- PRE_CLUSTERED_GROUP_BY[$$8] |UNPARTITIONED|
- {
- -- AGGREGATE |UNPARTITIONED|
- -- NESTED_TUPLE_SOURCE |UNPARTITIONED|
- }
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$8(ASC)] |LOCAL|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- STREAM_PROJECT |UNPARTITIONED|
- -- ASSIGN |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- HYBRID_HASH_JOIN [$$0][$$1] |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- UNNEST |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
- -- UNNEST |UNPARTITIONED|
- -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
+ -- HYBRID_HASH_JOIN [$$0][$$1] |UNPARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
+ -- UNNEST |UNPARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
+ -- UNNEST |UNPARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/unnest_list_in_subplan.plan b/asterix-app/src/test/resources/optimizerts/results/unnest_list_in_subplan.plan
index d249c29..7218717 100644
--- a/asterix-app/src/test/resources/optimizerts/results/unnest_list_in_subplan.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/unnest_list_in_subplan.plan
@@ -9,8 +9,8 @@
-- STREAM_SELECT |LOCAL|
-- NESTED_TUPLE_SOURCE |LOCAL|
}
- -- ONE_TO_ONE_EXCHANGE |LOCAL|
- -- STABLE_SORT [$$20(ASC), $$18(ASC)] |LOCAL|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- STABLE_SORT [$$20(ASC), $$18(ASC)] |PARTITIONED|
-- HASH_PARTITION_EXCHANGE [$$20] |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
@@ -18,7 +18,7 @@
-- HASH_PARTITION_EXCHANGE [$$3] |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- UNNEST |PARTITIONED|
- -- ASSIGN |PARTITIONED|
+ -- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
@@ -30,4 +30,4 @@
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
- -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/ignore.txt b/asterix-app/src/test/resources/runtimets/ignore.txt
deleted file mode 100644
index 784be19..0000000
--- a/asterix-app/src/test/resources/runtimets/ignore.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-custord/join_q_04.aql
-scan/spatial_types_02.aql
-scan/temp_types_02.aql
-fuzzyjoin/dblp-splits-3_1.aql
-fuzzyjoin/dblp-csx-aqlplus_1.aql
-fuzzyjoin/dblp-csx-aqlplus_2.aql
-fuzzyjoin/dblp-csx-aqlplus_3.aql
-fuzzyjoin/events-users-aqlplus_1.aql
-fuzzyjoin/dblp-aqlplus_1.aql
-fuzzyjoin/dblp-csx-dblp-aqlplus_1.aql
-fuzzyjoin/user-vis-int-vis-user-lot-aqlplus_1.aql
-subset-collection/04.aql
-quantifiers/everysat_01.aql
-custord/freq-clerk.aql
-custord/denorm-cust-order_01.aql
-custord/denorm-cust-order_03.aql
-custord/co.aql
-comparison/numeric-comparison_01.aql
-dapd/q3.aql
-failure/q1_pricing_summary_report_failure.aql
-dml/load-from-hdfs.aql
-open-closed/open-closed-15
-open-closed/open-closed-16
-open-closed/open-closed-17
-open-closed/open-closed-18
-open-closed/open-closed-19
-open-closed/open-closed-20
-open-closed/open-closed-21
-open-closed/open-closed-22
-open-closed/open-closed-28
-open-closed/open-closed-30
-open-closed/heterog-list02
-open-closed/heterog-list03
-open-closed/c2c
-quantifiers/somesat_03.aql
-quantifiers/somesat_04.aql
-quantifiers/somesat_05.aql
-quantifiers/everysat_02.aql
-quantifiers/everysat_03.aql
-flwor
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_empty_01.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_empty_01.aql
new file mode 100644
index 0000000..ab2a6fb
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_empty_01.aql
@@ -0,0 +1,17 @@
+/*
+ * Description : Tests that avg aggregation correctly returns null for an empty stream,
+ * without an aggregate combiner.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_avg_empty_01.adm";
+
+avg(
+ for $x in [1, 2, 3]
+ where $x > 10
+ return $x
+)
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_empty_02.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_empty_02.aql
new file mode 100644
index 0000000..3583ce0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_empty_02.aql
@@ -0,0 +1,23 @@
+/*
+ * Description : Tests that avg aggregation correctly returns null for an empty stream,
+ * with an aggregate combiner.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type TestType as closed {
+ id: int32,
+ val: double
+}
+
+create dataset Test(TestType) partitioned by key id;
+
+write output to nc1:"rttest/aggregate_avg_empty_02.adm";
+
+avg(
+ for $x in dataset('Test')
+ return $x.val
+)
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/count_empty_01.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/count_empty_01.aql
new file mode 100644
index 0000000..f03c252
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/count_empty_01.aql
@@ -0,0 +1,17 @@
+/*
+ * Description : Tests that count aggregation correctly returns 0 for an empty stream,
+ * without an aggregate combiner.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_count_empty_01.adm";
+
+count(
+ for $x in [1, 2, 3]
+ where $x > 10
+ return $x
+)
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/count_empty_02.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/count_empty_02.aql
new file mode 100644
index 0000000..0a6cc8e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/count_empty_02.aql
@@ -0,0 +1,23 @@
+/*
+ * Description : Tests that count aggregation correctly returns 0 for an empty stream,
+ * with an aggregate combiner.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type TestType as closed {
+ id: int32,
+ val: double
+}
+
+create dataset Test(TestType) partitioned by key id;
+
+write output to nc1:"rttest/aggregate_count_empty_02.adm";
+
+count(
+ for $x in dataset('Test')
+ return $x.val
+)
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/droptype.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/droptype.aql
new file mode 100644
index 0000000..dd0c342
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/droptype.aql
@@ -0,0 +1,22 @@
+/*
+ * Description : Test to cover => create type - drop type - recreate that dropped type
+ * Expected Res : Success
+ * Date : 13 Sep 2012
+ * Issue : 188
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_droptype.adm";
+
+create type footype as open {
+bar : int32?
+}
+
+drop type footype;
+
+create type footype as open {
+bar : int32?
+}
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/max_empty_01.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/max_empty_01.aql
new file mode 100644
index 0000000..2464b64
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/max_empty_01.aql
@@ -0,0 +1,17 @@
+/*
+ * Description : Tests that max aggregation correctly returns null for an empty stream,
+ * without an aggregate combiner.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_max_empty_01.adm";
+
+max(
+ for $x in [1, 2, 3]
+ where $x > 10
+ return $x
+)
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/max_empty_02.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/max_empty_02.aql
new file mode 100644
index 0000000..79ae1d8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/max_empty_02.aql
@@ -0,0 +1,23 @@
+/*
+ * Description : Tests that max aggregation correctly returns null for an empty stream,
+ * with an aggregate combiner.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type TestType as closed {
+ id: int32,
+ val: double
+}
+
+create dataset Test(TestType) partitioned by key id;
+
+write output to nc1:"rttest/aggregate_max_empty_02.adm";
+
+max(
+ for $x in dataset('Test')
+ return $x.val
+)
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/min_empty_01.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/min_empty_01.aql
new file mode 100644
index 0000000..30abd1e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/min_empty_01.aql
@@ -0,0 +1,17 @@
+/*
+ * Description : Tests that min aggregation correctly returns null for an empty stream,
+ * without an aggregate combiner.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_min_empty_01.adm";
+
+min(
+ for $x in [1, 2, 3]
+ where $x > 10
+ return $x
+)
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/min_empty_02.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/min_empty_02.aql
new file mode 100644
index 0000000..99d49f4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/min_empty_02.aql
@@ -0,0 +1,23 @@
+/*
+ * Description : Tests that min aggregation correctly returns null for an empty stream,
+ * with an aggregate combiner.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type TestType as closed {
+ id: int32,
+ val: double
+}
+
+create dataset Test(TestType) partitioned by key id;
+
+write output to nc1:"rttest/aggregate_min_empty_02.adm";
+
+min(
+ for $x in dataset('Test')
+ return $x.val
+)
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_avg.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_avg.aql
new file mode 100644
index 0000000..8c8ed73
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_avg.aql
@@ -0,0 +1,19 @@
+/*
+ * Description : Tests the scalar version of avg without nulls.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_scalar_avg.adm";
+
+let $i8 := avg([int8("1"), int8("2"), int8("3")])
+let $i16 := avg([int16("1"), int16("2"), int16("3")])
+let $i32 := avg([int32("1"), int32("2"), int32("3")])
+let $i64 := avg([int64("1"), int64("2"), int64("3")])
+let $f := avg([float("1"), float("2"), float("3")])
+let $d := avg([double("1"), double("2"), double("3")])
+for $i in [$i8, $i16, $i32, $i64, $f, $d]
+return $i
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_avg_empty.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_avg_empty.aql
new file mode 100644
index 0000000..351f5f8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_avg_empty.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : Tests the scalar version of avg with an empty list.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_scalar_avg_empty.adm";
+
+avg([ ])
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_avg_null.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_avg_null.aql
new file mode 100644
index 0000000..5108573
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_avg_null.aql
@@ -0,0 +1,19 @@
+/*
+ * Description : Tests the scalar version of avg with nulls.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_scalar_avg_null.adm";
+
+let $i8 := avg([int8("1"), int8("2"), int8("3"), null])
+let $i16 := avg([int16("1"), int16("2"), int16("3"), null])
+let $i32 := avg([int32("1"), int32("2"), int32("3"), null])
+let $i64 := avg([int64("1"), int64("2"), int64("3"), null])
+let $f := avg([float("1"), float("2"), float("3"), null])
+let $d := avg([double("1"), double("2"), double("3"), null])
+for $i in [$i8, $i16, $i32, $i64, $f, $d]
+return $i
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_count.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_count.aql
new file mode 100644
index 0000000..3508fc6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_count.aql
@@ -0,0 +1,20 @@
+/*
+ * Description : Tests the scalar version of count without nulls.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_scalar_count.adm";
+
+let $i8 := count([int8("1"), int8("2"), int8("3")])
+let $i16 := count([int16("1"), int16("2"), int16("3")])
+let $i32 := count([int32("1"), int32("2"), int32("3")])
+let $i64 := count([int64("1"), int64("2"), int64("3")])
+let $f := count([float("1"), float("2"), float("3")])
+let $d := count([double("1"), double("2"), double("3")])
+let $s := count(["a", "b", "c"])
+for $i in [$i8, $i16, $i32, $i64, $f, $d, $s]
+return $i
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_count_empty.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_count_empty.aql
new file mode 100644
index 0000000..afd3dab
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_count_empty.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : Tests the scalar version of count with an empty list.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_scalar_count_empty.adm";
+
+count([ ])
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_count_null.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_count_null.aql
new file mode 100644
index 0000000..60dd19f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_count_null.aql
@@ -0,0 +1,20 @@
+/*
+ * Description : Tests the scalar version of count with nulls.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_scalar_count_null.adm";
+
+let $i8 := count([int8("1"), int8("2"), int8("3"), null])
+let $i16 := count([int16("1"), int16("2"), int16("3"), null])
+let $i32 := count([int32("1"), int32("2"), int32("3"), null])
+let $i64 := count([int64("1"), int64("2"), int64("3"), null])
+let $f := count([float("1"), float("2"), float("3"), null])
+let $d := count([double("1"), double("2"), double("3"), null])
+let $s := count(["a", "b", "c", null])
+for $i in [$i8, $i16, $i32, $i64, $f, $d, $s]
+return $i
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_max.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_max.aql
new file mode 100644
index 0000000..8eefced
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_max.aql
@@ -0,0 +1,21 @@
+/*
+ * Description : Tests the scalar version of max without nulls.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_scalar_max.adm";
+
+let $i8 := max([int8("1"), int8("2"), int8("3")])
+let $i16 := max([int16("1"), int16("2"), int16("3")])
+let $i32 := max([int32("1"), int32("2"), int32("3")])
+let $i64 := max([int64("1"), int64("2"), int64("3")])
+let $f := max([float("1"), float("2"), float("3")])
+let $d := max([double("1"), double("2"), double("3")])
+let $s := max(["foo", "bar", "world"])
+let $dt := max([datetime("2012-03-01T00:00:00Z"), datetime("2012-01-01T00:00:00Z"), datetime("2012-02-01T00:00:00Z")])
+for $i in [$i8, $i16, $i32, $i64, $f, $d, $s, $dt]
+return $i
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_max_empty.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_max_empty.aql
new file mode 100644
index 0000000..3a4396e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_max_empty.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : Tests the scalar version of max with an empty list.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_scalar_max_empty.adm";
+
+max([ ])
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_max_null.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_max_null.aql
new file mode 100644
index 0000000..04436bf
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_max_null.aql
@@ -0,0 +1,21 @@
+/*
+ * Description : Tests the scalar version of max with nulls.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_scalar_max_null.adm";
+
+let $i8 := max([int8("1"), int8("2"), int8("3"), null])
+let $i16 := max([int16("1"), int16("2"), int16("3"), null])
+let $i32 := max([int32("1"), int32("2"), int32("3"), null])
+let $i64 := max([int64("1"), int64("2"), int64("3"), null])
+let $f := max([float("1"), float("2"), float("3"), null])
+let $d := max([double("1"), double("2"), double("3"), null])
+let $s := max(["foo", "bar", "world", null])
+let $dt := min([datetime("2012-03-01T00:00:00Z"), datetime("2012-01-01T00:00:00Z"), datetime("2012-02-01T00:00:00Z"), null])
+for $i in [$i8, $i16, $i32, $i64, $f, $d, $s, $dt]
+return $i
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_min.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_min.aql
new file mode 100644
index 0000000..04aa735
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_min.aql
@@ -0,0 +1,21 @@
+/*
+ * Description : Tests the scalar version of min without nulls.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_scalar_min.adm";
+
+let $i8 := min([int8("1"), int8("2"), int8("3")])
+let $i16 := min([int16("1"), int16("2"), int16("3")])
+let $i32 := min([int32("1"), int32("2"), int32("3")])
+let $i64 := min([int64("1"), int64("2"), int64("3")])
+let $f := min([float("1"), float("2"), float("3")])
+let $d := min([double("1"), double("2"), double("3")])
+let $s := min(["foo", "bar", "world"])
+let $dt := min([datetime("2012-03-01T00:00:00Z"), datetime("2012-01-01T00:00:00Z"), datetime("2012-02-01T00:00:00Z")])
+for $i in [$i8, $i16, $i32, $i64, $f, $d, $s, $dt]
+return $i
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_min_empty.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_min_empty.aql
new file mode 100644
index 0000000..e242a35
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_min_empty.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : Tests the scalar version of min with an empty list.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_scalar_min_empty.adm";
+
+min([ ])
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_min_null.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_min_null.aql
new file mode 100644
index 0000000..523ca26
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_min_null.aql
@@ -0,0 +1,21 @@
+/*
+ * Description : Tests the scalar version of min with nulls.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_scalar_min_null.adm";
+
+let $i8 := min([int8("1"), int8("2"), int8("3"), null])
+let $i16 := min([int16("1"), int16("2"), int16("3"), null])
+let $i32 := min([int32("1"), int32("2"), int32("3"), null])
+let $i64 := min([int64("1"), int64("2"), int64("3"), null])
+let $f := min([float("1"), float("2"), float("3"), null])
+let $d := min([double("1"), double("2"), double("3"), null])
+let $s := min(["foo", "bar", "world", null])
+let $dt := min([datetime("2012-03-01T00:00:00Z"), datetime("2012-01-01T00:00:00Z"), datetime("2012-02-01T00:00:00Z"), null])
+for $i in [$i8, $i16, $i32, $i64, $f, $d, $s, $dt]
+return $i
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_sum.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_sum.aql
new file mode 100644
index 0000000..843360f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_sum.aql
@@ -0,0 +1,19 @@
+/*
+ * Description : Tests the scalar version of sum without nulls.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_scalar_sum.adm";
+
+let $i8 := sum([int8("1"), int8("2"), int8("3")])
+let $i16 := sum([int16("1"), int16("2"), int16("3")])
+let $i32 := sum([int32("1"), int32("2"), int32("3")])
+let $i64 := sum([int64("1"), int64("2"), int64("3")])
+let $f := sum([float("1"), float("2"), float("3")])
+let $d := sum([double("1"), double("2"), double("3")])
+for $i in [$i8, $i16, $i32, $i64, $f, $d]
+return $i
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_sum_empty.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_sum_empty.aql
new file mode 100644
index 0000000..35bf676
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_sum_empty.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : Tests the scalar version of sum with an empty list.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_scalar_sum_empty.adm";
+
+sum([ ])
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_sum_null.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_sum_null.aql
new file mode 100644
index 0000000..a4c2e61
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_sum_null.aql
@@ -0,0 +1,19 @@
+/*
+ * Description : Tests the scalar version of sum with nulls.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_scalar_sum_null.adm";
+
+let $i8 := sum([int8("1"), int8("2"), int8("3"), null])
+let $i16 := sum([int16("1"), int16("2"), int16("3"), null])
+let $i32 := sum([int32("1"), int32("2"), int32("3"), null])
+let $i64 := sum([int64("1"), int64("2"), int64("3"), null])
+let $f := sum([float("1"), float("2"), float("3"), null])
+let $d := sum([double("1"), double("2"), double("3"), null])
+for $i in [$i8, $i16, $i32, $i64, $f, $d]
+return $i
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_empty_01.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_empty_01.aql
new file mode 100644
index 0000000..b4e26b8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_empty_01.aql
@@ -0,0 +1,17 @@
+/*
+ * Description : Tests that sum aggregation correctly returns null for an empty stream,
+ * without an aggregate combiner.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/aggregate_sum_empty_01.adm";
+
+sum(
+ for $x in [1, 2, 3]
+ where $x > 10
+ return $x
+)
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_empty_02.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_empty_02.aql
new file mode 100644
index 0000000..a94457a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_empty_02.aql
@@ -0,0 +1,23 @@
+/*
+ * Description : Tests that sum aggregation correctly returns null for an empty stream,
+ * with an aggregate combiner.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type TestType as closed {
+ id: int32,
+ val: double
+}
+
+create dataset Test(TestType) partitioned by key id;
+
+write output to nc1:"rttest/aggregate_sum_empty_02.adm";
+
+sum(
+ for $x in dataset('Test')
+ return $x.val
+)
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv01.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv01.aql
new file mode 100644
index 0000000..e95d102
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv01.aql
@@ -0,0 +1,50 @@
+/*
+ * Description : Test cross dataverse functionality
+ * : use dataverse statement is now optional.
+ * : Use fully qualified names to access datasets.
+ * Expected Res : Success
+ * Date : 29th Aug 2012
+ */
+
+drop dataverse student if exists;
+drop dataverse teacher if exists;
+
+create dataverse student;
+create dataverse teacher;
+
+write output to nc1:"rttest/cross-dataverse_cross-dv01.adm";
+
+create type student.stdType as open {
+id : int32,
+name : string,
+age : int32,
+sex : string,
+dept : string
+}
+
+create type teacher.tchrType as open {
+id : int32,
+name : string,
+age : int32,
+sex : string,
+dept : string
+}
+
+create dataset student.ugdstd(stdType) partitioned by key id;
+create dataset student.gdstd(stdType) partitioned by key id;
+create dataset teacher.prof(tchrType) partitioned by key id;
+create dataset teacher.pstdoc(tchrType) partitioned by key id;
+
+insert into dataset student.ugdstd({"id":457,"name":"John Doe","age":22,"sex":"M","dept":"Dance"});
+
+insert into dataset student.gdstd({"id":418,"name":"John Smith","age":26,"sex":"M","dept":"Economics"});
+
+insert into dataset teacher.prof({"id":152,"name":"John Meyer","age":42,"sex":"M","dept":"History"});
+
+insert into dataset teacher.pstdoc({"id":259,"name":"Sophia Reece","age":36,"sex":"F","dept":"Anthropology"});
+
+for $s in dataset('student.ugdstd')
+for $p in dataset('teacher.prof')
+for $a in dataset('student.gdstd')
+for $b in dataset('teacher.pstdoc')
+return {"ug-student":$s,"prof":$p,"grd-student":$a,"postdoc":$b}
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv02.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv02.aql
new file mode 100644
index 0000000..1257cac
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv02.aql
@@ -0,0 +1,48 @@
+/*
+ * Description : Test cross dataverse functionality
+ * : use dataverse statement is now optional.
+ * : Use fully qualified names to create datasets, types and query Metadata to verify.
+ * Expected Res : Success
+ * Date : 28th Aug 2012
+ */
+
+drop dataverse student if exists;
+drop dataverse teacher if exists;
+
+create dataverse student;
+create dataverse teacher;
+
+write output to nc1:"rttest/cross-dataverse_cross-dv02.adm";
+
+create type student.stdType as open {
+id : int32,
+name : string,
+age : int32,
+sex : string,
+dept : string
+}
+
+create type teacher.tchrType as open {
+id : int32,
+name : string,
+age : int32,
+sex : string,
+dept : string
+}
+
+create dataset student.ugdstd(stdType) partitioned by key id;
+create dataset student.gdstd(stdType) partitioned by key id;
+create dataset teacher.prof(tchrType) partitioned by key id;
+create dataset teacher.pstdoc(tchrType) partitioned by key id;
+
+insert into dataset student.ugdstd({"id":457,"name":"John Doe","age":22,"sex":"M","dept":"Dance"});
+
+insert into dataset student.gdstd({"id":418,"name":"John Smith","age":26,"sex":"M","dept":"Economics"});
+
+insert into dataset teacher.prof({"id":152,"name":"John Meyer","age":42,"sex":"M","dept":"History"});
+
+insert into dataset teacher.pstdoc({"id":259,"name":"Sophia Reece","age":36,"sex":"F","dept":"Anthropology"});
+
+for $l in dataset('Metadata.Dataset')
+where $l.DataverseName='student' or $l.DataverseName='teacher'
+return $l
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv03.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv03.aql
new file mode 100644
index 0000000..0c80540
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv03.aql
@@ -0,0 +1,49 @@
+/*
+ * Description : Test cross dataverse functionality
+ * : use dataverse statement is now optional.
+ * : Use fully qualified names to create datasets, types.
+ * : drop datasets using fully qualified names
+ * : Query metadata to verify datasets are dropped.
+ * Expected Res : Success
+ * Date : 28th Aug 2012
+ */
+
+drop dataverse student if exists;
+drop dataverse teacher if exists;
+
+create dataverse student;
+create dataverse teacher;
+
+write output to nc1:"rttest/cross-dataverse_cross-dv03.adm";
+
+create type student.stdType as open {
+id : int32,
+name : string,
+age : int32,
+sex : string,
+dept : string
+}
+
+create type teacher.tchrType as open {
+id : int32,
+name : string,
+age : int32,
+sex : string,
+dept : string
+}
+
+create dataset student.ugdstd(stdType) partitioned by key id;
+create dataset student.gdstd(stdType) partitioned by key id;
+create dataset teacher.prof(tchrType) partitioned by key id;
+create dataset teacher.pstdoc(tchrType) partitioned by key id;
+
+drop dataset student.ugdstd;
+drop dataset student.gdstd;
+drop dataset teacher.prof;
+drop dataset teacher.pstdoc;
+
+count(
+for $l in dataset('Metadata.Dataset')
+where $l.DataverseName='student' or $l.DataverseName='teacher'
+return $l
+)
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv04.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv04.aql
new file mode 100644
index 0000000..20be103
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv04.aql
@@ -0,0 +1,53 @@
+/*
+ * Description : Test cross dataverse functionality
+ * : use dataverse statement is now optional.
+ * : Use fully qualified names to create datasets, types.
+ * : drop datasets using fully qualified names
+ * : re create the datasets
+ * : Query metadata to verify datasets are created.
+ * Expected Res : Success
+ * Date : 28th Aug 2012
+ */
+
+drop dataverse student if exists;
+drop dataverse teacher if exists;
+
+create dataverse student;
+create dataverse teacher;
+
+write output to nc1:"rttest/cross-dataverse_cross-dv04.adm";
+
+create type student.stdType as open {
+id : int32,
+name : string,
+age : int32,
+sex : string,
+dept : string
+}
+
+create type teacher.tchrType as open {
+id : int32,
+name : string,
+age : int32,
+sex : string,
+dept : string
+}
+
+create dataset student.ugdstd(stdType) partitioned by key id;
+create dataset student.gdstd(stdType) partitioned by key id;
+create dataset teacher.prof(tchrType) partitioned by key id;
+create dataset teacher.pstdoc(tchrType) partitioned by key id;
+
+drop dataset student.ugdstd;
+drop dataset student.gdstd;
+drop dataset teacher.prof;
+drop dataset teacher.pstdoc;
+
+create dataset student.ugdstd(stdType) partitioned by key id;
+create dataset student.gdstd(stdType) partitioned by key id;
+create dataset teacher.prof(tchrType) partitioned by key id;
+create dataset teacher.pstdoc(tchrType) partitioned by key id;
+
+for $l in dataset('Metadata.Dataset')
+where $l.DataverseName='student' or $l.DataverseName='teacher'
+return $l
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv07.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv07.aql
new file mode 100644
index 0000000..4bba053
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv07.aql
@@ -0,0 +1,34 @@
+/*
+ * Description : Use fully qualified name to create dataset, type and index
+ * : and to access dataset
+ * Expected Result : Success
+ * Date : 29th August 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/cross-dataverse_cross-dv07.adm";
+
+create type test.Emp as closed {
+id:int32,
+fname:string,
+lname:string,
+age:int32,
+dept:string
+}
+
+create dataset test.employee(Emp) partitioned by key id;
+
+load dataset test.employee
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/names.adm"),("format"="delimited-text"),("delimiter"="|"));
+
+create index idx_employee_f_l_name on test.employee(fname,lname);
+
+write output to nc1:"rttest/cross-dataverse_cross-dv07.adm";
+
+for $l in dataset('test.employee')
+where $l.fname="Julio" and $l.lname="Isa"
+return $l
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv08.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv08.aql
new file mode 100644
index 0000000..10985e3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv08.aql
@@ -0,0 +1,52 @@
+/*
+ * Description : Create two UDFs in two different dataverses and create datasets in tose dvs
+ * : access the datasets from the UDF defined in the other dataverse and invoke one of the UDF
+ * Expected Res : Success
+ * Date : Sep 7th 2012
+ */
+
+// dv1 - udf1 - dataset1
+// dv2 - udf2 - dataset2
+
+drop dataverse test if exists;
+drop dataverse fest if exists;
+
+create dataverse test;
+create dataverse fest;
+
+create type test.testtype as open {
+id : int32
+}
+
+create type fest.testtype as open {
+id : int32
+}
+
+create dataset test.t1(testtype) partitioned by key id;
+create dataset fest.t1(testtype) partitioned by key id;
+
+insert into dataset test.t1({"id":24});
+insert into dataset test.t1({"id":23});
+insert into dataset test.t1({"id":21});
+insert into dataset test.t1({"id":44});
+insert into dataset test.t1({"id":64});
+
+insert into dataset fest.t1({"id":24});
+insert into dataset fest.t1({"id":23});
+insert into dataset fest.t1({"id":21});
+insert into dataset fest.t1({"id":44});
+insert into dataset fest.t1({"id":64});
+
+create function test.f1(){
+for $l in dataset('fest.t1')
+return $l
+}
+
+create function fest.f1(){
+for $m in dataset('test.t1')
+return $m
+}
+
+let $a := test.f1()
+let $b := fest.f1()
+return { "a" : $a, "b" : $b }
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv09.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv09.aql
new file mode 100644
index 0000000..6eea8ac
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv09.aql
@@ -0,0 +1,24 @@
+/*
+ * Description : Create user defined funs. in two different dataverses
+ * : and invoke one of them.
+ * : In this test we use fully qualified names to access and create the UDFs.
+ * Expected Res : Success
+ * Date : 31st Aug 2012
+ */
+
+drop dataverse testdv1 if exists;
+drop dataverse testdv2 if exists;
+create dataverse testdv1;
+create dataverse testdv2;
+
+write output to nc1:"rttest/cross-dataverse_cross-dv09.adm";
+
+create function testdv1.fun01(){
+"function 01"
+}
+
+create function testdv2.fun02(){
+"function 02"
+}
+
+testdv1.fun01()
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv11.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv11.aql
new file mode 100644
index 0000000..03b84a7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv11.aql
@@ -0,0 +1,23 @@
+/*
+ * Description : Create two UDFs in two different dataverses
+ * : Invoke one UDF from the body of the other UDF.
+ * Expected Res : Success
+ * Date : 31st Aug 2012
+ */
+
+drop dataverse testdv1 if exists;
+drop dataverse testdv2 if exists;
+create dataverse testdv1;
+create dataverse testdv2;
+
+write output to nc1:"rttest/cross-dataverse_cross-dv11.adm";
+
+create function testdv1.fun01(){
+testdv2.fun02()
+}
+
+create function testdv2.fun02(){
+"function 02"
+}
+
+testdv1.fun01()
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv12.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv12.aql
new file mode 100644
index 0000000..e3cde9f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv12.aql
@@ -0,0 +1,25 @@
+/*
+ * Description : Create two UDFs in two different dataverses
+ * : Bind the results returned by each UDF to a variable and return those variables
+ * Expected Res : Success
+ * Date : 31st Aug 2012
+ */
+
+drop dataverse testdv1 if exists;
+drop dataverse testdv2 if exists;
+create dataverse testdv1;
+create dataverse testdv2;
+
+write output to nc1:"rttest/cross-dataverse_cross-dv12.adm";
+
+create function testdv1.fun01(){
+"function 01"
+}
+
+create function testdv2.fun02(){
+"function 02"
+}
+
+let $a := testdv1.fun01()
+let $b := testdv2.fun02()
+return {"fun-01":$a,"fun-02":$b}
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv13.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv13.aql
new file mode 100644
index 0000000..13e31b9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv13.aql
@@ -0,0 +1,28 @@
+/*
+ * Description : Create UDFs in different dataverses
+ * : Test for recursion in those UDFs
+ * Expected Res : Failure - Recursion is not allowed!
+ * Date : 31st Aug 2012
+ * Ignored : This test is currently not part of the test build, because it being a negative test case expectedly throws an exception.
+ */
+
+drop dataverse testdv1 if exists;
+drop dataverse testdv2 if exists;
+create dataverse testdv1;
+create dataverse testdv2;
+
+write output to nc1:"rttest/cross-dataverse_cross-dv13.adm";
+
+create function testdv1.fun01(){
+testdv2.fun02()
+}
+
+create function testdv2.fun02(){
+testdv2.fun03()
+}
+
+create function testdv2.fun03(){
+testdv1.fun01()
+}
+
+testdv1.fun01();
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv14.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv14.aql
new file mode 100644
index 0000000..1c6b863
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv14.aql
@@ -0,0 +1,17 @@
+/*
+ * Description : Create UDF and invoke UDF in return clause of FLWOR expression
+ * Expected Res : Success
+ * Date : 31st Aug 2012
+ */
+
+drop dataverse testdv1 if exists;
+create dataverse testdv1;
+
+write output to nc1:"rttest/cross-dataverse_cross-dv14.adm";
+
+create function testdv1.fun01(){
+100
+}
+
+let $a := true
+return testdv1.fun01();
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv15.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv15.aql
new file mode 100644
index 0000000..2aee200
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv15.aql
@@ -0,0 +1,30 @@
+/*
+ * Description : Create user defined functions using fully qualified names
+ * : verify their details in Function dataset in Metadata dataverse.
+ * Expected Res :
+ * Date : 30th Aug 2012
+ */
+
+drop dataverse testdv1 if exists;
+create dataverse testdv1;
+
+write output to nc1:"rttest/cross-dataverse_cross-dv15.adm";
+
+// UDF with no inputs
+create function testdv1.fun01(){
+100
+}
+
+// UDF with one input
+create function testdv1.fun02($a){
+"function 02"
+}
+
+// UDF with two inputs
+create function testdv1.fun03($b,$c){
+$b+$c
+}
+
+for $l in dataset('Metadata.Function')
+where $l.DataverseName='testdv1'
+return $l;
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv16.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv16.aql
new file mode 100644
index 0000000..b0ac16d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv16.aql
@@ -0,0 +1,32 @@
+/*
+ * Description : Detect Recursion in UDFs
+ * Expected Res : Failure
+ * Date : 30 Aug 2012
+ * Ignored : Not part of test build, as its a negative test case that thrwos an exception
+ */
+
+drop dataverse testdv1 if exists;
+create dataverse testdv1;
+
+write output to nc1:"rttest/cross-dataverse_cross-dv16.adm";
+
+// UDF with no inputs
+create function testdv1.fun01(){
+testdv1.fun02()
+}
+
+// UDF with one input
+create function testdv1.fun02(){
+testdv1.fun03()
+}
+
+// UDF with two inputs
+create function testdv1.fun03(){
+testdv1.fun04()
+}
+
+create function testdv1.fun04(){
+testdv1.fun02()
+}
+
+testdv1.fun01()
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv17.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv17.aql
new file mode 100644
index 0000000..26556e0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv17.aql
@@ -0,0 +1,48 @@
+/*
+ * Decription : Create UDF to query two different datasets that are in tow different dataverses.
+ * Expected Res : Success
+ * Date : Sep 7 2012
+ */
+
+// this test currently gives ParseException
+
+drop dataverse test if exists;
+drop dataverse fest if exists;
+
+create dataverse test;
+create dataverse fest;
+
+create type test.testtype as open {
+id : int32
+}
+
+create type fest.testtype as open {
+id : int32
+}
+
+create dataset test.t1(testtype) partitioned by key id;
+create dataset fest.t1(testtype) partitioned by key id;
+
+insert into dataset test.t1({"id":24});
+insert into dataset test.t1({"id":23});
+insert into dataset test.t1({"id":21});
+insert into dataset test.t1({"id":44});
+insert into dataset test.t1({"id":64});
+
+insert into dataset fest.t1({"id":24});
+insert into dataset fest.t1({"id":23});
+insert into dataset fest.t1({"id":21});
+insert into dataset fest.t1({"id":44});
+insert into dataset fest.t1({"id":64});
+
+create function fest.f1(){
+for $m in dataset('test.t1')
+for $l in dataset('fest.t1')
+order by $m,$l
+return { "l":$l,"m":$m }
+}
+
+write output to nc1:"rttest/cross-dataverse_cross-dv17.adm";
+
+fest.f1();
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv18.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv18.aql
new file mode 100644
index 0000000..0d3bd53
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv18.aql
@@ -0,0 +1,41 @@
+/*
+ * Description : Create two dataverses and one dataset in each of the dataverse
+ * : insert data and query using the datasets using fully qualified names and return results.
+ * Expected Res : Success
+ * Date : Sep 7th 2012
+ * Ignored : Not part of the current test build because of Issue 199
+ */
+
+
+drop dataverse test if exists;
+drop dataverse fest if exists;
+
+create dataverse test;
+create dataverse fest;
+
+create type test.testtype as open {
+id : int32
+}
+
+create type fest.testtype as open {
+id : int32
+}
+
+create dataset test.t1(testtype) partitioned by key id;
+create dataset fest.t1(testtype) partitioned by key id;
+
+insert into dataset test.t1({"id":24});
+insert into dataset test.t1({"id":23});
+insert into dataset test.t1({"id":21});
+insert into dataset test.t1({"id":44});
+insert into dataset test.t1({"id":64});
+
+insert into dataset fest.t1({"id":24});
+insert into dataset fest.t1({"id":23});
+insert into dataset fest.t1({"id":21});
+insert into dataset fest.t1({"id":44});
+insert into dataset fest.t1({"id":64});
+
+let $a := (for $l in dataset('fest.t1') return $l)
+let $b := (for $m in dataset('test.t1') return $m)
+return {"a":$a,"b":$b}
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv19.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv19.aql
new file mode 100644
index 0000000..335f11c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv19.aql
@@ -0,0 +1,57 @@
+/*
+ * Description : Create internal and external datasets in more than one dataverse and query metadata to verify entries in Metadata.
+ * Expected Res : Success
+ * Date : Sep 20 2012
+ */
+
+drop dataverse test1 if exists;
+drop dataverse test2 if exists;
+create dataverse test1;
+create dataverse test2;
+
+write output to nc1:"rttest/cross-dataverse_cross-dv19.adm";
+
+create type test1.testtype as open {
+id : int32,
+name : string,
+loc: point,
+time: datetime
+}
+
+create type test2.testtype as open {
+id : int32,
+name : string?,
+loc: point,
+time: datetime
+}
+
+create type test1.Tweet as open {
+ id: int32,
+ tweetid: int64,
+ loc: point,
+ time: datetime,
+ text: string
+}
+
+create dataset test1.t1(testtype) partitioned by key id;
+
+create dataset test2.t2(testtype) partitioned by key id;
+
+create dataset test2.t3(testtype) partitioned by key id;
+
+create dataset test1.t2(testtype) partitioned by key id;
+
+create dataset test1.t3(testtype) partitioned by key id;
+
+create dataset test2.t4(testtype) partitioned by key id;
+
+create external dataset test1.TwitterData(Tweet)
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/twitter/extrasmalltweets.txt"),("format"="adm"));
+
+for $l in dataset('Metadata.Dataset')
+where $l.DataverseName='test1' or $l.DataverseName='test2' or $l.DataverseName='TwitterData'
+return $l
+
+
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/drop_dataset.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/drop_dataset.aql
new file mode 100644
index 0000000..7b14957
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/drop_dataset.aql
@@ -0,0 +1,31 @@
+drop dataverse test if exists;
+create dataverse test;
+
+create type test.AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+};
+
+create type test.CustomerType as closed {
+ cid: int32,
+ name: string,
+ cashBack: int32,
+ age: int32?,
+ address: AddressType?,
+ lastorder: {
+ oid: int32,
+ total: float
+ }
+};
+
+create dataset test.Customers(CustomerType)
+partitioned by key cid;
+
+drop dataset test.Customers;
+
+write output to nc1:"rttest/cross-dataverse_drop_dataset.adm";
+
+for $x in dataset('Metadata.Dataset')
+where $x.DataverseName='test' and $x.DatasetName='Customers'
+return $x
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/insert_across_dataverses.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/insert_across_dataverses.aql
new file mode 100644
index 0000000..7eebbaf
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/insert_across_dataverses.aql
@@ -0,0 +1,65 @@
+//***** Test to read from a dataset and insert into another dataset when the datasets belong to different dataverses*****//
+drop dataverse test1 if exists;
+drop dataverse test2 if exists;
+
+create dataverse test1;
+create dataverse test2;
+
+create type test1.AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+};
+
+create type test1.CustomerType as closed {
+ cid: int32,
+ name: string,
+ cashBack: int32,
+ age: int32?,
+ address: AddressType?,
+ lastorder: {
+ oid: int32,
+ total: float
+ }
+};
+
+create type test2.AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+};
+
+create type test2.CustomerType as closed {
+ cid: int32,
+ name: string,
+ cashBack: int32,
+ age: int32?,
+ address: AddressType?,
+ lastorder: {
+ oid: int32,
+ total: float
+ }
+};
+
+create dataset test1.Customers(CustomerType)
+partitioned by key cid;
+
+create dataset test2.Customers(CustomerType)
+partitioned by key cid;
+
+load dataset test1.Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/nontagged/customerData.json"),("format"="adm"));
+
+
+insert into dataset test2.Customers(
+for $x in dataset('test1.Customers')
+return $x
+);
+
+write output to nc1:"rttest/cross-dataverse_insert_across_dataverses.adm";
+
+for $c in dataset('test2.Customers')
+order by $c.cid
+return $c
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/insert_from_source_dataset.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/insert_from_source_dataset.aql
new file mode 100644
index 0000000..89180ef
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/insert_from_source_dataset.aql
@@ -0,0 +1,41 @@
+/*
+ * Description : Use fully qualified dataset names to insert into target dataset by doing a select on source dataset.
+ * Expected Res : Success
+ * Date : Sep 19 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+create type test.testtype as open {
+id : int32,
+name : string
+}
+
+write output to nc1:"rttest/cross-dataverse_insert_from_source_dataset.adm";
+
+create dataset test.t1(testtype) partitioned by key id;
+
+insert into dataset test.t1({"id":456,"name":"Roger"});
+insert into dataset test.t1({"id":351,"name":"Bob"});
+insert into dataset test.t1({"id":257,"name":"Sammy"});
+insert into dataset test.t1({"id":926,"name":"Richard"});
+insert into dataset test.t1({"id":482,"name":"Kevin"});
+
+create dataset test.t2(testtype) partitioned by key id;
+
+insert into dataset test.t2({"id":438,"name":"Ravi"});
+insert into dataset test.t2({"id":321,"name":"Bobby"});
+insert into dataset test.t2({"id":219,"name":"Sam"});
+insert into dataset test.t2({"id":851,"name":"Ricardo"});
+insert into dataset test.t2({"id":201,"name":"Kelvin"});
+
+insert into dataset test.t1(for $l in dataset('test.t2') return $l);
+
+for $l in dataset('test.t1')
+order by $l.id
+return $l;
+
+drop dataset test.t1 if exists;
+
+drop dataverse test if exists;
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/join_across_dataverses.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/join_across_dataverses.aql
new file mode 100644
index 0000000..d09755a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/join_across_dataverses.aql
@@ -0,0 +1,60 @@
+//***** Test to conduct a join between datasets belonging to different dataverses*****//
+
+drop dataverse test1 if exists;
+drop dataverse test2 if exists;
+
+create dataverse test1;
+create dataverse test2;
+
+create type test1.AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+};
+
+create type test1.CustomerType as closed {
+ cid: int32,
+ name: string,
+ cashBack: int32,
+ age: int32?,
+ address: AddressType?,
+ lastorder: {
+ oid: int32,
+ total: float
+ }
+};
+
+create dataset test1.Customers(CustomerType)
+partitioned by key cid;
+
+
+create type test2.OrderType as open {
+ oid: int32,
+ cid: int32,
+ orderstatus: string,
+ orderpriority: string,
+ clerk: string,
+ total: float,
+ items: [int32]
+}
+
+create dataset test2.Orders(OrderType)
+partitioned by key oid;
+
+
+load dataset test1.Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/nontagged/customerData.json"),
+("format"="adm"));
+
+load dataset test2.Orders
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/nontagged/orderData.json"),("format"="adm"));
+
+write output to nc1:"rttest/cross-dataverse_join_across_dataverses.adm";
+
+for $c in dataset('test1.Customers')
+for $o in dataset('test2.Orders')
+where $c.cid = $o.cid
+order by $c.name, $o.total
+return {"cust_name":$c.name, "cust_age": $c.age, "order_total":$o.total, "orderList":[$o.oid, $o.cid], "orderList":{{$o.oid, $o.cid}}}
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/metadata_dataset.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/metadata_dataset.aql
new file mode 100644
index 0000000..777613c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/metadata_dataset.aql
@@ -0,0 +1,8 @@
+write output to nc1:"rttest/cross-dataverse_metadata_dataset.adm";
+
+for $c in dataset('Metadata.Dataset')
+where $c.DataverseName='Metadata'
+return $c
+
+
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205.aql b/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205.aql
new file mode 100644
index 0000000..e0a0695
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205.aql
@@ -0,0 +1,33 @@
+/*
+ * Description : This test case is to verify the fix for issue205
+ : https://code.google.com/p/asterixdb/issues/detail?id=205
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type EmployeeStat as open {
+ age: int32,
+ salary:int32
+}
+
+create type EmployeeType as closed {
+ id:string,
+ stat:EmployeeStat,
+ deptCode:int32
+}
+
+create dataset Employees(EmployeeType)
+ partitioned by key id;
+
+insert into dataset Employees({"id":"1234", "stat":{ "age":50, "salary":120000}, "deptCode":32 });
+insert into dataset Employees({"id":"5678", "stat":{ "age":40, "salary":100000}, "deptCode":16 });
+
+delete $l from dataset Employees where $l.id = "1234";
+
+write output to nc1:"rttest/dml_query-issue205.adm";
+for $l in dataset('Employees')
+return $l
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index.aql
index 6201ca2..4e2ca6c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index.aql
@@ -10,7 +10,8 @@
line2: line,
poly1: polygon,
poly2: polygon,
- rec: rectangle
+ rec: rectangle,
+ circle: circle
}
create dataset MyData(MyRecord)
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index.aql
index 236b4a9..f1bc29d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index.aql
@@ -10,7 +10,8 @@
line2: line,
poly1: polygon,
poly2: polygon,
- rec: rectangle
+ rec: rectangle,
+ circle: circle
}
create type MyMiniRecord as closed {
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
new file mode 100644
index 0000000..5678681
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete-rtree.aql
@@ -0,0 +1,7 @@
+use dataverse test;
+
+write output to nc1:"rttest/failure_verify_delete-rtree.adm";
+
+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.aql b/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete.aql
new file mode 100644
index 0000000..61006a4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/verify_delete.aql
@@ -0,0 +1,8 @@
+use dataverse test;
+
+write output to nc1:"rttest/failure_verify_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/verify_insert-rtree.aql b/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert-rtree.aql
new file mode 100644
index 0000000..3e52732
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert-rtree.aql
@@ -0,0 +1,7 @@
+use dataverse test;
+
+write output to nc1:"rttest/failure_verify_insert-rtree.adm";
+
+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.aql b/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert.aql
new file mode 100644
index 0000000..97ca9ae
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/verify_insert.aql
@@ -0,0 +1,7 @@
+use dataverse test;
+
+write output to nc1:"rttest/failure_verify_insert.adm";
+
+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/feeds/feeds_01.aql b/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_01.aql
new file mode 100644
index 0000000..d4dcd38
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_01.aql
@@ -0,0 +1,27 @@
+/*
+ * Description : Create a feed dataset and verify contents in Metadata
+ * Expected Res : Success
+ * Date : 24th Dec 2012
+ */
+drop dataverse feeds if exists;
+create dataverse feeds;
+use dataverse feeds;
+
+create type TweetType as closed {
+ id: string,
+ username : string,
+ location : string,
+ text : string,
+ timestamp : string
+}
+
+create feed dataset TweetFeed(TweetType)
+using "edu.uci.ics.asterix.tools.external.data.RateControlledFileSystemBasedAdapterFactory"
+(("fs"="localfs"),("path"="nc1://data/twitter/obamatweets.adm"),("format"="adm"),("output-type-name"="TweetType"),("tuple-interval"="10"))
+partitioned by key id;
+
+write output to nc1:"rttest/feeds_feeds_01.adm";
+
+for $x in dataset('Metadata.Dataset')
+where $x.DataverseName='feeds' and $x.DatasetName='TweetFeed'
+return $x
diff --git a/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_02.aql b/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_02.aql
new file mode 100644
index 0000000..3129d63
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_02.aql
@@ -0,0 +1,31 @@
+/*
+ * Description : Create a feed dataset that uses the feed simulator adapter.
+ Begin ingestion and verify contents of the dataset post completion.
+ * Expected Res : Success
+ * Date : 24th Dec 2012
+ */
+drop dataverse feeds if exists;
+create dataverse feeds;
+use dataverse feeds;
+
+create type TweetType as closed {
+ id: string,
+ username : string,
+ location : string,
+ text : string,
+ timestamp : string
+}
+
+create feed dataset TweetFeed(TweetType)
+using "edu.uci.ics.asterix.tools.external.data.RateControlledFileSystemBasedAdapterFactory"
+(("fs"="localfs"),("path"="nc1://data/twitter/obamatweets.adm"),("format"="adm"),("output-type-name"="TweetType"),("tuple-interval"="10"))
+partitioned by key id;
+
+begin feed TweetFeed;
+
+write output to nc1:"rttest/feeds_feeds_02.adm";
+
+for $x in dataset('TweetFeed')
+return $x
+
+drop dataverse feeds;
diff --git a/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_03.aql b/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_03.aql
new file mode 100644
index 0000000..a4b22d0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_03.aql
@@ -0,0 +1,34 @@
+/*
+ * Description : Create a feed dataset with an associated function and verify contents in Metadata
+ * Expected Res : Success
+ * Date : 24th Dec 2012
+ */
+drop dataverse feeds if exists;
+create dataverse feeds;
+use dataverse feeds;
+
+create type TweetType as closed {
+ id: string,
+ username : string,
+ location : string,
+ text : string,
+ timestamp : string
+}
+
+create function feed_processor($x) {
+$x
+}
+
+create feed dataset TweetFeed(TweetType)
+using "edu.uci.ics.asterix.tools.external.data.RateControlledFileSystemBasedAdapterFactory"
+(("fs"="localfs"),("path"="nc1://data/twitter/obamatweets.adm"),("format"="adm"),("output-type-name"="TweetType"),("tuple-interval"="10"))
+apply function feed_processor@1
+partitioned by key id;
+
+write output to nc1:"rttest/feeds_feeds_03.adm";
+
+for $x in dataset('Metadata.Dataset')
+where $x.DataverseName='feeds' and $x.DatasetName='TweetFeed'
+return $x
+
+drop dataverse feeds;
diff --git a/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_04.aql b/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_04.aql
new file mode 100644
index 0000000..c38cfd2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_04.aql
@@ -0,0 +1,32 @@
+/*
+ * Description : Create a feed dataset that uses the feed simulator adapter.
+ The feed simulator simulates feed from a file in the HDFS.
+ Begin ingestion and verify contents of the dataset post completion.
+ * Expected Res : Success
+ * Date : 24th Dec 2012
+ */
+drop dataverse feeds if exists;
+create dataverse feeds;
+use dataverse feeds;
+
+create type TweetType as closed {
+ id: string,
+ username : string,
+ location : string,
+ text : string,
+ timestamp : string
+}
+
+create feed dataset TweetFeed(TweetType)
+using "edu.uci.ics.asterix.tools.external.data.RateControlledFileSystemBasedAdapterFactory"
+(("fs"="hdfs"),("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/obamatweets.adm"),("format"="adm"),("input-format"="text-input-format"),("output-type-name"="TweetType"),("tuple-interval"="10"))
+partitioned by key id;
+
+begin feed TweetFeed;
+
+write output to nc1:"rttest/feeds_feeds_04.adm";
+
+for $x in dataset('TweetFeed')
+return $x
+
+drop dataverse feeds;
diff --git a/asterix-app/src/test/resources/runtimets/queries/feeds/issue_230_feeds.aql b/asterix-app/src/test/resources/runtimets/queries/feeds/issue_230_feeds.aql
new file mode 100644
index 0000000..a7dc4fa
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/feeds/issue_230_feeds.aql
@@ -0,0 +1,31 @@
+/*
+ * Description : Create a feed dataset that uses the feed simulator adapter.
+ Begin ingestion using a fully qualified name and verify contents of the dataset post completion.
+ * Expected Res : Success
+ * Date : 24th Dec 2012
+ */
+drop dataverse feeds if exists;
+create dataverse feeds;
+use dataverse feeds;
+
+create type TweetType as closed {
+ id: string,
+ username : string,
+ location : string,
+ text : string,
+ timestamp : string
+}
+
+create feed dataset TweetFeed(TweetType)
+using "edu.uci.ics.asterix.tools.external.data.RateControlledFileSystemBasedAdapterFactory"
+(("fs"="localfs"),("path"="nc1://data/twitter/obamatweets.adm"),("format"="adm"),("output-type-name"="TweetType"),("tuple-interval"="10"))
+partitioned by key id;
+
+begin feed feeds.TweetFeed;
+
+write output to nc1:"rttest/feeds_issue_230_feeds.adm";
+
+for $x in dataset('TweetFeed')
+return $x
+
+drop dataverse feeds;
diff --git a/asterix-app/src/test/resources/runtimets/queries/float_01.aql b/asterix-app/src/test/resources/runtimets/queries/float_01.aql
deleted file mode 100644
index dea3790..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/float_01.aql
+++ /dev/null
@@ -1,8 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/float_01.adm";
-
-for $f in [1f, 1F, 1.1f, 1.1F, .1f, .1F]
-return $f
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for01.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for01.aql
index 046c55f..afb3783 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/for01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for01.aql
@@ -4,6 +4,8 @@
* Date : 23rd July 2012
*/
+write output to nc1:"rttest/flwor_for01.adm";
+
for $a in [1,2,3,4,5,6,7,8,9]
where not(false)
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for02.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for02.aql
index aa75cfa..6ff278a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/for02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for02.aql
@@ -4,6 +4,8 @@
* Date : 7th July 2012
*/
+write output to nc1:"rttest/flwor_for02.adm";
+
for $a in [[1,2,3,4,5,6,7,8,9],[20,30,40,50,60,70,80]]
where true
return for $b in $a where $b > 5 and $b <70 return $b
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for03.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for03.aql
index 00bf474..090aa69 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/for03.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for03.aql
@@ -4,5 +4,7 @@
* Date : 7th July 2012
*/
+write output to nc1:"rttest/flwor_for03.adm";
+
for $a in [[1,2,3,4,5,6,7,8,9,0],["r","t","w","a"],[11,34,56,78,98,01,12,34,56,76,83],[null,null,null],[" ",""," "],["at"],[-1],[0]]
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for04.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for04.aql
index 0d26a37..c419b6e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/for04.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for04.aql
@@ -4,6 +4,8 @@
* Date : 7th July 2012
*/
+write output to nc1:"rttest/flwor_for04.adm";
+
for $a in [[1,2,3,4,5,6,7,8,9,0],[11,34,56,78,98,01,12,34,56,76,83],[null,null,null,"and","bat","gone","do"],[" ",""," "],["at"],[-1],[0]]
where len($a) > 1
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for05.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for05.aql
index f2f1ca3..a8533d9 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/for05.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for05.aql
@@ -4,6 +4,8 @@
* Date : 7th July 2012
*/
+write output to nc1:"rttest/flwor_for05.adm";
+
for $a in [1,2,3,4,5,6,7,8,9]
where ()
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for06.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for06.aql
index 9cc9fe3..5ed5e5e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/for06.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for06.aql
@@ -4,6 +4,8 @@
* Date : 7th July 2012
*/
+write output to nc1:"rttest/flwor_for06.adm";
+
for $a in [1,2,3,4,5,6,7,8,9]
where $undefined
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for07.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for07.aql
index 9639c60..af2cd3c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/for07.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for07.aql
@@ -4,5 +4,7 @@
* Date : 7th July 2012
*/
+write output to nc1:"rttest/flwor_for07.adm";
+
for $a in [{"name":"Bob","age":10,"sex":"Male"},{"name":"John","age":45,"sex":"Female"},{"name":"Raj","age":35,"sex":"Male"}]
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for08.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for08.aql
index f0e0191..b8a88fe 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/for08.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for08.aql
@@ -4,6 +4,8 @@
* Date : 7th July 2012
*/
+write output to nc1:"rttest/flwor_for08.adm";
+
for $a in [{"name":"Bob","age":10,"sex":"Male"},{"name":"John","age":45,"sex":"Female"},{"name":"Raj","age":35,"sex":"Male"}]
where $a.name="John"
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for09.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for09.aql
index 872257f..fb03193 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/for09.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for09.aql
@@ -4,6 +4,8 @@
* Date : 7th July 2012
*/
+write output to nc1:"rttest/flwor_for09.adm";
+
for $a in [{"name":"Bob","age":10,"sex":"Male"},{"name":"John","age":45,"sex":"Female"},{"name":"Raj","age":35,"sex":"Male"}]
where $a.name="Tom"
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for10.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for10.aql
index 99c96b4..81589ea 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/for10.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for10.aql
@@ -4,5 +4,7 @@
* Date : 7th July 2012
*/
+write output to nc1:"rttest/flwor_for10.adm";
+
for $a in [{"name":"Bob","age":10,"sex":"Male"},{"name":"John","age":45,"sex":"Female"},{"name":"Raj","age":35,"sex":"Male"}]
return {"a":$a,"additional-data":{{"this is additional data","this is too","and this is additional too"}}}
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for11.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for11.aql
index f2c8ade..50f5635 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/for11.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for11.aql
@@ -4,5 +4,8 @@
* Date : 7th July 2012
*/
+write output to nc1:"rttest/flwor_for11.adm";
+
for $a in [true,true,false,true]
+where $a = true
return {{"this is additional data","this is too","and this is additional too"}}
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for12.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for12.aql
index 609af54..f870374 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/for12.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for12.aql
@@ -4,6 +4,9 @@
* Date : 7th July 2012
*/
+write output to nc1:"rttest/flwor_for12.adm";
+
for $a in [true,true,false,true]
+where $a = false
return {"a":{{"this is additional data","this is too","and this is additional too"}},"b":{{"this is additional data","this is too","and this is additional too"}}}
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for13.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for13.aql
index 307995b..5a6388e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/for13.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for13.aql
@@ -4,5 +4,7 @@
* Date : 7th July 2012
*/
+write output to nc1:"rttest/flwor_for13.adm";
+
for $a in [true]
return {{"this is additional data","this is too","and this is additional too"}}
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for14.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for14.aql
index bd9eff7..bef8754 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/for14.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for14.aql
@@ -4,5 +4,7 @@
* Date : 7th July 2012
*/
+write output to nc1:"rttest/flwor_for14.adm";
+
for $a in [{"name":"Rocky","age":59,"sex":"M"},["job","ink","king","ontario","lavelle"],[1,4,5,6,7,8,9,2,3,4,5,6,7],{{"extra data","extra data","extra data"}}]
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for15.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for15.aql
index 5e8f9786..5a65ae6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/for15.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for15.aql
@@ -4,5 +4,7 @@
* Date : 7th July 2012
*/
+write output to nc1:"rttest/flwor_for15.adm";
+
for $a in [{"name":"Rocky","age":59,"sex":"M"},[1]]
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for16.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for16.aql
index 790f9ce..c2fb57f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/for16.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for16.aql
@@ -4,5 +4,7 @@
* Date : 7th July 2012
*/
+write output to nc1:"rttest/flwor_for16.adm";
+
for $a in [[[1,2],[3]],[[4,5],[6,7]],[[8,9],[10,11]],[[12,13],[14]],[[15],[16,17]],[[18],[19,20]]]
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for17.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for17.aql
index 9e05da3..0d5d16c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/for17.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for17.aql
@@ -4,6 +4,8 @@
* Date : 24th July 2012
*/
+write output to nc1:"rttest/flwor_for17.adm";
+
(for $a in [{"id":1234,"name":"John Doe","age":56,"salary":50000,"dept":"HR"}]
return $a)
union
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for18.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for18.aql
new file mode 100644
index 0000000..e17daa8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for18.aql
@@ -0,0 +1,15 @@
+/*
+ * Description : Test nested for and return
+ * Expected Result : Success
+ * Date : 21st Aug 2012
+ */
+
+write output to nc1:"rttest/flwor_for18.adm";
+
+for $a in (
+ for $b in (
+ for $c in (
+ for $d in [1,2,3,4,5,6,7] return $d+1
+ ) return $c+1
+ ) return $b+1
+) return $a+1
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for19.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for19.aql
new file mode 100644
index 0000000..1101c95
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for19.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : Test for clause of the FLWOR expression
+ * Expected Result : Success
+ * Date : 7th July 2012
+ */
+
+write output to nc1:"rttest/flwor_for19.adm";
+
+for $a in [[1,2,3,4,5,6,7,8,9,0],[11,34,56,78,98,01,12,34,56,76,83]]
+where len($a) > 1
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/grpby01.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/grpby01.aql
new file mode 100644
index 0000000..252016f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/grpby01.aql
@@ -0,0 +1,15 @@
+/*
+ * Description : Test group by clause of the FLWOR expression
+ * Expected Result : Success
+ * Date : 31st July 2012
+ */
+
+for $sales in [{"storeno":"S101","itemno":"P78395","qty":125},
+{"storeno":"S101","itemno":"P71395","qty":135},
+{"storeno":"S102","itemno":"P78395","qty":225},
+{"storeno":"S103","itemno":"P78345","qty":105},
+{"storeno":"S104","itemno":"P71395","qty":115},
+{"storeno":"S105","itemno":"P74395","qty":120}]
+group by $strNum:=$sales.storeno with $sales
+order by $strNum desc
+return {"store-number":$strNum,"total-qty":sum(for $l in $sales return $l.qty)}
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/grpby02.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/grpby02.aql
new file mode 100644
index 0000000..252016f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/grpby02.aql
@@ -0,0 +1,15 @@
+/*
+ * Description : Test group by clause of the FLWOR expression
+ * Expected Result : Success
+ * Date : 31st July 2012
+ */
+
+for $sales in [{"storeno":"S101","itemno":"P78395","qty":125},
+{"storeno":"S101","itemno":"P71395","qty":135},
+{"storeno":"S102","itemno":"P78395","qty":225},
+{"storeno":"S103","itemno":"P78345","qty":105},
+{"storeno":"S104","itemno":"P71395","qty":115},
+{"storeno":"S105","itemno":"P74395","qty":120}]
+group by $strNum:=$sales.storeno with $sales
+order by $strNum desc
+return {"store-number":$strNum,"total-qty":sum(for $l in $sales return $l.qty)}
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let01.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let01.aql
index 9836f85..7313680 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let01.aql
@@ -4,5 +4,7 @@
* Date : 6th July 2012
*/
+write output to nc1:"rttest/flwor_let01.adm";
+
let $x := int64("92233720368547758")
return $x
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let02.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let02.aql
index a0f936f..8fae4a2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let02.aql
@@ -4,5 +4,7 @@
* Date : 6th July 2012
*/
+write output to nc1:"rttest/flwor_let02.adm";
+
let $x := 92233720368547758
return $x
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let03.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let03.aql
index 4cb816b..895630a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let03.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let03.aql
@@ -4,5 +4,7 @@
* Date : 6th July 2012
*/
+write output to nc1:"rttest/flwor_let03.adm";
+
let $x := int64("92233720368547758")+1
return $x
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let04.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let04.aql
index 4832e2c..fad97fa 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let04.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let04.aql
@@ -4,5 +4,7 @@
* Date : 6th July 2012
*/
+write output to nc1:"rttest/flwor_let04.adm";
+
let $x := double("1.7976931348623157E308")
return $x
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let05.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let05.aql
index d8d3023..f718608 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let05.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let05.aql
@@ -4,5 +4,7 @@
* Date : 6th July 2012
*/
+write output to nc1:"rttest/flwor_let05.adm";
+
let $x := {"a":(1+1*(100/20))}
return $x
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let06.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let06.aql
index 2d443a9..c693a04 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let06.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let06.aql
@@ -4,6 +4,8 @@
* Date : 6th July 2012
*/
+write output to nc1:"rttest/flwor_let06.adm";
+
let $x := 1
let $y := $x+1
return $x
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let07.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let07.aql
index 894b1da..5abf05e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let07.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let07.aql
@@ -4,6 +4,8 @@
* Date : 6th July 2012
*/
+write output to nc1:"rttest/flwor_let07.adm";
+
let $x := 1
let $y := ($x+1)
return $y
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let08.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let08.aql
index 687cc51..ca38246 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let08.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let08.aql
@@ -4,6 +4,8 @@
* Date : 6th July 2012
*/
+write output to nc1:"rttest/flwor_let08.adm";
+
let $x:=[1,2,3]
for $b in $x
let $y:=$b+1
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let09.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let09.aql
index 2d4439b..0c10d5a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let09.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let09.aql
@@ -4,6 +4,8 @@
* Date : 6th July 2012
*/
+write output to nc1:"rttest/flwor_let09.adm";
+
for $a in range(1,100)
where $a%5=0
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let10.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let10.aql
index 208a478..a10b28f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let10.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let10.aql
@@ -4,6 +4,8 @@
* Date : 6th July 2012
*/
+write output to nc1:"rttest/flwor_let10.adm";
+
let $x:=[1,2,3,4,5,6,7,8,9,10,11,14,15,17,19,24,35,56,67,77,89,60,35,25,60]
for $y in $x
where $y%5=0
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let11.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let11.aql
index 1a96ff3..150b075 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let11.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let11.aql
@@ -4,6 +4,8 @@
* Date : 6th July 2012
*/
+write output to nc1:"rttest/flwor_let11.adm";
+
// Return an ordered list comprising of records and other values
let $a := ["a",{"i":1},"b",{"j":2},"c",{"k":3}]
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let12.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let12.aql
index 6b80062..3061ea8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let12.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let12.aql
@@ -4,6 +4,8 @@
* Date : 6th July 2012
*/
+write output to nc1:"rttest/flwor_let12.adm";
+
let $a := 1
let $b := $a
let $c := $a+$b
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let13.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let13.aql
index 8722947..cf987b8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let13.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let13.aql
@@ -1,9 +1,11 @@
/*
* Description : Test let clause
- * Expected Result : Success
+ * Expected Result : Failure - Negative test
* Date : 6th July 2012
*/
+write output to nc1:"rttest/flwor_let13.adm";
+
// Bind an undefined variable.
let $a := $b
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let14.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let14.aql
index b0cdcad..524dd97 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let14.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let14.aql
@@ -4,6 +4,8 @@
* Date : 6th July 2012
*/
+write output to nc1:"rttest/flwor_let14.adm";
+
// nested ordered list
let $a := [[[[[[[[[[[[1,2,3,4,5,6,7,8,9,10],[3,4,5,6,7,8,9,0,0],int64("9222872036854775809")]]]]]]]]]]]
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let15.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let15.aql
index 317726a..52f9862 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let15.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let15.aql
@@ -4,6 +4,8 @@
* Date : 6th July 2012
*/
+write output to nc1:"rttest/flwor_let15.adm";
+
// nested ordered list comprising of only one integer value.
let $a := [[[[[[[[[[[int64("9222872036854775809")]]]]]]]]]]]
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let16.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let16.aql
index 122d3ee..b403c3e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let16.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let16.aql
@@ -4,5 +4,7 @@
* Date : 6th July 2012
*/
+write output to nc1:"rttest/flwor_let16.adm";
+
let $a := [[[[[[[[[[[int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809")]]]]]]]]]]]
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let17.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let17.aql
index 4f9be6f..4b53f84 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let17.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let17.aql
@@ -4,6 +4,8 @@
* Date : 6th July 2012
*/
+write output to nc1:"rttest/flwor_let17.adm";
+
let $a := ["and","here","we","are",["this is new","stuff"]]
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let18.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let18.aql
index c50c871..3373323 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let18.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let18.aql
@@ -4,6 +4,8 @@
* Date : 6th July 2012
*/
+write output to nc1:"rttest/flwor_let18.adm";
+
// An ordered list comprising of an un ordered list.
let $a:=[{{"John Doe",45,"HR",60000,"Separation"}}]
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let19.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let19.aql
index d3fbafc..e46856a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let19.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let19.aql
@@ -4,5 +4,10 @@
* Date : 6th July 2012
*/
+
+// bind and return bag of data
+
+write output to nc1:"rttest/flwor_let19.adm";
+
let $a:={{"John Doe",45,"HR",60000,"Separation"}}
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let20.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let20.aql
index 22814e6..0172b22 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let20.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let20.aql
@@ -4,6 +4,8 @@
* Date : 6th July 2012
*/
+write output to nc1:"rttest/flwor_let20.adm";
+
// An ordered list of un ordered lists, records and ordered list.
let $a:=[{{"John Doe",45,"HR",60000,"Separation"}},{"name":"Roger Sanders","age":50,"dept":"DB2-Books","designatin":"Author"},["DB2 for Z/OS","DB2 for LUW","DB2 9 Application Development","DB2 9 DBA","DB2 for Dummies"]]
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let21.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let21.aql
index 81f93be..1106a75 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let21.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let21.aql
@@ -4,6 +4,7 @@
* Date : 23rd July 2012
*/
+write output to nc1:"rttest/flwor_let21.adm";
// Ordered list of boolean values.
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let22.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let22.aql
index da33601..c83d81e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let22.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let22.aql
@@ -4,5 +4,7 @@
* Date : 23rd July 2012
*/
+write output to nc1:"rttest/flwor_let22.adm";
+
let $a := [null]
return len($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let23.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let23.aql
index 07ea21b..7ad2152 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let23.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let23.aql
@@ -4,5 +4,7 @@
* Date : 23rd July 2012
*/
+write output to nc1:"rttest/flwor_let23.adm";
+
let $a := [1,2,3,4,5,6,7,8,9,null]
return len($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let24.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let24.aql
index 9bfe510..75a96b1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let24.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let24.aql
@@ -12,6 +12,8 @@
* q - nested record
*/
+write output to nc1:"rttest/flwor_let24.adm";
+
let $m := {"name":"Holmes S","age":25,"sex":"M"}
let $n := {"name":"Bob","age":35,"sex":null}
let $o := {{"John",45,"M"}}
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let25.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let25.aql
index e2b88da..4959b7e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let25.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let25.aql
@@ -4,6 +4,8 @@
* Date : 23rd July 2012
*/
+write output to nc1:"rttest/flwor_let25.adm";
+
let $a := true or false
let $b := (true or false) and not(false)
return {"a":$a,"b":$b}
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let26.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let26.aql
index a8afffe..5352548 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let26.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let26.aql
@@ -8,6 +8,8 @@
* Test let clause - let variable := relational expression
*/
+write output to nc1:"rttest/flwor_let26.adm";
+
let $a := 10 > 9
let $b := ((100 * 100)/10 -1999) > 3900
let $c := true != false
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let27.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let27.aql
index 5cfc1a7..b675e2c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let27.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let27.aql
@@ -6,5 +6,7 @@
// Bind arithmetic expressions to variable using let clause
+write output to nc1:"rttest/flwor_let27.adm";
+
let $a := [(100+100),(100-100),(100 * 100),(100 / 100),(100 %10)]
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let28.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let28.aql
index 2f1b7ce..663304b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let28.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let28.aql
@@ -4,5 +4,7 @@
* Date : 24th July 2012
*/
+write output to nc1:"rttest/flwor_let28.adm";
+
let $a := [137.8932f,156f,.98781f, 436.219F,.89217F,16789F]
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let29.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let29.aql
index 55d6319..45083eb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let29.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let29.aql
@@ -4,5 +4,7 @@
* Date : 24th July 2012
*/
+write output to nc1:"rttest/flwor_let29.adm";
+
let $a := [137.8932,.98781,436.219,.89217,-234.324]
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let30.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let30.aql
index eebc11f..3229d86 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let30.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let30.aql
@@ -6,6 +6,8 @@
// $a and $b are ordered lists with one Record each.
+write output to nc1:"rttest/flwor_let30.adm";
+
let $a := [{"id":1234,"name":"John Doe","age":56,"salary":50000,"dept":"HR"}]
let $b := [{"id":3424,"name":"Roger Sanders","age":46,"salary":60000,"dept":"Publishing"}]
let $c := $a union $b
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let31.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let31.aql
index 84ac278..4c8da02 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let31.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let31.aql
@@ -6,6 +6,8 @@
// $a and $b hold one Record each.
+write output to nc1:"rttest/flwor_let31.adm";
+
let $a := {"id":1234,"name":"John Doe","age":56,"salary":50000,"dept":"HR"}
let $b := {"id":3424,"name":"Roger Sanders","age":46,"salary":60000,"dept":"Publishing"}
let $c := $a union $b
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let32.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let32.aql
index 0881fde..f78d8b5 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/let32.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let32.aql
@@ -4,6 +4,8 @@
* Date : 24th July 2012
*/
+write output to nc1:"rttest/flwor_let32.adm";
+
let $m := (for $a in [{"id":1234,"name":"John Doe","age":56,"salary":50000,"dept":"HR"}]
return $a)
let $n := (for $b in [{"id":3424,"name":"Roger Sanders","age":46,"salary":60000,"dept":"Publishing"}]
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-01.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-01.aql
index a5aec23..7824518 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-01.aql
@@ -4,6 +4,8 @@
* Date : 24th July 2012
*/
+write output to nc1:"rttest/flwor_order-by-01.adm";
+
for $a in ["two","four","six","eight","ten","twenty","undo"]
order by $a desc
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-02.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-02.aql
index 4cc087c..a60d172 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-02.aql
@@ -4,6 +4,8 @@
* Date : 24th July 2012
*/
+write output to nc1:"rttest/flwor_order-by-02.adm";
+
for $a in ["two","four","six","eight","ten","twenty","undo"]
order by $a asc
return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-03.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-03.aql
index 3792c74..eb0c23b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-03.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-03.aql
@@ -4,6 +4,8 @@
* Date : 24th July 2012
*/
+write output to nc1:"rttest/flwor_order-by-03.adm";
+
for $b in ["ten","twenty","thirty","forty","fifty","sixty","seventy","ninety"]
order by string-concat([$b,"test"]) asc
return string-concat([$b,"test"])
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-04.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-04.aql
index e7a209b..65c432f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-04.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-04.aql
@@ -4,6 +4,8 @@
* Date : 24th July 2012
*/
+write output to nc1:"rttest/flwor_order-by-04.adm";
+
for $b in ["ten","twenty","thirty","forty","fifty","sixty","seventy","ninety"]
order by string-concat([$b,"test"]) desc
return string-concat([$b,"test"])
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-05.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-05.aql
index c3139f5..7f9a751 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-05.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-05.aql
@@ -4,6 +4,8 @@
* Date : 24th July 2012
*/
+write output to nc1:"rttest/flwor_order-by-05.adm";
+
for $b in ["ten","twenty","thirty","forty","fifty","sixty","seventy","ninety"]
order by string-concat([$b,""]) desc
return string-concat([$b,""])
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-06.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-06.aql
index 791af3a..bf77da1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-06.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-06.aql
@@ -4,6 +4,8 @@
* Date : 24th July 2012
*/
+write output to nc1:"rttest/flwor_order-by-06.adm";
+
for $b in ["ten","twenty","thirty","forty","fifty","sixty","seventy","ninety"]
order by string-concat([$b,""]) asc
return string-concat([$b,""])
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-07.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-07.aql
index 9c85780..67e6c04 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-07.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-07.aql
@@ -4,6 +4,8 @@
* Date : 24th July 2012
*/
+write output to nc1:"rttest/flwor_order-by-07.adm";
+
for $b in ["ten","twenty","thirty","forty","fifty","sixty","seventy","ninety"]
order by string-concat(["",$b]) desc
return string-concat(["",$b])
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-08.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-08.aql
index 6a823c8..59de072 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-08.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-08.aql
@@ -4,6 +4,8 @@
* Date : 24th July 2012
*/
+write output to nc1:"rttest/flwor_order-by-08.adm";
+
for $b in ["ten","twenty","thirty","forty","fifty","sixty","seventy","ninety"]
order by string-concat(["",$b]) asc
return string-concat(["",$b])
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-09.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-09.aql
index 0df3a9e..cce7299 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-09.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-09.aql
@@ -4,6 +4,8 @@
* Date : 24th July 2012
*/
+write output to nc1:"rttest/flwor_order-by-09.adm";
+
for $x in ["ten","twenty","thirty","forty","fifty","sixty","seventy","ninety"]
order by string-concat([$x,$x]) asc
return string-concat([$x,$x])
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-10.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-10.aql
index 09a9026..91b7dc7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-10.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-10.aql
@@ -4,6 +4,8 @@
* Date : 24th July 2012
*/
+write output to nc1:"rttest/flwor_order-by-10.adm";
+
for $x in ["ten","twenty","thirty","forty","fifty","sixty","seventy","ninety"]
order by string-concat([$x,$x]) desc
return string-concat([$x,$x])
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-11.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-11.aql
index 5b79987..c97b708 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-11.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-11.aql
@@ -4,6 +4,8 @@
* Date : 24th July 2012
*/
+write output to nc1:"rttest/flwor_order-by-11.adm";
+
for $x in [1,3,4,5,2,3,33,55,43,12,34,45,67,66,89,0,-1,999]
order by ($x+$x) asc
return ($x+$x)
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-12.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-12.aql
index b620a05..b604158 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-12.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-12.aql
@@ -4,6 +4,8 @@
* Date : 24th July 2012
*/
+write output to nc1:"rttest/flwor_order-by-12.adm";
+
for $x in [[1,3,4],[5,2],[3,33,55],[43,12,34],[45,67],[66,89,0],[-1,999]]
order by len($x)
return { "x":$x,"len($x)":len($x) }
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-01.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-01.aql
index 0c7e73e..72fb94a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-01.aql
@@ -4,5 +4,9 @@
* Date : 7th July 2012
*/
+// return string length
+
+write output to nc1:"rttest/flwor_ret-01.adm";
+
for $x in ["ten","twenty","thirty","forty","fifty","sixty","seventy","ninety"]
return string-length($x)
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-02.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-02.aql
new file mode 100644
index 0000000..5201cc5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-02.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : Test return clause of the FLWOR expression
+ * Expected Result : Success
+ * Date : 7th July 2012
+ */
+
+// Return a string
+
+write output to nc1:"rttest/flwor_ret-02.adm";
+
+for $x in [true]
+return "this is a test string"
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-03.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-03.aql
new file mode 100644
index 0000000..e51f787
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-03.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : Test return clause of the FLWOR expression
+ * : Tes if expression then expression else expression in the return clause
+ * Expected Result : Success
+ * Date : 26th July 2012
+ */
+
+write output to nc1:"rttest/flwor_ret-03.adm";
+
+for $x in [true]
+return (if(true) then "YES" else "NO")
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-04.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-04.aql
new file mode 100644
index 0000000..5974ed4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-04.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : Test return clause of the FLWOR expression
+ * : Tes if expression then expression else expression in the return clause
+ * Expected Result : Success
+ * Date : 26th July 2012
+ */
+
+write output to nc1:"rttest/flwor_ret-04.adm";
+
+
+let $a := 12345
+return (if($a > 999) then "GREATER" else "LESSER")
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-05.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-05.aql
new file mode 100644
index 0000000..4f6249b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-05.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : Test return clause of the FLWOR expression
+ * : For + Return within return clause
+ * Expected Result : Success
+ * Date : 26th July 2012
+ */
+
+write output to nc1:"rttest/flwor_ret-05.adm";
+
+let $b := 12345
+return (for $a in [[1,2,3],[4,5,6,7],[8,9],[0,4,5],[6,7,1],[2,3,4],[5,6,7],[8,9,0]] return $a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-06.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-06.aql
new file mode 100644
index 0000000..e164cd3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-06.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : Test return clause of the FLWOR expression
+ * : Return an un-ordered list
+ * Expected Result : Success
+ * Date : 26th July 2012
+ */
+
+write output to nc1:"rttest/flwor_ret-06.adm";
+
+let $b := 12345
+return {{"Welcome","UCI","Anteater","DBH","ICS"}}
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-07.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-07.aql
new file mode 100644
index 0000000..73c86cc
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-07.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : Test return clause of the FLWOR expression
+ * Expected Result : Success
+ * Date : 26th July 2012
+ */
+
+// return nothing
+
+write output to nc1:"rttest/flwor_ret-07.adm";
+
+let $b := true
+return {}
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-08.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-08.aql
new file mode 100644
index 0000000..0b67dca
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-08.aql
@@ -0,0 +1,13 @@
+/*
+ * Description : Test return clause of the FLWOR expression
+ * Expected Result : Success
+ * Date : 26th July 2012
+ */
+
+// for and return in return clause
+
+write output to nc1:"rttest/flwor_ret-08.adm";
+
+for $a in [1,2,3,4,5,6,7,8]
+return {"a":$a,"inner-for":(for $b in [11,22,33,44,55,66,77,88] return $b)}
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-09.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-09.aql
new file mode 100644
index 0000000..a186c99
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-09.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : Test return clause of the FLWOR expression
+ * Expected Result : Success
+ * Date : 26th July 2012
+ */
+
+// return a constant
+
+write output to nc1:"rttest/flwor_ret-09.adm";
+
+let $b:=true
+return 1
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-10.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-10.aql
new file mode 100644
index 0000000..cc05a11
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-10.aql
@@ -0,0 +1,13 @@
+/*
+ * Description : Test return clause of the FLWOR expression
+ * Expected Result : Success
+ * Date : 26th July 2012
+ */
+
+// nested for and return within another for
+
+write output to nc1:"rttest/flwor_ret-10.adm";
+
+for $a in
+ for $b in [1,2,3,4,5,6,7,8,9,0] return $b
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-11.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-11.aql
new file mode 100644
index 0000000..3f54a13
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-11.aql
@@ -0,0 +1,10 @@
+/*
+ * Description : Test return clause of the FLWOR expression
+ * Expected Result : Success
+ * Date : 26th July 2012
+ */
+
+write output to nc1:"rttest/flwor_ret-11.adm";
+
+for $a in [1,2,3,4,5,6,7,8,9]
+return ($a + 1)
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-12.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-12.aql
new file mode 100644
index 0000000..7ce8e90
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-12.aql
@@ -0,0 +1,10 @@
+/*
+ * Description : Test return clause of the FLWOR expression
+ * Expected Result : Success
+ * Date : 26th July 2012
+ */
+
+write output to nc1:"rttest/flwor_ret-12.adm";
+
+for $a in [1,2,3,4,5,6,7,8,9]
+return ($a - 1)
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-13.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-13.aql
new file mode 100644
index 0000000..cc16cb3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-13.aql
@@ -0,0 +1,10 @@
+/*
+ * Description : Test return clause of the FLWOR expression
+ * Expected Result : Success
+ * Date : 26th July 2012
+ */
+
+write output to nc1:"rttest/flwor_ret-13.adm";
+
+for $a in [1,2,3,4,5,6,7,8,9]
+return ($a * 9)
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-14.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-14.aql
new file mode 100644
index 0000000..4716e71
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-14.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : Test return clause of the FLWOR expression
+ * Expected Result : Success
+ * Date : 26th July 2012
+ */
+
+// Return record
+
+write output to nc1:"rttest/flwor_ret-14.adm";
+
+let $a := true
+return {"name":"John Doe", "age":26,"sex":"M","salary":50000,"dept":"HR"}
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-15.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-15.aql
new file mode 100644
index 0000000..e17312d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-15.aql
@@ -0,0 +1,15 @@
+/*
+ * Description : Test return clause of the FLWOR expression
+ * Expected Result : Success
+ * Date : 30th July 2012
+ */
+
+// Return op1 and op2 or op3 and op4
+
+write output to nc1:"rttest/flwor_ret-15.adm";
+
+let $a := true
+let $b := false
+let $c := true
+let $d := false
+return ($a and $b or $c and $d)
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-16.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-16.aql
new file mode 100644
index 0000000..185d7b6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-16.aql
@@ -0,0 +1,15 @@
+/*
+ * Description : Test return clause of the FLWOR expression
+ * Expected Result : Success
+ * Date : 30th July 2012
+ */
+
+// Return arithmetic-expr1 and arithmetic-expr2
+
+write output to nc1:"rttest/flwor_ret-16.adm";
+
+let $a := 100 + 100
+let $b := 13.4 * 14.97
+let $c := 9999 + 98677
+let $d := 34.67 / 5.324
+return (($a*$d) and ($b / $c))
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-17.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-17.aql
new file mode 100644
index 0000000..f384f81
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-17.aql
@@ -0,0 +1,15 @@
+/*
+ * Description : Test return clause of the FLWOR expression
+ * Expected Result : Success
+ * Date : 30th July 2012
+ */
+
+// Return arithmetic-expr1 and arithmetic-expr2
+
+write output to nc1:"rttest/flwor_ret-17.adm";
+
+let $a := 100 + 100
+let $b := 13.4 * 14.97
+let $c := 9999 + 98677
+let $d := 34.67 / 5.324
+return (($a*$d) and ($b / $c))
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-18.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-18.aql
new file mode 100644
index 0000000..cf858f8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-18.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : Test return clause of the FLWOR expression
+ * Expected Result : Success
+ * Date : 30th July 2012
+ */
+
+// Return an item from the ordered list
+
+write output to nc1:"rttest/flwor_ret-18.adm";
+
+let $a := [1,2,3,4,5,6,7]
+return $a[6]
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-19.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-19.aql
new file mode 100644
index 0000000..4cfa63b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-19.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : Test return clause of the FLWOR expression
+ * Expected Result : Success
+ * Date : 30th July 2012
+ */
+
+// Return an item from the ordered list
+
+write output to nc1:"rttest/flwor_ret-19.adm";
+
+let $a := [[1,2,3,4,5,6,7],[7,8,9,10]]
+return $a[0]
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_2.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_2.aql
new file mode 100644
index 0000000..7bf7d5f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_2.aql
@@ -0,0 +1,32 @@
+/*
+ * Description : Tests that a proper error messags is returned for this scenario.
+ * Since we cannot statically know the type of the field 'title', the FuzzyEqRule
+ * cannot auto-inject a tokenizer, and hence we expect an error saying that we cannot
+ * scan over a string as if it were a collection.
+ * Guards against regression to issue 207.
+ * Success : Yes
+ */
+
+drop dataverse fuzzyjoin if exists;
+create dataverse fuzzyjoin;
+use dataverse fuzzyjoin;
+
+create type DBLPType as open {
+ id: int32
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+load dataset DBLP
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small.adm"),("format"="adm"));
+
+write output to nc1:'rttest/fuzzyjoin_dblp-aqlplus_2.adm';
+
+set simthreshold '.5f';
+
+for $dblp in dataset('DBLP')
+for $dblp2 in dataset('DBLP')
+where $dblp.title ~= $dblp2.title and $dblp.id < $dblp2.id
+order by $dblp.id, $dblp2.id
+return {'dblp': $dblp, 'dblp2': $dblp2}
diff --git a/asterix-app/src/test/resources/runtimets/queries/groupby-orderby-count.aql b/asterix-app/src/test/resources/runtimets/queries/groupby-orderby-count.aql
deleted file mode 100644
index ce4662d..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/groupby-orderby-count.aql
+++ /dev/null
@@ -1,23 +0,0 @@
-drop dataverse twitter if exists;
-create dataverse twitter;
-use dataverse twitter;
-create type Tweet as open {
- id: int32,
- tweetid: int64,
- loc: point,
- time: datetime,
- text: string
-}
-
-create external dataset TwitterData(Tweet)
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/twitter/extrasmalltweets.txt"),("format"="adm"));
-
-write output to nc1:"rttest/groupby-orderby-count.adm";
-
-for $t in dataset('TwitterData')
-let $tokens := word-tokens($t.text)
-for $token in $tokens
-group by $tok := $token with $token
-order by count($token) desc, $tok asc
-return { "word": $tok, "count": count($token) }
diff --git a/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_02.aql b/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_02.aql
new file mode 100644
index 0000000..7a0494f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_02.aql
@@ -0,0 +1,26 @@
+/*
+* Description : Create an external dataset that contains a tuples, the lines from a (*sequence*) file in HDFS.
+ Perform a word-count over the data in the dataset.
+* Expected Res : Success
+* Date : 7th Jan 2013
+*/
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type LineType as closed {
+ content: string
+};
+
+create external dataset TextDataset(LineType)
+using "hdfs"
+(("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/textFileS"),("input-format"="sequence-input-format"),("format"="delimited-text"),("delimiter"="."));
+
+write output to nc1:"rttest/hdfs_hdfs_02.adm";
+
+for $line in dataset('TextDataset')
+let $tokens := word-tokens($line.content)
+for $token in $tokens
+group by $tok := $token with $token
+order by $tok
+return { "word": $tok, "count": count($token) }
diff --git a/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_03.aql b/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_03.aql
new file mode 100644
index 0000000..fc5b3ab
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_03.aql
@@ -0,0 +1,28 @@
+/*
+* Description : Create an external dataset that contains a tuples, the lines from a large (35kb) text file in HDFS.
+ The input file is sufficiently large to guarantee that # of bytes > than internal buffer of size 8192.
+ This causes a record to span across the buffer size boundaries.
+ Perform a word-count over the data in the dataset.
+* Expected Res : Success
+* Date : 7th Jan 2013
+*/
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type LineType as closed {
+ content: string
+};
+
+create external dataset TextDataset(LineType)
+using "hdfs"
+(("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/large_text"),("input-format"="text-input-format"),("format"="delimited-text"),("delimiter"="."));
+
+write output to nc1:"rttest/hdfs_hdfs_03.adm";
+
+for $line in dataset('TextDataset')
+let $tokens := word-tokens($line.content)
+for $token in $tokens
+group by $tok := $token with $token
+order by $tok
+return { "word": $tok, "count": count($token) }
diff --git a/asterix-app/src/test/resources/runtimets/queries/hdfs/issue_245_hdfs.aql b/asterix-app/src/test/resources/runtimets/queries/hdfs/issue_245_hdfs.aql
new file mode 100644
index 0000000..c2a0963
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/hdfs/issue_245_hdfs.aql
@@ -0,0 +1,23 @@
+/*
+* Description : Create an external dataset that contains a tuples, the lines from a file in HDFS.
+ Iterate over the contained tuples.
+* Expected Res : Success
+* Issue : 245
+* Date : 7th Jan 2013
+*/
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type LineType as closed {
+ line: string
+};
+
+create external dataset TextDataset(LineType)
+using "hdfs"
+(("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/asterix_info.txt"),("input-format"="text-input-format"),("format"="delimited-text"),("delimiter"="."));
+
+write output to nc1:"rttest/hdfs_issue_245_hdfs.adm";
+
+for $x in dataset('TextDataset')
+return $x
diff --git a/asterix-app/src/test/resources/runtimets/queries/ifthenelse_01.aql b/asterix-app/src/test/resources/runtimets/queries/ifthenelse_01.aql
deleted file mode 100644
index 1da06a7..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/ifthenelse_01.aql
+++ /dev/null
@@ -1,8 +0,0 @@
-use dataverse test;
-
-write output to nc1:"rttest/ifthenelse_01.adm";
-
-if (2>1) then
- 20
-else
- 10
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-equi-join.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-equi-join.aql
new file mode 100644
index 0000000..1015e82
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-equi-join.aql
@@ -0,0 +1,57 @@
+/*
+ * Description : Equi joins two datasets, Customers and Orders, based on the customer id.
+ * Given the 'indexnl' hint we expect the join to be transformed
+ * into an indexed nested-loop join using Customers' primary index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ cashBack: int32,
+ age: int32?,
+ address: AddressType?,
+ lastorder: {
+ oid: int32,
+ total: float
+ }
+}
+
+create type OrderType as open {
+ oid: int32,
+ cid: int32,
+ orderstatus: string,
+ orderpriority: string,
+ clerk: string,
+ total: float,
+ items: [int32]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Orders(OrderType) partitioned by key oid;
+
+load dataset Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/nontagged/customerData.json"),("format"="adm"));
+
+load dataset Orders
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/nontagged/orderData.json"),("format"="adm"));
+
+write output to nc1:"rttest/index-join_btree-primary-equi-join.adm";
+
+for $c in dataset('Customers')
+for $o in dataset('Orders')
+where $c.cid /*+ indexnl */ = $o.cid
+order by $c.cid, $o.oid
+return {"cid":$c.cid, "oid": $o.oid}
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join.aql
new file mode 100644
index 0000000..d1e9824
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join.aql
@@ -0,0 +1,47 @@
+/*
+ * Description : Equi joins two datasets, DBLP and CSX, based on their title.
+ * DBLP has a secondary btree index on title, and given the 'indexnl' hint
+ * we expect the join to be transformed into an indexed nested-loop join.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create type CSXType as closed {
+ id: int32,
+ csxid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+create dataset CSX(CSXType) partitioned by key id;
+
+load dataset DBLP
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
+
+load dataset CSX
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
+
+create index title_index on DBLP(authors);
+
+write output to nc1:"rttest/index-join_btree-secondary-equi-join.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+where $a.authors /*+ indexnl */ = $b.authors
+order by $a.id, $b.id
+return {"aid": $a.id, "bid": $b.id, "authors": $a.authors}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/inverted-index-ngram-edit-distance.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/inverted-index-ngram-edit-distance.aql
deleted file mode 100644
index dfd86e3..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/index-join/inverted-index-ngram-edit-distance.aql
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Description : Fuzzy joins two datasets, Customers and Customers2, based on the edit-distance function of their names.
- * Customers has a 3-gram index on name, and we expect the join to be transformed into an indexed nested-loop join.
- * Success : Yes
- */
-
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-create type AddressType as open {
- number: int32,
- street: string,
- city: string
-}
-
-create type CustomerType as open {
- cid: int32,
- name: string,
- age: int32?,
- address: AddressType?,
- interests: [string],
- children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) partitioned by key cid;
-
-create dataset Customers2(CustomerType) partitioned by key cid;
-
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-create index ngram_index on Customers(name) type ngram(3);
-
-write output to nc1:"rttest/index-join_inverted-index-ngram-edit-distance.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-where edit-distance($a.name, $b.name) <= 4 and $a.cid < $b.cid
-order by $a.cid, $b.cid
-return { "arec": $a, "brec": $b }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/inverted-index-ngram-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/inverted-index-ngram-jaccard.aql
deleted file mode 100644
index 6f69866..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/index-join/inverted-index-ngram-jaccard.aql
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Description : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' 3-gram tokens.
- * DBLP has a 3-gram index on title, and we expect the join to be transformed into an indexed nested-loop join.
- * Success : Yes
- */
-
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-create type DBLPType as closed {
- id: int32,
- dblpid: string,
- title: string,
- authors: string,
- misc: string
-}
-
-create type CSXType as closed {
- id: int32,
- csxid: string,
- title: string,
- authors: string,
- misc: string
-}
-
-create dataset DBLP(DBLPType) partitioned by key id;
-
-create dataset CSX(CSXType) partitioned by key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-create index ngram_index on DBLP(title) type ngram(3);
-
-write output to nc1:"rttest/index-join_inverted-index-ngram-jaccard.adm";
-
-for $a in dataset('DBLP')
-for $b in dataset('CSX')
-where similarity-jaccard(gram-tokens($a.title, 3, false), gram-tokens($b.title, 3, false)) >= 0.5f
- and $a.id < $b.id
-order by $a.id, $b.id
-return { "arec": $a.title, "brec": $b.title }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/inverted-index-olist-edit-distance.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/inverted-index-olist-edit-distance.aql
deleted file mode 100644
index 601d1b8..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/index-join/inverted-index-olist-edit-distance.aql
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Description : Fuzzy joins two datasets, Customers and Customers2, based on the edit-distance function of their interest lists.
- * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
- * Success : Yes
- */
-
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-create type AddressType as open {
- number: int32,
- street: string,
- city: string
-}
-
-create type CustomerType as open {
- cid: int32,
- name: string,
- age: int32?,
- address: AddressType?,
- interests: [string],
- children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) partitioned by key cid;
-
-create dataset Customers2(CustomerType) partitioned by key cid;
-
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-create index interests_index on Customers(interests) type keyword;
-
-write output to nc1:"rttest/index-join_inverted-index-olist-edit-distance.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-where len($a.interests) > 2 and len($b.interests) > 2 and edit-distance($a.interests, $b.interests) <= 1 and $a.cid < $b.cid
-order by $a.cid, $b.cid
-return { "arec": $a, "brec": $b }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/inverted-index-olist-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/inverted-index-olist-jaccard.aql
deleted file mode 100644
index 91fcd80..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/index-join/inverted-index-olist-jaccard.aql
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Description : Fuzzy joins two datasets, Customers and Customers2, based on the Jaccard similarity of their interest lists.
- * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
- * Success : Yes
- */
-
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-create type AddressType as closed {
- number: int32,
- street: string,
- city: string
-}
-
-create type CustomerType as closed {
- cid: int32,
- name: string,
- age: int32?,
- address: AddressType?,
- interests: [string],
- children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) partitioned by key cid;
-
-create dataset Customers2(CustomerType) partitioned by key cid;
-
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-create index interests_index on Customers(interests) type keyword;
-
-write output to nc1:"rttest/index-join_inverted-index-olist-jaccard.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-where similarity-jaccard($a.interests, $b.interests) >= 0.9f
- and $a.cid < $b.cid
-order by $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/inverted-index-ulist-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/inverted-index-ulist-jaccard.aql
deleted file mode 100644
index 2b2d52c..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/index-join/inverted-index-ulist-jaccard.aql
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Description : Fuzzy joins two datasets, Customers and Customers2, based on the Jaccard similarity of their interest sets.
- * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
- * Success : Yes
- */
-
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-create type AddressType as closed {
- number: int32,
- street: string,
- city: string
-}
-
-create type CustomerType as closed {
- cid: int32,
- name: string,
- age: int32?,
- address: AddressType?,
- interests: {{string}},
- children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) partitioned by key cid;
-
-create dataset Customers2(CustomerType) partitioned by key cid;
-
-load dataset Customers
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
-create index interests_index on Customers(interests) type keyword;
-
-write output to nc1:"rttest/index-join_inverted-index-ulist-jaccard.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-where similarity-jaccard($a.interests, $b.interests) >= 0.9f
- and $a.cid < $b.cid
-order by $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/inverted-index-word-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/inverted-index-word-jaccard.aql
deleted file mode 100644
index 228dfd2..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/index-join/inverted-index-word-jaccard.aql
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Description : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
- * DBLP has a keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
- * Success : Yes
- */
-
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-create type DBLPType as closed {
- id: int32,
- dblpid: string,
- title: string,
- authors: string,
- misc: string
-}
-
-create type CSXType as closed {
- id: int32,
- csxid: string,
- title: string,
- authors: string,
- misc: string
-}
-
-create dataset DBLP(DBLPType) partitioned by key id;
-
-create dataset CSX(CSXType) partitioned by key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-create index keyword_index on DBLP(title) type keyword;
-
-write output to nc1:"rttest/index-join_inverted-index-word-jaccard.adm";
-
-for $a in dataset('DBLP')
-for $b in dataset('CSX')
-where similarity-jaccard(word-tokens($a.title), word-tokens($b.title)) >= 0.5f
- and $a.id < $b.id
-order by $a.id, $b.id
-return { "arec": $a.title, "brec": $b.title }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point.aql
new file mode 100644
index 0000000..ab79189
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point.aql
@@ -0,0 +1,43 @@
+/*
+ * Description : Joins two datasets on the intersection of their point attributes.
+ * The dataset 'MyData1' has an RTree index, and we expect the
+ * join to be transformed into an indexed nested-loop join.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type MyRecord as closed {
+ id: int32,
+ point: point,
+ kwds: string,
+ line1: line,
+ line2: line,
+ poly1: polygon,
+ poly2: polygon,
+ rec: rectangle,
+ circle: circle
+}
+
+create dataset MyData1(MyRecord) partitioned by key id;
+create dataset MyData2(MyRecord) partitioned by key id;
+
+load dataset MyData1
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/spatial/spatialData.json"),("format"="adm")) pre-sorted;
+
+load dataset MyData2
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/spatial/spatialData.json"),("format"="adm")) pre-sorted;
+
+create index rtree_index on MyData1(point) type rtree;
+
+write output to nc1:"rttest/index-join_rtree-spatial-intersect-point.adm";
+
+for $a in dataset('MyData1')
+for $b in dataset('MyData2')
+where spatial-intersect($a.point, $b.point) and $a.id != $b.id
+order by $a.id, $b.id
+return {"aid": $a.id, "bid": $b.id, "apt": $a.point, "bp": $b.point}
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key.aql
new file mode 100644
index 0000000..dadb884
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key.aql
@@ -0,0 +1,35 @@
+/*
+ * Description : Test that BTree index is used in query plan
+ * : define the BTree index on a composite key (fname,lanme)
+ * : predicate => where $l.fname="Julio" and $l.lname="Isa"
+ * Expected Result : Success
+ * Issue : Issue 162
+ * Date : 7th August 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type Emp as closed {
+id:int32,
+fname:string,
+lname:string,
+age:int32,
+dept:string
+}
+
+create dataset employee(Emp) partitioned by key id;
+
+load dataset employee
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/names.adm"),("format"="delimited-text"),("delimiter"="|"));
+
+create index idx_employee_f_l_name on employee(fname,lname);
+
+write output to nc1:"rttest/index-selection_btree-index-composite-key.adm";
+
+for $l in dataset('employee')
+where $l.fname="Julio" and $l.lname="Isa"
+return $l
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple.aql
new file mode 100644
index 0000000..7b72a80
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple.aql
@@ -0,0 +1,48 @@
+/*
+ * Description : Test that multiple subtrees in the same query
+ * can be rewritten with secondary BTree indexes.
+ * Guards against regression to issue 204.
+ * Expected Result : Success
+ * Issue : Issue 204
+ */
+
+drop dataverse tpch if exists;
+create dataverse tpch;
+use dataverse tpch;
+
+create type OrderType as open {
+ o_orderkey: int32,
+ o_custkey: int32,
+ o_orderstatus: string,
+ o_totalprice: double,
+ o_orderdate: string,
+ o_orderpriority: string,
+ o_clerk: string,
+ o_shippriority: int32,
+ o_comment: string
+}
+
+create dataset Orders(OrderType) partitioned by key o_orderkey;
+
+load dataset Orders
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
+
+create index idx_Orders_Custkey on Orders(o_custkey);
+
+write output to nc1:"rttest/index-selection_btree-index-rewrite-multiple.adm";
+
+for $o in dataset('Orders')
+for $o2 in dataset('Orders')
+where $o.o_custkey = 20 and $o2.o_custkey = 10
+and $o.o_orderstatus < $o2.o_orderstatus
+order by $o.o_orderkey, $o2.o_orderkey
+return {
+ "o_orderkey": $o.o_orderkey,
+ "o_custkey": $o.o_custkey,
+ "o_orderstatus": $o.o_orderstatus,
+ "o_orderkey2": $o2.o_orderkey,
+ "o_custkey2": $o2.o_custkey,
+ "o_orderstatus2": $o2.o_orderstatus
+}
+
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index.aql
index 7ff775c..c1e1890 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index.aql
@@ -10,7 +10,8 @@
line2: line,
poly1: polygon,
poly2: polygon,
- rec: rectangle
+ rec: rectangle,
+ circle: circle
}
create dataset MyData(MyRecord)
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline.aql
new file mode 100644
index 0000000..0ea267c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline.aql
@@ -0,0 +1,49 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the edit-distance function of their names.
+ * Customers has a 3-gram index on name, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as open {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+load dataset Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+load dataset Customers2
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+create index ngram_index on Customers(name) type ngram(3);
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-edit-distance-inline.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+let $ed := edit-distance($a.name, $b.name)
+where $ed <= 4 and $a.cid < $b.cid
+order by $ed, $a.cid, $b.cid
+return { "a": $a.name, "b": $b.name, "ed": $ed }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance.aql
new file mode 100644
index 0000000..f7e3a8b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance.aql
@@ -0,0 +1,47 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the edit-distance function of their names.
+ * Customers has a 3-gram index on name, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as open {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+load dataset Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+load dataset Customers2
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+create index ngram_index on Customers(name) type ngram(3);
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-edit-distance.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+where edit-distance($a.name, $b.name) <= 4 and $a.cid < $b.cid
+order by $a.cid, $b.cid
+return { "a": $a.name, "b": $b.name }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline.aql
new file mode 100644
index 0000000..734a269
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline.aql
@@ -0,0 +1,50 @@
+/*
+ * Description : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' 3-gram tokens.
+ * DBLP has a 3-gram index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create type CSXType as closed {
+ id: int32,
+ csxid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create dataset CSX(CSXType) partitioned by key id;
+
+load dataset DBLP
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+
+load dataset CSX
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
+
+create index ngram_index on DBLP(title) type ngram(3);
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-jaccard-inline.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+let $jacc := similarity-jaccard(gram-tokens($a.title, 3, false), gram-tokens($b.title, 3, false))
+where $jacc >= 0.5f and $a.id < $b.id
+order by $jacc, $a.id, $b.id
+return { "a": $a.title, "b": $b.title, "jacc": $jacc }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard.aql
new file mode 100644
index 0000000..2e1a635
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard.aql
@@ -0,0 +1,49 @@
+/*
+ * Description : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' 3-gram tokens.
+ * DBLP has a 3-gram index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create type CSXType as closed {
+ id: int32,
+ csxid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create dataset CSX(CSXType) partitioned by key id;
+
+load dataset DBLP
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+
+load dataset CSX
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
+
+create index ngram_index on DBLP(title) type ngram(3);
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-jaccard.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+where similarity-jaccard(gram-tokens($a.title, 3, false), gram-tokens($b.title, 3, false)) >= 0.5f
+ and $a.id < $b.id
+order by $a.id, $b.id
+return { "a": $a.title, "b": $b.title }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline.aql
new file mode 100644
index 0000000..3b46c7d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline.aql
@@ -0,0 +1,49 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the edit-distance function of their interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as open {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+load dataset Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+load dataset Customers2
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-edit-distance-inline.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+let $ed := edit-distance($a.interests, $b.interests)
+where len($a.interests) > 2 and len($b.interests) > 2 and $ed <= 1 and $a.cid < $b.cid
+order by $ed, $a.cid, $b.cid
+return { "a": $a.interests, "b": $b.interests, "ed": $ed }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance.aql
new file mode 100644
index 0000000..3f025ed
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance.aql
@@ -0,0 +1,47 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the edit-distance function of their interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as open {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+load dataset Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+load dataset Customers2
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-edit-distance.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+where len($a.interests) > 2 and len($b.interests) > 2 and edit-distance($a.interests, $b.interests) <= 1 and $a.cid < $b.cid
+order by $a.cid, $b.cid
+return { "a": $a.interests, "b": $b.interests }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline.aql
new file mode 100644
index 0000000..ea28721
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline.aql
@@ -0,0 +1,49 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the Jaccard similarity of their interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+load dataset Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+load dataset Customers2
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-jaccard-inline.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+let $jacc := /*+ indexnl */similarity-jaccard($a.interests, $b.interests)
+where $jacc >= 0.9f and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
+order by $jacc, $a.cid, $b.cid
+return { "a": $a.interests, "b": $b.interests, "jacc": $jacc }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard.aql
new file mode 100644
index 0000000..458d31c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard.aql
@@ -0,0 +1,48 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the Jaccard similarity of their interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+load dataset Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+load dataset Customers2
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-jaccard.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+where /*+ indexnl */ similarity-jaccard($a.interests, $b.interests) >= 0.9f
+ and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
+order by $a.cid, $b.cid
+return { "a": $a.interests, "b": $b.interests }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline.aql
new file mode 100644
index 0000000..e11b2f0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline.aql
@@ -0,0 +1,49 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the Jaccard similarity of their interest sets.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: {{string}},
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+load dataset Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
+
+load dataset Customers2
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_ulist-jaccard-inline.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+let $jacc := /*+ indexnl */ similarity-jaccard($a.interests, $b.interests)
+where $jacc >= 0.9f and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
+order by $jacc, $a.cid, $b.cid
+return { "a": $a.interests, "b": $b.interests, "jacc": $jacc }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard.aql
new file mode 100644
index 0000000..9732a51
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard.aql
@@ -0,0 +1,48 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the Jaccard similarity of their interest sets.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: {{string}},
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+load dataset Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
+
+load dataset Customers2
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_ulist-jaccard.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+where /*+ indexnl */ similarity-jaccard($a.interests, $b.interests) >= 0.9f
+ and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
+order by $a.cid, $b.cid
+return { "a": $a.interests, "b": $b.interests }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline.aql
new file mode 100644
index 0000000..1985878
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline.aql
@@ -0,0 +1,50 @@
+/*
+ * Description : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
+ * DBLP has a keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create type CSXType as closed {
+ id: int32,
+ csxid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create dataset CSX(CSXType) partitioned by key id;
+
+load dataset DBLP
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+
+load dataset CSX
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
+
+create index keyword_index on DBLP(title) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_word-jaccard-inline.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+let $jacc := similarity-jaccard(word-tokens($a.title), word-tokens($b.title))
+where $jacc >= 0.5f and $a.id < $b.id
+order by $jacc, $a.id, $b.id
+return { "a": $a.title, "b": $b.title, "jacc": $jacc }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard.aql
new file mode 100644
index 0000000..013b51e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard.aql
@@ -0,0 +1,49 @@
+/*
+ * Description : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
+ * DBLP has a keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create type CSXType as closed {
+ id: int32,
+ csxid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create dataset CSX(CSXType) partitioned by key id;
+
+load dataset DBLP
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+
+load dataset CSX
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
+
+create index keyword_index on DBLP(title) type keyword;
+
+write output to nc1:"rttest/inverted-index-join-noeqjoin_word-jaccard.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+where similarity-jaccard(word-tokens($a.title), word-tokens($b.title)) >= 0.5f
+ and $a.id < $b.id
+order by $a.id, $b.id
+return { "a": $a.title, "b": $b.title }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline.aql
new file mode 100644
index 0000000..a602ca1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline.aql
@@ -0,0 +1,48 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the edit-distance function of their names.
+ * Customers has a 3-gram index on name, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as open {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+load dataset Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+load dataset Customers2
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+create index ngram_index on Customers(name) type ngram(3);
+
+write output to nc1:"rttest/inverted-index-join_ngram-edit-distance-inline.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+let $ed := edit-distance($a.name, $b.name)
+where $ed <= 4 and $a.cid < $b.cid
+order by $ed, $a.cid, $b.cid
+return { "arec": $a, "brec": $b, "ed": $ed }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance.aql
new file mode 100644
index 0000000..1c88536
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance.aql
@@ -0,0 +1,46 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the edit-distance function of their names.
+ * Customers has a 3-gram index on name, and we expect the join to be transformed into an indexed nested-loop join.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as open {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+load dataset Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+load dataset Customers2
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+create index ngram_index on Customers(name) type ngram(3);
+
+write output to nc1:"rttest/inverted-index-join_ngram-edit-distance.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+where edit-distance($a.name, $b.name) <= 4 and $a.cid < $b.cid
+order by $a.cid, $b.cid
+return { "arec": $a, "brec": $b }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline.aql
new file mode 100644
index 0000000..cd88072
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline.aql
@@ -0,0 +1,49 @@
+/*
+ * Description : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' 3-gram tokens.
+ * DBLP has a 3-gram index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create type CSXType as closed {
+ id: int32,
+ csxid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create dataset CSX(CSXType) partitioned by key id;
+
+load dataset DBLP
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+
+load dataset CSX
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
+
+create index ngram_index on DBLP(title) type ngram(3);
+
+write output to nc1:"rttest/inverted-index-join_ngram-jaccard-inline.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+let $jacc := similarity-jaccard(gram-tokens($a.title, 3, false), gram-tokens($b.title, 3, false))
+where $jacc >= 0.5f and $a.id < $b.id
+order by $jacc, $a.id, $b.id
+return { "arec": $a, "brec": $b, "jacc": $jacc }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard.aql
new file mode 100644
index 0000000..abb5e33
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard.aql
@@ -0,0 +1,48 @@
+/*
+ * Description : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' 3-gram tokens.
+ * DBLP has a 3-gram index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create type CSXType as closed {
+ id: int32,
+ csxid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create dataset CSX(CSXType) partitioned by key id;
+
+load dataset DBLP
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+
+load dataset CSX
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
+
+create index ngram_index on DBLP(title) type ngram(3);
+
+write output to nc1:"rttest/inverted-index-join_ngram-jaccard.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+where similarity-jaccard(gram-tokens($a.title, 3, false), gram-tokens($b.title, 3, false)) >= 0.5f
+ and $a.id < $b.id
+order by $a.id, $b.id
+return { "arec": $a, "brec": $b }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline.aql
new file mode 100644
index 0000000..bdac6f1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline.aql
@@ -0,0 +1,48 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the edit-distance function of their interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as open {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+load dataset Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+load dataset Customers2
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join_olist-edit-distance-inline.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+let $ed := edit-distance($a.interests, $b.interests)
+where len($a.interests) > 2 and len($b.interests) > 2 and $ed <= 1 and $a.cid < $b.cid
+order by $ed, $a.cid, $b.cid
+return { "arec": $a, "brec": $b, "ed": $ed }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance.aql
new file mode 100644
index 0000000..5e679e4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance.aql
@@ -0,0 +1,46 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the edit-distance function of their interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as open {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+load dataset Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+load dataset Customers2
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join_olist-edit-distance.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+where len($a.interests) > 2 and len($b.interests) > 2 and edit-distance($a.interests, $b.interests) <= 1 and $a.cid < $b.cid
+order by $a.cid, $b.cid
+return { "arec": $a, "brec": $b }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline.aql
new file mode 100644
index 0000000..8fd8632
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline.aql
@@ -0,0 +1,48 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the Jaccard similarity of their interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+load dataset Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+load dataset Customers2
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join_olist-jaccard-inline.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+let $jacc := /*+ indexnl */similarity-jaccard($a.interests, $b.interests)
+where $jacc >= 0.9f and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
+order by $jacc, $a.cid, $b.cid
+return { "a": $a, "b": $b, "jacc": $jacc }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard.aql
new file mode 100644
index 0000000..50d13f1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard.aql
@@ -0,0 +1,47 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the Jaccard similarity of their interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: [string],
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+load dataset Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+load dataset Customers2
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join_olist-jaccard.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+where /*+ indexnl */ similarity-jaccard($a.interests, $b.interests) >= 0.9f
+ and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
+order by $a.cid, $b.cid
+return { "a": $a, "b": $b }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline.aql
new file mode 100644
index 0000000..a62c66d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline.aql
@@ -0,0 +1,48 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the Jaccard similarity of their interest sets.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: {{string}},
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+load dataset Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
+
+load dataset Customers2
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join_ulist-jaccard-inline.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+let $jacc := /*+ indexnl */ similarity-jaccard($a.interests, $b.interests)
+where $jacc >= 0.9f and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
+order by $jacc, $a.cid, $b.cid
+return { "a": $a, "b": $b, "jacc": $jacc }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard.aql
new file mode 100644
index 0000000..8c6570f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard.aql
@@ -0,0 +1,47 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the Jaccard similarity of their interest sets.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: {{string}},
+ children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+create dataset Customers2(CustomerType) partitioned by key cid;
+
+load dataset Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
+
+load dataset Customers2
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
+
+create index interests_index on Customers(interests) type keyword;
+
+write output to nc1:"rttest/inverted-index-join_ulist-jaccard.adm";
+
+for $a in dataset('Customers')
+for $b in dataset('Customers2')
+where /*+ indexnl */ similarity-jaccard($a.interests, $b.interests) >= 0.9f
+ and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
+order by $a.cid, $b.cid
+return { "a": $a, "b": $b }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline.aql
new file mode 100644
index 0000000..3ac3583
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline.aql
@@ -0,0 +1,49 @@
+/*
+ * Description : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
+ * DBLP has a keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create type CSXType as closed {
+ id: int32,
+ csxid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create dataset CSX(CSXType) partitioned by key id;
+
+load dataset DBLP
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+
+load dataset CSX
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
+
+create index keyword_index on DBLP(title) type keyword;
+
+write output to nc1:"rttest/inverted-index-join_word-jaccard-inline.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+let $jacc := similarity-jaccard(word-tokens($a.title), word-tokens($b.title))
+where $jacc >= 0.5f and $a.id < $b.id
+order by $jacc, $a.id, $b.id
+return { "arec": $a, "brec": $b, "jacc": $jacc }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard.aql
new file mode 100644
index 0000000..7060fe6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard.aql
@@ -0,0 +1,48 @@
+/*
+ * Description : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
+ * DBLP has a keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create type CSXType as closed {
+ id: int32,
+ csxid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLP(DBLPType) partitioned by key id;
+
+create dataset CSX(CSXType) partitioned by key id;
+
+load dataset DBLP
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+
+load dataset CSX
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
+
+create index keyword_index on DBLP(title) type keyword;
+
+write output to nc1:"rttest/inverted-index-join_word-jaccard.adm";
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+where similarity-jaccard(word-tokens($a.title), word-tokens($b.title)) >= 0.5f
+ and $a.id < $b.id
+order by $a.id, $b.id
+return { "arec": $a, "brec": $b }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/is-null_01.aql b/asterix-app/src/test/resources/runtimets/queries/is-null_01.aql
deleted file mode 100644
index ca6ac7a..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/is-null_01.aql
+++ /dev/null
@@ -1,8 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-
-use dataverse test;
-
-write output to nc1:"rttest/is-null_01.adm";
-
-[is-null(null), is-null(10)]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/list/listify_01.aql b/asterix-app/src/test/resources/runtimets/queries/list/listify_01.aql
index fe89111..3f08bcb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/list/listify_01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/list/listify_01.aql
@@ -7,8 +7,3 @@
let $token_list :=
for $token in [1, 2, 3] return $token
return $token_list
-
-
-
-
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/list/listify_02.aql b/asterix-app/src/test/resources/runtimets/queries/list/listify_02.aql
index 4fe1e0d..1dae103 100644
--- a/asterix-app/src/test/resources/runtimets/queries/list/listify_02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/list/listify_02.aql
@@ -7,8 +7,3 @@
let $token_list :=
for $token in ["foo", "bar"] return $token
return $token_list
-
-
-
-
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/list/listify_03.aql b/asterix-app/src/test/resources/runtimets/queries/list/listify_03.aql
new file mode 100644
index 0000000..e034069
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/list/listify_03.aql
@@ -0,0 +1,16 @@
+/*
+ * Description : Test that a listify on a nullable type creates a homogeneous list of type ANY.
+ * Guards against regression to issue 186.
+ * Expected Result : Success
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/list_listify_03.adm";
+
+// The for prohibits the subplan from being eliminated.
+for $x in [1, 2]
+let $y := (for $i in [[1,2,3],[10,20,30],[-2,-5,0]] return min($i))
+return min($y)
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/list/ordered-list-constructor_03.aql b/asterix-app/src/test/resources/runtimets/queries/list/ordered-list-constructor_03.aql
new file mode 100644
index 0000000..81eaf8b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/list/ordered-list-constructor_03.aql
@@ -0,0 +1,7 @@
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/list_ordered-list-constructor_03.adm";
+
+[ null, null, null ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/list/unordered-list-constructor_03.aql b/asterix-app/src/test/resources/runtimets/queries/list/unordered-list-constructor_03.aql
new file mode 100644
index 0000000..e8b119e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/list/unordered-list-constructor_03.aql
@@ -0,0 +1,7 @@
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/list_unordered-list-constructor_03.adm";
+
+{{ null, null, null }}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/load/issue14_query.aql b/asterix-app/src/test/resources/runtimets/queries/load/issue14_query.aql
new file mode 100644
index 0000000..9b25210
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/load/issue14_query.aql
@@ -0,0 +1,26 @@
+/*
+ * Description : Create and load a dataset but with an unspecified data format.
+ * Expected Res : Failure
+ * Date : 16 Jan 2012
+ */
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type Schema as closed{
+id: int32,
+age: int32,
+name: string
+}
+
+create dataset onektup(Schema)
+partitioned by key id;
+
+load dataset onektup
+using "localfs"(("path"="nc1:///tmp/one.adm"));
+
+write output to nc1:"/tmp/foo.adm";
+
+for $l in dataset('onektup')
+return $l
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/misc/float_01.aql b/asterix-app/src/test/resources/runtimets/queries/misc/float_01.aql
new file mode 100644
index 0000000..ec0e8e5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/misc/float_01.aql
@@ -0,0 +1,8 @@
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/misc_float_01.adm";
+
+for $f in [1f, 1F, 1.1f, 1.1F, .1f, .1F]
+return $f
diff --git a/asterix-app/src/test/resources/runtimets/queries/misc/groupby-orderby-count.aql b/asterix-app/src/test/resources/runtimets/queries/misc/groupby-orderby-count.aql
new file mode 100644
index 0000000..e5887ae
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/misc/groupby-orderby-count.aql
@@ -0,0 +1,23 @@
+drop dataverse twitter if exists;
+create dataverse twitter;
+use dataverse twitter;
+create type Tweet as open {
+ id: int32,
+ tweetid: int64,
+ loc: point,
+ time: datetime,
+ text: string
+}
+
+create external dataset TwitterData(Tweet)
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/twitter/extrasmalltweets.txt"),("format"="adm"));
+
+write output to nc1:"rttest/misc_groupby-orderby-count.adm";
+
+for $t in dataset('TwitterData')
+let $tokens := word-tokens($t.text)
+for $token in $tokens
+group by $tok := $token with $token
+order by count($token) desc, $tok asc
+return { "word": $tok, "count": count($token) }
diff --git a/asterix-app/src/test/resources/runtimets/queries/misc/ifthenelse_01.aql b/asterix-app/src/test/resources/runtimets/queries/misc/ifthenelse_01.aql
new file mode 100644
index 0000000..a65e675
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/misc/ifthenelse_01.aql
@@ -0,0 +1,8 @@
+use dataverse test;
+
+write output to nc1:"rttest/misc_ifthenelse_01.adm";
+
+if (2>1) then
+ 20
+else
+ 10
diff --git a/asterix-app/src/test/resources/runtimets/queries/misc/is-null_01.aql b/asterix-app/src/test/resources/runtimets/queries/misc/is-null_01.aql
new file mode 100644
index 0000000..9005392
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/misc/is-null_01.aql
@@ -0,0 +1,8 @@
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+write output to nc1:"rttest/misc_is-null_01.adm";
+
+[is-null(null), is-null(10)]
diff --git a/asterix-app/src/test/resources/runtimets/queries/misc/nested-loop-join_01.aql b/asterix-app/src/test/resources/runtimets/queries/misc/nested-loop-join_01.aql
new file mode 100644
index 0000000..f148d2e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/misc/nested-loop-join_01.aql
@@ -0,0 +1,37 @@
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type UserType as open {
+ uid: int32,
+ name: string,
+ lottery_numbers: [int32],
+ interests: {{string}}
+}
+
+create type VisitorType as open {
+ vid: int32,
+ name: string,
+ lottery_numbers: [int32],
+ interests: {{string}}
+}
+
+create dataset Users(UserType) partitioned by key uid;
+create dataset Visitors(VisitorType) partitioned by key vid;
+
+
+load dataset Users
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
+
+load dataset Visitors
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
+
+write output to nc1:'rttest/misc_nested-loop-join_01.adm';
+
+for $user in dataset('Users')
+for $visitor in dataset('Visitors')
+where len($user.lottery_numbers) = len($visitor.lottery_numbers)
+order by $user.uid, $visitor.vid
+return {'user': $user, 'visitor': $visitor, 'user-lottery_numbers-len': len($user.lottery_numbers), 'visitor-lottery_numbers-len': len($visitor.lottery_numbers)}
diff --git a/asterix-app/src/test/resources/runtimets/queries/misc/range_01.aql b/asterix-app/src/test/resources/runtimets/queries/misc/range_01.aql
new file mode 100644
index 0000000..9c5991d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/misc/range_01.aql
@@ -0,0 +1,8 @@
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/misc_range_01.adm";
+
+for $x in range(20,30)
+return $x
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/misc/tid_01.aql b/asterix-app/src/test/resources/runtimets/queries/misc/tid_01.aql
new file mode 100644
index 0000000..ff216ea
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/misc/tid_01.aql
@@ -0,0 +1,7 @@
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/misc_tid_01.adm";
+
+for $x at $i in ["a","b","c"]
+return $i
diff --git a/asterix-app/src/test/resources/runtimets/queries/misc/year_01.aql b/asterix-app/src/test/resources/runtimets/queries/misc/year_01.aql
new file mode 100644
index 0000000..f431a52
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/misc/year_01.aql
@@ -0,0 +1,6 @@
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/misc_year_01.adm";
+
+year("1996-12-01")
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-loop-join_01.aql b/asterix-app/src/test/resources/runtimets/queries/nested-loop-join_01.aql
deleted file mode 100644
index 79b3a9f..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/nested-loop-join_01.aql
+++ /dev/null
@@ -1,37 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-create type UserType as open {
- uid: int32,
- name: string,
- lottery_numbers: [int32],
- interests: {{string}}
-}
-
-create type VisitorType as open {
- vid: int32,
- name: string,
- lottery_numbers: [int32],
- interests: {{string}}
-}
-
-create dataset Users(UserType) partitioned by key uid;
-create dataset Visitors(VisitorType) partitioned by key vid;
-
-
-load dataset Users
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/nested-loop-join_01.adm';
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-where len($user.lottery_numbers) = len($visitor.lottery_numbers)
-order by $user.uid, $visitor.vid
-return {'user': $user, 'visitor': $visitor, 'user-lottery_numbers-len': len($user.lottery_numbers), 'visitor-lottery_numbers-len': len($visitor.lottery_numbers)}
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue134.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue134.aql
new file mode 100644
index 0000000..62a9ed8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue134.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : This test case is to verify the fix for issue134
+ : https://code.google.com/p/asterixdb/issues/detail?id=134
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+write output to nc1:"rttest/open-closed_query-issue134.adm";
+
+let $a:=true
+return {{[1,2,3,4,5],[6,5,3,8,9],[44,22,66,-1,0,99.9]}}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue166.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue166.aql
new file mode 100644
index 0000000..aa0d13b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue166.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : This test case is to verify the fix for issue166
+ : https://code.google.com/p/asterixdb/issues/detail?id=166
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+write output to nc1:"rttest/open-closed_query-issue166.adm";
+
+let $a := [[1,2,3],[4,5,6,7]]
+return $a[1]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue208.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue208.aql
new file mode 100644
index 0000000..e46286c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue208.aql
@@ -0,0 +1,45 @@
+/*
+ * Description : This test case is to verify the fix for issue208
+ : https://code.google.com/p/asterixdb/issues/detail?id=208
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+drop dataverse OpenSocialNetworkData if exists;
+create dataverse OpenSocialNetworkData;
+
+use dataverse OpenSocialNetworkData;
+
+create type TwitterUserType as open {
+screen-name: string,
+lang: string,
+friends_count: int32,
+statuses_count: int32,
+name: string,
+followers_count: int32
+}
+
+create type TweetMessageType as open {
+tweetid: string,
+tweetid-copy: string,
+send-time-copy: datetime
+}
+
+create dataset TweetMessages(TweetMessageType)
+partitioned by key tweetid;
+
+load dataset TweetMessages
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/twitter/tw_messages.adm"),("format"="adm"));
+
+write output to nc1:"rttest/open-closed_query-issue208.adm";
+for $t in dataset('TweetMessages')
+where $t.send-time >= datetime('2005-04-13T17:17:22') and
+$t.send-time <= datetime('2011-04-13T17:18:22')
+group by $uid := $t.user.screen-name with $t
+order by $uid
+return {
+ "user": $uid,
+ "count": count($t)
+}
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue29.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue29.aql
new file mode 100644
index 0000000..8b778ba
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue29.aql
@@ -0,0 +1,70 @@
+/*
+ * Description : This test case is to verify the fix for issue29
+ : https://code.google.com/p/asterixdb/issues/detail?id=29
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+write output to nc1:"rttest/open-closed_query-issue29.adm";
+
+let $tweets :=
+{{
+ {
+ "tweetid": "1023",
+ "user": {
+ "screen-name": "dflynn24",
+ "lang": "en",
+ "friends_count": 46,
+ "statuses_count": 987,
+ "name": "danielle flynn",
+ "followers_count": 47
+ },
+ "sender-location": "40.904177,-72.958996",
+ "send-time": "2010-02-21T11:56:02-05:00",
+ "referred-topics": {{ "verizon" }},
+ "message-text": "i need a #verizon phone like nowwwww! :("
+ },
+ {
+ "tweetid": "1024",
+ "user": {
+ "screen-name": "miriamorous",
+ "lang": "en",
+ "friends_count": 69,
+ "statuses_count": 1068,
+ "name": "Miriam Songco",
+ "followers_count": 78
+ },
+ "send-time": "2010-02-21T11:11:43-08:00",
+ "referred-topics": {{ "commercials", "verizon", "att" }},
+ "message-text": "#verizon & #att #commercials, so competitive"
+ },
+ {
+ "tweetid": "1025",
+ "user": {
+ "screen-name": "dj33",
+ "lang": "en",
+ "friends_count": 96,
+ "statuses_count": 1696,
+ "name": "Don Jango",
+ "followers_count": 22
+ },
+ "send-time": "2010-02-21T12:38:44-05:00",
+ "referred-topics": {{ "charlotte" }},
+ "message-text": "Chillin at dca waiting for 900am flight to #charlotte and from there to providenciales"
+ },
+ {
+ "tweetid": "1026",
+ "user": {
+ "screen-name": "reallyleila",
+ "lang": "en",
+ "friends_count": 106,
+ "statuses_count": 107,
+ "name": "Leila Samii",
+ "followers_count": 52
+ },
+ "send-time": "2010-02-21T21:31:57-06:00",
+ "referred-topics": {{ "verizon", "at&t", "iphone" }},
+ "message-text": "I think a switch from #verizon to #at&t may be in my near future... my smartphone is like a land line compared to the #iphone!"
+ }
+}}
+return $tweets
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue55-1.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue55-1.aql
new file mode 100644
index 0000000..11b75d1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue55-1.aql
@@ -0,0 +1,13 @@
+/*
+ * Description : This test case is to verify the fix for issue55 query 1
+ : https://code.google.com/p/asterixdb/issues/detail?id=55
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+write output to nc1:"rttest/open-closed_query-issue55-1.adm";
+
+let $l := [1.1f, 1.0f, 1.2f, 0.9, 1.3, 1, 2]
+for $i in $l
+for $j in $l
+return [$i, $j, "=", $i = $j, "<", $i < $j, "<=", $i <= $j, ">", $i > $j, ">=", $i >= $j]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue55.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue55.aql
new file mode 100644
index 0000000..b4e4572
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue55.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : This test case is to verify the fix for issue55 query 2
+ : https://code.google.com/p/asterixdb/issues/detail?id=55
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+write output to nc1:"rttest/open-closed_query-issue55.adm";
+
+for $x in [[1,3],[4,5,2],[-1,-3,0],["a"]]
+return $x
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-proposal.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-proposal.aql
new file mode 100644
index 0000000..a8d00f8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-proposal.aql
@@ -0,0 +1,107 @@
+/*
+ * Description : Insert open data into internal dataset and query the open data
+ * Expected Result : Success
+ * Date : 23rd October 2012
+ * Notes : This test was written to cover the scenario which is used in the proposal.
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type TweetMessageType as open {
+tweetid : string,
+user : {
+ screen-name: string,
+ lang: string,
+ friends_count: int32,
+ statuses_count: int32,
+ name: string,
+ followers_count: int32
+}, sender-location: point?,
+ send-time: datetime,
+ referred-topics: {{ string }},
+ message-text: string
+};
+
+create dataset TweetMessages(TweetMessageType)
+partitioned by key tweetid;
+
+insert into dataset TweetMessages(
+ {
+ "tweetid": "1023",
+ "user": {
+ "screen-name": "dflynn24",
+ "lang": "en",
+ "friends_count": 46,
+ "statuses_count": 987,
+ "name": "danielle flynn",
+ "followers_count": 47
+ },
+ "sender-location": create-point(40.904177,-72.958996),
+ "send-time": datetime("2010-02-21T11:56:02-05:00"),
+ "referred-topics": {{ "verizon" }},
+ "message-text": "i need a #verizon phone like nowwwww! : ("
+ });
+
+insert into dataset TweetMessages(
+ {
+ "tweetid": "1024",
+ "user": {
+ "screen-name": "miriamorous",
+ "lang": "en",
+ "friends_count": 69,
+ "statuses_count": 1068,
+ "name": "Miriam Songco",
+ "followers_count": 78
+ },
+ "send-time": datetime("2010-02-21T11:11:43-08:00"),
+ "referred-topics": {{ "commercials", "verizon", "att" }},
+ "message-text": "#verizon & #att #commercials, so competitive"
+ });
+
+insert into dataset TweetMessages(
+ {
+ "tweetid": "1025",
+ "user": {
+ "screen-name": "dj33",
+ "lang": "en",
+ "friends_count": 96,
+ "send-time": "2010-02-21T11:56:02-05:00",
+ "statuses_count": 1696,
+ "name": "Don Jango",
+ "followers_count": 22
+ },
+ "send-time": datetime("2010-02-21T12:38:44-05:00"),
+ "referred-topics": {{ "charlotte" }},
+ "message-text": "Chillin at dca waiting for 900am flight to #charlotte and from there to providenciales"
+ });
+
+insert into dataset TweetMessages(
+ { "tweetid": "1026",
+ "user": {
+ "screen-name": "reallyleila",
+ "lang": "en",
+ "friends_count": 106,
+ "statuses_count": 107,
+ "name": "Leila Samii",
+ "followers_count": 52
+ },
+ "send-time": datetime("2010-02-21T21:31:57-06:00"),
+ "referred-topics": {{ "verizon", "at&t", "iphone" }},
+ "message-text": "I think a switch from #verizon to #at&t may be in my near future... my smartphone is like a land line compared to the #iphone!"
+});
+
+write output to nc1:"rttest/open-closed_query-proposal.adm";
+
+for $tp1 in (
+ for $tweet in dataset('TweetMessages')
+ where some $topic in $tweet.referred-topics satisfies contains($topic, 'verizon')
+ for $tp in $tweet.referred-topics
+ return
+ { "topic": $tp }
+)
+group by $tp2 := $tp1.topic with $tp1
+order by $tp2
+return { "topic": $tp2, "count": count($tp1) }
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-proposal02.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-proposal02.aql
new file mode 100644
index 0000000..36feac4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-proposal02.aql
@@ -0,0 +1,110 @@
+/*
+ * Description : Insert open data into internal dataset and query the open data
+ * Expected Result : Success
+ * Date : 23rd October 2012
+ * Notes : This test was written to cover the scenario which is used in the proposal.
+ * : this is another variant of the test in query-proposal.aql
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type TweetMessageType as open {
+tweetid : string,
+user : {
+ screen-name: string,
+ lang: string,
+ friends_count: int32,
+ statuses_count: int32,
+ name: string,
+ followers_count: int32
+}, sender-location: point?,
+ send-time: datetime,
+ referred-topics: {{ string }},
+ message-text: string
+};
+
+create dataset TweetMessages(TweetMessageType)
+partitioned by key tweetid;
+
+insert into dataset TweetMessages(
+ {
+ "tweetid": "1023",
+ "user": {
+ "screen-name": "dflynn24",
+ "lang": "en",
+ "friends_count": 46,
+ "statuses_count": 987,
+ "name": "danielle flynn",
+ "followers_count": 47
+ },
+ "sender-location": create-point(40.904177,-72.958996),
+ "send-time": datetime("2010-02-21T11:56:02-05:00"),
+ "referred-topics": {{ "verizon" }},
+ "message-text": "i need a #verizon phone like nowwwww! : ("
+ });
+
+insert into dataset TweetMessages(
+ {
+ "tweetid": "1024",
+ "user": {
+ "screen-name": "miriamorous",
+ "lang": "en",
+ "friends_count": 69,
+ "statuses_count": 1068,
+ "name": "Miriam Songco",
+ "followers_count": 78
+ },
+ "send-time": datetime("2010-02-21T11:11:43-08:00"),
+ "referred-topics": {{ "commercials", "verizon", "att" }},
+ "message-text": "#verizon & #att #commercials, so competitive"
+ });
+
+insert into dataset TweetMessages(
+ {
+ "tweetid": "1025",
+ "user": {
+ "screen-name": "dj33",
+ "lang": "en",
+ "friends_count": 96,
+ "send-time": "2010-02-21T11:56:02-05:00",
+ "statuses_count": 1696,
+ "name": "Don Jango",
+ "followers_count": 22
+ },
+ "send-time": datetime("2010-02-21T12:38:44-05:00"),
+ "referred-topics": {{ "charlotte" }},
+ "message-text": "Chillin at dca waiting for 900am flight to #charlotte and from there to providenciales"
+ });
+
+insert into dataset TweetMessages(
+ { "tweetid": "1026",
+ "user": {
+ "screen-name": "reallyleila",
+ "lang": "en",
+ "friends_count": 106,
+ "statuses_count": 107,
+ "name": "Leila Samii",
+ "followers_count": 52
+ },
+ "send-time": datetime("2010-02-21T21:31:57-06:00"),
+ "referred-topics": {{ "verizon", "at&t", "iphone" }},
+ "message-text": "I think a switch from #verizon to #at&t may be in my near future... my smartphone is like a land line compared to the #iphone!"
+});
+
+write output to nc1:"rttest/open-closed_query-proposal02.adm";
+
+for $tweet in dataset('TweetMessages')
+ where some $reftopic in $tweet.referred-topics
+ satisfies contains($reftopic, 'verizon')
+ for $reftopic in $tweet.referred-topics
+ group by $topic := $reftopic with $tweet
+ order by $topic
+ return
+ {
+ "topic": $topic,
+ "count": count($tweet)
+ }
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/quantifiers/everysat_02.aql b/asterix-app/src/test/resources/runtimets/queries/quantifiers/everysat_02.aql
index fad06ba..bd52181 100644
--- a/asterix-app/src/test/resources/runtimets/queries/quantifiers/everysat_02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/quantifiers/everysat_02.aql
@@ -5,10 +5,6 @@
* Date : 5th July 2012
*/
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
write output to nc1:"rttest/quantifiers_everysat_02.adm";
let $a := [
diff --git a/asterix-app/src/test/resources/runtimets/queries/quantifiers/everysat_03.aql b/asterix-app/src/test/resources/runtimets/queries/quantifiers/everysat_03.aql
index 7f9824e..99b4844 100644
--- a/asterix-app/src/test/resources/runtimets/queries/quantifiers/everysat_03.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/quantifiers/everysat_03.aql
@@ -5,24 +5,20 @@
* Date : 5th July 2012
*/
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
write output to nc1:"rttest/quantifiers_everysat_02.adm";
let $a := [
every $x in [1, 2] satisfies avg([$x, 1]) = 1,
-every $x in [1, 2] satisfies string($x) = "1",
-every $x in [1, 2] satisfies string-length(string($x)) = 1,
+every $x in ["1", "2"] satisfies string($x) = "1",
+every $x in ["1", "2"] satisfies string-length($x) = 1,
every $x in [[1, 2],[10],[1,5,7,8]] satisfies count($x) = 1,
every $x in [[2],[10],[8]] satisfies count($x) = 1,
-every $x in [1, 2] satisfies boolean("true"),
-every $x in [1, 2] satisfies not($x),
+every $x in [true, false] satisfies boolean("true"),
+every $x in [true,true] satisfies not($x),
every $x in [1,2,3], $y in [4,5,6] satisfies $x + $y = 5,
every $x in [1,2,3], $y in [4,5,6] satisfies $x - $y = 5,
every $x in [1,2,3], $y in [4,5,6] satisfies $x * $y = 10,
-every $x in [1,2,3], $y in [4,5,6] satisfies string($x) = string($y),
+every $x in ["ab","cd"], $y in ["ab","de"] satisfies string($x) = string($y),
every $x in [1,2,3], $y in [4,5,6] satisfies int32($x) = int32($y),
every $x in [1,2,3], $y in [4,5,6] satisfies float($x) = float($y),
every $x in [1,2,3], $y in [4,5,6] satisfies double($x) = double($y),
diff --git a/asterix-app/src/test/resources/runtimets/queries/quantifiers/everysat_04.aql b/asterix-app/src/test/resources/runtimets/queries/quantifiers/everysat_04.aql
new file mode 100644
index 0000000..b9eccfd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/quantifiers/everysat_04.aql
@@ -0,0 +1,23 @@
+/*
+ * Description : Tests that universal quantification returns true/false correctly.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/quantifiers_everysat_04.adm";
+
+let $x := [
+every $x in [false,false] satisfies $x,
+every $x in [true,false] satisfies $x,
+every $x in [false,true] satisfies $x,
+every $x in [true,true] satisfies $x,
+every $x in [false,false] satisfies not($x),
+every $x in [true,false] satisfies not($x),
+every $x in [false,true] satisfies not($x),
+every $x in [true,true] satisfies not($x)
+]
+for $i in $x
+return $i
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_03.aql b/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_03.aql
index 5995b9b..7178156 100644
--- a/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_03.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_03.aql
@@ -1,13 +1,9 @@
/*
- * Description : Test quantified expressions; some variable in [ordered list] satisfies expression.
+ * Description : Test quantified expressions; some variable in [ordered list] satisfies expression.
* Expected Result : Success
* Date : 6th July 2012
*/
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
write output to nc1:"rttest/quantifiers_somesat_03.adm";
let $a := [
@@ -20,7 +16,7 @@
some $x in [1, 2] satisfies avg([$x,1]) = 1,
some $x in [1, 2] satisfies boolean("true"),
some $x in [1, 2] satisfies boolean("false"),
-some $x in [1, 2] satisfies not($x),
+some $x in [true,false] satisfies not($x),
some $x in [1, 2] satisfies $x = 1 or $x = 2,
some $x in [1, 2] satisfies $x = 1 and ($x +1) = 2
]
diff --git a/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_04.aql b/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_04.aql
index 8d92cbb..b308aa2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_04.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_04.aql
@@ -6,16 +6,11 @@
* Date : 5th July 2012
*/
-
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
write output to nc1:"rttest/quantifiers_somesat_04.adm";
let $a := [
-some $x in ["foo","foobar","foot","fox"] satisfies string-length($x) = 1,
-some $x in [1,2,3,4,5,6,7,8] satisfies count($x) = 8,
+some $x in ["foo","foobar","foot","fox"] satisfies string-length($x) = 3,
+some $x in [[5,4,3,2],[1,2,3,4,5,6,7,8],[4,2,3,4]] satisfies count($x) = 8,
some $x in [1, 2] satisfies $x = 1 or $x = 2,
some $x in [1, 2] satisfies $x = 1 and ($x +1) = 2,
some $x in ["A","B","C"] satisfies $x = "A",
diff --git a/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_05.aql b/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_05.aql
index fefd86d..4d802c7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_05.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_05.aql
@@ -5,10 +5,6 @@
* Date : 5th July 2012
*/
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
write output to nc1:"rttest/quantifiers_somesat_05.adm";
let $a := [
diff --git a/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_06.aql b/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_06.aql
new file mode 100644
index 0000000..6e8892c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_06.aql
@@ -0,0 +1,23 @@
+/*
+ * Description : Tests that existential quantification returns true/false correctly.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/quantifiers_somesat_06.adm";
+
+let $x := [
+some $x in [false,false] satisfies $x,
+some $x in [true,false] satisfies $x,
+some $x in [false,true] satisfies $x,
+some $x in [true,true] satisfies $x,
+some $x in [false,false] satisfies not($x),
+some $x in [true,false] satisfies not($x),
+some $x in [false,true] satisfies not($x),
+some $x in [true,true] satisfies not($x)
+]
+for $i in $x
+return $i
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/range_01.aql b/asterix-app/src/test/resources/runtimets/queries/range_01.aql
deleted file mode 100644
index 0f38113..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/range_01.aql
+++ /dev/null
@@ -1,8 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/range_01.adm";
-
-for $x in range(20,30)
-return $x
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/field-access-on-open-field.aql b/asterix-app/src/test/resources/runtimets/queries/records/field-access-on-open-field.aql
new file mode 100644
index 0000000..2592c67
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/field-access-on-open-field.aql
@@ -0,0 +1,24 @@
+/*
+ * Description : Tests whether a field access on an open field (statically of type ANY) succeeds.
+ * Guards against regression to issue 207.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type TestType as open {
+ id : int32,
+ name : string
+}
+
+create dataset testds(TestType) partitioned by key id;
+
+insert into dataset testds({"id": 123, "name": "John Doe", "address": { "zip": 92617} });
+
+write output to nc1:"rttest/records_field-access-on-open-field.adm";
+
+for $l in dataset("testds")
+let $a := $l.address
+return $a.zip
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_1.aql b/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_1.aql
new file mode 100644
index 0000000..ff04a36
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_1.aql
@@ -0,0 +1,35 @@
+/*
+* Description : Create an dataset and load it from two file splits
+ Include whitespace between the elements in the comma-separated list of file paths.
+* Expected Res : Success
+* Issue : 238
+* Date : 7th Jan 2013
+*/
+
+/* scan and print an ADM file as a dataset of closed records */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLPadm(DBLPType)
+ partitioned by key id;
+
+// drop dataset DBLPadm;
+load dataset DBLPadm
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/part-00000.adm, nc1://data/dblp-small/part-00001.adm"),("format"="adm"));
+
+write output to nc1:"rttest/scan_issue238_query_1.adm";
+
+for $paper in dataset('DBLPadm')
+order by $paper.id
+return $paper
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_2.aql b/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_2.aql
new file mode 100644
index 0000000..297e2f2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_2.aql
@@ -0,0 +1,36 @@
+/*
+* Description : Create an dataset and load it from two file splits
+ Include newline between the elements in the comma-separated list of file paths.
+* Expected Res : Success
+* Issue : 238
+* Date : 7th Jan 2013
+*/
+
+/* scan and print an ADM file as a dataset of closed records */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+ id: int32,
+ dblpid: string,
+ title: string,
+ authors: string,
+ misc: string
+}
+
+create dataset DBLPadm(DBLPType)
+ partitioned by key id;
+
+// drop dataset DBLPadm;
+load dataset DBLPadm
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/part-00000.adm,
+ nc1://data/dblp-small/part-00001.adm"),("format"="adm"));
+
+write output to nc1:"rttest/scan_issue238_query_2.adm";
+
+for $paper in dataset('DBLPadm')
+order by $paper.id
+return $paper
diff --git a/asterix-app/src/test/resources/runtimets/queries/spatial/circle_accessor.aql b/asterix-app/src/test/resources/runtimets/queries/spatial/circle_accessor.aql
new file mode 100644
index 0000000..1d48ebd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/spatial/circle_accessor.aql
@@ -0,0 +1,14 @@
+/*
+ * Description : Test spatial accessors
+ * Expected Result : Success
+ * Date : Oct 17, 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/spatial_circle_accessor.adm";
+
+let $circle := create-circle(create-point(6.0,3.0), 1.0)
+return {"circle-radius": get-radius($circle), "circle-center": get-center($circle)}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/spatial/create-rtree-index.aql b/asterix-app/src/test/resources/runtimets/queries/spatial/create-rtree-index.aql
new file mode 100644
index 0000000..e755aa9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/spatial/create-rtree-index.aql
@@ -0,0 +1,34 @@
+/*
+ * Description : Create r-tree indexes for all spatial data types.
+ * Success : Yes
+ */
+
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type SpatialType as open {
+ id: int32,
+ point: point,
+ line1: line,
+ poly1: polygon,
+ rec: rectangle,
+ circle: circle
+}
+
+create dataset MyData(SpatialType) partitioned by key id;
+create index rtree_index1 on MyData(point) type rtree;
+create index rtree_index2 on MyData(line1) type rtree;
+create index rtree_index3 on MyData(poly1) type rtree;
+create index rtree_index5 on MyData(rec) type rtree;
+create index rtree_index4 on MyData(circle) type rtree;
+
+write output to nc1:"rttest/spatial_create-rtree-index.adm";
+
+load dataset MyData
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/spatial/spatialData.json"),("format"="adm"));
+
+for $a in dataset('MyData')
+return $a.id
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/spatial/line_accessor.aql b/asterix-app/src/test/resources/runtimets/queries/spatial/line_accessor.aql
new file mode 100644
index 0000000..2085436
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/spatial/line_accessor.aql
@@ -0,0 +1,16 @@
+/*
+ * Description : Test spatial accessors
+ * Expected Result : Success
+ * Date : Oct 17, 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/spatial_line_accessor.adm";
+
+let $line := create-line(create-point(100.6,999.4), create-point(-872.0,-876.9))
+let $line_list := get-points($line)
+for $p in $line_list
+return $p
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/spatial/point_accessor.aql b/asterix-app/src/test/resources/runtimets/queries/spatial/point_accessor.aql
new file mode 100644
index 0000000..c408630
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/spatial/point_accessor.aql
@@ -0,0 +1,14 @@
+/*
+ * Description : Test spatial accessors
+ * Expected Result : Success
+ * Date : Oct 17, 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/spatial_point_accessor.adm";
+
+let $point := create-point(2.3,5.0)
+return {"x-coordinate": get-x($point), "y-coordinate": get-y($point)}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/spatial/polygon_accessor.aql b/asterix-app/src/test/resources/runtimets/queries/spatial/polygon_accessor.aql
new file mode 100644
index 0000000..a181648
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/spatial/polygon_accessor.aql
@@ -0,0 +1,16 @@
+/*
+ * Description : Test spatial accessors
+ * Expected Result : Success
+ * Date : Oct 17, 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/spatial_polygon_accessor.adm";
+
+let $polygon := create-polygon(create-point(1.0,1.0), create-point(2.0,2.0), create-point(3.0,3.0), create-point(4.0,4.0))
+let $polygon_list := get-points($polygon)
+for $p in $polygon_list
+return $p
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/spatial/rectangle-intersect-rectangle.aql b/asterix-app/src/test/resources/runtimets/queries/spatial/rectangle-intersect-rectangle.aql
index 90c9f77..b32b6a3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/spatial/rectangle-intersect-rectangle.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/spatial/rectangle-intersect-rectangle.aql
@@ -15,7 +15,7 @@
write output to nc1:"rttest/spatial_rectangle-intersect-rectangle.adm";
for $o in dataset('MyData')
-where spatial-intersect($o.rec, create-rectangle(create-point(-1.0,5.0), create-point(4.5,9.0)))
+where spatial-intersect($o.rec, create-rectangle(create-point(4.5,9.0), create-point(-1.0,5.0)))
order by $o.id
return {"id":$o.id}
diff --git a/asterix-app/src/test/resources/runtimets/queries/spatial/rectangle_accessor.aql b/asterix-app/src/test/resources/runtimets/queries/spatial/rectangle_accessor.aql
new file mode 100644
index 0000000..676888c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/spatial/rectangle_accessor.aql
@@ -0,0 +1,16 @@
+/*
+ * Description : Test spatial accessors
+ * Expected Result : Success
+ * Date : Oct 17, 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/spatial_rectangle_accessor.adm";
+
+let $rectangle := create-rectangle(create-point(9.2,49.0), create-point(77.8,111.1))
+let $rectangle_list := get-points($rectangle)
+for $p in $rectangle_list
+return $p
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/concat1.aql b/asterix-app/src/test/resources/runtimets/queries/string/concat1.aql
deleted file mode 100644
index a6ce63b..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/string/concat1.aql
+++ /dev/null
@@ -1,12 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/string_concat1.adm";
-
-let $x := ["aa", "25991", "bb", "31526"]
-let $c := string-concat($x)
-
-let $x1 := []
-let $c1 := string-concat($x1)
-return {"result1": $c,"result2": $c1}
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/concat_01.aql b/asterix-app/src/test/resources/runtimets/queries/string/concat_01.aql
new file mode 100644
index 0000000..2a0b1ab
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/concat_01.aql
@@ -0,0 +1,12 @@
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/string_concat_01.adm";
+
+let $x := ["aa", "25991", "bb", "31526"]
+let $c := string-concat($x)
+
+let $x1 := []
+let $c1 := string-concat($x1)
+return {"result1": $c,"result2": $c1}
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/concat_02.aql b/asterix-app/src/test/resources/runtimets/queries/string/concat_02.aql
new file mode 100644
index 0000000..c716fcb
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/concat_02.aql
@@ -0,0 +1,15 @@
+/*
+ * Description : Test concat-string function with nulls in the list which is passed as an argument.
+ * Success : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/string_concat_02.adm";
+
+let $a := string-concat([null])
+let $b := string-concat([null, "foo"])
+let $c := string-concat(["foo", null])
+return {"a": $a, "b": $b, "c": $c}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/cpttostr01.aql b/asterix-app/src/test/resources/runtimets/queries/string/cpttostr01.aql
new file mode 100644
index 0000000..a66b00f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/cpttostr01.aql
@@ -0,0 +1,28 @@
+/*
+ * Test case Name : cpttostr01.aql
+ * Description : Test codepoint-to-string(codepoint) function.
+ * : Pass the codepoints which are in the internal dataset to the function.
+ * Success : Yes
+ * Date : 16th April 2012
+ */
+
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type TestType as open{
+id:int32,
+cpt:[int32]
+}
+
+create dataset testds(TestType) partitioned by key id;
+
+// insert codepoint data into internal dataset testds here into the cpt attribute
+
+insert into dataset testds({"id":123,"cpt":[0048,0045,0057,0044,0065,0045,0090]});
+
+write output to nc1:"rttest/string_cpttostr01.adm";
+
+for $l in dataset('testds')
+return codepoint-to-string($l.cpt)
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/cpttostr02.aql b/asterix-app/src/test/resources/runtimets/queries/string/cpttostr02.aql
new file mode 100644
index 0000000..1e99989
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/cpttostr02.aql
@@ -0,0 +1,17 @@
+/*
+ * Test case Name : cpttostr02.aql
+ * Description : Test codepoint-to-string(codepoint) function.
+ * : Inputs are codepoint values for lowecase, uppercase and special characters
+ * Success : Yes
+ * Date : 16th April 2012
+ */
+
+write output to nc1:"rttest/string_cpttostr02.adm";
+
+let $c1 := codepoint-to-string([0065,0066,0067,0068,0069,0070,0071,0072,0073,0074,0075,0076,0077,0078,0079,0080,0081,0082,0083,0084,0085,0086,0087,0088,0089,0090])
+
+let $c2 := codepoint-to-string([0097,0098,0099,0100,0101,0102,0103,0104,0105,0106,0107,0108,0109,0110,0111,0112,0113,0114,0115,0116,0117,0118,0119,0120,0121,0122])
+
+let $c3 := codepoint-to-string([0033,0034,0035,0036,0037,0038,0039,0040,0041,0042,0043,0044,0045,0046,0047,0048,0049,0050,0051,0052,0053,0054,0055,0063,0064])
+
+return {"c1":$c1,"c2":$c2,"c3":$c3}
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/cpttostr04.aql b/asterix-app/src/test/resources/runtimets/queries/string/cpttostr04.aql
new file mode 100644
index 0000000..9e177c0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/cpttostr04.aql
@@ -0,0 +1,13 @@
+/*
+ * Test case Name : cpttostr04.aql
+ * Description : Test codepoint-to-string(codepoint) function.
+ * Success : Yes
+ * Date : 16th April 2012
+ */
+
+//Input = Output
+
+write output to nc1:"rttest/string_cpttostr04.adm";
+
+let $c1 := codepoint-to-string(string-to-codepoint("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"))
+return { "c1":$c1 }
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/endwith02.aql b/asterix-app/src/test/resources/runtimets/queries/string/endwith02.aql
new file mode 100644
index 0000000..cfca775
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/endwith02.aql
@@ -0,0 +1,16 @@
+/*
+ * Testcase Name : endwith02.aql
+ * Description : Positive tests
+ * Success : Yes
+ * Date : 20th April 2012
+ */
+
+write output to nc1:"rttest/string_endwith02.adm";
+
+for $a in [end-with("aBCDEFghIa",codepoint-to-string([0041])),
+end-with("AbCDEFghIA",codepoint-to-string([0041])),
+end-with("AbCdEfGhIjKlMnOpQrStUvWxYz","xYz"),
+end-with("abcdef",lowercase("ABCDEf")),
+end-with("abcdef","abcdef"),
+end-with("abcdef123","ef123")]
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/endwith03.aql b/asterix-app/src/test/resources/runtimets/queries/string/endwith03.aql
new file mode 100644
index 0000000..832efbc
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/endwith03.aql
@@ -0,0 +1,33 @@
+/*
+ * Testcase Name : endwith03.aql
+ * Description : Positive tests
+ * Success : Yes
+ * Date : 20th April 2012
+ */
+
+// create internal dataset, insert string data into string field and pass the string filed as input to end-with function
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type TestType as {
+name:string
+}
+
+create dataset testds(TestType) partitioned by key name;
+
+insert into dataset testds({"name":"Jim Jones"});
+insert into dataset testds({"name":"Ravi Kumar"});
+insert into dataset testds({"name":"Bruce Li"});
+insert into dataset testds({"name":"Marian Jones"});
+insert into dataset testds({"name":"Phil Jones"});
+insert into dataset testds({"name":"I am Jones"});
+
+write output to nc1:"rttest/string_endwith03.adm";
+
+for $l in dataset('testds')
+order by $l.name
+where end-with($l.name,"Jones")
+return $l
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/length.aql b/asterix-app/src/test/resources/runtimets/queries/string/length.aql
deleted file mode 100644
index d78d986..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/string/length.aql
+++ /dev/null
@@ -1,10 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/string_length.adm";
-
-let $c1 := string-length("hellow")
-let $c2 := string-length("")
-let $c3 := string-length(null)
-return {"result1": $c1, "result2": $c2, "result3": $c3}
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/length_01.aql b/asterix-app/src/test/resources/runtimets/queries/string/length_01.aql
new file mode 100644
index 0000000..8186f6b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/length_01.aql
@@ -0,0 +1,10 @@
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/string_length_01.adm";
+
+let $c1 := string-length("hellow")
+let $c2 := string-length("")
+let $c3 := string-length(null)
+return {"result1": $c1, "result2": $c2, "result3": $c3}
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/length_02.aql b/asterix-app/src/test/resources/runtimets/queries/string/length_02.aql
new file mode 100644
index 0000000..3cc33e7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/length_02.aql
@@ -0,0 +1,8 @@
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/string_length_02.adm";
+
+for $x in ["ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "ninety"]
+return string-length($x)
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/matches02.aql b/asterix-app/src/test/resources/runtimets/queries/string/matches02.aql
new file mode 100644
index 0000000..1018f02
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/matches02.aql
@@ -0,0 +1,23 @@
+/*
+ * Testcase Name : matches02.aql
+ * Description : Positive tests
+ * Success : Yes
+ * Date : 23th April 2012
+ */
+
+write output to nc1:"rttest/string_matches02.adm";
+
+let $c1:="Hello World"
+let $c2:="Hello World"
+let $c3:=matches($c1,$c2)
+let $c4:=matches("Asterix for Dummies","Asterix for Dummies")
+let $c5:=matches("semistructured data",lowercase("SEMISTRUCTURED DATA"))
+let $c6:=matches("Mega Living!","Mega")
+let $c7:=matches("Mega Living!","ving!")
+let $c8:=matches("Mega Living!"," ")
+let $c9:=matches("Mega Living!","a l")
+let $c10:=matches("Mega Living!","")
+let $c11:=matches(" "," ")
+let $c12:=matches("aaaa","aaaaa")
+return {"c3":$c3,"c4":$c4,"c5":$c5,"c6":$c6,"c7":$c7,"c8":$c8,"c9":$c9,"c10":$c10,"c11":$c11,"c12":$c12}
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/matches03.aql b/asterix-app/src/test/resources/runtimets/queries/string/matches03.aql
new file mode 100644
index 0000000..7f4623c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/matches03.aql
@@ -0,0 +1,26 @@
+/*
+ * Testcase Name : matches03.aql
+ * Description : Positive tests
+ * : Test matches functions with regular expressions as third input parameter
+ * Success : Yes
+ * Date : 23th April 2012
+ */
+
+
+write output to nc1:"rttest/string_matches03.adm";
+
+for $a in [matches("1234567890","[^a-z]"),
+matches("1234567890","[^a-zA-Z]"),
+matches("abcdefghABCDEFGH","[^a-zA-Z]"),
+matches("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ","[^a-zA-Z]"),
+matches("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ","[^A-Z]"),
+matches("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ","[^a-z]"),
+matches("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ","[^0-9]"),
+matches("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ","[0-9]"),
+matches("adefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ","[a-z&&[^bc]]"),
+matches("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ","[a-z&&[^bc]]"),
+matches("bc","[a-z&&[^bc]]"),
+matches("mnop","[a-z&&[^m-p]]"),
+matches("abcdmnop","[a-z&&[^m-p]]")]
+return $a
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/matches04.aql b/asterix-app/src/test/resources/runtimets/queries/string/matches04.aql
new file mode 100644
index 0000000..829a176
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/matches04.aql
@@ -0,0 +1,17 @@
+/*
+ * Testcase Name : matches04.aql
+ * Description : Positive tests
+ * Success : Yes (tests to check for patterns using regular expressions)
+ * Date : 20th April 2012
+ */
+
+write output to nc1:"rttest/string_matches04.adm";
+
+for $a in [matches("UCI UCI UCI UCI UCI UCI","[UCI{6}]"),
+matches("UCI UCI UCI UCI UCI UCI","[UCI{3,6}]"),
+matches("UCI UCI UCI UCI UCI UCI","[UCI{7}]"),
+matches("UCI UCI UCI UCI UCI UCI","[UCI{1}]"),
+matches("UCI UCI UCI","[UCI+]"),
+matches("false","[true|false]"),
+matches("YX","[XY]")]
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/matches05.aql b/asterix-app/src/test/resources/runtimets/queries/string/matches05.aql
new file mode 100644
index 0000000..2f7b83e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/matches05.aql
@@ -0,0 +1,34 @@
+/*
+ * Testcase Name : matches05.aql
+ * Description : Positive tests
+ * : Create two internal datasets and insert string data and perform match of fname using matches function.
+ * Success : Yes
+ * Date : 25th April 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type TestType1 as{
+fname:string,
+lname:string,
+id:int32
+}
+
+create dataset testds1(TestType1) partitioned by key id;
+
+insert into dataset testds1({"fname":"Test","lname":"Test","id":123});
+insert into dataset testds1({"fname":"Testa","lname":"Test","id":124});
+insert into dataset testds1({"fname":"Test1","lname":"Test1","id":125});
+insert into dataset testds1({"fname":"Test","lname":"Testb","id":126});
+insert into dataset testds1({"fname":"Test2","lname":"Test2","id":127});
+
+write output to nc1:"rttest/string_matches05.adm";
+
+//Perform the match for fname and lname
+for $l in dataset('testds1')
+order by $l.id
+where matches($l.fname,$l.lname)
+return $l
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/matches06.aql b/asterix-app/src/test/resources/runtimets/queries/string/matches06.aql
new file mode 100644
index 0000000..0e18a84
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/matches06.aql
@@ -0,0 +1,25 @@
+/*
+ * Description : Test matches string function using regular expressions
+ * Expected Res : Success
+ * Date : May 21 2012
+ */
+
+write output to nc1:"rttest/string_matches06.adm";
+
+for $a in [matches("mnop","."),
+matches("abcdefABCDEF","/d"),
+matches("12345","\d"),
+matches("abcdefGHIJK","\D"),
+matches(" ","\s"),
+matches(" ","\S"),
+matches("Welcome to pattern matching!","[a-zA-Z_0-9]"),
+matches("!@#$%^&*()","[a-zA-Z_0-9]"),
+matches("!@#$%^&*()","[^\W]"),
+matches("!@#$%^&*","[^\w]"),
+matches("0xffff","[\p{XDigit}]"),
+matches("FFFFFFFF","[\p{XDigit}]"),
+matches("abcdefgh","[\p{javaLowerCase}]"),
+matches("ABCDEF","[\p{javaLowerCase}]"),
+matches(codepoint-to-string([0163]),"[\p{Sc}]")]
+return $a
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/matches11.aql b/asterix-app/src/test/resources/runtimets/queries/string/matches11.aql
new file mode 100644
index 0000000..1e96b5f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/matches11.aql
@@ -0,0 +1,16 @@
+/*
+ * Testcase Name : matches11.aql
+ * Description : Positive tests
+ * Success : Yes
+ * Date : 20th April 2012
+ */
+
+write output to nc1:"rttest/string_matches11.adm";
+
+for $a in [matches("hello",null),
+matches("hello","helllo"),
+matches("hello"," "),
+matches(null,"hello"),
+matches("hello","[^a-z]")]
+return $a
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/startwith02.aql b/asterix-app/src/test/resources/runtimets/queries/string/startwith02.aql
new file mode 100644
index 0000000..b4ab93a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/startwith02.aql
@@ -0,0 +1,26 @@
+/*
+ * Testcase Name : startwith02.aql
+ * Description : Positive tests
+ * Success : Yes
+ * Date : 19th April 2012
+ */
+
+write output to nc1:"rttest/string_startwith02.adm";
+
+for $a in [start-with("Hello","H"),
+start-with("Hello",lowercase("He")),
+start-with("Hello",""),
+start-with("Hello"," "),
+start-with("Hello",null),
+start-with("abcdef",lowercase("ABCDEf")),
+start-with("abcdef","abcdef"),
+start-with("abcdef","abc "),
+start-with("abc\tdef","abc\t"),
+start-with(" abcdef","abc"),
+start-with("0x1FF","0"),
+start-with("<ID>","<"),
+start-with("aBCDEFghI",codepoint-to-string([0041])),
+start-with("AbCDEFghI",codepoint-to-string([0041]))]
+return $a
+
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/startwith03.aql b/asterix-app/src/test/resources/runtimets/queries/string/startwith03.aql
new file mode 100644
index 0000000..8aed603
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/startwith03.aql
@@ -0,0 +1,35 @@
+/*
+ * Testcase Name : startwith02.aql
+ * Description : Positive tests
+ * Success : Yes
+ * Date : 19th April 2012
+ */
+
+// Create internal dataset, insert string data into string field and pass the string field as first input to start-with function
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type TestType as {
+name:string
+}
+
+create dataset testds(TestType) partitioned by key name;
+
+insert into dataset testds({"name":"John Smith"});
+insert into dataset testds({"name":"John Doe"});
+insert into dataset testds({"name":"John Wayne"});
+insert into dataset testds({"name":"Johnson Ben"});
+insert into dataset testds({"name":"Johnny Walker"});
+insert into dataset testds({"name":"David Smith"});
+insert into dataset testds({"name":"Not a Name"});
+
+write output to nc1:"rttest/string_startwith03.adm";
+
+// Return all names that start with John
+
+for $l in dataset('testds')
+order by $l.name
+where start-with($l.name,"John")
+return $l
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/strconcat01.aql b/asterix-app/src/test/resources/runtimets/queries/string/strconcat01.aql
new file mode 100644
index 0000000..0b3941d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/strconcat01.aql
@@ -0,0 +1,38 @@
+/*
+ * Test case Name : strconcat01.aql
+ * Description : Test string-concat([string]) function.
+ * : Pass the strings(which are in internal dataset) to string-concat function for concatenation.
+ * Success : Yes
+ * Date : 16th April 2012
+ */
+
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type TestType as open{
+id:int32,
+fname:string,
+lname:string
+}
+
+create dataset testds(TestType) partitioned by key id;
+
+// insert string data into internal dataset testds into the name attribute
+
+insert into dataset testds({"id":123,"fname":"John","lname":"Smith"});
+insert into dataset testds({"id":124,"fname":"Bob","lname":"Jones"});
+insert into dataset testds({"id":125,"fname":"Mike","lname":"Carey"});
+insert into dataset testds({"id":126,"fname":"Chen","lname":"Li"});
+insert into dataset testds({"id":121,"fname":"Young Seok","lname":"Kim"});
+insert into dataset testds({"id":122,"fname":"Alex","lname":"Behm"});
+insert into dataset testds({"id":127,"fname":"Raman","lname":"Grover"});
+insert into dataset testds({"id":128,"fname":"Yingyi","lname":"Bu"});
+insert into dataset testds({"id":129,"fname":"Vinayak","lname":"Borkar"});
+
+write output to nc1:"rttest/string_strconcat01.adm";
+
+for $l in dataset('testds')
+order by $l.id
+return { "Full Name": string-concat([$l.fname,$l.lname]) }
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/strconcat02.aql b/asterix-app/src/test/resources/runtimets/queries/string/strconcat02.aql
new file mode 100644
index 0000000..4991bde
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/strconcat02.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : Test string-concat([string]) function.
+ * Success : Yes
+ * Date : 16th April 2012
+ */
+
+
+write output to nc1:"rttest/string_strconcat02.adm";
+
+for $a in [string-concat([codepoint-to-string(string-to-codepoint("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")),codepoint-to-string(string-to-codepoint("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")),codepoint-to-string(string-to-codepoint("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"))]),string-concat([" ","a","b"," ","c","d","e","f","g","p","o","q","r","s","t"," "]),string-concat(["This is a test","and all tests must pass","and life is good..."])]
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/strlen02.aql b/asterix-app/src/test/resources/runtimets/queries/string/strlen02.aql
new file mode 100644
index 0000000..852570f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/strlen02.aql
@@ -0,0 +1,27 @@
+/*
+ * Description : Test string-length(string) function
+ * Success : Yes
+ * Date : 19th April 2012
+ */
+
+
+/*
+for $a in [ string-length("abcdefghijklmnopqrstu"),
+string-length("ABCDEFGHIJKLMNOPQRSTU"),
+string-length("abcdEFGHijklMNOPqrstu"),
+string-length("abcd EFGH ijkl MNOP qrstu"),
+string-length(" Hello World !!!!....:-)"),
+string-length(string-concat(["test string to","concatenate"])),
+string-length("~!@#$%^&*()_+{}:?<>/.,';`][\")]
+return $a
+*/
+
+write output to nc1:"rttest/string_strlen02.adm";
+
+for $a in [ string-length("abcdefghijklmnopqrstu"),
+string-length("ABCDEFGHIJKLMNOPQRSTU"),
+string-length("abcdEFGHijklMNOPqrstu"),
+string-length("abcd EFGH ijkl MNOP qrstu"),
+string-length(" Hello World !!!!....:-)"),
+string-length("~!@#$%^&*()_+{}:?<>/.,';`][\")]
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/strlen03.aql b/asterix-app/src/test/resources/runtimets/queries/string/strlen03.aql
new file mode 100644
index 0000000..bba2a7f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/strlen03.aql
@@ -0,0 +1,37 @@
+/*
+ * Description : Test string-length(string) function
+ * Expected Res : Success
+ * Date : 19th April 2012
+ */
+
+
+// Create internal dataset, insert string data and pass the string attribute to string-length function, and verify results.
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type TestType as {
+name:string
+}
+
+create dataset testds(TestType) partitioned by key name;
+
+insert into dataset testds({"name":"Maradona"});
+insert into dataset testds({"name":"Pele"});
+insert into dataset testds({"name":"Roberto Baggio"});
+insert into dataset testds({"name":"Beckham David"});
+insert into dataset testds({"name":"Rooney"});
+insert into dataset testds({"name":"Ronaldinho"});
+insert into dataset testds({"name":"Ronaldo"});
+insert into dataset testds({"name":"Zinadine Zidane"});
+insert into dataset testds({"name":"Cristiano Ronaldo"});
+insert into dataset testds({"name":"Messi"});
+insert into dataset testds({"name":"Tevez"});
+insert into dataset testds({"name":"Henry"});
+
+write output to nc1:"rttest/string_strlen03.adm";
+
+for $l in dataset('testds')
+order by $l.name
+return string-length($l.name)
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/strtocpt01.aql b/asterix-app/src/test/resources/runtimets/queries/string/strtocpt01.aql
new file mode 100644
index 0000000..fdbf014
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/strtocpt01.aql
@@ -0,0 +1,10 @@
+/*
+ * Description : Test string to codepoint function with valid inputs
+ * Expected Res : Success
+ * Date : 7th Aug 2012
+ */
+
+write output to nc1:"rttest/string_strtocpt01.adm";
+
+let $x := "ABCDEFGHIJKLMNOPQRSTUVWXYZ-01234567890"
+return string-to-codepoint($x)
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/strtocpt02.aql b/asterix-app/src/test/resources/runtimets/queries/string/strtocpt02.aql
new file mode 100644
index 0000000..b203f6d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/strtocpt02.aql
@@ -0,0 +1,10 @@
+/*
+ * Description : Test string to codepoint function with special characters
+ * Expected Res : Success
+ * Date : 7th Aug 2012
+ */
+
+write output to nc1:"rttest/string_strtocpt02.adm";
+
+let $x := "\"'-=_+|\,./<>?:;~`"
+return string-to-codepoint($x)
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/strtocpt03.aql b/asterix-app/src/test/resources/runtimets/queries/string/strtocpt03.aql
new file mode 100644
index 0000000..6daf0fe
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/strtocpt03.aql
@@ -0,0 +1,10 @@
+/*
+ * Description : Test string to codepoint function with special characters
+ * Expected Res : Success
+ * Date : 7th Aug 2012
+ */
+
+write output to nc1:"rttest/string_strtocpt03.adm";
+
+let $x := "!@#$%^&*()"
+return string-to-codepoint($x)
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/substr01.aql b/asterix-app/src/test/resources/runtimets/queries/string/substr01.aql
new file mode 100644
index 0000000..791e7c0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/substr01.aql
@@ -0,0 +1,30 @@
+/*
+ * Testcase Name : substr01.aql
+ * Description : Test substring2(string,position) built in function.
+ * Success : Yes
+ * Date : 18th April 2012
+ */
+
+write output to nc1:"rttest/string_substr01.adm";
+
+let $str1:="Hello World"
+let $str2:=substring2($str1,10)
+
+let $str3:="This is a test string"
+let $str4:=substring2($str3,21)
+
+let $str5:="This is a test string"
+let $str6:=substring2($str5,22)
+
+let $str7:="This is a test string"
+let $str8:=substring2($str7,0)
+
+let $str9:="This is a test string"
+let $str10:=substring2($str9,-1)
+
+let $str11:="This is a test string"
+let $str12:="This is a another test string"
+let $str13:=substring2(string-concat([$str11,$str12]),21)
+
+let $str14:=substring2("UC Irvine",string-length("UC Irvine")/2)
+return { "str2":$str2,"str4":$str4,"str6":$str6,"str8":$str8,"str10":$str10,"str13":$str13,"str14":$str14}
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/substr04.aql b/asterix-app/src/test/resources/runtimets/queries/string/substr04.aql
new file mode 100644
index 0000000..880499c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/substr04.aql
@@ -0,0 +1,21 @@
+/*
+ * Testcase Name : substr04.aql
+ * Description : Test substring2(string,position,position) built in function.
+ * Success : Yes
+ * Date : 18th April 2012
+ */
+
+write output to nc1:"rttest/string_substr04.adm";
+
+for $a in [ substring2("hello world",7,11),
+substring2("hello world",1,11),
+substring2("hello world",3,7),
+substring2("ABCD",3,6),
+substring2("ABCD",0,4),
+substring2("UC Irvine",4,string-length("UC Irvine")),
+substring2("UC Irvine",0,string-length("UC Irvine")),
+substring2("UC Irvine",1,string-length("UC Irvine")),
+substring2(substring2("UC Irvine",4),0,string-length("Irvine")),
+substring2(substring2("UC Irvine",4),0,(string-length("Irvine")/2))
+]
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/substr05.aql b/asterix-app/src/test/resources/runtimets/queries/string/substr05.aql
new file mode 100644
index 0000000..fbdcba4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/substr05.aql
@@ -0,0 +1,33 @@
+/*
+ * Testcase Name : substr05.aql
+ * Description : Test substring2(string,position,position) built in function.
+ * Success : Yes
+ * Date : 19th April 2012
+ */
+
+// To test substring2 function with string data stored in an internal dataset.
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type TestType as open {
+name : string
+}
+
+create dataset testdst(TestType) partitioned by key name;
+
+insert into dataset testdst({"name":"UC Berkeley"});
+insert into dataset testdst({"name":"UC Irvine"});
+insert into dataset testdst({"name":"UC LA"});
+insert into dataset testdst({"name":"UC Riverside"});
+insert into dataset testdst({"name":"UC San Diego"});
+insert into dataset testdst({"name":"UC Santa Barbara"});
+insert into dataset testdst({"name":"UT Austin "});
+insert into dataset testdst({"name":"UT Dallas"});
+
+write output to nc1:"rttest/string_substr05.adm";
+
+for $a in dataset('testdst')
+order by $a.name
+return substring2($a.name,4,string-length($a.name));
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/substr06.aql b/asterix-app/src/test/resources/runtimets/queries/string/substr06.aql
new file mode 100644
index 0000000..82d21c2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/substr06.aql
@@ -0,0 +1,32 @@
+/*
+ * Description : Test substring2(string,position) built in function.
+ * Success : Yes
+ * Date : 19th April 2012
+ */
+
+// To test substring function with string data stored in an internal dataset.
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type TestType as open {
+name : string
+}
+
+create dataset testdst(TestType) partitioned by key name;
+
+insert into dataset testdst({"name":"UC Berkeley"});
+insert into dataset testdst({"name":"UC Irvine"});
+insert into dataset testdst({"name":"UC LA"});
+insert into dataset testdst({"name":"UC Riverside"});
+insert into dataset testdst({"name":"UC San Diego"});
+insert into dataset testdst({"name":"UC Santa Barbara"});
+insert into dataset testdst({"name":"UT Austin "});
+insert into dataset testdst({"name":"UT Dallas"});
+
+write output to nc1:"rttest/string_substr06.adm";
+
+for $a in dataset('testdst')
+order by $a.name
+return substring2($a.name,4);
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase02.aql b/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase02.aql
new file mode 100644
index 0000000..2c16e01
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase02.aql
@@ -0,0 +1,23 @@
+/*
+ * Testcase Name : toLowerCas02.aql
+ * Description : Test lowercase(string) function
+ * : Positive tests
+ * Success : Yes
+ * Date : 19th April 2012
+ */
+
+write output to nc1:"rttest/string_toLowerCase02.adm";
+
+for $a in [lowercase("a b c d e f g"),
+ lowercase("A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"),
+ lowercase("abcdefghij KLMNOP qrstu VWXYZ"),
+ lowercase("abcdefghijklmnopqrstuvwxyz"),
+ lowercase("this is a test string"),
+ lowercase("smaller string"),
+ lowercase("ABCD"),
+ lowercase("AbCdEfGhIjKlMnOpQrStUvWxYz"),
+ lowercase("abcdefghijkABCDEFGHIJK"),
+ lowercase("HIJKLMNOPQRhijklmnopqr"),
+ lowercase(substring2("ABCDEFghIJKLMnopQRSTuvwxYZ01234",0)),
+ lowercase("A33B2CD1EF78GHijk123LMNopqrstUVW3x2y01035Z")]
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase03.aql b/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase03.aql
new file mode 100644
index 0000000..411dacf
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase03.aql
@@ -0,0 +1,39 @@
+/*
+ * Test case Name : toLowerCas03.aql
+ * Description : Test lowercase(string) function
+ * : This test case covers Positive tests
+ * Success : Yes
+ * Date : 19th April 2012
+ */
+
+
+// Create internal dataset, insert string data and pass the string attribute to lowercase function, and verify results.
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type TestType as {
+name:string
+}
+
+create dataset testds(TestType) partitioned by key name;
+
+insert into dataset testds({"name":"Maradona"});
+insert into dataset testds({"name":"Pele"});
+insert into dataset testds({"name":"Roberto Baggio"});
+insert into dataset testds({"name":"Beckham David"});
+insert into dataset testds({"name":"Rooney"});
+insert into dataset testds({"name":"Ronaldinho"});
+insert into dataset testds({"name":"Ronaldo"});
+insert into dataset testds({"name":"Zinadine Zidane"});
+insert into dataset testds({"name":"Cristiano Ronaldo"});
+insert into dataset testds({"name":"Messi"});
+insert into dataset testds({"name":"Tevez"});
+insert into dataset testds({"name":"Henry"});
+
+write output to nc1:"rttest/string_toLowerCase03.adm";
+
+for $l in dataset('testds')
+order by $l.name
+return lowercase($l.name)
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase04.aql b/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase04.aql
new file mode 100644
index 0000000..3d99aab
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase04.aql
@@ -0,0 +1,12 @@
+/*
+ * Test case Name : toLowerCas04.aql
+ * Description : Test lowercase(string) function
+ * : Convert all upper case english alphabets A-Z to lower case a-z
+ * Success : Yes
+ * Date : 19th April 2012
+ */
+
+write output to nc1:"rttest/string_toLowerCase04.adm";
+
+for $a in[lowercase(codepoint-to-string([0065,0066,0067,0068,0069,0070,0071,0072,0073,0074,0075,0076,0077,0078,0079,0080,0081,0082,0083,0084,0085,0086,0087,0088,0089,0090])),lowercase(string-concat(["ABCDEFGHIJKLMNOP","QRSTUVWXYZ"]))]
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/tid_01.aql b/asterix-app/src/test/resources/runtimets/queries/tid_01.aql
deleted file mode 100644
index 3cd8396..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/tid_01.aql
+++ /dev/null
@@ -1,7 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/tid_01.adm";
-
-for $x at $i in ["a","b","c"]
-return $i
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt.aql
index b53fc877..af39b3f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt.aql
@@ -1,7 +1,5 @@
drop dataverse tpch if exists;
create dataverse tpch;
-
-
use dataverse tpch;
create type LineItemType as closed {
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/f01.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/f01.aql
new file mode 100644
index 0000000..7f87de7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/f01.aql
@@ -0,0 +1,14 @@
+/*
+ * Description : Invoke a built-in function with incorrect number of arguments
+ * Expected Res : Failure
+ * Date : Nov 13th 2012
+ */
+
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_f01.adm";
+
+let $c1 := int8()
+return $c1
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/query-issue201.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/query-issue201.aql
new file mode 100644
index 0000000..0505179
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/query-issue201.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : This test case is to verify the fix for issue201
+ : https://code.google.com/p/asterixdb/issues/detail?id=201
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+write output to nc1:"rttest/user-defined-functions_query-issue201.adm";
+
+let $x:=range(1,100)
+for $i in $x
+return $i
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf01.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf01.aql
new file mode 100644
index 0000000..35718b1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf01.aql
@@ -0,0 +1,18 @@
+/*
+ * Description : Pass an ordered list as input to UDF
+ * : and return that ordered list.
+ * Expected Res : Success
+ * Date : 4th September 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf01.adm";
+
+create function test.echo($list){
+$list
+}
+
+for $a in [1,2,3,4,5,6,7,8,9,10]
+return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf02.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf02.aql
new file mode 100644
index 0000000..2605f7a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf02.aql
@@ -0,0 +1,17 @@
+/*
+ * Description : Pass an ordered list as input to UDF and return the zeroth element of that list.
+ * Expected Res : Success
+ * Date : 4th September 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf02.adm";
+
+create function test.getFirst($list){
+$list[0]
+}
+
+for $a in [[1,2],[3,4]]
+return test.getFirst($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf03.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf03.aql
new file mode 100644
index 0000000..747f29d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf03.aql
@@ -0,0 +1,20 @@
+/*
+ * Description : Pass an ordered list as input to UDF and return the zeroth element of that list.
+ * Expected Res : Success
+ * Date : 4th September 2012
+ * Ignored : Not part of test build due to Issue 200
+ */
+
+// This test is returning NPE... Issue 200
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf03.adm";
+
+create function test.echo($list){
+$list
+}
+
+for $a in [[1,2],["A","B"],["UCLA","UCSD","UCR","UCI"]]
+return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf04.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf04.aql
new file mode 100644
index 0000000..bd6544f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf04.aql
@@ -0,0 +1,17 @@
+/*
+ * Description : Pass as input an ordered list of Records as input to UDF and return the list.
+ * Expected Res : Success
+ * Date : 4th September 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf04.adm";
+
+create function test.echo($list){
+$list
+}
+
+for $a in [{"name":"John","age":45,"id":123},{"name":"Jim","age":55,"id":103},{"name":"Bill","age":35,"id":125}]
+return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf05.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf05.aql
new file mode 100644
index 0000000..2429f1c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf05.aql
@@ -0,0 +1,17 @@
+/*
+ * Description : Create UDF and bind its return value to a variable and return that variable
+ * Expected Res : Success
+ * Date : Sep 4th 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf05.adm";
+
+create function test.echo($a){
+$a
+}
+
+let $b:=1234
+return test.echo($b)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf06.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf06.aql
new file mode 100644
index 0000000..3301d5c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf06.aql
@@ -0,0 +1,17 @@
+/*
+ * Description : Pass input of type double to UDF
+ * Expected Res : Success
+ * Date : 4th September 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf06.adm";
+
+create function test.echo($a){
+$a
+}
+
+let $b:=1234.1
+return test.echo($b)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf07.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf07.aql
new file mode 100644
index 0000000..0280e92
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf07.aql
@@ -0,0 +1,17 @@
+/*
+ * Description : Pass value of type float to UDF
+ * Expected Res : Success
+ * Date : Sep 4th 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf07.adm";
+
+create function test.echo($a){
+$a
+}
+
+let $b:=1234.1f
+return test.echo($b)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf08.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf08.aql
new file mode 100644
index 0000000..5dfb9a2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf08.aql
@@ -0,0 +1,17 @@
+/*
+ * Description : Pass a sting as input to UDF
+ * Expected Res : Success
+ * Date : 4th September 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf08.adm";
+
+create function test.echo($a){
+$a
+}
+
+let $a:="This is a test string"
+return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf09.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf09.aql
new file mode 100644
index 0000000..b16e2dd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf09.aql
@@ -0,0 +1,31 @@
+/*
+ * Description : Create UDF to read from internal dataset
+ * Expected Res : Success
+ * Date : Sep 4th 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf09.adm";
+
+create type test.TestType as open {
+id : int32
+}
+
+create dataset test.t1(TestType) partitioned by key id;
+
+insert into dataset test.t1({"id":345});
+insert into dataset test.t1({"id":315});
+insert into dataset test.t1({"id":245});
+insert into dataset test.t1({"id":385});
+insert into dataset test.t1({"id":241});
+insert into dataset test.t1({"id":745});
+insert into dataset test.t1({"id":349});
+insert into dataset test.t1({"id":845});
+
+create function test.readDataset($a) {
+$a
+}
+
+test.readDataset(for $a in dataset('test.t1') order by $a.id return $a);
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf10.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf10.aql
new file mode 100644
index 0000000..d0da4e1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf10.aql
@@ -0,0 +1,17 @@
+/*
+ * Description : Create UDF and pass an unordered list as input and return that list.
+ * Expected Res : Success
+ * Date : 4th September 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf10.adm";
+
+create function test.echo($uolist){
+$uolist
+}
+
+let $a:={{"this is optional data","this is extra data","open types are good"}}
+return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf11.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf11.aql
new file mode 100644
index 0000000..b842c93
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf11.aql
@@ -0,0 +1,17 @@
+/*
+ * Description : Create UDF to return ordered list of integers
+ * Expected Res : Success
+ * Date : Sep 4th 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf11.adm";
+
+create function test.OList(){
+[1,2,3,4,5,6,7,8,9,10]
+}
+
+for $a in test.OList()
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf12.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf12.aql
new file mode 100644
index 0000000..e3f8122
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf12.aql
@@ -0,0 +1,16 @@
+/*
+ * Description : Create UDF to add two integers
+ * Expected Res : Success
+ * Date : 4th September 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf12.adm";
+
+create function test.foo($a,$b) {
+$a+$b
+}
+
+test.foo(100,200)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf13.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf13.aql
new file mode 100644
index 0000000..533def7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf13.aql
@@ -0,0 +1,16 @@
+/*
+ * Description : Create UDF to subtract two integers
+ * Expected Res : Success
+ * Date : 4th September 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf13.adm";
+
+create function test.foo($a,$b) {
+$a - $b
+}
+
+test.foo(400,200)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf14.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf14.aql
new file mode 100644
index 0000000..fc3447d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf14.aql
@@ -0,0 +1,16 @@
+/*
+ * Description : Create UDF to multiply two integers
+ * Expected Res : Success
+ * Date : 4th September 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf14.adm";
+
+create function test.foo($a,$b) {
+$a*$b
+}
+
+test.foo(400,200)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf15.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf15.aql
new file mode 100644
index 0000000..4b4992a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf15.aql
@@ -0,0 +1,21 @@
+/*
+ * Description : Create UDF that returns a heterogeneous ordered list
+ * : invoke the UDF in the FOR expression of FLWOR
+ * Expected Res : Success
+ * Date : Sep 5th 2012
+ * Ignored : Not part of current tests because of Issue 200
+ */
+
+// this test resturns NPE:Issue 166
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf15.adm";
+
+create function test.OList2(){
+[[1,2,3,4,5,6,7,8,9,10],["a","b","c","d","e","f","g","h","y"]]
+}
+
+for $a in test.OList2()
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf16.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf16.aql
new file mode 100644
index 0000000..e9f0742
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf16.aql
@@ -0,0 +1,18 @@
+/*
+ * Description : Create UDF that returns string
+ * : compute the string lenght of the string
+ * Expected Res : Success
+ * Date : Sep 5th 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf16.adm";
+
+create function test.fn02(){
+"Welcome to the world of Asterix"
+}
+
+let $str := test.fn02()
+return string-length($str)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf17.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf17.aql
new file mode 100644
index 0000000..b98d123
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf17.aql
@@ -0,0 +1,22 @@
+/*
+ * Description : Create UDF and invoke it from another UDF and
+ * : child UDF returns a string to the parent.
+ * Expected Res : Success
+ * Date : Sep 5th 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf17.adm";
+
+create function test.parent(){
+test.child()
+}
+
+create function test.child() {
+"This data is from the child function"
+}
+
+let $str := test.parent()
+return $str
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf18.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf18.aql
new file mode 100644
index 0000000..aa6a57b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf18.aql
@@ -0,0 +1,17 @@
+/*
+ * Description : Create UDF and invoke the UDF from with in asterix built-in function
+ * Expected Res : Success
+ * Date : Sep 5th 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf18.adm";
+
+create function test.fn06(){
+false
+}
+
+let $val := not(test.fn06())
+return $val
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf19.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf19.aql
new file mode 100644
index 0000000..87c39a5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf19.aql
@@ -0,0 +1,23 @@
+/*
+ * Description : Create UDF and invoke in the WHERE clause of FLWOR expression
+ * Expected Res : Success
+ * Date : Sep 5th 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf19.adm";
+
+create function test.pie(){
+3.14
+}
+
+create function test.area($radius){
+test.pie() * $radius * $radius
+}
+
+for $a in [2,4,6,8,10,12]
+where test.area($a) > 100
+return test.area($a)
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf20.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf20.aql
new file mode 100644
index 0000000..e0a16a1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf20.aql
@@ -0,0 +1,23 @@
+/*
+ * Description : Create UDF and invoke in the WHERE clause of FLWOR expression
+ * Expected Res : Success
+ * Date : Sep 5th 2012
+ */
+
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf20.adm";
+
+create function test.pie(){
+3.14
+}
+
+create function test.area($radius){
+test.pie() * $radius * $radius
+}
+
+for $a in [2,4,6,8,10,12]
+where test.area($a) > 100
+return { "radius" : $a,"area" : test.area($a) }
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf21.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf21.aql
new file mode 100644
index 0000000..7e943c3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf21.aql
@@ -0,0 +1,18 @@
+/*
+ * Description : Create UDF to verify if input is odd
+ * Expected Res : Success
+ * Date : Sep 5th 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf21.adm";
+
+create function test.isOdd($b){
+$b%2 != 0
+}
+
+for $a in [10,20,2,30,4,3,6,44,5,7,9,1,13,17,992,19,40,50,60,25,45,65,75]
+where test.isOdd($a)
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf22.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf22.aql
new file mode 100644
index 0000000..83e19e6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf22.aql
@@ -0,0 +1,18 @@
+/*
+ * Description : Create UDF to concatenate two input strings.
+ * Expected Res : Success
+ * Date : Sep 5th 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf22.adm";
+
+create function test.getFullName($fname,$lname){
+string-concat([$fname,$lname])
+}
+
+let $fn := "Bob"
+let $ln := "Harbus"
+return test.getFullName($fn,$ln)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf23.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf23.aql
new file mode 100644
index 0000000..a2d8ec5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf23.aql
@@ -0,0 +1,18 @@
+/*
+ * Description : Create UDF and invoke it in limit clause
+ * Expected Res : Success
+ * Date : Sep 5th 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf23.adm";
+
+create function test.numRows(){
+6
+}
+
+for $l in dataset('Metadata.Dataset')
+limit test.numRows()
+return $l
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf24.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf24.aql
new file mode 100644
index 0000000..eef906d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf24.aql
@@ -0,0 +1,21 @@
+/*
+ * Description : Create UDF that returns a range
+ * Expected Res : Success
+ * Date : Sep 5 2012
+ * Ignored : Not part of current test build because of Issue 201
+ */
+
+// Returns java.lang.ClassCastException : Issue 195
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf24.adm";
+
+create function test.myRangeFn($n)
+{
+ range(1,$n)
+}
+
+for $i in test.myRangeFn(100)
+return $i
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf25.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf25.aql
new file mode 100644
index 0000000..fefc07e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf25.aql
@@ -0,0 +1,23 @@
+/*
+ * Description : Create UDF and invoke with negative inputs.
+ * Expected Res : Failure
+ * Date : 5th Sep 2012
+ */
+
+// This one returns NPE...
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf25.adm";
+
+create function test.computeBonus($pbcRating,$salary)
+{
+ if ($pbcRating = 1) then
+ $salary * 0.25
+ else
+ $salary * 0.10
+}
+
+test.computeBonus(-1,-1)
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf26.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf26.aql
new file mode 100644
index 0000000..95420b7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf26.aql
@@ -0,0 +1,16 @@
+/*
+ * Description : Create UDF and define with missing references.
+ * Expected Res : Failure
+ * Date : Sep 6th 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf26.adm";
+
+create function test.needs_f1($x){
+ $x + f1()
+}
+
+test.needs_f1(12345)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf27.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf27.aql
new file mode 100644
index 0000000..b9db17f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf27.aql
@@ -0,0 +1,20 @@
+/*
+ * Description : Create UDF and invoke UDF from a quantified expression
+ * Expected Res : Success
+ * Date : Sep 6th 2012
+ */
+
+// this test is not giving expected results.
+// issue 194 reported to track this
+
+drop dataverse test if exists;
+create dataverse test;
+
+write output to nc1:"rttest/user-defined-functions_udf27.adm";
+
+create function test.f1(){
+100
+}
+
+let $a := true
+return some $i in [100,200] satisfies test.f1()
diff --git a/asterix-app/src/test/resources/runtimets/queries/year_01.aql b/asterix-app/src/test/resources/runtimets/queries/year_01.aql
deleted file mode 100644
index da93e96..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/year_01.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/year_01.adm";
-
-year("1996-12-01")
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/avg_empty_01.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/avg_empty_01.adm
new file mode 100644
index 0000000..19765bd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/avg_empty_01.adm
@@ -0,0 +1 @@
+null
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/avg_empty_02.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/avg_empty_02.adm
new file mode 100644
index 0000000..19765bd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/avg_empty_02.adm
@@ -0,0 +1 @@
+null
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/count_empty_01.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/count_empty_01.adm
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/count_empty_01.adm
@@ -0,0 +1 @@
+0
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/count_empty_02.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/count_empty_02.adm
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/count_empty_02.adm
@@ -0,0 +1 @@
+0
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/count_null.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/count_null.adm
index df462fe..51d5f4f 100644
--- a/asterix-app/src/test/resources/runtimets/results/aggregate/count_null.adm
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/count_null.adm
@@ -1 +1 @@
-{ "count": 2 }
\ No newline at end of file
+{ "count": null }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_double_null.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_double_null.adm
index 8649548..b11c820 100644
--- a/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_double_null.adm
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_double_null.adm
@@ -1 +1 @@
-{ "sum": null, "count": 2 }
\ No newline at end of file
+{ "sum": null, "count": 1 }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_float_null.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_float_null.adm
index 8649548..b11c820 100644
--- a/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_float_null.adm
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_float_null.adm
@@ -1 +1 @@
-{ "sum": null, "count": 2 }
\ No newline at end of file
+{ "sum": null, "count": 1 }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_int16_null.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_int16_null.adm
index 8649548..b11c820 100644
--- a/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_int16_null.adm
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_int16_null.adm
@@ -1 +1 @@
-{ "sum": null, "count": 2 }
\ No newline at end of file
+{ "sum": null, "count": 1 }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_int32_null.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_int32_null.adm
index 8649548..b11c820 100644
--- a/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_int32_null.adm
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_int32_null.adm
@@ -1 +1 @@
-{ "sum": null, "count": 2 }
\ No newline at end of file
+{ "sum": null, "count": 1 }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_int64_null.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_int64_null.adm
index 8649548..b11c820 100644
--- a/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_int64_null.adm
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_int64_null.adm
@@ -1 +1 @@
-{ "sum": null, "count": 2 }
\ No newline at end of file
+{ "sum": null, "count": 1 }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_int8_null.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_int8_null.adm
index 8649548..b11c820 100644
--- a/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_int8_null.adm
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/local-avg_int8_null.adm
@@ -1 +1 @@
-{ "sum": null, "count": 2 }
\ No newline at end of file
+{ "sum": null, "count": 1 }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/max_empty_01.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/max_empty_01.adm
new file mode 100644
index 0000000..19765bd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/max_empty_01.adm
@@ -0,0 +1 @@
+null
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/max_empty_02.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/max_empty_02.adm
new file mode 100644
index 0000000..19765bd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/max_empty_02.adm
@@ -0,0 +1 @@
+null
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/min_empty_01.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/min_empty_01.adm
new file mode 100644
index 0000000..19765bd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/min_empty_01.adm
@@ -0,0 +1 @@
+null
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/min_empty_02.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/min_empty_02.adm
new file mode 100644
index 0000000..19765bd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/min_empty_02.adm
@@ -0,0 +1 @@
+null
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_avg.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_avg.adm
new file mode 100644
index 0000000..483cb2f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_avg.adm
@@ -0,0 +1,6 @@
+2.0
+2.0
+2.0
+2.0
+2.0
+2.0
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_avg_empty.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_avg_empty.adm
new file mode 100644
index 0000000..19765bd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_avg_empty.adm
@@ -0,0 +1 @@
+null
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_avg_null.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_avg_null.adm
new file mode 100644
index 0000000..0800a91
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_avg_null.adm
@@ -0,0 +1,6 @@
+null
+null
+null
+null
+null
+null
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_count.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_count.adm
new file mode 100644
index 0000000..80f0b99
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_count.adm
@@ -0,0 +1,7 @@
+3
+3
+3
+3
+3
+3
+3
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_count_empty.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_count_empty.adm
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_count_empty.adm
@@ -0,0 +1 @@
+0
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_count_null.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_count_null.adm
new file mode 100644
index 0000000..1abbc3f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_count_null.adm
@@ -0,0 +1,7 @@
+null
+null
+null
+null
+null
+null
+null
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_max.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_max.adm
new file mode 100644
index 0000000..d420c2f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_max.adm
@@ -0,0 +1,8 @@
+3i8
+3i16
+3
+3i64
+3.0f
+3.0d
+"world"
+datetime("2012-03-01T00:00:00.000Z")
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_max_empty.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_max_empty.adm
new file mode 100644
index 0000000..19765bd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_max_empty.adm
@@ -0,0 +1 @@
+null
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_max_null.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_max_null.adm
new file mode 100644
index 0000000..c9f3cb3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_max_null.adm
@@ -0,0 +1,8 @@
+null
+null
+null
+null
+null
+null
+null
+null
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_min.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_min.adm
new file mode 100644
index 0000000..6acf213
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_min.adm
@@ -0,0 +1,8 @@
+1i8
+1i16
+1
+1i64
+1.0f
+1.0d
+"bar"
+datetime("2012-01-01T00:00:00.000Z")
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_min_empty.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_min_empty.adm
new file mode 100644
index 0000000..19765bd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_min_empty.adm
@@ -0,0 +1 @@
+null
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_min_null.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_min_null.adm
new file mode 100644
index 0000000..c9f3cb3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_min_null.adm
@@ -0,0 +1,8 @@
+null
+null
+null
+null
+null
+null
+null
+null
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_sum.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_sum.adm
new file mode 100644
index 0000000..6e7617e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_sum.adm
@@ -0,0 +1,6 @@
+6i8
+6i16
+6
+6i64
+6.0f
+6.0d
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_sum_empty.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_sum_empty.adm
new file mode 100644
index 0000000..19765bd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_sum_empty.adm
@@ -0,0 +1 @@
+null
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_sum_null.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_sum_null.adm
new file mode 100644
index 0000000..0800a91
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_sum_null.adm
@@ -0,0 +1,6 @@
+null
+null
+null
+null
+null
+null
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/sum_empty_01.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/sum_empty_01.adm
new file mode 100644
index 0000000..19765bd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/sum_empty_01.adm
@@ -0,0 +1 @@
+null
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/sum_empty_02.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/sum_empty_02.adm
new file mode 100644
index 0000000..19765bd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/sum_empty_02.adm
@@ -0,0 +1 @@
+null
diff --git a/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv01.adm b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv01.adm
new file mode 100644
index 0000000..83de609
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv01.adm
@@ -0,0 +1 @@
+{ "ug-student": { "id": 457, "name": "John Doe", "age": 22, "sex": "M", "dept": "Dance" }, "prof": { "id": 152, "name": "John Meyer", "age": 42, "sex": "M", "dept": "History" }, "grd-student": { "id": 418, "name": "John Smith", "age": 26, "sex": "M", "dept": "Economics" }, "postdoc": { "id": 259, "name": "Sophia Reece", "age": 36, "sex": "F", "dept": "Anthropology" } }
diff --git a/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv02.adm b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv02.adm
new file mode 100644
index 0000000..f8d0c9d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv02.adm
@@ -0,0 +1,4 @@
+{ "DataverseName": "student", "DatasetName": "gdstd", "DataTypeName": "stdType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Nov 08 13:22:47 PST 2012" }
+{ "DataverseName": "student", "DatasetName": "ugdstd", "DataTypeName": "stdType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Nov 08 13:22:47 PST 2012" }
+{ "DataverseName": "teacher", "DatasetName": "prof", "DataTypeName": "tchrType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Nov 08 13:22:47 PST 2012" }
+{ "DataverseName": "teacher", "DatasetName": "pstdoc", "DataTypeName": "tchrType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Nov 08 13:22:47 PST 2012" }
diff --git a/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv03.adm b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv03.adm
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv03.adm
@@ -0,0 +1 @@
+0
diff --git a/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv04.adm b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv04.adm
new file mode 100644
index 0000000..bd3c0af
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv04.adm
@@ -0,0 +1,4 @@
+{ "DataverseName": "student", "DatasetName": "gdstd", "DataTypeName": "stdType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Nov 08 13:25:37 PST 2012" }
+{ "DataverseName": "student", "DatasetName": "ugdstd", "DataTypeName": "stdType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Nov 08 13:25:37 PST 2012" }
+{ "DataverseName": "teacher", "DatasetName": "prof", "DataTypeName": "tchrType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Nov 08 13:25:37 PST 2012" }
+{ "DataverseName": "teacher", "DatasetName": "pstdoc", "DataTypeName": "tchrType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Thu Nov 08 13:25:37 PST 2012" }
diff --git a/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv07.adm b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv07.adm
new file mode 100644
index 0000000..cebf05b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv07.adm
@@ -0,0 +1 @@
+{ "id": 881, "fname": "Julio", "lname": "Isa", "age": 38, "dept": "Sales" }
diff --git a/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv09.adm b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv09.adm
new file mode 100644
index 0000000..1b2a42c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv09.adm
@@ -0,0 +1 @@
+"function 01"
diff --git a/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv11.adm b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv11.adm
new file mode 100644
index 0000000..490df54
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv11.adm
@@ -0,0 +1 @@
+"function 02"
diff --git a/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv12.adm b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv12.adm
new file mode 100644
index 0000000..552e141
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv12.adm
@@ -0,0 +1 @@
+{ "fun-01": "function 01", "fun-02": "function 02" }
diff --git a/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv14.adm b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv14.adm
new file mode 100644
index 0000000..29d6383
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv14.adm
@@ -0,0 +1 @@
+100
diff --git a/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv15.adm b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv15.adm
new file mode 100644
index 0000000..05deeeb
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv15.adm
@@ -0,0 +1,3 @@
+{ "DataverseName": "testdv1", "Name": "fun01", "Arity": "0", "Params": [ ], "ReturnType": "VOID", "Definition": "100", "Language": "AQL", "Kind": "SCALAR" }
+{ "DataverseName": "testdv1", "Name": "fun02", "Arity": "1", "Params": [ "$a" ], "ReturnType": "VOID", "Definition": "\"function 02\"", "Language": "AQL", "Kind": "SCALAR" }
+{ "DataverseName": "testdv1", "Name": "fun03", "Arity": "2", "Params": [ "$b", "$c" ], "ReturnType": "VOID", "Definition": "$b+$c", "Language": "AQL", "Kind": "SCALAR" }
diff --git a/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv17.adm b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv17.adm
new file mode 100644
index 0000000..cd358f1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv17.adm
@@ -0,0 +1,2 @@
+[ { "l": { "id": 21 }, "m": { "id": 21 } }, { "l": { "id": 23 }, "m": { "id": 21 } }, { "l": { "id": 21 }, "m": { "id": 23 } }, { "l": { "id": 23 }, "m": { "id": 23 } }, { "l": { "id": 21 }, "m": { "id": 24 } }, { "l": { "id": 23 }, "m": { "id": 24 } }, { "l": { "id": 21 }, "m": { "id": 44 } }, { "l": { "id": 23 }, "m": { "id": 44 } }, { "l": { "id": 21 }, "m": { "id": 64 } }, { "l": { "id": 23 }, "m": { "id": 64 } } ]
+[ { "l": { "id": 24 }, "m": { "id": 21 } }, { "l": { "id": 44 }, "m": { "id": 21 } }, { "l": { "id": 64 }, "m": { "id": 21 } }, { "l": { "id": 24 }, "m": { "id": 23 } }, { "l": { "id": 44 }, "m": { "id": 23 } }, { "l": { "id": 64 }, "m": { "id": 23 } }, { "l": { "id": 24 }, "m": { "id": 24 } }, { "l": { "id": 44 }, "m": { "id": 24 } }, { "l": { "id": 64 }, "m": { "id": 24 } }, { "l": { "id": 24 }, "m": { "id": 44 } }, { "l": { "id": 44 }, "m": { "id": 44 } }, { "l": { "id": 64 }, "m": { "id": 44 } }, { "l": { "id": 24 }, "m": { "id": 64 } }, { "l": { "id": 44 }, "m": { "id": 64 } }, { "l": { "id": 64 }, "m": { "id": 64 } } ]
diff --git a/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv19.adm b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv19.adm
new file mode 100644
index 0000000..be94bc8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/cross-dv19.adm
@@ -0,0 +1,7 @@
+{ "DataverseName": "test1", "DatasetName": "TwitterData", "DataTypeName": "Tweet", "DatasetType": "EXTERNAL", "InternalDetails": null, "ExternalDetails": { "DatasourceAdapter": "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter", "Properties": [ { "Name": "path", "Value": "nc1://data/twitter/extrasmalltweets.txt" }, { "Name": "format", "Value": "adm" } ] }, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:41:21 PST 2012" }
+{ "DataverseName": "test1", "DatasetName": "t1", "DataTypeName": "testtype", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:41:21 PST 2012" }
+{ "DataverseName": "test1", "DatasetName": "t2", "DataTypeName": "testtype", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:41:21 PST 2012" }
+{ "DataverseName": "test1", "DatasetName": "t3", "DataTypeName": "testtype", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:41:21 PST 2012" }
+{ "DataverseName": "test2", "DatasetName": "t2", "DataTypeName": "testtype", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:41:21 PST 2012" }
+{ "DataverseName": "test2", "DatasetName": "t3", "DataTypeName": "testtype", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:41:21 PST 2012" }
+{ "DataverseName": "test2", "DatasetName": "t4", "DataTypeName": "testtype", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:41:21 PST 2012" }
diff --git a/asterix-app/src/test/resources/runtimets/only.txt b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/drop_dataset.adm
similarity index 100%
copy from asterix-app/src/test/resources/runtimets/only.txt
copy to asterix-app/src/test/resources/runtimets/results/cross-dataverse/drop_dataset.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/cross-dataverse/insert_across_dataverses.adm b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/insert_across_dataverses.adm
new file mode 100644
index 0000000..f3449f0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/insert_across_dataverses.adm
@@ -0,0 +1,5 @@
+{ "cid": 0, "name": "Mike ley", "cashBack": 600, "age": null, "address": null, "lastorder": { "oid": 258, "total": 368.61862f } }
+{ "cid": 1, "name": "Mike Carey", "cashBack": 650, "age": null, "address": { "number": 389, "street": "Hill St.", "city": "Mountain View" }, "lastorder": { "oid": 18, "total": 338.61862f } }
+{ "cid": 4, "name": "Mary Carey", "cashBack": 450, "age": 12, "address": { "number": 8, "street": "Hill St.", "city": "Mountain View" }, "lastorder": { "oid": 4545, "total": 87.61863f } }
+{ "cid": 5, "name": "Jodi Alex", "cashBack": 350, "age": 19, "address": null, "lastorder": { "oid": 48, "total": 318.61862f } }
+{ "cid": 775, "name": "Jodi Rotruck", "cashBack": 100, "age": null, "address": { "number": 8389, "street": "Hill St.", "city": "Mountain View" }, "lastorder": { "oid": 66, "total": 38.618626f } }
diff --git a/asterix-app/src/test/resources/runtimets/results/cross-dataverse/insert_from_source_dataset.adm b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/insert_from_source_dataset.adm
new file mode 100644
index 0000000..2d65d9a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/insert_from_source_dataset.adm
@@ -0,0 +1,10 @@
+{ "id": 201, "name": "Kelvin" }
+{ "id": 219, "name": "Sam" }
+{ "id": 257, "name": "Sammy" }
+{ "id": 321, "name": "Bobby" }
+{ "id": 351, "name": "Bob" }
+{ "id": 438, "name": "Ravi" }
+{ "id": 456, "name": "Roger" }
+{ "id": 482, "name": "Kevin" }
+{ "id": 851, "name": "Ricardo" }
+{ "id": 926, "name": "Richard" }
diff --git a/asterix-app/src/test/resources/runtimets/results/cross-dataverse/join_across_dataverses.adm b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/join_across_dataverses.adm
new file mode 100644
index 0000000..87619a8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/join_across_dataverses.adm
@@ -0,0 +1,3 @@
+{ "cust_name": "Jodi Alex", "cust_age": 19, "order_total": 7.206f, "orderList": [ 10, 5 ], "orderList": {{ 10, 5 }} }
+{ "cust_name": "Jodi Rotruck", "cust_age": null, "order_total": 14.2326f, "orderList": [ 10, 775 ], "orderList": {{ 10, 775 }} }
+{ "cust_name": "Jodi Rotruck", "cust_age": null, "order_total": 97.20656f, "orderList": [ 1000, 775 ], "orderList": {{ 1000, 775 }} }
diff --git a/asterix-app/src/test/resources/runtimets/results/cross-dataverse/metadata_dataset.adm b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/metadata_dataset.adm
new file mode 100644
index 0000000..8abc339
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/cross-dataverse/metadata_dataset.adm
@@ -0,0 +1,8 @@
+{ "DataverseName": "Metadata", "DatasetName": "Dataset", "DataTypeName": "DatasetRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName" ], "PrimaryKey": [ "DataverseName", "DatasetName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "DatasourceAdapter", "DataTypeName": "DatasourceAdapterRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "Name" ], "PrimaryKey": [ "DataverseName", "Name" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Datatype", "DataTypeName": "DatatypeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatatypeName" ], "PrimaryKey": [ "DataverseName", "DatatypeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataverse", "DataTypeName": "DataverseRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName" ], "PrimaryKey": [ "DataverseName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Function", "DataTypeName": "FunctionRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "Name", "Arity" ], "PrimaryKey": [ "DataverseName", "Name", "Arity" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Index", "DataTypeName": "IndexRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName", "IndexName" ], "PrimaryKey": [ "DataverseName", "DatasetName", "IndexName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Node", "DataTypeName": "NodeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "NodeName" ], "PrimaryKey": [ "NodeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Nodegroup", "DataTypeName": "NodeGroupRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "GroupName" ], "PrimaryKey": [ "GroupName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:33:40 PST 2012" }
diff --git a/asterix-app/src/test/resources/runtimets/results/dml/query-issue205.adm b/asterix-app/src/test/resources/runtimets/results/dml/query-issue205.adm
new file mode 100644
index 0000000..ea80112
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/dml/query-issue205.adm
@@ -0,0 +1 @@
+{ "id": "5678", "stat": { "age": 40, "salary": 100000 }, "deptCode": 16 }
diff --git a/asterix-app/src/test/resources/runtimets/results/feeds/feeds_01.adm b/asterix-app/src/test/resources/runtimets/results/feeds/feeds_01.adm
new file mode 100644
index 0000000..17d8d1d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/feeds/feeds_01.adm
@@ -0,0 +1 @@
+{ "DataverseName": "feeds", "DatasetName": "TweetFeed", "DataTypeName": "TweetType", "DatasetType": "FEED", "InternalDetails": null, "ExternalDetails": null, "FeedDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES", "DatasourceAdapter": "edu.uci.ics.asterix.tools.external.data.RateControlledFileSystemBasedAdapterFactory", "Properties": [ { "Name": "output-type-name", "Value": "TweetType" }, { "Name": "fs", "Value": "localfs" }, { "Name": "path", "Value": "nc1://data/twitter/obamatweets.adm" }, { "Name": "format", "Value": "adm" }, { "Name": "tuple-interval", "Value": "10" } ], "Function": null, "Status": "INACTIVE" }, "Timestamp": "Mon Dec 24 13:51:31 PST 2012" }
diff --git a/asterix-app/src/test/resources/runtimets/results/feeds/feeds_02.adm b/asterix-app/src/test/resources/runtimets/results/feeds/feeds_02.adm
new file mode 100644
index 0000000..9720960
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/feeds/feeds_02.adm
@@ -0,0 +1,12 @@
+{ "id": "nc1:1", "username": "BronsonMike", "location": "", "text": "@GottaLaff @reutersus Christie and obama just foul weather friends", "timestamp": "Thu Dec 06 16:53:06 PST 2012" }
+{ "id": "nc1:100", "username": "KidrauhlProuds", "location": "", "text": "RT @01Direclieber: A filha do Michael Jackson uma Belieber,a filha do Eminem e uma Belieber,as filhas de Obama sao Beliebers, e a filha do meu pai e Belieber", "timestamp": "Thu Dec 06 16:53:16 PST 2012" }
+{ "id": "nc1:102", "username": "jaysauce82", "location": "", "text": "Not voting for President Obama #BadDecision", "timestamp": "Thu Dec 06 16:53:16 PST 2012" }
+{ "id": "nc1:104", "username": "princeofsupras", "location": "", "text": "RT @01Direclieber: A filha do Michael Jackson e uma Belieber,a filha do Eminem e uma Belieber,as filhas de Obama sao Beliebers, e a filha do meu pai e Belieber", "timestamp": "Thu Dec 06 16:53:15 PST 2012" }
+{ "id": "nc1:106", "username": "GulfDogs", "location": "", "text": "Obama Admin Knew Libyan Terrorists Had US-Provided Weaponsteaparty #tcot #ccot #NewGuards #BreitbartArmy #patriotwttp://t.co/vJxzrQUE", "timestamp": "Thu Dec 06 16:53:14 PST 2012" }
+{ "id": "nc1:108", "username": "Laugzpz", "location": "", "text": "@AlfredoJalife Maestro Obama se hace de la vista gorda, es un acuerdo de siempre creo yo.", "timestamp": "Thu Dec 06 16:53:14 PST 2012" }
+{ "id": "nc1:11", "username": "magarika", "location": "", "text": "RT @ken24xavier: Obama tells SOROS - our plan is ALMOST finished http://t.co/WvzK0GtU", "timestamp": "Thu Dec 06 16:53:05 PST 2012" }
+{ "id": "nc1:111", "username": "ToucanMall", "location": "", "text": "RT @WorldWar3Watch: Michelle Obama Gets More Grammy Nominations Than Justin ... #Obama #WW3 http://t.co/0Wv2GKij", "timestamp": "Thu Dec 06 16:53:13 PST 2012" }
+{ "id": "nc1:113", "username": "ToucanMall", "location": "", "text": "RT @ObamaPalooza: Tiffany Shared What $2,000 Meant to Her ... and the President Stopped by to Talk About It http://t.co/sgT7lsNV #Obama", "timestamp": "Thu Dec 06 16:53:12 PST 2012" }
+{ "id": "nc1:115", "username": "thewildpitch", "location": "", "text": "RT @RevkahJC: Dennis Miller: Obama Should Just Say He Wants To Tax Successful People http://t.co/Ihlemy9Y", "timestamp": "Thu Dec 06 16:53:11 PST 2012" }
+{ "id": "nc1:117", "username": "Rnugent24", "location": "", "text": "RT @ConservativeQuo: unemployment is above 8% again. I wonder how long it will take for Obama to start blaming Bush? 3-2-1 #tcot #antiobama", "timestamp": "Thu Dec 06 16:53:10 PST 2012" }
+{ "id": "nc1:119", "username": "ToucanMall", "location": "", "text": "RT @Newitrsdotcom: I hope #Obama will win re-election... Other four years without meaningless #wars", "timestamp": "Thu Dec 06 16:53:09 PST 2012" }
diff --git a/asterix-app/src/test/resources/runtimets/results/feeds/feeds_03.adm b/asterix-app/src/test/resources/runtimets/results/feeds/feeds_03.adm
new file mode 100644
index 0000000..2fd80d983
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/feeds/feeds_03.adm
@@ -0,0 +1 @@
+{ "DataverseName": "feeds", "DatasetName": "TweetFeed", "DataTypeName": "TweetType", "DatasetType": "FEED", "InternalDetails": null, "ExternalDetails": null, "FeedDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES", "DatasourceAdapter": "edu.uci.ics.asterix.tools.external.data.RateControlledFileSystemBasedAdapterFactory", "Properties": [ { "Name": "output-type-name", "Value": "TweetType" }, { "Name": "fs", "Value": "localfs" }, { "Name": "path", "Value": "nc1://data/twitter/obamatweets.adm" }, { "Name": "format", "Value": "adm" }, { "Name": "tuple-interval", "Value": "10" } ], "Function": "feeds.feed_processor@1", "Status": "INACTIVE" }, "Timestamp": "Mon Dec 24 13:49:20 PST 2012" }
diff --git a/asterix-app/src/test/resources/runtimets/results/feeds/feeds_04.adm b/asterix-app/src/test/resources/runtimets/results/feeds/feeds_04.adm
new file mode 100644
index 0000000..2567483
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/feeds/feeds_04.adm
@@ -0,0 +1,11 @@
+{ "id": "nc1:1", "username": "BronsonMike", "location": "", "text": "@GottaLaff @reutersus Christie and obama just foul weather friends", "timestamp": "Thu Dec 06 16:53:06 PST 2012" }
+{ "id": "nc1:100", "username": "KidrauhlProuds", "location": "", "text": "RT @01Direclieber: A filha do Michael Jackson uma Belieber,a filha do Eminem e uma Belieber,as filhas de Obama sao Beliebers, e a filha do meu pai e Belieber", "timestamp": "Thu Dec 06 16:53:16 PST 2012" }
+{ "id": "nc1:102", "username": "jaysauce82", "location": "", "text": "Not voting for President Obama #BadDecision", "timestamp": "Thu Dec 06 16:53:16 PST 2012" }
+{ "id": "nc1:104", "username": "princeofsupras", "location": "", "text": "RT @01Direclieber: A filha do Michael Jackson e uma Belieber,a filha do Eminem e uma Belieber,as filhas de Obama sao Beliebers, e a filha do meu pai e Belieber", "timestamp": "Thu Dec 06 16:53:15 PST 2012" }
+{ "id": "nc1:106", "username": "GulfDogs", "location": "", "text": "Obama Admin Knew Libyan Terrorists Had US-Provided Weaponsteaparty #tcot #ccot #NewGuards #BreitbartArmy #patriotwttp://t.co/vJxzrQUE", "timestamp": "Thu Dec 06 16:53:14 PST 2012" }
+{ "id": "nc1:108", "username": "Laugzpz", "location": "", "text": "@AlfredoJalife Maestro Obama se hace de la vista gorda, es un acuerdo de siempre creo yo.", "timestamp": "Thu Dec 06 16:53:14 PST 2012" }
+{ "id": "nc1:11", "username": "magarika", "location": "", "text": "RT @ken24xavier: Obama tells SOROS - our plan is ALMOST finished http://t.co/WvzK0GtU", "timestamp": "Thu Dec 06 16:53:05 PST 2012" }
+{ "id": "nc1:111", "username": "ToucanMall", "location": "", "text": "RT @WorldWar3Watch: Michelle Obama Gets More Grammy Nominations Than Justin ... #Obama #WW3 http://t.co/0Wv2GKij", "timestamp": "Thu Dec 06 16:53:13 PST 2012" }
+{ "id": "nc1:113", "username": "ToucanMall", "location": "", "text": "RT @ObamaPalooza: Tiffany Shared What $2,000 Meant to Her ... and the President Stopped by to Talk About It http://t.co/sgT7lsNV #Obama", "timestamp": "Thu Dec 06 16:53:12 PST 2012" }
+{ "id": "nc1:115", "username": "thewildpitch", "location": "", "text": "RT @RevkahJC: Dennis Miller: Obama Should Just Say He Wants To Tax Successful People http://t.co/Ihlemy9Y", "timestamp": "Thu Dec 06 16:53:11 PST 2012" }
+{ "id": "nc1:117", "username": "Rnugent24", "location": "", "text": "RT @ConservativeQuo: unemployment is above 8% again. I wonder how long it will take for Obama to start blaming Bush? 3-2-1 #tcot #antiobama", "timestamp": "Thu Dec 06 16:53:10 PST 2012" }
diff --git a/asterix-app/src/test/resources/runtimets/results/feeds/issue_230_feeds.adm b/asterix-app/src/test/resources/runtimets/results/feeds/issue_230_feeds.adm
new file mode 100644
index 0000000..9720960
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/feeds/issue_230_feeds.adm
@@ -0,0 +1,12 @@
+{ "id": "nc1:1", "username": "BronsonMike", "location": "", "text": "@GottaLaff @reutersus Christie and obama just foul weather friends", "timestamp": "Thu Dec 06 16:53:06 PST 2012" }
+{ "id": "nc1:100", "username": "KidrauhlProuds", "location": "", "text": "RT @01Direclieber: A filha do Michael Jackson uma Belieber,a filha do Eminem e uma Belieber,as filhas de Obama sao Beliebers, e a filha do meu pai e Belieber", "timestamp": "Thu Dec 06 16:53:16 PST 2012" }
+{ "id": "nc1:102", "username": "jaysauce82", "location": "", "text": "Not voting for President Obama #BadDecision", "timestamp": "Thu Dec 06 16:53:16 PST 2012" }
+{ "id": "nc1:104", "username": "princeofsupras", "location": "", "text": "RT @01Direclieber: A filha do Michael Jackson e uma Belieber,a filha do Eminem e uma Belieber,as filhas de Obama sao Beliebers, e a filha do meu pai e Belieber", "timestamp": "Thu Dec 06 16:53:15 PST 2012" }
+{ "id": "nc1:106", "username": "GulfDogs", "location": "", "text": "Obama Admin Knew Libyan Terrorists Had US-Provided Weaponsteaparty #tcot #ccot #NewGuards #BreitbartArmy #patriotwttp://t.co/vJxzrQUE", "timestamp": "Thu Dec 06 16:53:14 PST 2012" }
+{ "id": "nc1:108", "username": "Laugzpz", "location": "", "text": "@AlfredoJalife Maestro Obama se hace de la vista gorda, es un acuerdo de siempre creo yo.", "timestamp": "Thu Dec 06 16:53:14 PST 2012" }
+{ "id": "nc1:11", "username": "magarika", "location": "", "text": "RT @ken24xavier: Obama tells SOROS - our plan is ALMOST finished http://t.co/WvzK0GtU", "timestamp": "Thu Dec 06 16:53:05 PST 2012" }
+{ "id": "nc1:111", "username": "ToucanMall", "location": "", "text": "RT @WorldWar3Watch: Michelle Obama Gets More Grammy Nominations Than Justin ... #Obama #WW3 http://t.co/0Wv2GKij", "timestamp": "Thu Dec 06 16:53:13 PST 2012" }
+{ "id": "nc1:113", "username": "ToucanMall", "location": "", "text": "RT @ObamaPalooza: Tiffany Shared What $2,000 Meant to Her ... and the President Stopped by to Talk About It http://t.co/sgT7lsNV #Obama", "timestamp": "Thu Dec 06 16:53:12 PST 2012" }
+{ "id": "nc1:115", "username": "thewildpitch", "location": "", "text": "RT @RevkahJC: Dennis Miller: Obama Should Just Say He Wants To Tax Successful People http://t.co/Ihlemy9Y", "timestamp": "Thu Dec 06 16:53:11 PST 2012" }
+{ "id": "nc1:117", "username": "Rnugent24", "location": "", "text": "RT @ConservativeQuo: unemployment is above 8% again. I wonder how long it will take for Obama to start blaming Bush? 3-2-1 #tcot #antiobama", "timestamp": "Thu Dec 06 16:53:10 PST 2012" }
+{ "id": "nc1:119", "username": "ToucanMall", "location": "", "text": "RT @Newitrsdotcom: I hope #Obama will win re-election... Other four years without meaningless #wars", "timestamp": "Thu Dec 06 16:53:09 PST 2012" }
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/ret-01.adm b/asterix-app/src/test/resources/runtimets/results/flwor/ret-01.adm
new file mode 100644
index 0000000..930236d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/ret-01.adm
@@ -0,0 +1,8 @@
+3
+6
+6
+5
+5
+5
+7
+6
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/ret-02.adm b/asterix-app/src/test/resources/runtimets/results/flwor/ret-02.adm
new file mode 100644
index 0000000..f38fb92
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/ret-02.adm
@@ -0,0 +1 @@
+"this is a test string"
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/ret-03.adm b/asterix-app/src/test/resources/runtimets/results/flwor/ret-03.adm
new file mode 100644
index 0000000..f42d61b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/ret-03.adm
@@ -0,0 +1 @@
+"YES"
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/ret-04.adm b/asterix-app/src/test/resources/runtimets/results/flwor/ret-04.adm
new file mode 100644
index 0000000..e236a3d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/ret-04.adm
@@ -0,0 +1 @@
+"GREATER"
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/ret-05.adm b/asterix-app/src/test/resources/runtimets/results/flwor/ret-05.adm
new file mode 100644
index 0000000..63aa2a3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/ret-05.adm
@@ -0,0 +1 @@
+[ [ 1, 2, 3 ], [ 4, 5, 6, 7 ], [ 8, 9 ], [ 0, 4, 5 ], [ 6, 7, 1 ], [ 2, 3, 4 ], [ 5, 6, 7 ], [ 8, 9, 0 ] ]
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/ret-06.adm b/asterix-app/src/test/resources/runtimets/results/flwor/ret-06.adm
new file mode 100644
index 0000000..438d43b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/ret-06.adm
@@ -0,0 +1 @@
+{{ "Welcome", "UCI", "Anteater", "DBH", "ICS" }}
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/ret-07.adm b/asterix-app/src/test/resources/runtimets/results/flwor/ret-07.adm
new file mode 100644
index 0000000..6578fd5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/ret-07.adm
@@ -0,0 +1 @@
+{ }
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/ret-08.adm b/asterix-app/src/test/resources/runtimets/results/flwor/ret-08.adm
new file mode 100644
index 0000000..bb40282
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/ret-08.adm
@@ -0,0 +1,8 @@
+{ "a": 1, "inner-for": [ 11, 22, 33, 44, 55, 66, 77, 88 ] }
+{ "a": 2, "inner-for": [ 11, 22, 33, 44, 55, 66, 77, 88 ] }
+{ "a": 3, "inner-for": [ 11, 22, 33, 44, 55, 66, 77, 88 ] }
+{ "a": 4, "inner-for": [ 11, 22, 33, 44, 55, 66, 77, 88 ] }
+{ "a": 5, "inner-for": [ 11, 22, 33, 44, 55, 66, 77, 88 ] }
+{ "a": 6, "inner-for": [ 11, 22, 33, 44, 55, 66, 77, 88 ] }
+{ "a": 7, "inner-for": [ 11, 22, 33, 44, 55, 66, 77, 88 ] }
+{ "a": 8, "inner-for": [ 11, 22, 33, 44, 55, 66, 77, 88 ] }
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/ret-09.adm b/asterix-app/src/test/resources/runtimets/results/flwor/ret-09.adm
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/ret-09.adm
@@ -0,0 +1 @@
+1
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/ret-10.adm b/asterix-app/src/test/resources/runtimets/results/flwor/ret-10.adm
new file mode 100644
index 0000000..e53eaa1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/ret-10.adm
@@ -0,0 +1,10 @@
+1
+2
+3
+4
+5
+6
+7
+8
+9
+0
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/ret-11.adm b/asterix-app/src/test/resources/runtimets/results/flwor/ret-11.adm
new file mode 100644
index 0000000..4fd875a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/ret-11.adm
@@ -0,0 +1,9 @@
+2
+3
+4
+5
+6
+7
+8
+9
+10
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/ret-12.adm b/asterix-app/src/test/resources/runtimets/results/flwor/ret-12.adm
new file mode 100644
index 0000000..1000f90
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/ret-12.adm
@@ -0,0 +1,9 @@
+0
+1
+2
+3
+4
+5
+6
+7
+8
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/ret-13.adm b/asterix-app/src/test/resources/runtimets/results/flwor/ret-13.adm
new file mode 100644
index 0000000..eb62fa2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/ret-13.adm
@@ -0,0 +1,9 @@
+9
+18
+27
+36
+45
+54
+63
+72
+81
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/ret-14.adm b/asterix-app/src/test/resources/runtimets/results/flwor/ret-14.adm
new file mode 100644
index 0000000..734a18a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/ret-14.adm
@@ -0,0 +1 @@
+{ "name": "John Doe", "age": 26, "sex": "M", "salary": 50000, "dept": "HR" }
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/ret-15.adm b/asterix-app/src/test/resources/runtimets/results/flwor/ret-15.adm
new file mode 100644
index 0000000..c508d53
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/ret-15.adm
@@ -0,0 +1 @@
+false
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/ret-16.adm b/asterix-app/src/test/resources/runtimets/results/flwor/ret-16.adm
new file mode 100644
index 0000000..27ba77d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/ret-16.adm
@@ -0,0 +1 @@
+true
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/ret-17.adm b/asterix-app/src/test/resources/runtimets/results/flwor/ret-17.adm
new file mode 100644
index 0000000..27ba77d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/ret-17.adm
@@ -0,0 +1 @@
+true
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/ret-18.adm b/asterix-app/src/test/resources/runtimets/results/flwor/ret-18.adm
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/ret-18.adm
@@ -0,0 +1 @@
+7
diff --git a/asterix-app/src/test/resources/runtimets/only.txt b/asterix-app/src/test/resources/runtimets/results/fuzzyjoin/dblp-aqlplus_2.adm
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/only.txt
rename to asterix-app/src/test/resources/runtimets/results/fuzzyjoin/dblp-aqlplus_2.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/hdfs/hdfs_02.adm b/asterix-app/src/test/resources/runtimets/results/hdfs/hdfs_02.adm
new file mode 100644
index 0000000..d7ae022
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/hdfs/hdfs_02.adm
@@ -0,0 +1,5 @@
+{ "word": "am", "count": 1 }
+{ "word": "grover", "count": 1 }
+{ "word": "hi", "count": 1 }
+{ "word": "i", "count": 1 }
+{ "word": "raman", "count": 1 }
diff --git a/asterix-app/src/test/resources/runtimets/results/hdfs/hdfs_03.adm b/asterix-app/src/test/resources/runtimets/results/hdfs/hdfs_03.adm
new file mode 100644
index 0000000..1033913
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/hdfs/hdfs_03.adm
@@ -0,0 +1,93 @@
+{ "word": "a", "count": 68 }
+{ "word": "addressing", "count": 34 }
+{ "word": "an", "count": 34 }
+{ "word": "analyzing", "count": 68 }
+{ "word": "and", "count": 238 }
+{ "word": "areas", "count": 34 }
+{ "word": "asterix", "count": 102 }
+{ "word": "by", "count": 34 }
+{ "word": "cases", "count": 68 }
+{ "word": "clusters", "count": 68 }
+{ "word": "combining", "count": 34 }
+{ "word": "commodity", "count": 34 }
+{ "word": "computing", "count": 102 }
+{ "word": "content", "count": 34 }
+{ "word": "create", "count": 34 }
+{ "word": "data", "count": 238 }
+{ "word": "database", "count": 34 }
+{ "word": "databases", "count": 34 }
+{ "word": "datum", "count": 34 }
+{ "word": "declarative", "count": 34 }
+{ "word": "developing", "count": 34 }
+{ "word": "distinct", "count": 34 }
+{ "word": "each", "count": 34 }
+{ "word": "for", "count": 34 }
+{ "word": "formats", "count": 34 }
+{ "word": "from", "count": 68 }
+{ "word": "generation", "count": 34 }
+{ "word": "highly", "count": 68 }
+{ "word": "ideas", "count": 34 }
+{ "word": "including", "count": 34 }
+{ "word": "indexing", "count": 68 }
+{ "word": "information", "count": 136 }
+{ "word": "ingesting", "count": 34 }
+{ "word": "intensive", "count": 68 }
+{ "word": "irregular", "count": 34 }
+{ "word": "is", "count": 204 }
+{ "word": "issues", "count": 34 }
+{ "word": "large", "count": 68 }
+{ "word": "managing", "count": 34 }
+{ "word": "merging", "count": 34 }
+{ "word": "much", "count": 34 }
+{ "word": "new", "count": 34 }
+{ "word": "next", "count": 34 }
+{ "word": "nothing", "count": 34 }
+{ "word": "of", "count": 136 }
+{ "word": "on", "count": 102 }
+{ "word": "open", "count": 68 }
+{ "word": "parallel", "count": 68 }
+{ "word": "performant", "count": 34 }
+{ "word": "platform", "count": 34 }
+{ "word": "problem", "count": 34 }
+{ "word": "processing", "count": 34 }
+{ "word": "project", "count": 68 }
+{ "word": "quantities", "count": 34 }
+{ "word": "query", "count": 34 }
+{ "word": "querying", "count": 34 }
+{ "word": "range", "count": 34 }
+{ "word": "ranging", "count": 34 }
+{ "word": "regular", "count": 34 }
+{ "word": "research", "count": 34 }
+{ "word": "running", "count": 34 }
+{ "word": "scalable", "count": 34 }
+{ "word": "scales", "count": 34 }
+{ "word": "semi", "count": 170 }
+{ "word": "shared", "count": 34 }
+{ "word": "software", "count": 34 }
+{ "word": "solutions", "count": 34 }
+{ "word": "source", "count": 34 }
+{ "word": "stance", "count": 34 }
+{ "word": "storage", "count": 34 }
+{ "word": "storing", "count": 34 }
+{ "word": "structured", "count": 170 }
+{ "word": "subscribing", "count": 34 }
+{ "word": "support", "count": 34 }
+{ "word": "tagged", "count": 34 }
+{ "word": "taking", "count": 34 }
+{ "word": "targets", "count": 34 }
+{ "word": "techniques", "count": 68 }
+{ "word": "technologies", "count": 34 }
+{ "word": "textual", "count": 34 }
+{ "word": "that", "count": 34 }
+{ "word": "the", "count": 102 }
+{ "word": "three", "count": 34 }
+{ "word": "to", "count": 170 }
+{ "word": "todays", "count": 34 }
+{ "word": "use", "count": 68 }
+{ "word": "vast", "count": 34 }
+{ "word": "very", "count": 34 }
+{ "word": "well", "count": 34 }
+{ "word": "where", "count": 68 }
+{ "word": "wide", "count": 34 }
+{ "word": "with", "count": 34 }
+{ "word": "yet", "count": 34 }
diff --git a/asterix-app/src/test/resources/runtimets/results/hdfs/issue_245_hdfs.adm b/asterix-app/src/test/resources/runtimets/results/hdfs/issue_245_hdfs.adm
new file mode 100644
index 0000000..8af2f5f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/hdfs/issue_245_hdfs.adm
@@ -0,0 +1,4 @@
+{ "line": "The ASTERIX project is developing new technologies for ingesting, storing, managing, indexing, querying, analyzing, and subscribing to vast quantities of semi-structured information" }
+{ "line": "The project is combining ideas from three distinct areas semi-structured data, parallel databases, and data-intensive computing to create a next-generation, open source software platform that scales by running on large, shared-nothing commodity computing clusters" }
+{ "line": "ASTERIX targets a wide range of semi-structured information, ranging from data use cases where information is well-tagged and highly regular to content use cases where data is irregular and much of each datum is textual" }
+{ "line": "ASTERIX is taking an open stance on data formats and addressing research issues including highly scalable data storage and indexing, semi-structured query processing on very large clusters, and merging parallel database techniques with todays data-intensive computing techniques to support performant yet declarative solutions to the problem of analyzing semi-structured information" }
diff --git a/asterix-app/src/test/resources/runtimets/results/index-join/btree-primary-equi-join.adm b/asterix-app/src/test/resources/runtimets/results/index-join/btree-primary-equi-join.adm
new file mode 100644
index 0000000..bc2a454
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/index-join/btree-primary-equi-join.adm
@@ -0,0 +1,3 @@
+{ "cid": 5, "oid": 10 }
+{ "cid": 775, "oid": 10 }
+{ "cid": 775, "oid": 1000 }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-equi-join.adm b/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-equi-join.adm
new file mode 100644
index 0000000..7dcc1fc
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-equi-join.adm
@@ -0,0 +1,5 @@
+{ "aid": 5, "bid": 98, "authors": "Umeshwar Dayal Eric N. Hanson Jennifer Widom" }
+{ "aid": 34, "bid": 57, "authors": "" }
+{ "aid": 54, "bid": 91, "authors": "Lynn Andrea Stein Henry Lieberman David Ungar" }
+{ "aid": 68, "bid": 57, "authors": "" }
+{ "aid": 69, "bid": 57, "authors": "" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/index-join/inverted-index-ngram-jaccard.adm b/asterix-app/src/test/resources/runtimets/results/index-join/inverted-index-ngram-jaccard.adm
deleted file mode 100644
index c54133f..0000000
--- a/asterix-app/src/test/resources/runtimets/results/index-join/inverted-index-ngram-jaccard.adm
+++ /dev/null
@@ -1,7 +0,0 @@
-{ "arec": "Transaction Management in Multidatabase Systems.", "brec": "Overview of Multidatabase Transaction Management" }
-{ "arec": "Transaction Management in Multidatabase Systems.", "brec": "Overview of Multidatabase Transaction Management" }
-{ "arec": "Active Database Systems.", "brec": "Active Database Systems" }
-{ "arec": "Specification and Execution of Transactional Workflows.", "brec": "Specification and Execution of Transactional Workflows" }
-{ "arec": "Integrated Office Systems.", "brec": "Integrated Office Systems" }
-{ "arec": "Integrated Office Systems.", "brec": "Integrated Office Systems" }
-{ "arec": "A Shared View of Sharing The Treaty of Orlando.", "brec": "A Shared View of Sharing The Treaty of Orlando" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/index-join/inverted-index-olist-edit-distance.adm b/asterix-app/src/test/resources/runtimets/results/index-join/inverted-index-olist-edit-distance.adm
deleted file mode 100644
index 99d6623..0000000
--- a/asterix-app/src/test/resources/runtimets/results/index-join/inverted-index-olist-edit-distance.adm
+++ /dev/null
@@ -1,157 +0,0 @@
-{ "arec": { "cid": 8, "name": "Audria Haylett", "age": 44, "address": { "number": 4872, "street": "Washington St.", "city": "Portland" }, "interests": [ "Cooking", "Fishing", "Video Games" ], "children": [ { "name": "Lacie Haylett", "age": 19 } ] }, "brec": { "cid": 563, "name": "Deirdre Landero", "age": null, "address": null, "interests": [ "Books", "Fishing", "Video Games" ], "children": [ { "name": "Norman Landero", "age": 59 }, { "name": "Jennine Landero", "age": 45 }, { "name": "Rutha Landero", "age": 19 }, { "name": "Jackie Landero", "age": 29 } ] } }
-{ "arec": { "cid": 16, "name": "Felisa Auletta", "age": 55, "address": { "number": 7737, "street": "View St.", "city": "San Jose" }, "interests": [ "Skiing", "Coffee", "Wine" ], "children": [ { "name": "Rosalia Auletta", "age": 36 } ] }, "brec": { "cid": 273, "name": "Corrinne Seaquist", "age": 24, "address": { "number": 6712, "street": "7th St.", "city": "Portland" }, "interests": [ "Puzzles", "Coffee", "Wine" ], "children": [ { "name": "Mignon Seaquist", "age": null }, { "name": "Leo Seaquist", "age": null } ] } }
-{ "arec": { "cid": 16, "name": "Felisa Auletta", "age": 55, "address": { "number": 7737, "street": "View St.", "city": "San Jose" }, "interests": [ "Skiing", "Coffee", "Wine" ], "children": [ { "name": "Rosalia Auletta", "age": 36 } ] }, "brec": { "cid": 618, "name": "Janella Hurtt", "age": null, "address": null, "interests": [ "Skiing", "Coffee", "Skiing" ], "children": [ { "name": "Lupe Hurtt", "age": 17 }, { "name": "Jae Hurtt", "age": 14 }, { "name": "Evan Hurtt", "age": 45 } ] } }
-{ "arec": { "cid": 17, "name": "Ingeborg Monkhouse", "age": null, "address": null, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] }, "brec": { "cid": 156, "name": "Bobbye Kauppi", "age": 79, "address": { "number": 2051, "street": "Hill St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] } }
-{ "arec": { "cid": 17, "name": "Ingeborg Monkhouse", "age": null, "address": null, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] }, "brec": { "cid": 462, "name": "Margaret Galvis", "age": null, "address": null, "interests": [ "Base Jumping", "Movies", "Movies" ], "children": [ { "name": "Isaac Galvis", "age": 48 }, { "name": "Mei Galvis", "age": null }, { "name": "Asha Galvis", "age": null }, { "name": "Zachery Galvis", "age": null } ] } }
-{ "arec": { "cid": 17, "name": "Ingeborg Monkhouse", "age": null, "address": null, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] }, "brec": { "cid": 666, "name": "Pamila Burzlaff", "age": 68, "address": { "number": 6543, "street": "View St.", "city": "Portland" }, "interests": [ "Squash", "Cigars", "Movies" ], "children": [ ] } }
-{ "arec": { "cid": 18, "name": "Dewayne Ardan", "age": 32, "address": { "number": 8229, "street": "Hill St.", "city": "San Jose" }, "interests": [ "Wine", "Walking", "Bass" ], "children": [ { "name": "Wen Ardan", "age": null }, { "name": "Sachiko Ardan", "age": 11 }, { "name": "Francis Ardan", "age": 20 } ] }, "brec": { "cid": 846, "name": "Kieth Norlund", "age": 15, "address": { "number": 4039, "street": "Park St.", "city": "Mountain View" }, "interests": [ "Wine", "Walking", "Puzzles" ], "children": [ { "name": "Shawn Norlund", "age": null } ] } }
-{ "arec": { "cid": 35, "name": "Saundra Aparo", "age": 86, "address": { "number": 9550, "street": "Lake St.", "city": "Portland" }, "interests": [ "Cigars", "Skiing", "Video Games", "Books" ], "children": [ ] }, "brec": { "cid": 926, "name": "Krishna Barkdull", "age": 31, "address": { "number": 2640, "street": "Cedar St.", "city": "Sunnyvale" }, "interests": [ "Cigars", "Skiing", "Video Games", "Coffee" ], "children": [ { "name": "Nilsa Barkdull", "age": null }, { "name": "Denver Barkdull", "age": 10 }, { "name": "Jenell Barkdull", "age": 15 } ] } }
-{ "arec": { "cid": 51, "name": "Simonne Cape", "age": null, "address": null, "interests": [ "Bass", "Bass", "Books" ], "children": [ { "name": "Leland Cape", "age": null }, { "name": "Gearldine Cape", "age": null } ] }, "brec": { "cid": 232, "name": "Joey Potes", "age": null, "address": null, "interests": [ "Bass", "Bass", "Base Jumping" ], "children": [ { "name": "Bobby Potes", "age": null } ] } }
-{ "arec": { "cid": 51, "name": "Simonne Cape", "age": null, "address": null, "interests": [ "Bass", "Bass", "Books" ], "children": [ { "name": "Leland Cape", "age": null }, { "name": "Gearldine Cape", "age": null } ] }, "brec": { "cid": 412, "name": "Devon Szalai", "age": 26, "address": { "number": 2384, "street": "Lake St.", "city": "Los Angeles" }, "interests": [ "Bass", "Books", "Books" ], "children": [ { "name": "Yolonda Szalai", "age": null }, { "name": "Denita Szalai", "age": null }, { "name": "Priscila Szalai", "age": 10 }, { "name": "Cassondra Szalai", "age": 12 } ] } }
-{ "arec": { "cid": 70, "name": "Mellisa Lek", "age": 62, "address": { "number": 4281, "street": "Oak St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Databases" ], "children": [ ] }, "brec": { "cid": 229, "name": "Raymundo Meurin", "age": null, "address": null, "interests": [ "Bass", "Basketball", "Databases" ], "children": [ { "name": "Mariela Meurin", "age": null } ] } }
-{ "arec": { "cid": 70, "name": "Mellisa Lek", "age": 62, "address": { "number": 4281, "street": "Oak St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Databases" ], "children": [ ] }, "brec": { "cid": 371, "name": "Agatha Tensley", "age": 13, "address": { "number": 1810, "street": "Hill St.", "city": "San Jose" }, "interests": [ "Bass", "Running", "Movies" ], "children": [ { "name": "Launa Tensley", "age": null } ] } }
-{ "arec": { "cid": 70, "name": "Mellisa Lek", "age": 62, "address": { "number": 4281, "street": "Oak St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Databases" ], "children": [ ] }, "brec": { "cid": 387, "name": "Leonard Mabie", "age": 33, "address": { "number": 6703, "street": "View St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Walking" ], "children": [ { "name": "Jone Mabie", "age": 16 }, { "name": "Claire Mabie", "age": null }, { "name": "Larraine Mabie", "age": null }, { "name": "Corrina Mabie", "age": null } ] } }
-{ "arec": { "cid": 70, "name": "Mellisa Lek", "age": 62, "address": { "number": 4281, "street": "Oak St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Databases" ], "children": [ ] }, "brec": { "cid": 424, "name": "Camila Rightmire", "age": 25, "address": { "number": 7542, "street": "Oak St.", "city": "Sunnyvale" }, "interests": [ "Bass", "Running", "Puzzles" ], "children": [ { "name": "Donny Rightmire", "age": 14 }, { "name": "Karlene Rightmire", "age": 10 }, { "name": "Nicholas Rightmire", "age": null }, { "name": "Margareta Rightmire", "age": null } ] } }
-{ "arec": { "cid": 72, "name": "Clarissa Geraldes", "age": 67, "address": { "number": 8248, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Cigars", "Walking", "Databases", "Video Games" ], "children": [ { "name": "Vina Geraldes", "age": 51 } ] }, "brec": { "cid": 919, "name": "Fairy Wansley", "age": 45, "address": { "number": 9020, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Wine", "Walking", "Databases", "Video Games" ], "children": [ { "name": "Marvella Wansley", "age": null }, { "name": "Hisako Wansley", "age": null }, { "name": "Shaunta Wansley", "age": null }, { "name": "Gemma Wansley", "age": 21 } ] } }
-{ "arec": { "cid": 73, "name": "Kelsey Flever", "age": 20, "address": { "number": 3555, "street": "Main St.", "city": "Portland" }, "interests": [ "Tennis", "Puzzles", "Video Games" ], "children": [ { "name": "Isis Flever", "age": null }, { "name": "Gonzalo Flever", "age": null } ] }, "brec": { "cid": 453, "name": "Sherlyn Deadmond", "age": null, "address": null, "interests": [ "Tennis", "Puzzles", "Base Jumping" ], "children": [ { "name": "Torrie Deadmond", "age": 46 }, { "name": "Cleotilde Deadmond", "age": 55 }, { "name": "Garry Deadmond", "age": 34 }, { "name": "Valrie Deadmond", "age": null } ] } }
-{ "arec": { "cid": 73, "name": "Kelsey Flever", "age": 20, "address": { "number": 3555, "street": "Main St.", "city": "Portland" }, "interests": [ "Tennis", "Puzzles", "Video Games" ], "children": [ { "name": "Isis Flever", "age": null }, { "name": "Gonzalo Flever", "age": null } ] }, "brec": { "cid": 734, "name": "Lera Korn", "age": null, "address": null, "interests": [ "Tennis", "Puzzles", "Cigars" ], "children": [ { "name": "Criselda Korn", "age": 37 } ] } }
-{ "arec": { "cid": 77, "name": "Chantal Parriera", "age": 78, "address": { "number": 5967, "street": "Lake St.", "city": "San Jose" }, "interests": [ "Squash", "Movies", "Coffee" ], "children": [ ] }, "brec": { "cid": 909, "name": "Mariko Sharar", "age": null, "address": null, "interests": [ "Squash", "Movies", "Computers" ], "children": [ ] } }
-{ "arec": { "cid": 78, "name": "Wesley Huggler", "age": 80, "address": { "number": 3078, "street": "7th St.", "city": "Los Angeles" }, "interests": [ "Base Jumping", "Movies", "Skiing" ], "children": [ { "name": "Chassidy Huggler", "age": null }, { "name": "Emogene Huggler", "age": null }, { "name": "Cheryle Huggler", "age": null } ] }, "brec": { "cid": 88, "name": "Courtney Muckleroy", "age": null, "address": null, "interests": [ "Wine", "Movies", "Skiing" ], "children": [ { "name": "Alona Muckleroy", "age": 30 }, { "name": "Flora Muckleroy", "age": 41 }, { "name": "Angel Muckleroy", "age": null }, { "name": "Daniella Muckleroy", "age": null } ] } }
-{ "arec": { "cid": 78, "name": "Wesley Huggler", "age": 80, "address": { "number": 3078, "street": "7th St.", "city": "Los Angeles" }, "interests": [ "Base Jumping", "Movies", "Skiing" ], "children": [ { "name": "Chassidy Huggler", "age": null }, { "name": "Emogene Huggler", "age": null }, { "name": "Cheryle Huggler", "age": null } ] }, "brec": { "cid": 462, "name": "Margaret Galvis", "age": null, "address": null, "interests": [ "Base Jumping", "Movies", "Movies" ], "children": [ { "name": "Isaac Galvis", "age": 48 }, { "name": "Mei Galvis", "age": null }, { "name": "Asha Galvis", "age": null }, { "name": "Zachery Galvis", "age": null } ] } }
-{ "arec": { "cid": 78, "name": "Wesley Huggler", "age": 80, "address": { "number": 3078, "street": "7th St.", "city": "Los Angeles" }, "interests": [ "Base Jumping", "Movies", "Skiing" ], "children": [ { "name": "Chassidy Huggler", "age": null }, { "name": "Emogene Huggler", "age": null }, { "name": "Cheryle Huggler", "age": null } ] }, "brec": { "cid": 498, "name": "Arleen Sultzer", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Norine Sultzer", "age": 29 } ] } }
-{ "arec": { "cid": 78, "name": "Wesley Huggler", "age": 80, "address": { "number": 3078, "street": "7th St.", "city": "Los Angeles" }, "interests": [ "Base Jumping", "Movies", "Skiing" ], "children": [ { "name": "Chassidy Huggler", "age": null }, { "name": "Emogene Huggler", "age": null }, { "name": "Cheryle Huggler", "age": null } ] }, "brec": { "cid": 875, "name": "Ramon Crepps", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Elisha Crepps", "age": null } ] } }
-{ "arec": { "cid": 84, "name": "Huong Kachel", "age": null, "address": null, "interests": [ "Music", "Tennis", "Base Jumping" ], "children": [ { "name": "Katlyn Kachel", "age": 40 }, { "name": "Sherman Kachel", "age": null }, { "name": "Susana Kachel", "age": 32 } ] }, "brec": { "cid": 326, "name": "Tad Tellers", "age": null, "address": null, "interests": [ "Books", "Tennis", "Base Jumping" ], "children": [ { "name": "Fannie Tellers", "age": null } ] } }
-{ "arec": { "cid": 88, "name": "Courtney Muckleroy", "age": null, "address": null, "interests": [ "Wine", "Movies", "Skiing" ], "children": [ { "name": "Alona Muckleroy", "age": 30 }, { "name": "Flora Muckleroy", "age": 41 }, { "name": "Angel Muckleroy", "age": null }, { "name": "Daniella Muckleroy", "age": null } ] }, "brec": { "cid": 498, "name": "Arleen Sultzer", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Norine Sultzer", "age": 29 } ] } }
-{ "arec": { "cid": 88, "name": "Courtney Muckleroy", "age": null, "address": null, "interests": [ "Wine", "Movies", "Skiing" ], "children": [ { "name": "Alona Muckleroy", "age": 30 }, { "name": "Flora Muckleroy", "age": 41 }, { "name": "Angel Muckleroy", "age": null }, { "name": "Daniella Muckleroy", "age": null } ] }, "brec": { "cid": 875, "name": "Ramon Crepps", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Elisha Crepps", "age": null } ] } }
-{ "arec": { "cid": 101, "name": "Meaghan Vandel", "age": null, "address": null, "interests": [ "Music", "Base Jumping", "Books" ], "children": [ { "name": "Larissa Vandel", "age": null } ] }, "brec": { "cid": 633, "name": "Shalon Grauberger", "age": 34, "address": { "number": 765, "street": "Washington St.", "city": "Sunnyvale" }, "interests": [ "Music", "Base Jumping", "Tennis" ], "children": [ { "name": "Kris Grauberger", "age": 14 }, { "name": "Stuart Grauberger", "age": 12 }, { "name": "Billy Grauberger", "age": null } ] } }
-{ "arec": { "cid": 101, "name": "Meaghan Vandel", "age": null, "address": null, "interests": [ "Music", "Base Jumping", "Books" ], "children": [ { "name": "Larissa Vandel", "age": null } ] }, "brec": { "cid": 967, "name": "Melida Laliotis", "age": null, "address": null, "interests": [ "Music", "Base Jumping", "Coffee", "Books" ], "children": [ { "name": "Lai Laliotis", "age": 52 }, { "name": "Jillian Laliotis", "age": 11 } ] } }
-{ "arec": { "cid": 115, "name": "Jason Oakden", "age": 89, "address": { "number": 8182, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Music", "Basketball", "Movies" ], "children": [ { "name": "Johnson Oakden", "age": null }, { "name": "Neva Oakden", "age": null }, { "name": "Juliann Oakden", "age": null }, { "name": "Elmer Oakden", "age": null } ] }, "brec": { "cid": 827, "name": "Clementina Papin", "age": null, "address": null, "interests": [ "Music", "Basketball", "Cigars" ], "children": [ { "name": "Catina Papin", "age": null }, { "name": "Demetrius Papin", "age": 59 }, { "name": "Marylou Papin", "age": 12 }, { "name": "Apryl Papin", "age": 16 } ] } }
-{ "arec": { "cid": 120, "name": "Jan Gianandrea", "age": null, "address": null, "interests": [ "Databases", "Movies", "Cigars" ], "children": [ { "name": "Keesha Gianandrea", "age": null }, { "name": "Vashti Gianandrea", "age": 35 }, { "name": "Larry Gianandrea", "age": 29 } ] }, "brec": { "cid": 397, "name": "Blake Kealy", "age": 34, "address": { "number": 2156, "street": "Cedar St.", "city": "Los Angeles" }, "interests": [ "Databases", "Wine", "Cigars" ], "children": [ { "name": "Lorenza Kealy", "age": null }, { "name": "Beula Kealy", "age": 15 }, { "name": "Kristofer Kealy", "age": null }, { "name": "Shayne Kealy", "age": null } ] } }
-{ "arec": { "cid": 120, "name": "Jan Gianandrea", "age": null, "address": null, "interests": [ "Databases", "Movies", "Cigars" ], "children": [ { "name": "Keesha Gianandrea", "age": null }, { "name": "Vashti Gianandrea", "age": 35 }, { "name": "Larry Gianandrea", "age": 29 } ] }, "brec": { "cid": 636, "name": "Babara Shore", "age": 83, "address": { "number": 9452, "street": "Oak St.", "city": "Los Angeles" }, "interests": [ "Databases", "Movies", "Tennis" ], "children": [ { "name": "Candy Shore", "age": 58 }, { "name": "Nanci Shore", "age": null }, { "name": "Asia Shore", "age": null } ] } }
-{ "arec": { "cid": 120, "name": "Jan Gianandrea", "age": null, "address": null, "interests": [ "Databases", "Movies", "Cigars" ], "children": [ { "name": "Keesha Gianandrea", "age": null }, { "name": "Vashti Gianandrea", "age": 35 }, { "name": "Larry Gianandrea", "age": 29 } ] }, "brec": { "cid": 992, "name": "Staci Alexandropoul", "age": null, "address": null, "interests": [ "Databases", "Movies", "Tennis" ], "children": [ { "name": "Casimira Alexandropoul", "age": null }, { "name": "Kena Alexandropoul", "age": 54 }, { "name": "Ellie Alexandropoul", "age": null }, { "name": "Ambrose Alexandropoul", "age": null } ] } }
-{ "arec": { "cid": 137, "name": "Camellia Pressman", "age": 81, "address": { "number": 3947, "street": "Park St.", "city": "Seattle" }, "interests": [ "Movies", "Books", "Bass" ], "children": [ { "name": "Dwana Pressman", "age": null }, { "name": "Johnathan Pressman", "age": null }, { "name": "Kasey Pressman", "age": null }, { "name": "Mitch Pressman", "age": null } ] }, "brec": { "cid": 923, "name": "Bobbi Ursino", "age": null, "address": null, "interests": [ "Movies", "Books", "Walking" ], "children": [ { "name": "Shon Ursino", "age": null }, { "name": "Lorean Ursino", "age": null } ] } }
-{ "arec": { "cid": 139, "name": "Micheline Argenal", "age": null, "address": null, "interests": [ "Bass", "Walking", "Movies" ], "children": [ { "name": "Joye Argenal", "age": 51 }, { "name": "Richard Argenal", "age": 46 }, { "name": "Sarah Argenal", "age": 21 }, { "name": "Jacinda Argenal", "age": 21 } ] }, "brec": { "cid": 371, "name": "Agatha Tensley", "age": 13, "address": { "number": 1810, "street": "Hill St.", "city": "San Jose" }, "interests": [ "Bass", "Running", "Movies" ], "children": [ { "name": "Launa Tensley", "age": null } ] } }
-{ "arec": { "cid": 141, "name": "Adena Klockars", "age": null, "address": null, "interests": [ "Skiing", "Computers", "Bass", "Cigars" ], "children": [ ] }, "brec": { "cid": 794, "name": "Annabel Leins", "age": 75, "address": { "number": 9761, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Bass", "Computers", "Bass", "Cigars" ], "children": [ { "name": "Oswaldo Leins", "age": 21 } ] } }
-{ "arec": { "cid": 156, "name": "Bobbye Kauppi", "age": 79, "address": { "number": 2051, "street": "Hill St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] }, "brec": { "cid": 462, "name": "Margaret Galvis", "age": null, "address": null, "interests": [ "Base Jumping", "Movies", "Movies" ], "children": [ { "name": "Isaac Galvis", "age": 48 }, { "name": "Mei Galvis", "age": null }, { "name": "Asha Galvis", "age": null }, { "name": "Zachery Galvis", "age": null } ] } }
-{ "arec": { "cid": 156, "name": "Bobbye Kauppi", "age": 79, "address": { "number": 2051, "street": "Hill St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] }, "brec": { "cid": 666, "name": "Pamila Burzlaff", "age": 68, "address": { "number": 6543, "street": "View St.", "city": "Portland" }, "interests": [ "Squash", "Cigars", "Movies" ], "children": [ ] } }
-{ "arec": { "cid": 160, "name": "Yevette Chanez", "age": null, "address": null, "interests": [ "Bass", "Wine", "Coffee" ], "children": [ { "name": "Walter Chanez", "age": 11 }, { "name": "Pa Chanez", "age": 27 } ] }, "brec": { "cid": 299, "name": "Jacob Wainman", "age": 76, "address": { "number": 4551, "street": "Washington St.", "city": "Portland" }, "interests": [ "Base Jumping", "Wine", "Coffee" ], "children": [ { "name": "Abram Wainman", "age": 28 }, { "name": "Ramonita Wainman", "age": 18 }, { "name": "Sheryll Wainman", "age": null } ] } }
-{ "arec": { "cid": 160, "name": "Yevette Chanez", "age": null, "address": null, "interests": [ "Bass", "Wine", "Coffee" ], "children": [ { "name": "Walter Chanez", "age": 11 }, { "name": "Pa Chanez", "age": 27 } ] }, "brec": { "cid": 898, "name": "Thao Seufert", "age": 78, "address": { "number": 3529, "street": "Hill St.", "city": "Seattle" }, "interests": [ "Bass", "Squash", "Coffee" ], "children": [ { "name": "Classie Seufert", "age": null } ] } }
-{ "arec": { "cid": 172, "name": "Weldon Alquesta", "age": null, "address": null, "interests": [ "Music", "Fishing", "Music" ], "children": [ { "name": "Kip Alquesta", "age": null } ] }, "brec": { "cid": 961, "name": "Mirian Herpolsheimer", "age": null, "address": null, "interests": [ "Music", "Fishing", "Computers" ], "children": [ { "name": "Larissa Herpolsheimer", "age": 41 }, { "name": "Markus Herpolsheimer", "age": null }, { "name": "Natacha Herpolsheimer", "age": null } ] } }
-{ "arec": { "cid": 173, "name": "Annamae Lucien", "age": 46, "address": { "number": 1253, "street": "Hill St.", "city": "Mountain View" }, "interests": [ "Puzzles", "Cooking", "Squash" ], "children": [ { "name": "Sanjuana Lucien", "age": 21 }, { "name": "Nathanael Lucien", "age": 27 }, { "name": "Jae Lucien", "age": null }, { "name": "Judith Lucien", "age": null } ] }, "brec": { "cid": 507, "name": "Yuk Flanegan", "age": null, "address": null, "interests": [ "Puzzles", "Puzzles", "Squash" ], "children": [ { "name": "Alexander Flanegan", "age": null } ] } }
-{ "arec": { "cid": 173, "name": "Annamae Lucien", "age": 46, "address": { "number": 1253, "street": "Hill St.", "city": "Mountain View" }, "interests": [ "Puzzles", "Cooking", "Squash" ], "children": [ { "name": "Sanjuana Lucien", "age": 21 }, { "name": "Nathanael Lucien", "age": 27 }, { "name": "Jae Lucien", "age": null }, { "name": "Judith Lucien", "age": null } ] }, "brec": { "cid": 691, "name": "Sharee Charrier", "age": 17, "address": { "number": 6693, "street": "Main St.", "city": "Mountain View" }, "interests": [ "Puzzles", "Cooking", "Bass" ], "children": [ { "name": "Odessa Charrier", "age": null } ] } }
-{ "arec": { "cid": 178, "name": "Athena Kaluna", "age": null, "address": null, "interests": [ "Running", "Computers", "Basketball" ], "children": [ { "name": "Rosalba Kaluna", "age": 48 }, { "name": "Max Kaluna", "age": 10 } ] }, "brec": { "cid": 345, "name": "Derick Rippel", "age": 79, "address": { "number": 6843, "street": "Oak St.", "city": "Portland" }, "interests": [ "Running", "Basketball", "Computers", "Basketball" ], "children": [ ] } }
-{ "arec": { "cid": 187, "name": "Seema Hartsch", "age": 80, "address": { "number": 6629, "street": "Lake St.", "city": "Portland" }, "interests": [ "Coffee", "Coffee", "Cigars" ], "children": [ { "name": "Suellen Hartsch", "age": null }, { "name": "Pennie Hartsch", "age": 20 }, { "name": "Aubrey Hartsch", "age": null }, { "name": "Randy Hartsch", "age": 32 } ] }, "brec": { "cid": 598, "name": "Venus Peat", "age": null, "address": null, "interests": [ "Coffee", "Walking", "Cigars" ], "children": [ { "name": "Antonetta Peat", "age": null }, { "name": "Shane Peat", "age": null } ] } }
-{ "arec": { "cid": 187, "name": "Seema Hartsch", "age": 80, "address": { "number": 6629, "street": "Lake St.", "city": "Portland" }, "interests": [ "Coffee", "Coffee", "Cigars" ], "children": [ { "name": "Suellen Hartsch", "age": null }, { "name": "Pennie Hartsch", "age": 20 }, { "name": "Aubrey Hartsch", "age": null }, { "name": "Randy Hartsch", "age": 32 } ] }, "brec": { "cid": 927, "name": "Lillia Hartlein", "age": 55, "address": { "number": 5856, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Coffee", "Cigars" ], "children": [ { "name": "Nicky Hartlein", "age": null }, { "name": "Cassaundra Hartlein", "age": 10 }, { "name": "Micheline Hartlein", "age": 26 }, { "name": "Anton Hartlein", "age": 32 } ] } }
-{ "arec": { "cid": 198, "name": "Thelma Youkers", "age": null, "address": null, "interests": [ "Basketball", "Movies", "Cooking" ], "children": [ { "name": "Shamika Youkers", "age": 28 } ] }, "brec": { "cid": 806, "name": "Corliss Sharratt", "age": null, "address": null, "interests": [ "Basketball", "Cigars", "Cooking" ], "children": [ { "name": "Albertine Sharratt", "age": null }, { "name": "Nobuko Sharratt", "age": 29 }, { "name": "Neil Sharratt", "age": null } ] } }
-{ "arec": { "cid": 207, "name": "Phyliss Honda", "age": 22, "address": { "number": 8387, "street": "Lake St.", "city": "Seattle" }, "interests": [ "Cooking", "Music", "Books" ], "children": [ { "name": "Bee Honda", "age": null }, { "name": "Cyril Honda", "age": null }, { "name": "Vertie Honda", "age": null } ] }, "brec": { "cid": 440, "name": "Rosie Shappen", "age": null, "address": null, "interests": [ "Cooking", "Music", "Cigars" ], "children": [ { "name": "Jung Shappen", "age": 11 } ] } }
-{ "arec": { "cid": 207, "name": "Phyliss Honda", "age": 22, "address": { "number": 8387, "street": "Lake St.", "city": "Seattle" }, "interests": [ "Cooking", "Music", "Books" ], "children": [ { "name": "Bee Honda", "age": null }, { "name": "Cyril Honda", "age": null }, { "name": "Vertie Honda", "age": null } ] }, "brec": { "cid": 825, "name": "Kirstie Rinebold", "age": 57, "address": { "number": 9463, "street": "Oak St.", "city": "Portland" }, "interests": [ "Cooking", "Cigars", "Books" ], "children": [ { "name": "Vonda Rinebold", "age": null }, { "name": "Man Rinebold", "age": 21 } ] } }
-{ "arec": { "cid": 216, "name": "Odilia Lampson", "age": null, "address": null, "interests": [ "Wine", "Databases", "Basketball" ], "children": [ { "name": "Callie Lampson", "age": null } ] }, "brec": { "cid": 220, "name": "Soila Hannemann", "age": null, "address": null, "interests": [ "Wine", "Puzzles", "Basketball" ], "children": [ { "name": "Piper Hannemann", "age": 44 } ] } }
-{ "arec": { "cid": 220, "name": "Soila Hannemann", "age": null, "address": null, "interests": [ "Wine", "Puzzles", "Basketball" ], "children": [ { "name": "Piper Hannemann", "age": 44 } ] }, "brec": { "cid": 312, "name": "Epifania Chorney", "age": 62, "address": { "number": 9749, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Wine", "Puzzles", "Tennis" ], "children": [ { "name": "Lizeth Chorney", "age": 22 } ] } }
-{ "arec": { "cid": 224, "name": "Rene Rowey", "age": null, "address": null, "interests": [ "Base Jumping", "Base Jumping", "Walking", "Computers" ], "children": [ { "name": "Necole Rowey", "age": 26 }, { "name": "Sharyl Rowey", "age": 20 }, { "name": "Yvone Rowey", "age": 36 } ] }, "brec": { "cid": 538, "name": "Mack Vollick", "age": null, "address": null, "interests": [ "Base Jumping", "Fishing", "Walking", "Computers" ], "children": [ { "name": "Gil Vollick", "age": 11 }, { "name": "Marica Vollick", "age": null } ] } }
-{ "arec": { "cid": 224, "name": "Rene Rowey", "age": null, "address": null, "interests": [ "Base Jumping", "Base Jumping", "Walking", "Computers" ], "children": [ { "name": "Necole Rowey", "age": 26 }, { "name": "Sharyl Rowey", "age": 20 }, { "name": "Yvone Rowey", "age": 36 } ] }, "brec": { "cid": 788, "name": "Franklyn Crowner", "age": 56, "address": { "number": 4186, "street": "Lake St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Base Jumping", "Books", "Computers" ], "children": [ { "name": "Adrian Crowner", "age": 43 }, { "name": "Vasiliki Crowner", "age": null } ] } }
-{ "arec": { "cid": 237, "name": "Sona Hehn", "age": 47, "address": { "number": 3720, "street": "Oak St.", "city": "Portland" }, "interests": [ "Computers", "Squash", "Coffee" ], "children": [ { "name": "Marquerite Hehn", "age": null }, { "name": "Suellen Hehn", "age": 29 }, { "name": "Herb Hehn", "age": 29 } ] }, "brec": { "cid": 898, "name": "Thao Seufert", "age": 78, "address": { "number": 3529, "street": "Hill St.", "city": "Seattle" }, "interests": [ "Bass", "Squash", "Coffee" ], "children": [ { "name": "Classie Seufert", "age": null } ] } }
-{ "arec": { "cid": 244, "name": "Rene Shenk", "age": null, "address": null, "interests": [ "Puzzles", "Puzzles", "Skiing" ], "children": [ { "name": "Victor Shenk", "age": 28 }, { "name": "Doris Shenk", "age": null }, { "name": "Max Shenk", "age": 51 } ] }, "brec": { "cid": 507, "name": "Yuk Flanegan", "age": null, "address": null, "interests": [ "Puzzles", "Puzzles", "Squash" ], "children": [ { "name": "Alexander Flanegan", "age": null } ] } }
-{ "arec": { "cid": 250, "name": "Angeles Saltonstall", "age": null, "address": null, "interests": [ "Tennis", "Fishing", "Movies" ], "children": [ { "name": "Suzanna Saltonstall", "age": null } ] }, "brec": { "cid": 276, "name": "Denyse Groth", "age": 81, "address": { "number": 6825, "street": "Main St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Fishing", "Movies" ], "children": [ { "name": "Marilee Groth", "age": 12 }, { "name": "Lyla Groth", "age": 46 }, { "name": "Sarah Groth", "age": null } ] } }
-{ "arec": { "cid": 250, "name": "Angeles Saltonstall", "age": null, "address": null, "interests": [ "Tennis", "Fishing", "Movies" ], "children": [ { "name": "Suzanna Saltonstall", "age": null } ] }, "brec": { "cid": 302, "name": "Rosalie Laderer", "age": null, "address": null, "interests": [ "Tennis", "Movies", "Movies" ], "children": [ { "name": "Moriah Laderer", "age": null }, { "name": "Liana Laderer", "age": 21 }, { "name": "Genia Laderer", "age": 45 } ] } }
-{ "arec": { "cid": 263, "name": "Mellisa Machalek", "age": null, "address": null, "interests": [ "Bass", "Coffee", "Skiing" ], "children": [ ] }, "brec": { "cid": 618, "name": "Janella Hurtt", "age": null, "address": null, "interests": [ "Skiing", "Coffee", "Skiing" ], "children": [ { "name": "Lupe Hurtt", "age": 17 }, { "name": "Jae Hurtt", "age": 14 }, { "name": "Evan Hurtt", "age": 45 } ] } }
-{ "arec": { "cid": 264, "name": "Leon Yoshizawa", "age": 81, "address": { "number": 608, "street": "Washington St.", "city": "San Jose" }, "interests": [ "Running", "Books", "Running" ], "children": [ { "name": "Carmela Yoshizawa", "age": 34 } ] }, "brec": { "cid": 804, "name": "Joaquina Burlin", "age": 77, "address": { "number": 5479, "street": "7th St.", "city": "Sunnyvale" }, "interests": [ "Running", "Wine", "Running" ], "children": [ ] } }
-{ "arec": { "cid": 268, "name": "Fernando Pingel", "age": null, "address": null, "interests": [ "Computers", "Tennis", "Books" ], "children": [ { "name": "Latrice Pingel", "age": null }, { "name": "Wade Pingel", "age": 13 }, { "name": "Christal Pingel", "age": null }, { "name": "Melania Pingel", "age": null } ] }, "brec": { "cid": 446, "name": "Lilly Grannell", "age": 21, "address": { "number": 5894, "street": "Washington St.", "city": "San Jose" }, "interests": [ "Computers", "Tennis", "Puzzles", "Books" ], "children": [ { "name": "Victor Grannell", "age": null } ] } }
-{ "arec": { "cid": 273, "name": "Corrinne Seaquist", "age": 24, "address": { "number": 6712, "street": "7th St.", "city": "Portland" }, "interests": [ "Puzzles", "Coffee", "Wine" ], "children": [ { "name": "Mignon Seaquist", "age": null }, { "name": "Leo Seaquist", "age": null } ] }, "brec": { "cid": 709, "name": "Jazmine Twiddy", "age": null, "address": null, "interests": [ "Puzzles", "Computers", "Wine" ], "children": [ { "name": "Veronika Twiddy", "age": 21 } ] } }
-{ "arec": { "cid": 274, "name": "Claude Harral", "age": null, "address": null, "interests": [ "Squash", "Bass", "Cooking" ], "children": [ { "name": "Archie Harral", "age": null }, { "name": "Royal Harral", "age": null } ] }, "brec": { "cid": 654, "name": "Louis Laubersheimer", "age": 76, "address": { "number": 8010, "street": "7th St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Bass", "Cooking" ], "children": [ { "name": "Jewel Laubersheimer", "age": 22 }, { "name": "Toccara Laubersheimer", "age": 45 }, { "name": "Eve Laubersheimer", "age": null } ] } }
-{ "arec": { "cid": 276, "name": "Denyse Groth", "age": 81, "address": { "number": 6825, "street": "Main St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Fishing", "Movies" ], "children": [ { "name": "Marilee Groth", "age": 12 }, { "name": "Lyla Groth", "age": 46 }, { "name": "Sarah Groth", "age": null } ] }, "brec": { "cid": 892, "name": "Madge Hendson", "age": 79, "address": { "number": 8832, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Databases", "Fishing", "Skiing" ], "children": [ { "name": "Elia Hendson", "age": 48 }, { "name": "Lashawn Hendson", "age": 27 } ] } }
-{ "arec": { "cid": 276, "name": "Denyse Groth", "age": 81, "address": { "number": 6825, "street": "Main St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Fishing", "Movies" ], "children": [ { "name": "Marilee Groth", "age": 12 }, { "name": "Lyla Groth", "age": 46 }, { "name": "Sarah Groth", "age": null } ] }, "brec": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Databases", "Fishing", "Wine" ], "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] } }
-{ "arec": { "cid": 297, "name": "Adeline Frierson", "age": null, "address": null, "interests": [ "Coffee", "Computers", "Fishing" ], "children": [ { "name": "Marci Frierson", "age": null }, { "name": "Rolanda Frierson", "age": null }, { "name": "Del Frierson", "age": null } ] }, "brec": { "cid": 854, "name": "Angie Oyster", "age": 32, "address": { "number": 8860, "street": "Main St.", "city": "San Jose" }, "interests": [ "Coffee", "Movies", "Fishing" ], "children": [ { "name": "Hugh Oyster", "age": 10 } ] } }
-{ "arec": { "cid": 297, "name": "Adeline Frierson", "age": null, "address": null, "interests": [ "Coffee", "Computers", "Fishing" ], "children": [ { "name": "Marci Frierson", "age": null }, { "name": "Rolanda Frierson", "age": null }, { "name": "Del Frierson", "age": null } ] }, "brec": { "cid": 996, "name": "Elouise Wider", "age": null, "address": null, "interests": [ "Coffee", "Computers", "Base Jumping" ], "children": [ ] } }
-{ "arec": { "cid": 299, "name": "Jacob Wainman", "age": 76, "address": { "number": 4551, "street": "Washington St.", "city": "Portland" }, "interests": [ "Base Jumping", "Wine", "Coffee" ], "children": [ { "name": "Abram Wainman", "age": 28 }, { "name": "Ramonita Wainman", "age": 18 }, { "name": "Sheryll Wainman", "age": null } ] }, "brec": { "cid": 448, "name": "Gracie Pekas", "age": 59, "address": { "number": 4732, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Wine", "Cigars" ], "children": [ { "name": "Jeanett Pekas", "age": 35 }, { "name": "Jennifer Pekas", "age": null }, { "name": "Carrol Pekas", "age": null } ] } }
-{ "arec": { "cid": 302, "name": "Rosalie Laderer", "age": null, "address": null, "interests": [ "Tennis", "Movies", "Movies" ], "children": [ { "name": "Moriah Laderer", "age": null }, { "name": "Liana Laderer", "age": 21 }, { "name": "Genia Laderer", "age": 45 } ] }, "brec": { "cid": 462, "name": "Margaret Galvis", "age": null, "address": null, "interests": [ "Base Jumping", "Movies", "Movies" ], "children": [ { "name": "Isaac Galvis", "age": 48 }, { "name": "Mei Galvis", "age": null }, { "name": "Asha Galvis", "age": null }, { "name": "Zachery Galvis", "age": null } ] } }
-{ "arec": { "cid": 302, "name": "Rosalie Laderer", "age": null, "address": null, "interests": [ "Tennis", "Movies", "Movies" ], "children": [ { "name": "Moriah Laderer", "age": null }, { "name": "Liana Laderer", "age": 21 }, { "name": "Genia Laderer", "age": 45 } ] }, "brec": { "cid": 661, "name": "Lorita Kraut", "age": 43, "address": { "number": 5017, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Tennis", "Movies", "Bass" ], "children": [ { "name": "Mirian Kraut", "age": null } ] } }
-{ "arec": { "cid": 312, "name": "Epifania Chorney", "age": 62, "address": { "number": 9749, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Wine", "Puzzles", "Tennis" ], "children": [ { "name": "Lizeth Chorney", "age": 22 } ] }, "brec": { "cid": 895, "name": "Joie Siffert", "age": null, "address": null, "interests": [ "Wine", "Skiing", "Puzzles", "Tennis" ], "children": [ { "name": "Erma Siffert", "age": null }, { "name": "Natosha Siffert", "age": 38 }, { "name": "Somer Siffert", "age": 27 } ] } }
-{ "arec": { "cid": 326, "name": "Tad Tellers", "age": null, "address": null, "interests": [ "Books", "Tennis", "Base Jumping" ], "children": [ { "name": "Fannie Tellers", "age": null } ] }, "brec": { "cid": 541, "name": "Sammy Adamitis", "age": 71, "address": { "number": 5593, "street": "Washington St.", "city": "Seattle" }, "interests": [ "Books", "Tennis", "Cooking" ], "children": [ ] } }
-{ "arec": { "cid": 335, "name": "Odessa Dammeyer", "age": 18, "address": { "number": 6828, "street": "Cedar St.", "city": "Los Angeles" }, "interests": [ "Basketball", "Bass", "Cigars" ], "children": [ { "name": "Lindsey Dammeyer", "age": null } ] }, "brec": { "cid": 660, "name": "Israel Aday", "age": null, "address": null, "interests": [ "Wine", "Bass", "Cigars" ], "children": [ { "name": "Mi Aday", "age": null } ] } }
-{ "arec": { "cid": 352, "name": "Bonny Sischo", "age": null, "address": null, "interests": [ "Bass", "Movies", "Computers" ], "children": [ { "name": "Judith Sischo", "age": 43 }, { "name": "Adeline Sischo", "age": null }, { "name": "Dayna Sischo", "age": null } ] }, "brec": { "cid": 614, "name": "Wallace Chaidy", "age": null, "address": null, "interests": [ "Bass", "Movies", "Music" ], "children": [ { "name": "Refugio Chaidy", "age": null }, { "name": "Hae Chaidy", "age": 55 }, { "name": "Julian Chaidy", "age": null }, { "name": "Tabatha Chaidy", "age": null } ] } }
-{ "arec": { "cid": 352, "name": "Bonny Sischo", "age": null, "address": null, "interests": [ "Bass", "Movies", "Computers" ], "children": [ { "name": "Judith Sischo", "age": 43 }, { "name": "Adeline Sischo", "age": null }, { "name": "Dayna Sischo", "age": null } ] }, "brec": { "cid": 909, "name": "Mariko Sharar", "age": null, "address": null, "interests": [ "Squash", "Movies", "Computers" ], "children": [ ] } }
-{ "arec": { "cid": 359, "name": "Sharika Vientos", "age": 42, "address": { "number": 5981, "street": "Hill St.", "city": "Mountain View" }, "interests": [ "Walking", "Bass", "Fishing", "Movies" ], "children": [ { "name": "Clifton Vientos", "age": 21 }, { "name": "Renae Vientos", "age": null }, { "name": "Marcelo Vientos", "age": 31 }, { "name": "Jacalyn Vientos", "age": null } ] }, "brec": { "cid": 969, "name": "Laurinda Gnerre", "age": 42, "address": { "number": 2284, "street": "Hill St.", "city": "Mountain View" }, "interests": [ "Walking", "Bass", "Fishing", "Video Games" ], "children": [ { "name": "Veronica Gnerre", "age": null } ] } }
-{ "arec": { "cid": 363, "name": "Merlene Hoying", "age": 25, "address": { "number": 2105, "street": "Cedar St.", "city": "Portland" }, "interests": [ "Squash", "Squash", "Music" ], "children": [ { "name": "Andrew Hoying", "age": 10 } ] }, "brec": { "cid": 415, "name": "Valentin Mclarney", "age": null, "address": null, "interests": [ "Squash", "Squash", "Video Games" ], "children": [ { "name": "Vanda Mclarney", "age": 17 } ] } }
-{ "arec": { "cid": 363, "name": "Merlene Hoying", "age": 25, "address": { "number": 2105, "street": "Cedar St.", "city": "Portland" }, "interests": [ "Squash", "Squash", "Music" ], "children": [ { "name": "Andrew Hoying", "age": 10 } ] }, "brec": { "cid": 642, "name": "Odell Nova", "age": 25, "address": { "number": 896, "street": "Park St.", "city": "San Jose" }, "interests": [ "Video Games", "Squash", "Music" ], "children": [ { "name": "Leopoldo Nova", "age": null }, { "name": "Rickey Nova", "age": null }, { "name": "Mike Nova", "age": 14 }, { "name": "Tamie Nova", "age": 14 } ] } }
-{ "arec": { "cid": 371, "name": "Agatha Tensley", "age": 13, "address": { "number": 1810, "street": "Hill St.", "city": "San Jose" }, "interests": [ "Bass", "Running", "Movies" ], "children": [ { "name": "Launa Tensley", "age": null } ] }, "brec": { "cid": 387, "name": "Leonard Mabie", "age": 33, "address": { "number": 6703, "street": "View St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Walking" ], "children": [ { "name": "Jone Mabie", "age": 16 }, { "name": "Claire Mabie", "age": null }, { "name": "Larraine Mabie", "age": null }, { "name": "Corrina Mabie", "age": null } ] } }
-{ "arec": { "cid": 371, "name": "Agatha Tensley", "age": 13, "address": { "number": 1810, "street": "Hill St.", "city": "San Jose" }, "interests": [ "Bass", "Running", "Movies" ], "children": [ { "name": "Launa Tensley", "age": null } ] }, "brec": { "cid": 424, "name": "Camila Rightmire", "age": 25, "address": { "number": 7542, "street": "Oak St.", "city": "Sunnyvale" }, "interests": [ "Bass", "Running", "Puzzles" ], "children": [ { "name": "Donny Rightmire", "age": 14 }, { "name": "Karlene Rightmire", "age": 10 }, { "name": "Nicholas Rightmire", "age": null }, { "name": "Margareta Rightmire", "age": null } ] } }
-{ "arec": { "cid": 378, "name": "Melany Matias", "age": 10, "address": { "number": 8838, "street": "Main St.", "city": "Seattle" }, "interests": [ "Coffee", "Tennis", "Bass" ], "children": [ { "name": "Earnestine Matias", "age": null }, { "name": "Lore Matias", "age": null } ] }, "brec": { "cid": 580, "name": "Liana Gabbert", "age": null, "address": null, "interests": [ "Coffee", "Tennis", "Bass", "Running" ], "children": [ ] } }
-{ "arec": { "cid": 387, "name": "Leonard Mabie", "age": 33, "address": { "number": 6703, "street": "View St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Walking" ], "children": [ { "name": "Jone Mabie", "age": 16 }, { "name": "Claire Mabie", "age": null }, { "name": "Larraine Mabie", "age": null }, { "name": "Corrina Mabie", "age": null } ] }, "brec": { "cid": 424, "name": "Camila Rightmire", "age": 25, "address": { "number": 7542, "street": "Oak St.", "city": "Sunnyvale" }, "interests": [ "Bass", "Running", "Puzzles" ], "children": [ { "name": "Donny Rightmire", "age": 14 }, { "name": "Karlene Rightmire", "age": 10 }, { "name": "Nicholas Rightmire", "age": null }, { "name": "Margareta Rightmire", "age": null } ] } }
-{ "arec": { "cid": 397, "name": "Blake Kealy", "age": 34, "address": { "number": 2156, "street": "Cedar St.", "city": "Los Angeles" }, "interests": [ "Databases", "Wine", "Cigars" ], "children": [ { "name": "Lorenza Kealy", "age": null }, { "name": "Beula Kealy", "age": 15 }, { "name": "Kristofer Kealy", "age": null }, { "name": "Shayne Kealy", "age": null } ] }, "brec": { "cid": 448, "name": "Gracie Pekas", "age": 59, "address": { "number": 4732, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Wine", "Cigars" ], "children": [ { "name": "Jeanett Pekas", "age": 35 }, { "name": "Jennifer Pekas", "age": null }, { "name": "Carrol Pekas", "age": null } ] } }
-{ "arec": { "cid": 402, "name": "Terrilyn Shinall", "age": null, "address": null, "interests": [ "Computers", "Skiing", "Music" ], "children": [ { "name": "Minh Shinall", "age": null }, { "name": "Diedre Shinall", "age": 22 } ] }, "brec": { "cid": 803, "name": "Yolonda Korf", "age": null, "address": null, "interests": [ "Bass", "Skiing", "Music" ], "children": [ { "name": "Ivette Korf", "age": null }, { "name": "Lashon Korf", "age": null } ] } }
-{ "arec": { "cid": 406, "name": "Addie Mandez", "age": null, "address": null, "interests": [ "Tennis", "Cigars", "Books" ], "children": [ { "name": "Rosendo Mandez", "age": 34 } ] }, "brec": { "cid": 489, "name": "Brigid Delosier", "age": 31, "address": { "number": 6082, "street": "Oak St.", "city": "Portland" }, "interests": [ "Tennis", "Cigars", "Music" ], "children": [ { "name": "Allegra Delosier", "age": null }, { "name": "Yong Delosier", "age": 10 }, { "name": "Steffanie Delosier", "age": 13 } ] } }
-{ "arec": { "cid": 406, "name": "Addie Mandez", "age": null, "address": null, "interests": [ "Tennis", "Cigars", "Books" ], "children": [ { "name": "Rosendo Mandez", "age": 34 } ] }, "brec": { "cid": 825, "name": "Kirstie Rinebold", "age": 57, "address": { "number": 9463, "street": "Oak St.", "city": "Portland" }, "interests": [ "Cooking", "Cigars", "Books" ], "children": [ { "name": "Vonda Rinebold", "age": null }, { "name": "Man Rinebold", "age": 21 } ] } }
-{ "arec": { "cid": 412, "name": "Devon Szalai", "age": 26, "address": { "number": 2384, "street": "Lake St.", "city": "Los Angeles" }, "interests": [ "Bass", "Books", "Books" ], "children": [ { "name": "Yolonda Szalai", "age": null }, { "name": "Denita Szalai", "age": null }, { "name": "Priscila Szalai", "age": 10 }, { "name": "Cassondra Szalai", "age": 12 } ] }, "brec": { "cid": 722, "name": "Noel Goncalves", "age": null, "address": null, "interests": [ "Books", "Bass", "Books", "Books" ], "children": [ { "name": "Latrice Goncalves", "age": null }, { "name": "Evelia Goncalves", "age": 36 }, { "name": "Etta Goncalves", "age": 11 }, { "name": "Collin Goncalves", "age": null } ] } }
-{ "arec": { "cid": 417, "name": "Irene Funderberg", "age": 45, "address": { "number": 8503, "street": "Hill St.", "city": "Seattle" }, "interests": [ "Music", "Skiing", "Running" ], "children": [ { "name": "Lyndia Funderberg", "age": 14 }, { "name": "Herta Funderberg", "age": null } ] }, "brec": { "cid": 629, "name": "Mayola Clabo", "age": null, "address": null, "interests": [ "Basketball", "Skiing", "Running" ], "children": [ { "name": "Rigoberto Clabo", "age": 58 } ] } }
-{ "arec": { "cid": 417, "name": "Irene Funderberg", "age": 45, "address": { "number": 8503, "street": "Hill St.", "city": "Seattle" }, "interests": [ "Music", "Skiing", "Running" ], "children": [ { "name": "Lyndia Funderberg", "age": 14 }, { "name": "Herta Funderberg", "age": null } ] }, "brec": { "cid": 678, "name": "Lekisha Barnell", "age": null, "address": null, "interests": [ "Movies", "Skiing", "Running" ], "children": [ { "name": "August Barnell", "age": null }, { "name": "Tiffany Barnell", "age": 55 }, { "name": "Meghan Barnell", "age": null } ] } }
-{ "arec": { "cid": 418, "name": "Gavin Delpino", "age": null, "address": null, "interests": [ "Basketball", "Skiing", "Wine", "Fishing" ], "children": [ { "name": "Gianna Delpino", "age": null }, { "name": "Carmella Delpino", "age": 55 } ] }, "brec": { "cid": 621, "name": "Theresa Satterthwaite", "age": 16, "address": { "number": 3249, "street": "Main St.", "city": "Mountain View" }, "interests": [ "Wine", "Skiing", "Wine", "Fishing" ], "children": [ { "name": "Rickie Satterthwaite", "age": null }, { "name": "Rina Satterthwaite", "age": null } ] } }
-{ "arec": { "cid": 429, "name": "Eladia Scannell", "age": 20, "address": { "number": 5036, "street": "Main St.", "city": "Portland" }, "interests": [ "Skiing", "Music", "Movies" ], "children": [ ] }, "brec": { "cid": 518, "name": "Cora Ingargiola", "age": null, "address": null, "interests": [ "Skiing", "Squash", "Movies" ], "children": [ { "name": "Katlyn Ingargiola", "age": null }, { "name": "Mike Ingargiola", "age": null }, { "name": "Lawrence Ingargiola", "age": null }, { "name": "Isabelle Ingargiola", "age": null } ] } }
-{ "arec": { "cid": 435, "name": "Britni Kazemi", "age": 69, "address": { "number": 7868, "street": "Main St.", "city": "San Jose" }, "interests": [ "Databases", "Music", "Wine" ], "children": [ ] }, "brec": { "cid": 587, "name": "Santos Monterio", "age": 36, "address": { "number": 4454, "street": "Oak St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Music", "Cooking" ], "children": [ { "name": "Lashonda Monterio", "age": null } ] } }
-{ "arec": { "cid": 435, "name": "Britni Kazemi", "age": 69, "address": { "number": 7868, "street": "Main St.", "city": "San Jose" }, "interests": [ "Databases", "Music", "Wine" ], "children": [ ] }, "brec": { "cid": 624, "name": "Bong Lyall", "age": null, "address": null, "interests": [ "Databases", "Music", "Video Games" ], "children": [ ] } }
-{ "arec": { "cid": 435, "name": "Britni Kazemi", "age": 69, "address": { "number": 7868, "street": "Main St.", "city": "San Jose" }, "interests": [ "Databases", "Music", "Wine" ], "children": [ ] }, "brec": { "cid": 694, "name": "Ariel Soltani", "age": null, "address": null, "interests": [ "Databases", "Music", "Puzzles" ], "children": [ { "name": "Aldo Soltani", "age": null }, { "name": "Anglea Soltani", "age": null } ] } }
-{ "arec": { "cid": 435, "name": "Britni Kazemi", "age": 69, "address": { "number": 7868, "street": "Main St.", "city": "San Jose" }, "interests": [ "Databases", "Music", "Wine" ], "children": [ ] }, "brec": { "cid": 859, "name": "Mozelle Catillo", "age": 61, "address": { "number": 253, "street": "View St.", "city": "Los Angeles" }, "interests": [ "Databases", "Cooking", "Wine" ], "children": [ ] } }
-{ "arec": { "cid": 435, "name": "Britni Kazemi", "age": 69, "address": { "number": 7868, "street": "Main St.", "city": "San Jose" }, "interests": [ "Databases", "Music", "Wine" ], "children": [ ] }, "brec": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Databases", "Fishing", "Wine" ], "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] } }
-{ "arec": { "cid": 438, "name": "Allegra Pefanis", "age": null, "address": null, "interests": [ "Computers", "Music", "Cigars" ], "children": [ ] }, "brec": { "cid": 440, "name": "Rosie Shappen", "age": null, "address": null, "interests": [ "Cooking", "Music", "Cigars" ], "children": [ { "name": "Jung Shappen", "age": 11 } ] } }
-{ "arec": { "cid": 444, "name": "Demetra Sava", "age": null, "address": null, "interests": [ "Music", "Fishing", "Databases", "Wine" ], "children": [ { "name": "Fidel Sava", "age": 16 } ] }, "brec": { "cid": 484, "name": "Bennie Dragaj", "age": null, "address": null, "interests": [ "Fishing", "Databases", "Wine" ], "children": [ { "name": "Viva Dragaj", "age": 13 } ] } }
-{ "arec": { "cid": 445, "name": "Walton Komo", "age": 16, "address": { "number": 8769, "street": "Main St.", "city": "Seattle" }, "interests": [ "Running", "Basketball", "Tennis" ], "children": [ ] }, "brec": { "cid": 828, "name": "Marcelle Steinhour", "age": null, "address": null, "interests": [ "Running", "Basketball", "Walking" ], "children": [ { "name": "Jimmie Steinhour", "age": 13 }, { "name": "Kirstie Steinhour", "age": 19 } ] } }
-{ "arec": { "cid": 445, "name": "Walton Komo", "age": 16, "address": { "number": 8769, "street": "Main St.", "city": "Seattle" }, "interests": [ "Running", "Basketball", "Tennis" ], "children": [ ] }, "brec": { "cid": 962, "name": "Taryn Coley", "age": null, "address": null, "interests": [ "Running", "Basketball", "Cooking" ], "children": [ ] } }
-{ "arec": { "cid": 448, "name": "Gracie Pekas", "age": 59, "address": { "number": 4732, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Wine", "Cigars" ], "children": [ { "name": "Jeanett Pekas", "age": 35 }, { "name": "Jennifer Pekas", "age": null }, { "name": "Carrol Pekas", "age": null } ] }, "brec": { "cid": 927, "name": "Lillia Hartlein", "age": 55, "address": { "number": 5856, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Coffee", "Cigars" ], "children": [ { "name": "Nicky Hartlein", "age": null }, { "name": "Cassaundra Hartlein", "age": 10 }, { "name": "Micheline Hartlein", "age": 26 }, { "name": "Anton Hartlein", "age": 32 } ] } }
-{ "arec": { "cid": 453, "name": "Sherlyn Deadmond", "age": null, "address": null, "interests": [ "Tennis", "Puzzles", "Base Jumping" ], "children": [ { "name": "Torrie Deadmond", "age": 46 }, { "name": "Cleotilde Deadmond", "age": 55 }, { "name": "Garry Deadmond", "age": 34 }, { "name": "Valrie Deadmond", "age": null } ] }, "brec": { "cid": 734, "name": "Lera Korn", "age": null, "address": null, "interests": [ "Tennis", "Puzzles", "Cigars" ], "children": [ { "name": "Criselda Korn", "age": 37 } ] } }
-{ "arec": { "cid": 453, "name": "Sherlyn Deadmond", "age": null, "address": null, "interests": [ "Tennis", "Puzzles", "Base Jumping" ], "children": [ { "name": "Torrie Deadmond", "age": 46 }, { "name": "Cleotilde Deadmond", "age": 55 }, { "name": "Garry Deadmond", "age": 34 }, { "name": "Valrie Deadmond", "age": null } ] }, "brec": { "cid": 791, "name": "Jame Apresa", "age": 66, "address": { "number": 8417, "street": "Main St.", "city": "San Jose" }, "interests": [ "Running", "Puzzles", "Base Jumping" ], "children": [ { "name": "Awilda Apresa", "age": null }, { "name": "Nelle Apresa", "age": 40 }, { "name": "Terrell Apresa", "age": null }, { "name": "Malia Apresa", "age": 43 } ] } }
-{ "arec": { "cid": 455, "name": "Manual Altizer", "age": 70, "address": { "number": 6293, "street": "7th St.", "city": "Portland" }, "interests": [ "Running", "Fishing", "Coffee" ], "children": [ { "name": "Katherine Altizer", "age": null } ] }, "brec": { "cid": 488, "name": "Dannielle Wilkie", "age": null, "address": null, "interests": [ "Running", "Fishing", "Coffee", "Basketball" ], "children": [ { "name": "Vita Wilkie", "age": 17 }, { "name": "Marisa Wilkie", "age": null }, { "name": "Faustino Wilkie", "age": null } ] } }
-{ "arec": { "cid": 473, "name": "Cordell Solas", "age": null, "address": null, "interests": [ "Squash", "Music", "Bass", "Puzzles" ], "children": [ { "name": "Douglass Solas", "age": null }, { "name": "Claribel Solas", "age": null }, { "name": "Fred Solas", "age": null }, { "name": "Ahmed Solas", "age": 21 } ] }, "brec": { "cid": 527, "name": "Lance Kenison", "age": 77, "address": { "number": 8750, "street": "Main St.", "city": "San Jose" }, "interests": [ "Squash", "Cooking", "Bass", "Puzzles" ], "children": [ { "name": "Youlanda Kenison", "age": null }, { "name": "Lavon Kenison", "age": null }, { "name": "Maryann Kenison", "age": 60 }, { "name": "Kecia Kenison", "age": 50 } ] } }
-{ "arec": { "cid": 484, "name": "Bennie Dragaj", "age": null, "address": null, "interests": [ "Fishing", "Databases", "Wine" ], "children": [ { "name": "Viva Dragaj", "age": 13 } ] }, "brec": { "cid": 986, "name": "Tennille Wikle", "age": 78, "address": { "number": 3428, "street": "View St.", "city": "Portland" }, "interests": [ "Movies", "Databases", "Wine" ], "children": [ { "name": "Lourie Wikle", "age": null }, { "name": "Laure Wikle", "age": null } ] } }
-{ "arec": { "cid": 487, "name": "Zenia Virgilio", "age": 46, "address": { "number": 584, "street": "Main St.", "city": "Mountain View" }, "interests": [ "Walking", "Squash", "Wine" ], "children": [ { "name": "Quintin Virgilio", "age": null }, { "name": "Edith Virgilio", "age": null }, { "name": "Nicolle Virgilio", "age": 33 } ] }, "brec": { "cid": 735, "name": "Lonnie Bechel", "age": 36, "address": { "number": 592, "street": "Main St.", "city": "Sunnyvale" }, "interests": [ "Walking", "Cigars", "Squash", "Wine" ], "children": [ ] } }
-{ "arec": { "cid": 496, "name": "Lonna Starkweather", "age": 80, "address": { "number": 1162, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Coffee", "Bass", "Running" ], "children": [ { "name": "Matilda Starkweather", "age": null } ] }, "brec": { "cid": 545, "name": "Dolores Ferer", "age": null, "address": null, "interests": [ "Coffee", "Bass", "Tennis" ], "children": [ { "name": "Bridgette Ferer", "age": null } ] } }
-{ "arec": { "cid": 496, "name": "Lonna Starkweather", "age": 80, "address": { "number": 1162, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Coffee", "Bass", "Running" ], "children": [ { "name": "Matilda Starkweather", "age": null } ] }, "brec": { "cid": 580, "name": "Liana Gabbert", "age": null, "address": null, "interests": [ "Coffee", "Tennis", "Bass", "Running" ], "children": [ ] } }
-{ "arec": { "cid": 498, "name": "Arleen Sultzer", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Norine Sultzer", "age": 29 } ] }, "brec": { "cid": 854, "name": "Angie Oyster", "age": 32, "address": { "number": 8860, "street": "Main St.", "city": "San Jose" }, "interests": [ "Coffee", "Movies", "Fishing" ], "children": [ { "name": "Hugh Oyster", "age": 10 } ] } }
-{ "arec": { "cid": 498, "name": "Arleen Sultzer", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Norine Sultzer", "age": 29 } ] }, "brec": { "cid": 875, "name": "Ramon Crepps", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Elisha Crepps", "age": null } ] } }
-{ "arec": { "cid": 498, "name": "Arleen Sultzer", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Norine Sultzer", "age": 29 } ] }, "brec": { "cid": 984, "name": "Janett Kitchens", "age": 66, "address": { "number": 7558, "street": "View St.", "city": "Mountain View" }, "interests": [ "Coffee", "Movies", "Squash" ], "children": [ { "name": "Grayce Kitchens", "age": 14 }, { "name": "Dwayne Kitchens", "age": null }, { "name": "Wilber Kitchens", "age": 51 }, { "name": "Nancey Kitchens", "age": null } ] } }
-{ "arec": { "cid": 522, "name": "Daryl Kissack", "age": 86, "address": { "number": 7825, "street": "Cedar St.", "city": "Mountain View" }, "interests": [ "Squash", "Base Jumping", "Tennis" ], "children": [ { "name": "Darrel Kissack", "age": 21 } ] }, "brec": { "cid": 633, "name": "Shalon Grauberger", "age": 34, "address": { "number": 765, "street": "Washington St.", "city": "Sunnyvale" }, "interests": [ "Music", "Base Jumping", "Tennis" ], "children": [ { "name": "Kris Grauberger", "age": 14 }, { "name": "Stuart Grauberger", "age": 12 }, { "name": "Billy Grauberger", "age": null } ] } }
-{ "arec": { "cid": 522, "name": "Daryl Kissack", "age": 86, "address": { "number": 7825, "street": "Cedar St.", "city": "Mountain View" }, "interests": [ "Squash", "Base Jumping", "Tennis" ], "children": [ { "name": "Darrel Kissack", "age": 21 } ] }, "brec": { "cid": 812, "name": "Bee Godette", "age": 26, "address": { "number": 1757, "street": "Washington St.", "city": "Portland" }, "interests": [ "Video Games", "Base Jumping", "Tennis" ], "children": [ { "name": "Madaline Godette", "age": 10 }, { "name": "Shasta Godette", "age": 15 }, { "name": "Parthenia Godette", "age": 11 }, { "name": "Priscila Godette", "age": 13 } ] } }
-{ "arec": { "cid": 537, "name": "Mara Hugar", "age": null, "address": null, "interests": [ "Fishing", "Skiing", "Skiing" ], "children": [ { "name": "Krista Hugar", "age": null } ] }, "brec": { "cid": 600, "name": "Cordell Sherburn", "age": null, "address": null, "interests": [ "Squash", "Skiing", "Skiing" ], "children": [ { "name": "Shenna Sherburn", "age": 22 }, { "name": "Minna Sherburn", "age": 10 }, { "name": "Tari Sherburn", "age": null } ] } }
-{ "arec": { "cid": 541, "name": "Sammy Adamitis", "age": 71, "address": { "number": 5593, "street": "Washington St.", "city": "Seattle" }, "interests": [ "Books", "Tennis", "Cooking" ], "children": [ ] }, "brec": { "cid": 913, "name": "Evelynn Fague", "age": 42, "address": { "number": 5729, "street": "7th St.", "city": "Seattle" }, "interests": [ "Books", "Databases", "Cooking" ], "children": [ ] } }
-{ "arec": { "cid": 545, "name": "Dolores Ferer", "age": null, "address": null, "interests": [ "Coffee", "Bass", "Tennis" ], "children": [ { "name": "Bridgette Ferer", "age": null } ] }, "brec": { "cid": 566, "name": "Asley Grow", "age": null, "address": null, "interests": [ "Coffee", "Books", "Tennis" ], "children": [ { "name": "Dale Grow", "age": null } ] } }
-{ "arec": { "cid": 562, "name": "Etta Hooton", "age": null, "address": null, "interests": [ "Databases", "Cigars", "Music", "Video Games" ], "children": [ { "name": "Sherice Hooton", "age": null }, { "name": "Estefana Hooton", "age": 38 }, { "name": "Nidia Hooton", "age": 47 }, { "name": "Erwin Hooton", "age": null } ] }, "brec": { "cid": 624, "name": "Bong Lyall", "age": null, "address": null, "interests": [ "Databases", "Music", "Video Games" ], "children": [ ] } }
-{ "arec": { "cid": 563, "name": "Deirdre Landero", "age": null, "address": null, "interests": [ "Books", "Fishing", "Video Games" ], "children": [ { "name": "Norman Landero", "age": 59 }, { "name": "Jennine Landero", "age": 45 }, { "name": "Rutha Landero", "age": 19 }, { "name": "Jackie Landero", "age": 29 } ] }, "brec": { "cid": 941, "name": "Jamey Jakobson", "age": null, "address": null, "interests": [ "Books", "Cooking", "Video Games" ], "children": [ { "name": "Elmer Jakobson", "age": 14 }, { "name": "Minh Jakobson", "age": 30 } ] } }
-{ "arec": { "cid": 564, "name": "Inger Dargin", "age": 56, "address": { "number": 8704, "street": "View St.", "city": "Mountain View" }, "interests": [ "Wine", "Running", "Computers" ], "children": [ ] }, "brec": { "cid": 849, "name": "Kristen Zapalac", "age": 14, "address": { "number": 4087, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Wine", "Cooking", "Running", "Computers" ], "children": [ ] } }
-{ "arec": { "cid": 566, "name": "Asley Grow", "age": null, "address": null, "interests": [ "Coffee", "Books", "Tennis" ], "children": [ { "name": "Dale Grow", "age": null } ] }, "brec": { "cid": 750, "name": "Rosaura Gaul", "age": null, "address": null, "interests": [ "Music", "Books", "Tennis" ], "children": [ { "name": "Letisha Gaul", "age": 41 } ] } }
-{ "arec": { "cid": 575, "name": "Phyliss Mattes", "age": 26, "address": { "number": 3956, "street": "Washington St.", "city": "Los Angeles" }, "interests": [ "Tennis", "Music", "Running", "Music" ], "children": [ ] }, "brec": { "cid": 757, "name": "Bertie Flemming", "age": null, "address": null, "interests": [ "Tennis", "Music", "Running", "Cooking" ], "children": [ { "name": "Temeka Flemming", "age": 46 }, { "name": "Terrance Flemming", "age": null }, { "name": "Jenette Flemming", "age": 23 }, { "name": "Debra Flemming", "age": null } ] } }
-{ "arec": { "cid": 585, "name": "Young Drube", "age": 21, "address": { "number": 6960, "street": "View St.", "city": "Seattle" }, "interests": [ "Basketball", "Fishing", "Walking" ], "children": [ { "name": "Irwin Drube", "age": null }, { "name": "Gustavo Drube", "age": null } ] }, "brec": { "cid": 808, "name": "Brande Decius", "age": null, "address": null, "interests": [ "Basketball", "Fishing", "Puzzles" ], "children": [ { "name": "Li Decius", "age": 56 }, { "name": "Eusebio Decius", "age": 50 }, { "name": "Clementina Decius", "age": 29 } ] } }
-{ "arec": { "cid": 587, "name": "Santos Monterio", "age": 36, "address": { "number": 4454, "street": "Oak St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Music", "Cooking" ], "children": [ { "name": "Lashonda Monterio", "age": null } ] }, "brec": { "cid": 624, "name": "Bong Lyall", "age": null, "address": null, "interests": [ "Databases", "Music", "Video Games" ], "children": [ ] } }
-{ "arec": { "cid": 587, "name": "Santos Monterio", "age": 36, "address": { "number": 4454, "street": "Oak St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Music", "Cooking" ], "children": [ { "name": "Lashonda Monterio", "age": null } ] }, "brec": { "cid": 694, "name": "Ariel Soltani", "age": null, "address": null, "interests": [ "Databases", "Music", "Puzzles" ], "children": [ { "name": "Aldo Soltani", "age": null }, { "name": "Anglea Soltani", "age": null } ] } }
-{ "arec": { "cid": 588, "name": "Debora Laughinghouse", "age": 87, "address": { "number": 5099, "street": "View St.", "city": "San Jose" }, "interests": [ "Tennis", "Walking", "Databases" ], "children": [ { "name": "Frederica Laughinghouse", "age": 59 }, { "name": "Johnie Laughinghouse", "age": 12 }, { "name": "Numbers Laughinghouse", "age": 73 } ] }, "brec": { "cid": 853, "name": "Denisse Peralto", "age": 25, "address": { "number": 3931, "street": "7th St.", "city": "Portland" }, "interests": [ "Tennis", "Walking", "Basketball" ], "children": [ { "name": "Asha Peralto", "age": 14 }, { "name": "Clark Peralto", "age": null }, { "name": "Jessika Peralto", "age": null }, { "name": "Nadene Peralto", "age": null } ] } }
-{ "arec": { "cid": 600, "name": "Cordell Sherburn", "age": null, "address": null, "interests": [ "Squash", "Skiing", "Skiing" ], "children": [ { "name": "Shenna Sherburn", "age": 22 }, { "name": "Minna Sherburn", "age": 10 }, { "name": "Tari Sherburn", "age": null } ] }, "brec": { "cid": 703, "name": "Susanne Pettey", "age": null, "address": null, "interests": [ "Squash", "Basketball", "Skiing" ], "children": [ { "name": "Nancey Pettey", "age": 35 }, { "name": "Lawana Pettey", "age": null }, { "name": "Percy Pettey", "age": 25 } ] } }
-{ "arec": { "cid": 602, "name": "Clyde Salada", "age": 59, "address": { "number": 8316, "street": "7th St.", "city": "Sunnyvale" }, "interests": [ "Movies", "Skiing", "Cooking" ], "children": [ ] }, "brec": { "cid": 678, "name": "Lekisha Barnell", "age": null, "address": null, "interests": [ "Movies", "Skiing", "Running" ], "children": [ { "name": "August Barnell", "age": null }, { "name": "Tiffany Barnell", "age": 55 }, { "name": "Meghan Barnell", "age": null } ] } }
-{ "arec": { "cid": 614, "name": "Wallace Chaidy", "age": null, "address": null, "interests": [ "Bass", "Movies", "Music" ], "children": [ { "name": "Refugio Chaidy", "age": null }, { "name": "Hae Chaidy", "age": 55 }, { "name": "Julian Chaidy", "age": null }, { "name": "Tabatha Chaidy", "age": null } ] }, "brec": { "cid": 639, "name": "Zena Seehusen", "age": 24, "address": { "number": 6303, "street": "Hill St.", "city": "Mountain View" }, "interests": [ "Cooking", "Movies", "Music" ], "children": [ { "name": "Hester Seehusen", "age": null }, { "name": "Coreen Seehusen", "age": 12 } ] } }
-{ "arec": { "cid": 614, "name": "Wallace Chaidy", "age": null, "address": null, "interests": [ "Bass", "Movies", "Music" ], "children": [ { "name": "Refugio Chaidy", "age": null }, { "name": "Hae Chaidy", "age": 55 }, { "name": "Julian Chaidy", "age": null }, { "name": "Tabatha Chaidy", "age": null } ] }, "brec": { "cid": 803, "name": "Yolonda Korf", "age": null, "address": null, "interests": [ "Bass", "Skiing", "Music" ], "children": [ { "name": "Ivette Korf", "age": null }, { "name": "Lashon Korf", "age": null } ] } }
-{ "arec": { "cid": 621, "name": "Theresa Satterthwaite", "age": 16, "address": { "number": 3249, "street": "Main St.", "city": "Mountain View" }, "interests": [ "Wine", "Skiing", "Wine", "Fishing" ], "children": [ { "name": "Rickie Satterthwaite", "age": null }, { "name": "Rina Satterthwaite", "age": null } ] }, "brec": { "cid": 929, "name": "Jean Guitierrez", "age": 75, "address": { "number": 9736, "street": "Lake St.", "city": "Mountain View" }, "interests": [ "Wine", "Wine", "Fishing" ], "children": [ ] } }
-{ "arec": { "cid": 624, "name": "Bong Lyall", "age": null, "address": null, "interests": [ "Databases", "Music", "Video Games" ], "children": [ ] }, "brec": { "cid": 694, "name": "Ariel Soltani", "age": null, "address": null, "interests": [ "Databases", "Music", "Puzzles" ], "children": [ { "name": "Aldo Soltani", "age": null }, { "name": "Anglea Soltani", "age": null } ] } }
-{ "arec": { "cid": 629, "name": "Mayola Clabo", "age": null, "address": null, "interests": [ "Basketball", "Skiing", "Running" ], "children": [ { "name": "Rigoberto Clabo", "age": 58 } ] }, "brec": { "cid": 678, "name": "Lekisha Barnell", "age": null, "address": null, "interests": [ "Movies", "Skiing", "Running" ], "children": [ { "name": "August Barnell", "age": null }, { "name": "Tiffany Barnell", "age": 55 }, { "name": "Meghan Barnell", "age": null } ] } }
-{ "arec": { "cid": 633, "name": "Shalon Grauberger", "age": 34, "address": { "number": 765, "street": "Washington St.", "city": "Sunnyvale" }, "interests": [ "Music", "Base Jumping", "Tennis" ], "children": [ { "name": "Kris Grauberger", "age": 14 }, { "name": "Stuart Grauberger", "age": 12 }, { "name": "Billy Grauberger", "age": null } ] }, "brec": { "cid": 750, "name": "Rosaura Gaul", "age": null, "address": null, "interests": [ "Music", "Books", "Tennis" ], "children": [ { "name": "Letisha Gaul", "age": 41 } ] } }
-{ "arec": { "cid": 633, "name": "Shalon Grauberger", "age": 34, "address": { "number": 765, "street": "Washington St.", "city": "Sunnyvale" }, "interests": [ "Music", "Base Jumping", "Tennis" ], "children": [ { "name": "Kris Grauberger", "age": 14 }, { "name": "Stuart Grauberger", "age": 12 }, { "name": "Billy Grauberger", "age": null } ] }, "brec": { "cid": 812, "name": "Bee Godette", "age": 26, "address": { "number": 1757, "street": "Washington St.", "city": "Portland" }, "interests": [ "Video Games", "Base Jumping", "Tennis" ], "children": [ { "name": "Madaline Godette", "age": 10 }, { "name": "Shasta Godette", "age": 15 }, { "name": "Parthenia Godette", "age": 11 }, { "name": "Priscila Godette", "age": 13 } ] } }
-{ "arec": { "cid": 636, "name": "Babara Shore", "age": 83, "address": { "number": 9452, "street": "Oak St.", "city": "Los Angeles" }, "interests": [ "Databases", "Movies", "Tennis" ], "children": [ { "name": "Candy Shore", "age": 58 }, { "name": "Nanci Shore", "age": null }, { "name": "Asia Shore", "age": null } ] }, "brec": { "cid": 992, "name": "Staci Alexandropoul", "age": null, "address": null, "interests": [ "Databases", "Movies", "Tennis" ], "children": [ { "name": "Casimira Alexandropoul", "age": null }, { "name": "Kena Alexandropoul", "age": 54 }, { "name": "Ellie Alexandropoul", "age": null }, { "name": "Ambrose Alexandropoul", "age": null } ] } }
-{ "arec": { "cid": 649, "name": "Anisha Sender", "age": null, "address": null, "interests": [ "Tennis", "Databases", "Bass" ], "children": [ { "name": "Viva Sender", "age": 40 }, { "name": "Terica Sender", "age": null } ] }, "brec": { "cid": 661, "name": "Lorita Kraut", "age": 43, "address": { "number": 5017, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Tennis", "Movies", "Bass" ], "children": [ { "name": "Mirian Kraut", "age": null } ] } }
-{ "arec": { "cid": 649, "name": "Anisha Sender", "age": null, "address": null, "interests": [ "Tennis", "Databases", "Bass" ], "children": [ { "name": "Viva Sender", "age": 40 }, { "name": "Terica Sender", "age": null } ] }, "brec": { "cid": 928, "name": "Maddie Diclaudio", "age": 33, "address": { "number": 4674, "street": "Washington St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Databases", "Bass" ], "children": [ { "name": "Dominique Diclaudio", "age": 12 } ] } }
-{ "arec": { "cid": 655, "name": "Shaun Brandenburg", "age": null, "address": null, "interests": [ "Skiing", "Computers", "Base Jumping" ], "children": [ { "name": "Ned Brandenburg", "age": null }, { "name": "Takako Brandenburg", "age": 41 }, { "name": "Astrid Brandenburg", "age": null }, { "name": "Patience Brandenburg", "age": null } ] }, "brec": { "cid": 996, "name": "Elouise Wider", "age": null, "address": null, "interests": [ "Coffee", "Computers", "Base Jumping" ], "children": [ ] } }
-{ "arec": { "cid": 658, "name": "Truman Leitner", "age": null, "address": null, "interests": [ "Computers", "Bass", "Walking" ], "children": [ ] }, "brec": { "cid": 838, "name": "Karan Aharon", "age": 88, "address": { "number": 8033, "street": "Washington St.", "city": "Portland" }, "interests": [ "Computers", "Movies", "Walking" ], "children": [ { "name": "Matha Aharon", "age": 16 } ] } }
-{ "arec": { "cid": 662, "name": "Domonique Corbi", "age": 13, "address": { "number": 7286, "street": "Hill St.", "city": "Seattle" }, "interests": [ "Tennis", "Cooking", "Computers" ], "children": [ { "name": "Katrice Corbi", "age": null }, { "name": "Idalia Corbi", "age": null }, { "name": "Hayley Corbi", "age": null } ] }, "brec": { "cid": 964, "name": "Stephany Soders", "age": null, "address": null, "interests": [ "Tennis", "Wine", "Computers" ], "children": [ ] } }
-{ "arec": { "cid": 670, "name": "Angelo Kellar", "age": 22, "address": { "number": 3178, "street": "View St.", "city": "Seattle" }, "interests": [ "Wine", "Music", "Fishing" ], "children": [ { "name": "Zula Kellar", "age": null }, { "name": "Brittaney Kellar", "age": 10 }, { "name": "Fredia Kellar", "age": null } ] }, "brec": { "cid": 929, "name": "Jean Guitierrez", "age": 75, "address": { "number": 9736, "street": "Lake St.", "city": "Mountain View" }, "interests": [ "Wine", "Wine", "Fishing" ], "children": [ ] } }
-{ "arec": { "cid": 694, "name": "Ariel Soltani", "age": null, "address": null, "interests": [ "Databases", "Music", "Puzzles" ], "children": [ { "name": "Aldo Soltani", "age": null }, { "name": "Anglea Soltani", "age": null } ] }, "brec": { "cid": 916, "name": "Kris Mcmarlin", "age": null, "address": null, "interests": [ "Movies", "Music", "Puzzles" ], "children": [ ] } }
-{ "arec": { "cid": 704, "name": "Melodee Clemons", "age": null, "address": null, "interests": [ "Base Jumping", "Tennis", "Video Games" ], "children": [ { "name": "Doreatha Clemons", "age": 22 } ] }, "brec": { "cid": 901, "name": "Riva Ziko", "age": null, "address": null, "interests": [ "Running", "Tennis", "Video Games" ], "children": [ { "name": "Leandra Ziko", "age": 49 }, { "name": "Torrie Ziko", "age": null } ] } }
-{ "arec": { "cid": 704, "name": "Melodee Clemons", "age": null, "address": null, "interests": [ "Base Jumping", "Tennis", "Video Games" ], "children": [ { "name": "Doreatha Clemons", "age": 22 } ] }, "brec": { "cid": 948, "name": "Thad Scialpi", "age": 22, "address": { "number": 8731, "street": "Washington St.", "city": "Portland" }, "interests": [ "Base Jumping", "Tennis", "Wine" ], "children": [ { "name": "Harlan Scialpi", "age": 10 }, { "name": "Lucile Scialpi", "age": 11 }, { "name": "Audria Scialpi", "age": null } ] } }
-{ "arec": { "cid": 710, "name": "Arlen Horka", "age": null, "address": null, "interests": [ "Movies", "Coffee", "Walking" ], "children": [ { "name": "Valencia Horka", "age": null }, { "name": "Wesley Horka", "age": null } ] }, "brec": { "cid": 923, "name": "Bobbi Ursino", "age": null, "address": null, "interests": [ "Movies", "Books", "Walking" ], "children": [ { "name": "Shon Ursino", "age": null }, { "name": "Lorean Ursino", "age": null } ] } }
-{ "arec": { "cid": 744, "name": "Crysta Christen", "age": 57, "address": { "number": 439, "street": "Hill St.", "city": "Portland" }, "interests": [ "Basketball", "Squash", "Base Jumping" ], "children": [ ] }, "brec": { "cid": 856, "name": "Inocencia Petzold", "age": 83, "address": { "number": 4631, "street": "Cedar St.", "city": "Mountain View" }, "interests": [ "Basketball", "Squash", "Movies", "Base Jumping" ], "children": [ ] } }
-{ "arec": { "cid": 769, "name": "Isaias Tenny", "age": 71, "address": { "number": 270, "street": "Park St.", "city": "Portland" }, "interests": [ "Wine", "Fishing", "Base Jumping" ], "children": [ { "name": "Theo Tenny", "age": null }, { "name": "Shena Tenny", "age": null }, { "name": "Coralee Tenny", "age": null }, { "name": "Orval Tenny", "age": 39 } ] }, "brec": { "cid": 848, "name": "Myrta Kopf", "age": null, "address": null, "interests": [ "Wine", "Basketball", "Base Jumping" ], "children": [ ] } }
-{ "arec": { "cid": 776, "name": "Dagmar Sarkis", "age": null, "address": null, "interests": [ "Basketball", "Running", "Wine" ], "children": [ { "name": "Tari Sarkis", "age": null }, { "name": "Rana Sarkis", "age": 56 }, { "name": "Merissa Sarkis", "age": null }, { "name": "Lori Sarkis", "age": 26 } ] }, "brec": { "cid": 908, "name": "Ferdinand Auila", "age": 82, "address": { "number": 1071, "street": "Lake St.", "city": "Portland" }, "interests": [ "Base Jumping", "Running", "Wine" ], "children": [ { "name": "Ai Auila", "age": 69 }, { "name": "Laurel Auila", "age": null } ] } }
-{ "arec": { "cid": 791, "name": "Jame Apresa", "age": 66, "address": { "number": 8417, "street": "Main St.", "city": "San Jose" }, "interests": [ "Running", "Puzzles", "Base Jumping" ], "children": [ { "name": "Awilda Apresa", "age": null }, { "name": "Nelle Apresa", "age": 40 }, { "name": "Terrell Apresa", "age": null }, { "name": "Malia Apresa", "age": 43 } ] }, "brec": { "cid": 801, "name": "Julio Brun", "age": 13, "address": { "number": 9774, "street": "Main St.", "city": "Sunnyvale" }, "interests": [ "Puzzles", "Running", "Puzzles", "Base Jumping" ], "children": [ { "name": "Peter Brun", "age": null }, { "name": "Remona Brun", "age": null }, { "name": "Giovanni Brun", "age": null } ] } }
-{ "arec": { "cid": 806, "name": "Corliss Sharratt", "age": null, "address": null, "interests": [ "Basketball", "Cigars", "Cooking" ], "children": [ { "name": "Albertine Sharratt", "age": null }, { "name": "Nobuko Sharratt", "age": 29 }, { "name": "Neil Sharratt", "age": null } ] }, "brec": { "cid": 861, "name": "Hugh Mcbrien", "age": null, "address": null, "interests": [ "Skiing", "Cigars", "Cooking" ], "children": [ { "name": "Otha Mcbrien", "age": 38 } ] } }
-{ "arec": { "cid": 806, "name": "Corliss Sharratt", "age": null, "address": null, "interests": [ "Basketball", "Cigars", "Cooking" ], "children": [ { "name": "Albertine Sharratt", "age": null }, { "name": "Nobuko Sharratt", "age": 29 }, { "name": "Neil Sharratt", "age": null } ] }, "brec": { "cid": 867, "name": "Denise Dipiero", "age": null, "address": null, "interests": [ "Basketball", "Cigars", "Cooking", "Running" ], "children": [ { "name": "Santa Dipiero", "age": null } ] } }
-{ "arec": { "cid": 828, "name": "Marcelle Steinhour", "age": null, "address": null, "interests": [ "Running", "Basketball", "Walking" ], "children": [ { "name": "Jimmie Steinhour", "age": 13 }, { "name": "Kirstie Steinhour", "age": 19 } ] }, "brec": { "cid": 962, "name": "Taryn Coley", "age": null, "address": null, "interests": [ "Running", "Basketball", "Cooking" ], "children": [ ] } }
-{ "arec": { "cid": 853, "name": "Denisse Peralto", "age": 25, "address": { "number": 3931, "street": "7th St.", "city": "Portland" }, "interests": [ "Tennis", "Walking", "Basketball" ], "children": [ { "name": "Asha Peralto", "age": 14 }, { "name": "Clark Peralto", "age": null }, { "name": "Jessika Peralto", "age": null }, { "name": "Nadene Peralto", "age": null } ] }, "brec": { "cid": 912, "name": "Alessandra Kaskey", "age": 52, "address": { "number": 6906, "street": "View St.", "city": "Los Angeles" }, "interests": [ "Skiing", "Walking", "Basketball" ], "children": [ { "name": "Mack Kaskey", "age": null } ] } }
-{ "arec": { "cid": 854, "name": "Angie Oyster", "age": 32, "address": { "number": 8860, "street": "Main St.", "city": "San Jose" }, "interests": [ "Coffee", "Movies", "Fishing" ], "children": [ { "name": "Hugh Oyster", "age": 10 } ] }, "brec": { "cid": 875, "name": "Ramon Crepps", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Elisha Crepps", "age": null } ] } }
-{ "arec": { "cid": 854, "name": "Angie Oyster", "age": 32, "address": { "number": 8860, "street": "Main St.", "city": "San Jose" }, "interests": [ "Coffee", "Movies", "Fishing" ], "children": [ { "name": "Hugh Oyster", "age": 10 } ] }, "brec": { "cid": 984, "name": "Janett Kitchens", "age": 66, "address": { "number": 7558, "street": "View St.", "city": "Mountain View" }, "interests": [ "Coffee", "Movies", "Squash" ], "children": [ { "name": "Grayce Kitchens", "age": 14 }, { "name": "Dwayne Kitchens", "age": null }, { "name": "Wilber Kitchens", "age": 51 }, { "name": "Nancey Kitchens", "age": null } ] } }
-{ "arec": { "cid": 859, "name": "Mozelle Catillo", "age": 61, "address": { "number": 253, "street": "View St.", "city": "Los Angeles" }, "interests": [ "Databases", "Cooking", "Wine" ], "children": [ ] }, "brec": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Databases", "Fishing", "Wine" ], "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] } }
-{ "arec": { "cid": 875, "name": "Ramon Crepps", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Elisha Crepps", "age": null } ] }, "brec": { "cid": 984, "name": "Janett Kitchens", "age": 66, "address": { "number": 7558, "street": "View St.", "city": "Mountain View" }, "interests": [ "Coffee", "Movies", "Squash" ], "children": [ { "name": "Grayce Kitchens", "age": 14 }, { "name": "Dwayne Kitchens", "age": null }, { "name": "Wilber Kitchens", "age": 51 }, { "name": "Nancey Kitchens", "age": null } ] } }
-{ "arec": { "cid": 892, "name": "Madge Hendson", "age": 79, "address": { "number": 8832, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Databases", "Fishing", "Skiing" ], "children": [ { "name": "Elia Hendson", "age": 48 }, { "name": "Lashawn Hendson", "age": 27 } ] }, "brec": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Databases", "Fishing", "Wine" ], "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] } }
-{ "arec": { "cid": 908, "name": "Ferdinand Auila", "age": 82, "address": { "number": 1071, "street": "Lake St.", "city": "Portland" }, "interests": [ "Base Jumping", "Running", "Wine" ], "children": [ { "name": "Ai Auila", "age": 69 }, { "name": "Laurel Auila", "age": null } ] }, "brec": { "cid": 948, "name": "Thad Scialpi", "age": 22, "address": { "number": 8731, "street": "Washington St.", "city": "Portland" }, "interests": [ "Base Jumping", "Tennis", "Wine" ], "children": [ { "name": "Harlan Scialpi", "age": 10 }, { "name": "Lucile Scialpi", "age": 11 }, { "name": "Audria Scialpi", "age": null } ] } }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/index-join/inverted-index-olist-jaccard.adm b/asterix-app/src/test/resources/runtimets/results/index-join/inverted-index-olist-jaccard.adm
deleted file mode 100644
index b733c588..0000000
--- a/asterix-app/src/test/resources/runtimets/results/index-join/inverted-index-olist-jaccard.adm
+++ /dev/null
@@ -1,267 +0,0 @@
-{ "a": [ "Bass", "Tennis", "Bass", "Cooking" ], "b": [ "Bass", "Cooking", "Running", "Tennis" ] }
-{ "a": [ "Bass", "Wine" ], "b": [ "Bass", "Wine" ] }
-{ "a": [ "Music", "Databases" ], "b": [ "Databases", "Music" ] }
-{ "a": [ "Music", "Databases" ], "b": [ "Databases", "Music" ] }
-{ "a": [ "Music", "Databases" ], "b": [ "Music", "Databases" ] }
-{ "a": [ "Music", "Databases" ], "b": [ "Databases", "Music" ] }
-{ "a": [ "Wine", "Walking" ], "b": [ "Wine", "Walking" ] }
-{ "a": [ "Wine", "Walking" ], "b": [ "Walking", "Wine" ] }
-{ "a": [ "Base Jumping", "Cigars", "Movies" ], "b": [ "Base Jumping", "Cigars", "Movies" ] }
-{ "a": [ "Fishing", "Running", "Tennis", "Running" ], "b": [ "Tennis", "Coffee", "Running", "Fishing" ] }
-{ "a": [ "Skiing", "Walking" ], "b": [ "Skiing", "Walking" ] }
-{ "a": [ "Base Jumping", "Music" ], "b": [ "Music", "Base Jumping" ] }
-{ "a": [ "Base Jumping", "Music" ], "b": [ "Music", "Base Jumping" ] }
-{ "a": [ "Fishing", "Video Games" ], "b": [ "Video Games", "Fishing" ] }
-{ "a": [ "Base Jumping", "Skiing" ], "b": [ "Skiing", "Base Jumping" ] }
-{ "a": [ "Base Jumping", "Skiing" ], "b": [ "Base Jumping", "Skiing" ] }
-{ "a": [ "Skiing", "Bass" ], "b": [ "Skiing", "Bass" ] }
-{ "a": [ "Skiing", "Bass" ], "b": [ "Skiing", "Bass" ] }
-{ "a": [ "Skiing", "Bass" ], "b": [ "Bass", "Skiing" ] }
-{ "a": [ "Fishing", "Running", "Cigars" ], "b": [ "Fishing", "Cigars", "Running" ] }
-{ "a": [ "Bass", "Bass", "Books" ], "b": [ "Movies", "Books", "Bass" ] }
-{ "a": [ "Bass", "Bass", "Books" ], "b": [ "Bass", "Books", "Books" ] }
-{ "a": [ "Cigars", "Skiing" ], "b": [ "Skiing", "Cigars" ] }
-{ "a": [ "Tennis", "Tennis", "Databases", "Squash" ], "b": [ "Cigars", "Databases", "Squash", "Tennis" ] }
-{ "a": [ "Cigars", "Cigars", "Bass", "Books" ], "b": [ "Books", "Cigars", "Bass", "Base Jumping" ] }
-{ "a": [ "Cigars", "Cigars", "Bass", "Books" ], "b": [ "Bass", "Cigars", "Books", "Basketball" ] }
-{ "a": [ "Movies", "Walking" ], "b": [ "Movies", "Walking" ] }
-{ "a": [ "Music", "Coffee" ], "b": [ "Coffee", "Music" ] }
-{ "a": [ "Running", "Coffee", "Fishing" ], "b": [ "Running", "Fishing", "Coffee" ] }
-{ "a": [ "Squash", "Movies", "Coffee" ], "b": [ "Coffee", "Movies", "Squash" ] }
-{ "a": [ "Music", "Tennis", "Base Jumping" ], "b": [ "Music", "Base Jumping", "Tennis" ] }
-{ "a": [ "Movies", "Fishing", "Fishing" ], "b": [ "Tennis", "Fishing", "Movies" ] }
-{ "a": [ "Movies", "Fishing", "Fishing" ], "b": [ "Databases", "Fishing", "Movies" ] }
-{ "a": [ "Movies", "Fishing", "Fishing" ], "b": [ "Coffee", "Movies", "Fishing" ] }
-{ "a": [ "Music", "Base Jumping", "Books" ], "b": [ "Books", "Base Jumping", "Music" ] }
-{ "a": [ "Bass", "Books" ], "b": [ "Bass", "Books" ] }
-{ "a": [ "Bass", "Books" ], "b": [ "Books", "Bass" ] }
-{ "a": [ "Skiing", "Squash", "Skiing", "Fishing" ], "b": [ "Base Jumping", "Fishing", "Skiing", "Squash" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Puzzles", "Squash" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Squash", "Databases" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Wine", "Squash" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Skiing", "Squash" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Bass", "Squash" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Video Games", "Squash" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Squash", "Tennis" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Music", "Squash" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Squash", "Tennis" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Squash", "Databases" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Squash", "Cigars" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Squash", "Puzzles" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Wine", "Squash" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Squash", "Computers" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Bass", "Squash" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Running", "Squash" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Squash", "Cigars" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Base Jumping", "Squash" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Music", "Squash" ] }
-{ "a": [ "Squash", "Squash" ], "b": [ "Cooking", "Squash" ] }
-{ "a": [ "Puzzles", "Squash" ], "b": [ "Squash", "Puzzles" ] }
-{ "a": [ "Computers", "Wine" ], "b": [ "Wine", "Computers" ] }
-{ "a": [ "Computers", "Wine" ], "b": [ "Computers", "Wine" ] }
-{ "a": [ "Computers", "Wine" ], "b": [ "Wine", "Computers" ] }
-{ "a": [ "Walking", "Cooking" ], "b": [ "Walking", "Cooking" ] }
-{ "a": [ "Walking", "Cooking" ], "b": [ "Walking", "Cooking" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Squash", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Basketball", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Music" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Skiing" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Music" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Video Games", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Coffee", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Video Games" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Skiing" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Fishing", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Cooking" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Puzzles" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Fishing", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Wine", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Tennis" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Movies" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Squash", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Base Jumping", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Video Games" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Music", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Music" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Coffee" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Wine" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Running", "Databases" ] }
-{ "a": [ "Squash", "Databases" ], "b": [ "Squash", "Databases" ] }
-{ "a": [ "Music", "Fishing", "Music" ], "b": [ "Wine", "Music", "Fishing" ] }
-{ "a": [ "Music", "Fishing", "Music" ], "b": [ "Music", "Fishing", "Computers" ] }
-{ "a": [ "Wine", "Computers" ], "b": [ "Computers", "Wine" ] }
-{ "a": [ "Wine", "Computers" ], "b": [ "Wine", "Computers" ] }
-{ "a": [ "Skiing", "Bass" ], "b": [ "Skiing", "Bass" ] }
-{ "a": [ "Skiing", "Bass" ], "b": [ "Bass", "Skiing" ] }
-{ "a": [ "Coffee", "Coffee", "Cigars" ], "b": [ "Cigars", "Cigars", "Coffee" ] }
-{ "a": [ "Coffee", "Coffee", "Cigars" ], "b": [ "Cigars", "Coffee", "Books" ] }
-{ "a": [ "Coffee", "Coffee", "Cigars" ], "b": [ "Coffee", "Walking", "Cigars" ] }
-{ "a": [ "Coffee", "Coffee", "Cigars" ], "b": [ "Base Jumping", "Coffee", "Cigars" ] }
-{ "a": [ "Movies", "Books" ], "b": [ "Movies", "Books" ] }
-{ "a": [ "Movies", "Books" ], "b": [ "Books", "Movies" ] }
-{ "a": [ "Movies", "Books" ], "b": [ "Movies", "Books" ] }
-{ "a": [ "Wine", "Squash" ], "b": [ "Wine", "Squash" ] }
-{ "a": [ "Coffee", "Tennis" ], "b": [ "Tennis", "Coffee" ] }
-{ "a": [ "Coffee", "Tennis" ], "b": [ "Tennis", "Coffee" ] }
-{ "a": [ "Skiing", "Books" ], "b": [ "Books", "Skiing" ] }
-{ "a": [ "Databases", "Music" ], "b": [ "Databases", "Music" ] }
-{ "a": [ "Databases", "Music" ], "b": [ "Music", "Databases" ] }
-{ "a": [ "Databases", "Music" ], "b": [ "Databases", "Music" ] }
-{ "a": [ "Video Games", "Cigars" ], "b": [ "Cigars", "Video Games" ] }
-{ "a": [ "Video Games", "Cigars" ], "b": [ "Video Games", "Cigars" ] }
-{ "a": [ "Databases", "Skiing" ], "b": [ "Databases", "Skiing" ] }
-{ "a": [ "Running", "Fishing" ], "b": [ "Running", "Fishing" ] }
-{ "a": [ "Base Jumping", "Base Jumping", "Walking", "Computers" ], "b": [ "Base Jumping", "Fishing", "Walking", "Computers" ] }
-{ "a": [ "Databases", "Music" ], "b": [ "Music", "Databases" ] }
-{ "a": [ "Databases", "Music" ], "b": [ "Databases", "Music" ] }
-{ "a": [ "Wine", "Walking", "Books", "Walking" ], "b": [ "Music", "Wine", "Books", "Walking" ] }
-{ "a": [ "Bass", "Bass", "Base Jumping" ], "b": [ "Base Jumping", "Bass", "Cooking" ] }
-{ "a": [ "Bass", "Bass", "Base Jumping" ], "b": [ "Base Jumping", "Databases", "Bass" ] }
-{ "a": [ "Cigars", "Cigars", "Coffee" ], "b": [ "Cigars", "Coffee", "Books" ] }
-{ "a": [ "Cigars", "Cigars", "Coffee" ], "b": [ "Coffee", "Walking", "Cigars" ] }
-{ "a": [ "Cigars", "Cigars", "Coffee" ], "b": [ "Base Jumping", "Coffee", "Cigars" ] }
-{ "a": [ "Base Jumping", "Running" ], "b": [ "Running", "Base Jumping" ] }
-{ "a": [ "Base Jumping", "Running" ], "b": [ "Base Jumping", "Running" ] }
-{ "a": [ "Cooking", "Squash", "Cooking", "Coffee" ], "b": [ "Coffee", "Cigars", "Cooking", "Squash" ] }
-{ "a": [ "Books", "Base Jumping" ], "b": [ "Books", "Base Jumping" ] }
-{ "a": [ "Books", "Base Jumping" ], "b": [ "Books", "Base Jumping" ] }
-{ "a": [ "Cooking", "Running" ], "b": [ "Cooking", "Running" ] }
-{ "a": [ "Video Games", "Databases" ], "b": [ "Databases", "Video Games" ] }
-{ "a": [ "Video Games", "Databases" ], "b": [ "Databases", "Video Games" ] }
-{ "a": [ "Cigars", "Video Games" ], "b": [ "Video Games", "Cigars" ] }
-{ "a": [ "Running", "Base Jumping" ], "b": [ "Base Jumping", "Running" ] }
-{ "a": [ "Coffee", "Databases" ], "b": [ "Databases", "Coffee" ] }
-{ "a": [ "Movies", "Books" ], "b": [ "Books", "Movies" ] }
-{ "a": [ "Movies", "Books" ], "b": [ "Movies", "Books" ] }
-{ "a": [ "Databases", "Video Games" ], "b": [ "Databases", "Video Games" ] }
-{ "a": [ "Tennis", "Movies", "Movies" ], "b": [ "Databases", "Movies", "Tennis" ] }
-{ "a": [ "Tennis", "Movies", "Movies" ], "b": [ "Tennis", "Movies", "Bass" ] }
-{ "a": [ "Tennis", "Movies", "Movies" ], "b": [ "Databases", "Movies", "Tennis" ] }
-{ "a": [ "Music", "Base Jumping" ], "b": [ "Music", "Base Jumping" ] }
-{ "a": [ "Bass", "Squash" ], "b": [ "Bass", "Squash" ] }
-{ "a": [ "Walking", "Walking" ], "b": [ "Walking", "Cooking" ] }
-{ "a": [ "Walking", "Walking" ], "b": [ "Walking", "Books" ] }
-{ "a": [ "Walking", "Walking" ], "b": [ "Wine", "Walking" ] }
-{ "a": [ "Walking", "Walking" ], "b": [ "Walking", "Running" ] }
-{ "a": [ "Walking", "Walking" ], "b": [ "Walking", "Computers" ] }
-{ "a": [ "Walking", "Walking" ], "b": [ "Bass", "Walking" ] }
-{ "a": [ "Walking", "Walking" ], "b": [ "Skiing", "Walking" ] }
-{ "a": [ "Walking", "Walking" ], "b": [ "Computers", "Walking" ] }
-{ "a": [ "Walking", "Walking" ], "b": [ "Walking", "Wine" ] }
-{ "a": [ "Walking", "Walking" ], "b": [ "Movies", "Walking" ] }
-{ "a": [ "Walking", "Walking" ], "b": [ "Walking", "Bass" ] }
-{ "a": [ "Walking", "Walking" ], "b": [ "Music", "Walking" ] }
-{ "a": [ "Walking", "Walking" ], "b": [ "Walking", "Cooking" ] }
-{ "a": [ "Walking", "Walking" ], "b": [ "Cigars", "Walking" ] }
-{ "a": [ "Computers", "Tennis" ], "b": [ "Tennis", "Computers" ] }
-{ "a": [ "Tennis", "Coffee" ], "b": [ "Tennis", "Coffee" ] }
-{ "a": [ "Running", "Basketball", "Computers", "Basketball" ], "b": [ "Computers", "Cooking", "Running", "Basketball" ] }
-{ "a": [ "Puzzles", "Books" ], "b": [ "Puzzles", "Books" ] }
-{ "a": [ "Puzzles", "Books" ], "b": [ "Puzzles", "Books" ] }
-{ "a": [ "Skiing", "Wine" ], "b": [ "Wine", "Skiing" ] }
-{ "a": [ "Squash", "Squash", "Music" ], "b": [ "Video Games", "Squash", "Music" ] }
-{ "a": [ "Squash", "Tennis" ], "b": [ "Squash", "Tennis" ] }
-{ "a": [ "Walking", "Cooking" ], "b": [ "Walking", "Cooking" ] }
-{ "a": [ "Coffee", "Tennis", "Bass" ], "b": [ "Coffee", "Bass", "Tennis" ] }
-{ "a": [ "Music", "Squash" ], "b": [ "Music", "Squash" ] }
-{ "a": [ "Computers", "Fishing" ], "b": [ "Fishing", "Computers" ] }
-{ "a": [ "Computers", "Fishing" ], "b": [ "Computers", "Fishing" ] }
-{ "a": [ "Wine", "Walking" ], "b": [ "Walking", "Wine" ] }
-{ "a": [ "Skiing", "Base Jumping" ], "b": [ "Base Jumping", "Skiing" ] }
-{ "a": [ "Bass", "Books" ], "b": [ "Books", "Bass" ] }
-{ "a": [ "Tennis", "Running", "Tennis" ], "b": [ "Running", "Basketball", "Tennis" ] }
-{ "a": [ "Tennis", "Running", "Tennis" ], "b": [ "Running", "Tennis", "Video Games" ] }
-{ "a": [ "Fishing", "Music" ], "b": [ "Fishing", "Music" ] }
-{ "a": [ "Books", "Tennis" ], "b": [ "Books", "Tennis" ] }
-{ "a": [ "Books", "Tennis" ], "b": [ "Tennis", "Books" ] }
-{ "a": [ "Squash", "Squash", "Video Games" ], "b": [ "Video Games", "Squash", "Music" ] }
-{ "a": [ "Books", "Tennis" ], "b": [ "Tennis", "Books" ] }
-{ "a": [ "Music", "Books", "Books", "Wine" ], "b": [ "Music", "Wine", "Books", "Walking" ] }
-{ "a": [ "Basketball", "Basketball", "Computers" ], "b": [ "Computers", "Basketball", "Squash" ] }
-{ "a": [ "Fishing", "Databases" ], "b": [ "Fishing", "Databases" ] }
-{ "a": [ "Walking", "Computers" ], "b": [ "Computers", "Walking" ] }
-{ "a": [ "Books", "Base Jumping" ], "b": [ "Books", "Base Jumping" ] }
-{ "a": [ "Movies", "Cooking", "Skiing" ], "b": [ "Movies", "Skiing", "Cooking" ] }
-{ "a": [ "Puzzles", "Books" ], "b": [ "Puzzles", "Books" ] }
-{ "a": [ "Wine", "Databases" ], "b": [ "Databases", "Wine" ] }
-{ "a": [ "Fishing", "Databases", "Wine" ], "b": [ "Fishing", "Wine", "Databases" ] }
-{ "a": [ "Fishing", "Databases", "Wine" ], "b": [ "Databases", "Fishing", "Wine" ] }
-{ "a": [ "Coffee", "Movies", "Skiing" ], "b": [ "Coffee", "Movies", "Skiing" ] }
-{ "a": [ "Cigars", "Cigars" ], "b": [ "Squash", "Cigars" ] }
-{ "a": [ "Cigars", "Cigars" ], "b": [ "Cigars", "Base Jumping" ] }
-{ "a": [ "Cigars", "Cigars" ], "b": [ "Video Games", "Cigars" ] }
-{ "a": [ "Cigars", "Cigars" ], "b": [ "Cigars", "Cigars" ] }
-{ "a": [ "Cigars", "Cigars" ], "b": [ "Cigars", "Bass" ] }
-{ "a": [ "Cigars", "Cigars" ], "b": [ "Squash", "Cigars" ] }
-{ "a": [ "Cigars", "Cigars" ], "b": [ "Skiing", "Cigars" ] }
-{ "a": [ "Cigars", "Cigars" ], "b": [ "Cigars", "Walking" ] }
-{ "a": [ "Cigars", "Cigars" ], "b": [ "Fishing", "Cigars" ] }
-{ "a": [ "Bass", "Walking" ], "b": [ "Walking", "Bass" ] }
-{ "a": [ "Wine", "Base Jumping", "Running" ], "b": [ "Base Jumping", "Running", "Wine" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Tennis" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Movies" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Squash", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Base Jumping", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Video Games" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Music", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Music" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Coffee" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Wine" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Running", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Movies" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Squash", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Base Jumping", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Video Games" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Music", "Databases" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Music" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Coffee" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Wine" ] }
-{ "a": [ "Databases", "Databases" ], "b": [ "Running", "Databases" ] }
-{ "a": [ "Fishing", "Skiing", "Skiing" ], "b": [ "Databases", "Fishing", "Skiing" ] }
-{ "a": [ "Base Jumping", "Basketball", "Music", "Basketball" ], "b": [ "Music", "Walking", "Basketball", "Base Jumping" ] }
-{ "a": [ "Movies", "Running" ], "b": [ "Movies", "Running" ] }
-{ "a": [ "Wine", "Puzzles" ], "b": [ "Puzzles", "Wine" ] }
-{ "a": [ "Squash", "Cigars" ], "b": [ "Squash", "Cigars" ] }
-{ "a": [ "Computers", "Coffee", "Walking", "Walking" ], "b": [ "Coffee", "Computers", "Walking", "Basketball" ] }
-{ "a": [ "Tennis", "Music", "Running", "Music" ], "b": [ "Tennis", "Music", "Running", "Cooking" ] }
-{ "a": [ "Movies", "Movies" ], "b": [ "Fishing", "Movies" ] }
-{ "a": [ "Movies", "Movies" ], "b": [ "Movies", "Running" ] }
-{ "a": [ "Movies", "Movies" ], "b": [ "Movies", "Skiing" ] }
-{ "a": [ "Movies", "Movies" ], "b": [ "Movies", "Walking" ] }
-{ "a": [ "Movies", "Movies" ], "b": [ "Books", "Movies" ] }
-{ "a": [ "Movies", "Movies" ], "b": [ "Fishing", "Movies" ] }
-{ "a": [ "Movies", "Movies" ], "b": [ "Movies", "Books" ] }
-{ "a": [ "Squash", "Skiing", "Skiing" ], "b": [ "Squash", "Basketball", "Skiing" ] }
-{ "a": [ "Cooking", "Databases", "Databases" ], "b": [ "Databases", "Cooking", "Wine" ] }
-{ "a": [ "Cooking", "Databases", "Databases" ], "b": [ "Books", "Databases", "Cooking" ] }
-{ "a": [ "Running", "Running" ], "b": [ "Running", "Tennis" ] }
-{ "a": [ "Running", "Running" ], "b": [ "Movies", "Running" ] }
-{ "a": [ "Running", "Running" ], "b": [ "Running", "Squash" ] }
-{ "a": [ "Running", "Running" ], "b": [ "Running", "Databases" ] }
-{ "a": [ "Skiing", "Coffee", "Skiing" ], "b": [ "Coffee", "Movies", "Skiing" ] }
-{ "a": [ "Cooking", "Bass" ], "b": [ "Cooking", "Bass" ] }
-{ "a": [ "Cigars", "Cigars", "Video Games", "Wine" ], "b": [ "Tennis", "Wine", "Cigars", "Video Games" ] }
-{ "a": [ "Databases", "Movies", "Tennis" ], "b": [ "Databases", "Movies", "Tennis" ] }
-{ "a": [ "Fishing", "Computers" ], "b": [ "Computers", "Fishing" ] }
-{ "a": [ "Fishing", "Movies" ], "b": [ "Fishing", "Movies" ] }
-{ "a": [ "Base Jumping", "Tennis", "Video Games" ], "b": [ "Video Games", "Base Jumping", "Tennis" ] }
-{ "a": [ "Computers", "Wine" ], "b": [ "Wine", "Computers" ] }
-{ "a": [ "Fishing", "Fishing" ], "b": [ "Computers", "Fishing" ] }
-{ "a": [ "Fishing", "Fishing" ], "b": [ "Fishing", "Movies" ] }
-{ "a": [ "Fishing", "Fishing" ], "b": [ "Fishing", "Music" ] }
-{ "a": [ "Fishing", "Fishing" ], "b": [ "Fishing", "Cigars" ] }
-{ "a": [ "Books", "Bass", "Books", "Books" ], "b": [ "Books", "Books", "Bass", "Cooking" ] }
-{ "a": [ "Skiing", "Bass" ], "b": [ "Bass", "Skiing" ] }
-{ "a": [ "Music", "Databases" ], "b": [ "Databases", "Music" ] }
-{ "a": [ "Fishing", "Wine", "Databases" ], "b": [ "Databases", "Fishing", "Wine" ] }
-{ "a": [ "Cigars", "Cigars" ], "b": [ "Cigars", "Bass" ] }
-{ "a": [ "Cigars", "Cigars" ], "b": [ "Squash", "Cigars" ] }
-{ "a": [ "Cigars", "Cigars" ], "b": [ "Skiing", "Cigars" ] }
-{ "a": [ "Cigars", "Cigars" ], "b": [ "Cigars", "Walking" ] }
-{ "a": [ "Cigars", "Cigars" ], "b": [ "Fishing", "Cigars" ] }
-{ "a": [ "Running", "Wine", "Running" ], "b": [ "Base Jumping", "Running", "Wine" ] }
-{ "a": [ "Books", "Movies" ], "b": [ "Movies", "Books" ] }
-{ "a": [ "Wine", "Wine", "Fishing" ], "b": [ "Databases", "Fishing", "Wine" ] }
diff --git a/asterix-app/src/test/resources/runtimets/results/index-join/inverted-index-ulist-jaccard.adm b/asterix-app/src/test/resources/runtimets/results/index-join/inverted-index-ulist-jaccard.adm
deleted file mode 100644
index 55af5a9..0000000
--- a/asterix-app/src/test/resources/runtimets/results/index-join/inverted-index-ulist-jaccard.adm
+++ /dev/null
@@ -1,267 +0,0 @@
-{ "a": {{ "Bass", "Tennis", "Bass", "Cooking" }}, "b": {{ "Bass", "Cooking", "Running", "Tennis" }} }
-{ "a": {{ "Bass", "Wine" }}, "b": {{ "Bass", "Wine" }} }
-{ "a": {{ "Music", "Databases" }}, "b": {{ "Databases", "Music" }} }
-{ "a": {{ "Music", "Databases" }}, "b": {{ "Databases", "Music" }} }
-{ "a": {{ "Music", "Databases" }}, "b": {{ "Music", "Databases" }} }
-{ "a": {{ "Music", "Databases" }}, "b": {{ "Databases", "Music" }} }
-{ "a": {{ "Wine", "Walking" }}, "b": {{ "Wine", "Walking" }} }
-{ "a": {{ "Wine", "Walking" }}, "b": {{ "Walking", "Wine" }} }
-{ "a": {{ "Base Jumping", "Cigars", "Movies" }}, "b": {{ "Base Jumping", "Cigars", "Movies" }} }
-{ "a": {{ "Fishing", "Running", "Tennis", "Running" }}, "b": {{ "Tennis", "Coffee", "Running", "Fishing" }} }
-{ "a": {{ "Skiing", "Walking" }}, "b": {{ "Skiing", "Walking" }} }
-{ "a": {{ "Base Jumping", "Music" }}, "b": {{ "Music", "Base Jumping" }} }
-{ "a": {{ "Base Jumping", "Music" }}, "b": {{ "Music", "Base Jumping" }} }
-{ "a": {{ "Fishing", "Video Games" }}, "b": {{ "Video Games", "Fishing" }} }
-{ "a": {{ "Base Jumping", "Skiing" }}, "b": {{ "Skiing", "Base Jumping" }} }
-{ "a": {{ "Base Jumping", "Skiing" }}, "b": {{ "Base Jumping", "Skiing" }} }
-{ "a": {{ "Skiing", "Bass" }}, "b": {{ "Skiing", "Bass" }} }
-{ "a": {{ "Skiing", "Bass" }}, "b": {{ "Skiing", "Bass" }} }
-{ "a": {{ "Skiing", "Bass" }}, "b": {{ "Bass", "Skiing" }} }
-{ "a": {{ "Fishing", "Running", "Cigars" }}, "b": {{ "Fishing", "Cigars", "Running" }} }
-{ "a": {{ "Bass", "Bass", "Books" }}, "b": {{ "Movies", "Books", "Bass" }} }
-{ "a": {{ "Bass", "Bass", "Books" }}, "b": {{ "Bass", "Books", "Books" }} }
-{ "a": {{ "Cigars", "Skiing" }}, "b": {{ "Skiing", "Cigars" }} }
-{ "a": {{ "Tennis", "Tennis", "Databases", "Squash" }}, "b": {{ "Cigars", "Databases", "Squash", "Tennis" }} }
-{ "a": {{ "Cigars", "Cigars", "Bass", "Books" }}, "b": {{ "Books", "Cigars", "Bass", "Base Jumping" }} }
-{ "a": {{ "Cigars", "Cigars", "Bass", "Books" }}, "b": {{ "Bass", "Cigars", "Books", "Basketball" }} }
-{ "a": {{ "Movies", "Walking" }}, "b": {{ "Movies", "Walking" }} }
-{ "a": {{ "Music", "Coffee" }}, "b": {{ "Coffee", "Music" }} }
-{ "a": {{ "Running", "Coffee", "Fishing" }}, "b": {{ "Running", "Fishing", "Coffee" }} }
-{ "a": {{ "Squash", "Movies", "Coffee" }}, "b": {{ "Coffee", "Movies", "Squash" }} }
-{ "a": {{ "Music", "Tennis", "Base Jumping" }}, "b": {{ "Music", "Base Jumping", "Tennis" }} }
-{ "a": {{ "Movies", "Fishing", "Fishing" }}, "b": {{ "Tennis", "Fishing", "Movies" }} }
-{ "a": {{ "Movies", "Fishing", "Fishing" }}, "b": {{ "Databases", "Fishing", "Movies" }} }
-{ "a": {{ "Movies", "Fishing", "Fishing" }}, "b": {{ "Coffee", "Movies", "Fishing" }} }
-{ "a": {{ "Music", "Base Jumping", "Books" }}, "b": {{ "Books", "Base Jumping", "Music" }} }
-{ "a": {{ "Bass", "Books" }}, "b": {{ "Bass", "Books" }} }
-{ "a": {{ "Bass", "Books" }}, "b": {{ "Books", "Bass" }} }
-{ "a": {{ "Skiing", "Squash", "Skiing", "Fishing" }}, "b": {{ "Base Jumping", "Fishing", "Skiing", "Squash" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Puzzles", "Squash" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Squash", "Databases" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Wine", "Squash" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Skiing", "Squash" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Bass", "Squash" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Video Games", "Squash" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Squash", "Tennis" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Music", "Squash" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Squash", "Tennis" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Squash", "Databases" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Squash", "Cigars" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Squash", "Puzzles" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Wine", "Squash" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Squash", "Computers" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Bass", "Squash" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Running", "Squash" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Squash", "Cigars" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Base Jumping", "Squash" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Music", "Squash" }} }
-{ "a": {{ "Squash", "Squash" }}, "b": {{ "Cooking", "Squash" }} }
-{ "a": {{ "Puzzles", "Squash" }}, "b": {{ "Squash", "Puzzles" }} }
-{ "a": {{ "Computers", "Wine" }}, "b": {{ "Wine", "Computers" }} }
-{ "a": {{ "Computers", "Wine" }}, "b": {{ "Computers", "Wine" }} }
-{ "a": {{ "Computers", "Wine" }}, "b": {{ "Wine", "Computers" }} }
-{ "a": {{ "Walking", "Cooking" }}, "b": {{ "Walking", "Cooking" }} }
-{ "a": {{ "Walking", "Cooking" }}, "b": {{ "Walking", "Cooking" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Squash", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Basketball", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Music" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Skiing" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Music" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Video Games", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Coffee", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Video Games" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Skiing" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Fishing", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Cooking" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Puzzles" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Fishing", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Wine", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Tennis" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Movies" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Squash", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Base Jumping", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Video Games" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Music", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Music" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Coffee" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Wine" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Running", "Databases" }} }
-{ "a": {{ "Squash", "Databases" }}, "b": {{ "Squash", "Databases" }} }
-{ "a": {{ "Music", "Fishing", "Music" }}, "b": {{ "Wine", "Music", "Fishing" }} }
-{ "a": {{ "Music", "Fishing", "Music" }}, "b": {{ "Music", "Fishing", "Computers" }} }
-{ "a": {{ "Wine", "Computers" }}, "b": {{ "Computers", "Wine" }} }
-{ "a": {{ "Wine", "Computers" }}, "b": {{ "Wine", "Computers" }} }
-{ "a": {{ "Skiing", "Bass" }}, "b": {{ "Skiing", "Bass" }} }
-{ "a": {{ "Skiing", "Bass" }}, "b": {{ "Bass", "Skiing" }} }
-{ "a": {{ "Coffee", "Coffee", "Cigars" }}, "b": {{ "Cigars", "Cigars", "Coffee" }} }
-{ "a": {{ "Coffee", "Coffee", "Cigars" }}, "b": {{ "Cigars", "Coffee", "Books" }} }
-{ "a": {{ "Coffee", "Coffee", "Cigars" }}, "b": {{ "Coffee", "Walking", "Cigars" }} }
-{ "a": {{ "Coffee", "Coffee", "Cigars" }}, "b": {{ "Base Jumping", "Coffee", "Cigars" }} }
-{ "a": {{ "Movies", "Books" }}, "b": {{ "Movies", "Books" }} }
-{ "a": {{ "Movies", "Books" }}, "b": {{ "Books", "Movies" }} }
-{ "a": {{ "Movies", "Books" }}, "b": {{ "Movies", "Books" }} }
-{ "a": {{ "Wine", "Squash" }}, "b": {{ "Wine", "Squash" }} }
-{ "a": {{ "Coffee", "Tennis" }}, "b": {{ "Tennis", "Coffee" }} }
-{ "a": {{ "Coffee", "Tennis" }}, "b": {{ "Tennis", "Coffee" }} }
-{ "a": {{ "Skiing", "Books" }}, "b": {{ "Books", "Skiing" }} }
-{ "a": {{ "Databases", "Music" }}, "b": {{ "Databases", "Music" }} }
-{ "a": {{ "Databases", "Music" }}, "b": {{ "Music", "Databases" }} }
-{ "a": {{ "Databases", "Music" }}, "b": {{ "Databases", "Music" }} }
-{ "a": {{ "Video Games", "Cigars" }}, "b": {{ "Cigars", "Video Games" }} }
-{ "a": {{ "Video Games", "Cigars" }}, "b": {{ "Video Games", "Cigars" }} }
-{ "a": {{ "Databases", "Skiing" }}, "b": {{ "Databases", "Skiing" }} }
-{ "a": {{ "Running", "Fishing" }}, "b": {{ "Running", "Fishing" }} }
-{ "a": {{ "Base Jumping", "Base Jumping", "Walking", "Computers" }}, "b": {{ "Base Jumping", "Fishing", "Walking", "Computers" }} }
-{ "a": {{ "Databases", "Music" }}, "b": {{ "Music", "Databases" }} }
-{ "a": {{ "Databases", "Music" }}, "b": {{ "Databases", "Music" }} }
-{ "a": {{ "Wine", "Walking", "Books", "Walking" }}, "b": {{ "Music", "Wine", "Books", "Walking" }} }
-{ "a": {{ "Bass", "Bass", "Base Jumping" }}, "b": {{ "Base Jumping", "Bass", "Cooking" }} }
-{ "a": {{ "Bass", "Bass", "Base Jumping" }}, "b": {{ "Base Jumping", "Databases", "Bass" }} }
-{ "a": {{ "Cigars", "Cigars", "Coffee" }}, "b": {{ "Cigars", "Coffee", "Books" }} }
-{ "a": {{ "Cigars", "Cigars", "Coffee" }}, "b": {{ "Coffee", "Walking", "Cigars" }} }
-{ "a": {{ "Cigars", "Cigars", "Coffee" }}, "b": {{ "Base Jumping", "Coffee", "Cigars" }} }
-{ "a": {{ "Base Jumping", "Running" }}, "b": {{ "Running", "Base Jumping" }} }
-{ "a": {{ "Base Jumping", "Running" }}, "b": {{ "Base Jumping", "Running" }} }
-{ "a": {{ "Cooking", "Squash", "Cooking", "Coffee" }}, "b": {{ "Coffee", "Cigars", "Cooking", "Squash" }} }
-{ "a": {{ "Books", "Base Jumping" }}, "b": {{ "Books", "Base Jumping" }} }
-{ "a": {{ "Books", "Base Jumping" }}, "b": {{ "Books", "Base Jumping" }} }
-{ "a": {{ "Cooking", "Running" }}, "b": {{ "Cooking", "Running" }} }
-{ "a": {{ "Video Games", "Databases" }}, "b": {{ "Databases", "Video Games" }} }
-{ "a": {{ "Video Games", "Databases" }}, "b": {{ "Databases", "Video Games" }} }
-{ "a": {{ "Cigars", "Video Games" }}, "b": {{ "Video Games", "Cigars" }} }
-{ "a": {{ "Running", "Base Jumping" }}, "b": {{ "Base Jumping", "Running" }} }
-{ "a": {{ "Coffee", "Databases" }}, "b": {{ "Databases", "Coffee" }} }
-{ "a": {{ "Movies", "Books" }}, "b": {{ "Books", "Movies" }} }
-{ "a": {{ "Movies", "Books" }}, "b": {{ "Movies", "Books" }} }
-{ "a": {{ "Databases", "Video Games" }}, "b": {{ "Databases", "Video Games" }} }
-{ "a": {{ "Tennis", "Movies", "Movies" }}, "b": {{ "Databases", "Movies", "Tennis" }} }
-{ "a": {{ "Tennis", "Movies", "Movies" }}, "b": {{ "Tennis", "Movies", "Bass" }} }
-{ "a": {{ "Tennis", "Movies", "Movies" }}, "b": {{ "Databases", "Movies", "Tennis" }} }
-{ "a": {{ "Music", "Base Jumping" }}, "b": {{ "Music", "Base Jumping" }} }
-{ "a": {{ "Bass", "Squash" }}, "b": {{ "Bass", "Squash" }} }
-{ "a": {{ "Walking", "Walking" }}, "b": {{ "Walking", "Cooking" }} }
-{ "a": {{ "Walking", "Walking" }}, "b": {{ "Walking", "Books" }} }
-{ "a": {{ "Walking", "Walking" }}, "b": {{ "Wine", "Walking" }} }
-{ "a": {{ "Walking", "Walking" }}, "b": {{ "Walking", "Running" }} }
-{ "a": {{ "Walking", "Walking" }}, "b": {{ "Walking", "Computers" }} }
-{ "a": {{ "Walking", "Walking" }}, "b": {{ "Bass", "Walking" }} }
-{ "a": {{ "Walking", "Walking" }}, "b": {{ "Skiing", "Walking" }} }
-{ "a": {{ "Walking", "Walking" }}, "b": {{ "Computers", "Walking" }} }
-{ "a": {{ "Walking", "Walking" }}, "b": {{ "Walking", "Wine" }} }
-{ "a": {{ "Walking", "Walking" }}, "b": {{ "Movies", "Walking" }} }
-{ "a": {{ "Walking", "Walking" }}, "b": {{ "Walking", "Bass" }} }
-{ "a": {{ "Walking", "Walking" }}, "b": {{ "Music", "Walking" }} }
-{ "a": {{ "Walking", "Walking" }}, "b": {{ "Walking", "Cooking" }} }
-{ "a": {{ "Walking", "Walking" }}, "b": {{ "Cigars", "Walking" }} }
-{ "a": {{ "Computers", "Tennis" }}, "b": {{ "Tennis", "Computers" }} }
-{ "a": {{ "Tennis", "Coffee" }}, "b": {{ "Tennis", "Coffee" }} }
-{ "a": {{ "Running", "Basketball", "Computers", "Basketball" }}, "b": {{ "Computers", "Cooking", "Running", "Basketball" }} }
-{ "a": {{ "Puzzles", "Books" }}, "b": {{ "Puzzles", "Books" }} }
-{ "a": {{ "Puzzles", "Books" }}, "b": {{ "Puzzles", "Books" }} }
-{ "a": {{ "Skiing", "Wine" }}, "b": {{ "Wine", "Skiing" }} }
-{ "a": {{ "Squash", "Squash", "Music" }}, "b": {{ "Video Games", "Squash", "Music" }} }
-{ "a": {{ "Squash", "Tennis" }}, "b": {{ "Squash", "Tennis" }} }
-{ "a": {{ "Walking", "Cooking" }}, "b": {{ "Walking", "Cooking" }} }
-{ "a": {{ "Coffee", "Tennis", "Bass" }}, "b": {{ "Coffee", "Bass", "Tennis" }} }
-{ "a": {{ "Music", "Squash" }}, "b": {{ "Music", "Squash" }} }
-{ "a": {{ "Computers", "Fishing" }}, "b": {{ "Fishing", "Computers" }} }
-{ "a": {{ "Computers", "Fishing" }}, "b": {{ "Computers", "Fishing" }} }
-{ "a": {{ "Wine", "Walking" }}, "b": {{ "Walking", "Wine" }} }
-{ "a": {{ "Skiing", "Base Jumping" }}, "b": {{ "Base Jumping", "Skiing" }} }
-{ "a": {{ "Bass", "Books" }}, "b": {{ "Books", "Bass" }} }
-{ "a": {{ "Tennis", "Running", "Tennis" }}, "b": {{ "Running", "Basketball", "Tennis" }} }
-{ "a": {{ "Tennis", "Running", "Tennis" }}, "b": {{ "Running", "Tennis", "Video Games" }} }
-{ "a": {{ "Fishing", "Music" }}, "b": {{ "Fishing", "Music" }} }
-{ "a": {{ "Books", "Tennis" }}, "b": {{ "Books", "Tennis" }} }
-{ "a": {{ "Books", "Tennis" }}, "b": {{ "Tennis", "Books" }} }
-{ "a": {{ "Squash", "Squash", "Video Games" }}, "b": {{ "Video Games", "Squash", "Music" }} }
-{ "a": {{ "Books", "Tennis" }}, "b": {{ "Tennis", "Books" }} }
-{ "a": {{ "Music", "Books", "Books", "Wine" }}, "b": {{ "Music", "Wine", "Books", "Walking" }} }
-{ "a": {{ "Basketball", "Basketball", "Computers" }}, "b": {{ "Computers", "Basketball", "Squash" }} }
-{ "a": {{ "Fishing", "Databases" }}, "b": {{ "Fishing", "Databases" }} }
-{ "a": {{ "Walking", "Computers" }}, "b": {{ "Computers", "Walking" }} }
-{ "a": {{ "Books", "Base Jumping" }}, "b": {{ "Books", "Base Jumping" }} }
-{ "a": {{ "Movies", "Cooking", "Skiing" }}, "b": {{ "Movies", "Skiing", "Cooking" }} }
-{ "a": {{ "Puzzles", "Books" }}, "b": {{ "Puzzles", "Books" }} }
-{ "a": {{ "Wine", "Databases" }}, "b": {{ "Databases", "Wine" }} }
-{ "a": {{ "Fishing", "Databases", "Wine" }}, "b": {{ "Fishing", "Wine", "Databases" }} }
-{ "a": {{ "Fishing", "Databases", "Wine" }}, "b": {{ "Databases", "Fishing", "Wine" }} }
-{ "a": {{ "Coffee", "Movies", "Skiing" }}, "b": {{ "Coffee", "Movies", "Skiing" }} }
-{ "a": {{ "Cigars", "Cigars" }}, "b": {{ "Squash", "Cigars" }} }
-{ "a": {{ "Cigars", "Cigars" }}, "b": {{ "Cigars", "Base Jumping" }} }
-{ "a": {{ "Cigars", "Cigars" }}, "b": {{ "Video Games", "Cigars" }} }
-{ "a": {{ "Cigars", "Cigars" }}, "b": {{ "Cigars", "Cigars" }} }
-{ "a": {{ "Cigars", "Cigars" }}, "b": {{ "Cigars", "Bass" }} }
-{ "a": {{ "Cigars", "Cigars" }}, "b": {{ "Squash", "Cigars" }} }
-{ "a": {{ "Cigars", "Cigars" }}, "b": {{ "Skiing", "Cigars" }} }
-{ "a": {{ "Cigars", "Cigars" }}, "b": {{ "Cigars", "Walking" }} }
-{ "a": {{ "Cigars", "Cigars" }}, "b": {{ "Fishing", "Cigars" }} }
-{ "a": {{ "Bass", "Walking" }}, "b": {{ "Walking", "Bass" }} }
-{ "a": {{ "Wine", "Base Jumping", "Running" }}, "b": {{ "Base Jumping", "Running", "Wine" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Tennis" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Movies" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Squash", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Base Jumping", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Video Games" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Music", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Music" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Coffee" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Wine" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Running", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Movies" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Squash", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Base Jumping", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Video Games" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Music", "Databases" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Music" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Coffee" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Wine" }} }
-{ "a": {{ "Databases", "Databases" }}, "b": {{ "Running", "Databases" }} }
-{ "a": {{ "Fishing", "Skiing", "Skiing" }}, "b": {{ "Databases", "Fishing", "Skiing" }} }
-{ "a": {{ "Base Jumping", "Basketball", "Music", "Basketball" }}, "b": {{ "Music", "Walking", "Basketball", "Base Jumping" }} }
-{ "a": {{ "Movies", "Running" }}, "b": {{ "Movies", "Running" }} }
-{ "a": {{ "Wine", "Puzzles" }}, "b": {{ "Puzzles", "Wine" }} }
-{ "a": {{ "Squash", "Cigars" }}, "b": {{ "Squash", "Cigars" }} }
-{ "a": {{ "Computers", "Coffee", "Walking", "Walking" }}, "b": {{ "Coffee", "Computers", "Walking", "Basketball" }} }
-{ "a": {{ "Tennis", "Music", "Running", "Music" }}, "b": {{ "Tennis", "Music", "Running", "Cooking" }} }
-{ "a": {{ "Movies", "Movies" }}, "b": {{ "Fishing", "Movies" }} }
-{ "a": {{ "Movies", "Movies" }}, "b": {{ "Movies", "Running" }} }
-{ "a": {{ "Movies", "Movies" }}, "b": {{ "Movies", "Skiing" }} }
-{ "a": {{ "Movies", "Movies" }}, "b": {{ "Movies", "Walking" }} }
-{ "a": {{ "Movies", "Movies" }}, "b": {{ "Books", "Movies" }} }
-{ "a": {{ "Movies", "Movies" }}, "b": {{ "Fishing", "Movies" }} }
-{ "a": {{ "Movies", "Movies" }}, "b": {{ "Movies", "Books" }} }
-{ "a": {{ "Squash", "Skiing", "Skiing" }}, "b": {{ "Squash", "Basketball", "Skiing" }} }
-{ "a": {{ "Cooking", "Databases", "Databases" }}, "b": {{ "Databases", "Cooking", "Wine" }} }
-{ "a": {{ "Cooking", "Databases", "Databases" }}, "b": {{ "Books", "Databases", "Cooking" }} }
-{ "a": {{ "Running", "Running" }}, "b": {{ "Running", "Tennis" }} }
-{ "a": {{ "Running", "Running" }}, "b": {{ "Movies", "Running" }} }
-{ "a": {{ "Running", "Running" }}, "b": {{ "Running", "Squash" }} }
-{ "a": {{ "Running", "Running" }}, "b": {{ "Running", "Databases" }} }
-{ "a": {{ "Skiing", "Coffee", "Skiing" }}, "b": {{ "Coffee", "Movies", "Skiing" }} }
-{ "a": {{ "Cooking", "Bass" }}, "b": {{ "Cooking", "Bass" }} }
-{ "a": {{ "Cigars", "Cigars", "Video Games", "Wine" }}, "b": {{ "Tennis", "Wine", "Cigars", "Video Games" }} }
-{ "a": {{ "Databases", "Movies", "Tennis" }}, "b": {{ "Databases", "Movies", "Tennis" }} }
-{ "a": {{ "Fishing", "Computers" }}, "b": {{ "Computers", "Fishing" }} }
-{ "a": {{ "Fishing", "Movies" }}, "b": {{ "Fishing", "Movies" }} }
-{ "a": {{ "Base Jumping", "Tennis", "Video Games" }}, "b": {{ "Video Games", "Base Jumping", "Tennis" }} }
-{ "a": {{ "Computers", "Wine" }}, "b": {{ "Wine", "Computers" }} }
-{ "a": {{ "Fishing", "Fishing" }}, "b": {{ "Computers", "Fishing" }} }
-{ "a": {{ "Fishing", "Fishing" }}, "b": {{ "Fishing", "Movies" }} }
-{ "a": {{ "Fishing", "Fishing" }}, "b": {{ "Fishing", "Music" }} }
-{ "a": {{ "Fishing", "Fishing" }}, "b": {{ "Fishing", "Cigars" }} }
-{ "a": {{ "Books", "Bass", "Books", "Books" }}, "b": {{ "Books", "Books", "Bass", "Cooking" }} }
-{ "a": {{ "Skiing", "Bass" }}, "b": {{ "Bass", "Skiing" }} }
-{ "a": {{ "Music", "Databases" }}, "b": {{ "Databases", "Music" }} }
-{ "a": {{ "Fishing", "Wine", "Databases" }}, "b": {{ "Databases", "Fishing", "Wine" }} }
-{ "a": {{ "Cigars", "Cigars" }}, "b": {{ "Cigars", "Bass" }} }
-{ "a": {{ "Cigars", "Cigars" }}, "b": {{ "Squash", "Cigars" }} }
-{ "a": {{ "Cigars", "Cigars" }}, "b": {{ "Skiing", "Cigars" }} }
-{ "a": {{ "Cigars", "Cigars" }}, "b": {{ "Cigars", "Walking" }} }
-{ "a": {{ "Cigars", "Cigars" }}, "b": {{ "Fishing", "Cigars" }} }
-{ "a": {{ "Running", "Wine", "Running" }}, "b": {{ "Base Jumping", "Running", "Wine" }} }
-{ "a": {{ "Books", "Movies" }}, "b": {{ "Movies", "Books" }} }
-{ "a": {{ "Wine", "Wine", "Fishing" }}, "b": {{ "Databases", "Fishing", "Wine" }} }
diff --git a/asterix-app/src/test/resources/runtimets/results/index-join/inverted-index-word-jaccard.adm b/asterix-app/src/test/resources/runtimets/results/index-join/inverted-index-word-jaccard.adm
deleted file mode 100644
index 9793e0b..0000000
--- a/asterix-app/src/test/resources/runtimets/results/index-join/inverted-index-word-jaccard.adm
+++ /dev/null
@@ -1,5 +0,0 @@
-{ "arec": "Active Database Systems.", "brec": "Active Database Systems" }
-{ "arec": "Specification and Execution of Transactional Workflows.", "brec": "Specification and Execution of Transactional Workflows" }
-{ "arec": "Integrated Office Systems.", "brec": "Integrated Office Systems" }
-{ "arec": "Integrated Office Systems.", "brec": "Integrated Office Systems" }
-{ "arec": "A Shared View of Sharing The Treaty of Orlando.", "brec": "A Shared View of Sharing The Treaty of Orlando" }
diff --git a/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point.adm b/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point.adm
new file mode 100644
index 0000000..6e8c011
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point.adm
@@ -0,0 +1,44 @@
+{ "aid": 1, "bid": 17, "apt": point("4.1,7.0"), "bp": point("4.1,7.0") }
+{ "aid": 3, "bid": 4, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 3, "bid": 5, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 3, "bid": 6, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 3, "bid": 7, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 3, "bid": 8, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 3, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 5, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 6, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 7, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 8, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 3, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 4, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 6, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 7, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 8, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 3, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 4, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 5, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 7, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 8, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 3, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 4, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 5, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 6, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 8, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 3, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 4, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 5, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 6, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 7, "apt": point("43.5083,-79.3007"), "bp": point("43.5083,-79.3007") }
+{ "aid": 15, "bid": 16, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 15, "bid": 18, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 15, "bid": 19, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 16, "bid": 15, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 16, "bid": 18, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 16, "bid": 19, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 17, "bid": 1, "apt": point("4.1,7.0"), "bp": point("4.1,7.0") }
+{ "aid": 18, "bid": 15, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 18, "bid": 16, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 18, "bid": 19, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 19, "bid": 15, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 19, "bid": 16, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 19, "bid": 18, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/index-selection/btree-index-composite-key.adm b/asterix-app/src/test/resources/runtimets/results/index-selection/btree-index-composite-key.adm
new file mode 100644
index 0000000..cebf05b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/index-selection/btree-index-composite-key.adm
@@ -0,0 +1 @@
+{ "id": 881, "fname": "Julio", "lname": "Isa", "age": 38, "dept": "Sales" }
diff --git a/asterix-app/src/test/resources/runtimets/results/index-selection/btree-index-rewrite-multiple.adm b/asterix-app/src/test/resources/runtimets/results/index-selection/btree-index-rewrite-multiple.adm
new file mode 100644
index 0000000..3bf46e6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/index-selection/btree-index-rewrite-multiple.adm
@@ -0,0 +1,18 @@
+{ "o_orderkey": 1188, "o_custkey": 20, "o_orderstatus": "O", "o_orderkey2": 3911, "o_custkey2": 10, "o_orderstatus2": "P" }
+{ "o_orderkey": 1377, "o_custkey": 20, "o_orderstatus": "O", "o_orderkey2": 3911, "o_custkey2": 10, "o_orderstatus2": "P" }
+{ "o_orderkey": 1378, "o_custkey": 20, "o_orderstatus": "O", "o_orderkey2": 3911, "o_custkey2": 10, "o_orderstatus2": "P" }
+{ "o_orderkey": 3042, "o_custkey": 20, "o_orderstatus": "F", "o_orderkey2": 227, "o_custkey2": 10, "o_orderstatus2": "O" }
+{ "o_orderkey": 3042, "o_custkey": 20, "o_orderstatus": "F", "o_orderkey2": 517, "o_custkey2": 10, "o_orderstatus2": "O" }
+{ "o_orderkey": 3042, "o_custkey": 20, "o_orderstatus": "F", "o_orderkey2": 1223, "o_custkey2": 10, "o_orderstatus2": "O" }
+{ "o_orderkey": 3042, "o_custkey": 20, "o_orderstatus": "F", "o_orderkey2": 1860, "o_custkey2": 10, "o_orderstatus2": "O" }
+{ "o_orderkey": 3042, "o_custkey": 20, "o_orderstatus": "F", "o_orderkey2": 1890, "o_custkey2": 10, "o_orderstatus2": "O" }
+{ "o_orderkey": 3042, "o_custkey": 20, "o_orderstatus": "F", "o_orderkey2": 3428, "o_custkey2": 10, "o_orderstatus2": "O" }
+{ "o_orderkey": 3042, "o_custkey": 20, "o_orderstatus": "F", "o_orderkey2": 3618, "o_custkey2": 10, "o_orderstatus2": "O" }
+{ "o_orderkey": 3042, "o_custkey": 20, "o_orderstatus": "F", "o_orderkey2": 3843, "o_custkey2": 10, "o_orderstatus2": "O" }
+{ "o_orderkey": 3042, "o_custkey": 20, "o_orderstatus": "F", "o_orderkey2": 3911, "o_custkey2": 10, "o_orderstatus2": "P" }
+{ "o_orderkey": 3042, "o_custkey": 20, "o_orderstatus": "F", "o_orderkey2": 4032, "o_custkey2": 10, "o_orderstatus2": "O" }
+{ "o_orderkey": 3042, "o_custkey": 20, "o_orderstatus": "F", "o_orderkey2": 4097, "o_custkey2": 10, "o_orderstatus2": "O" }
+{ "o_orderkey": 3042, "o_custkey": 20, "o_orderstatus": "F", "o_orderkey2": 4388, "o_custkey2": 10, "o_orderstatus2": "O" }
+{ "o_orderkey": 3042, "o_custkey": 20, "o_orderstatus": "F", "o_orderkey2": 4421, "o_custkey2": 10, "o_orderstatus2": "O" }
+{ "o_orderkey": 3042, "o_custkey": 20, "o_orderstatus": "F", "o_orderkey2": 4449, "o_custkey2": 10, "o_orderstatus2": "O" }
+{ "o_orderkey": 3042, "o_custkey": 20, "o_orderstatus": "F", "o_orderkey2": 5123, "o_custkey2": 10, "o_orderstatus2": "O" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/ngram-edit-distance-inline.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/ngram-edit-distance-inline.adm
new file mode 100644
index 0000000..8caff33
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/ngram-edit-distance-inline.adm
@@ -0,0 +1,13 @@
+{ "a": "Audria Haylett", "b": "Ria Haflett", "ed": 4 }
+{ "a": "Melany Rotan", "b": "Melany Matias", "ed": 4 }
+{ "a": "Neda Dilts", "b": "Beata Diles", "ed": 4 }
+{ "a": "Josette Dries", "b": "Rosette Reen", "ed": 4 }
+{ "a": "Londa Herdt", "b": "Minda Heron", "ed": 4 }
+{ "a": "Moises Plake", "b": "Moises Jago", "ed": 4 }
+{ "a": "Donnette Kreb", "b": "Donnette Lebel", "ed": 4 }
+{ "a": "Frederick Valla", "b": "Frederica Kale", "ed": 4 }
+{ "a": "Petra Kinsel", "b": "Petra Ganes", "ed": 4 }
+{ "a": "Yesenia Doyon", "b": "Yesenia Gao", "ed": 4 }
+{ "a": "Willa Patman", "b": "Mila Barman", "ed": 4 }
+{ "a": "Camelia Yoes", "b": "Camellia Toxey", "ed": 4 }
+{ "a": "Yolonda Korf", "b": "Yolonda Pu", "ed": 4 }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/ngram-edit-distance.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/ngram-edit-distance.adm
new file mode 100644
index 0000000..a18f61d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/ngram-edit-distance.adm
@@ -0,0 +1,13 @@
+{ "a": "Audria Haylett", "b": "Ria Haflett" }
+{ "a": "Melany Rotan", "b": "Melany Matias" }
+{ "a": "Neda Dilts", "b": "Beata Diles" }
+{ "a": "Josette Dries", "b": "Rosette Reen" }
+{ "a": "Londa Herdt", "b": "Minda Heron" }
+{ "a": "Moises Plake", "b": "Moises Jago" }
+{ "a": "Donnette Kreb", "b": "Donnette Lebel" }
+{ "a": "Frederick Valla", "b": "Frederica Kale" }
+{ "a": "Petra Kinsel", "b": "Petra Ganes" }
+{ "a": "Yesenia Doyon", "b": "Yesenia Gao" }
+{ "a": "Willa Patman", "b": "Mila Barman" }
+{ "a": "Camelia Yoes", "b": "Camellia Toxey" }
+{ "a": "Yolonda Korf", "b": "Yolonda Pu" }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/ngram-jaccard-inline.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/ngram-jaccard-inline.adm
new file mode 100644
index 0000000..f6c6049
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/ngram-jaccard-inline.adm
@@ -0,0 +1,7 @@
+{ "a": "Transaction Management in Multidatabase Systems.", "b": "Overview of Multidatabase Transaction Management", "jacc": 0.55932206f }
+{ "a": "Transaction Management in Multidatabase Systems.", "b": "Overview of Multidatabase Transaction Management", "jacc": 0.55932206f }
+{ "a": "Active Database Systems.", "b": "Active Database Systems", "jacc": 0.95454544f }
+{ "a": "Integrated Office Systems.", "b": "Integrated Office Systems", "jacc": 0.9583333f }
+{ "a": "Integrated Office Systems.", "b": "Integrated Office Systems", "jacc": 0.9583333f }
+{ "a": "A Shared View of Sharing The Treaty of Orlando.", "b": "A Shared View of Sharing The Treaty of Orlando", "jacc": 0.9782609f }
+{ "a": "Specification and Execution of Transactional Workflows.", "b": "Specification and Execution of Transactional Workflows", "jacc": 0.9811321f }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/ngram-jaccard.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/ngram-jaccard.adm
new file mode 100644
index 0000000..b528fe7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/ngram-jaccard.adm
@@ -0,0 +1,7 @@
+{ "a": "Transaction Management in Multidatabase Systems.", "b": "Overview of Multidatabase Transaction Management" }
+{ "a": "Transaction Management in Multidatabase Systems.", "b": "Overview of Multidatabase Transaction Management" }
+{ "a": "Active Database Systems.", "b": "Active Database Systems" }
+{ "a": "Specification and Execution of Transactional Workflows.", "b": "Specification and Execution of Transactional Workflows" }
+{ "a": "Integrated Office Systems.", "b": "Integrated Office Systems" }
+{ "a": "Integrated Office Systems.", "b": "Integrated Office Systems" }
+{ "a": "A Shared View of Sharing The Treaty of Orlando.", "b": "A Shared View of Sharing The Treaty of Orlando" }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/olist-edit-distance-inline.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/olist-edit-distance-inline.adm
new file mode 100644
index 0000000..7ece8ee
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/olist-edit-distance-inline.adm
@@ -0,0 +1,157 @@
+{ "a": [ "Base Jumping", "Cigars", "Movies" ], "b": [ "Base Jumping", "Cigars", "Movies" ], "ed": 0 }
+{ "a": [ "Coffee", "Movies", "Skiing" ], "b": [ "Coffee", "Movies", "Skiing" ], "ed": 0 }
+{ "a": [ "Databases", "Movies", "Tennis" ], "b": [ "Databases", "Movies", "Tennis" ], "ed": 0 }
+{ "a": [ "Cooking", "Fishing", "Video Games" ], "b": [ "Books", "Fishing", "Video Games" ], "ed": 1 }
+{ "a": [ "Skiing", "Coffee", "Wine" ], "b": [ "Puzzles", "Coffee", "Wine" ], "ed": 1 }
+{ "a": [ "Skiing", "Coffee", "Wine" ], "b": [ "Skiing", "Coffee", "Skiing" ], "ed": 1 }
+{ "a": [ "Base Jumping", "Cigars", "Movies" ], "b": [ "Base Jumping", "Movies", "Movies" ], "ed": 1 }
+{ "a": [ "Base Jumping", "Cigars", "Movies" ], "b": [ "Squash", "Cigars", "Movies" ], "ed": 1 }
+{ "a": [ "Wine", "Walking", "Bass" ], "b": [ "Wine", "Walking", "Puzzles" ], "ed": 1 }
+{ "a": [ "Cigars", "Skiing", "Video Games", "Books" ], "b": [ "Cigars", "Skiing", "Video Games", "Coffee" ], "ed": 1 }
+{ "a": [ "Bass", "Bass", "Books" ], "b": [ "Bass", "Bass", "Base Jumping" ], "ed": 1 }
+{ "a": [ "Bass", "Bass", "Books" ], "b": [ "Bass", "Books", "Books" ], "ed": 1 }
+{ "a": [ "Bass", "Running", "Databases" ], "b": [ "Bass", "Basketball", "Databases" ], "ed": 1 }
+{ "a": [ "Bass", "Running", "Databases" ], "b": [ "Bass", "Running", "Movies" ], "ed": 1 }
+{ "a": [ "Bass", "Running", "Databases" ], "b": [ "Bass", "Running", "Walking" ], "ed": 1 }
+{ "a": [ "Bass", "Running", "Databases" ], "b": [ "Bass", "Running", "Puzzles" ], "ed": 1 }
+{ "a": [ "Cigars", "Walking", "Databases", "Video Games" ], "b": [ "Wine", "Walking", "Databases", "Video Games" ], "ed": 1 }
+{ "a": [ "Tennis", "Puzzles", "Video Games" ], "b": [ "Tennis", "Puzzles", "Base Jumping" ], "ed": 1 }
+{ "a": [ "Tennis", "Puzzles", "Video Games" ], "b": [ "Tennis", "Puzzles", "Cigars" ], "ed": 1 }
+{ "a": [ "Squash", "Movies", "Coffee" ], "b": [ "Squash", "Movies", "Computers" ], "ed": 1 }
+{ "a": [ "Base Jumping", "Movies", "Skiing" ], "b": [ "Wine", "Movies", "Skiing" ], "ed": 1 }
+{ "a": [ "Base Jumping", "Movies", "Skiing" ], "b": [ "Base Jumping", "Movies", "Movies" ], "ed": 1 }
+{ "a": [ "Base Jumping", "Movies", "Skiing" ], "b": [ "Coffee", "Movies", "Skiing" ], "ed": 1 }
+{ "a": [ "Base Jumping", "Movies", "Skiing" ], "b": [ "Coffee", "Movies", "Skiing" ], "ed": 1 }
+{ "a": [ "Music", "Tennis", "Base Jumping" ], "b": [ "Books", "Tennis", "Base Jumping" ], "ed": 1 }
+{ "a": [ "Wine", "Movies", "Skiing" ], "b": [ "Coffee", "Movies", "Skiing" ], "ed": 1 }
+{ "a": [ "Wine", "Movies", "Skiing" ], "b": [ "Coffee", "Movies", "Skiing" ], "ed": 1 }
+{ "a": [ "Music", "Base Jumping", "Books" ], "b": [ "Music", "Base Jumping", "Tennis" ], "ed": 1 }
+{ "a": [ "Music", "Base Jumping", "Books" ], "b": [ "Music", "Base Jumping", "Coffee", "Books" ], "ed": 1 }
+{ "a": [ "Music", "Basketball", "Movies" ], "b": [ "Music", "Basketball", "Cigars" ], "ed": 1 }
+{ "a": [ "Databases", "Movies", "Cigars" ], "b": [ "Databases", "Wine", "Cigars" ], "ed": 1 }
+{ "a": [ "Databases", "Movies", "Cigars" ], "b": [ "Databases", "Movies", "Tennis" ], "ed": 1 }
+{ "a": [ "Databases", "Movies", "Cigars" ], "b": [ "Databases", "Movies", "Tennis" ], "ed": 1 }
+{ "a": [ "Movies", "Books", "Bass" ], "b": [ "Movies", "Books", "Walking" ], "ed": 1 }
+{ "a": [ "Bass", "Walking", "Movies" ], "b": [ "Bass", "Running", "Movies" ], "ed": 1 }
+{ "a": [ "Skiing", "Computers", "Bass", "Cigars" ], "b": [ "Bass", "Computers", "Bass", "Cigars" ], "ed": 1 }
+{ "a": [ "Base Jumping", "Cigars", "Movies" ], "b": [ "Base Jumping", "Movies", "Movies" ], "ed": 1 }
+{ "a": [ "Base Jumping", "Cigars", "Movies" ], "b": [ "Squash", "Cigars", "Movies" ], "ed": 1 }
+{ "a": [ "Bass", "Wine", "Coffee" ], "b": [ "Base Jumping", "Wine", "Coffee" ], "ed": 1 }
+{ "a": [ "Bass", "Wine", "Coffee" ], "b": [ "Bass", "Squash", "Coffee" ], "ed": 1 }
+{ "a": [ "Music", "Fishing", "Music" ], "b": [ "Music", "Fishing", "Computers" ], "ed": 1 }
+{ "a": [ "Puzzles", "Cooking", "Squash" ], "b": [ "Puzzles", "Puzzles", "Squash" ], "ed": 1 }
+{ "a": [ "Puzzles", "Cooking", "Squash" ], "b": [ "Puzzles", "Cooking", "Bass" ], "ed": 1 }
+{ "a": [ "Running", "Computers", "Basketball" ], "b": [ "Running", "Basketball", "Computers", "Basketball" ], "ed": 1 }
+{ "a": [ "Coffee", "Coffee", "Cigars" ], "b": [ "Coffee", "Walking", "Cigars" ], "ed": 1 }
+{ "a": [ "Coffee", "Coffee", "Cigars" ], "b": [ "Base Jumping", "Coffee", "Cigars" ], "ed": 1 }
+{ "a": [ "Basketball", "Movies", "Cooking" ], "b": [ "Basketball", "Cigars", "Cooking" ], "ed": 1 }
+{ "a": [ "Cooking", "Music", "Books" ], "b": [ "Cooking", "Music", "Cigars" ], "ed": 1 }
+{ "a": [ "Cooking", "Music", "Books" ], "b": [ "Cooking", "Cigars", "Books" ], "ed": 1 }
+{ "a": [ "Wine", "Databases", "Basketball" ], "b": [ "Wine", "Puzzles", "Basketball" ], "ed": 1 }
+{ "a": [ "Wine", "Puzzles", "Basketball" ], "b": [ "Wine", "Puzzles", "Tennis" ], "ed": 1 }
+{ "a": [ "Base Jumping", "Base Jumping", "Walking", "Computers" ], "b": [ "Base Jumping", "Fishing", "Walking", "Computers" ], "ed": 1 }
+{ "a": [ "Base Jumping", "Base Jumping", "Walking", "Computers" ], "b": [ "Base Jumping", "Base Jumping", "Books", "Computers" ], "ed": 1 }
+{ "a": [ "Computers", "Squash", "Coffee" ], "b": [ "Bass", "Squash", "Coffee" ], "ed": 1 }
+{ "a": [ "Puzzles", "Puzzles", "Skiing" ], "b": [ "Puzzles", "Puzzles", "Squash" ], "ed": 1 }
+{ "a": [ "Tennis", "Fishing", "Movies" ], "b": [ "Databases", "Fishing", "Movies" ], "ed": 1 }
+{ "a": [ "Tennis", "Fishing", "Movies" ], "b": [ "Tennis", "Movies", "Movies" ], "ed": 1 }
+{ "a": [ "Bass", "Coffee", "Skiing" ], "b": [ "Skiing", "Coffee", "Skiing" ], "ed": 1 }
+{ "a": [ "Running", "Books", "Running" ], "b": [ "Running", "Wine", "Running" ], "ed": 1 }
+{ "a": [ "Computers", "Tennis", "Books" ], "b": [ "Computers", "Tennis", "Puzzles", "Books" ], "ed": 1 }
+{ "a": [ "Puzzles", "Coffee", "Wine" ], "b": [ "Puzzles", "Computers", "Wine" ], "ed": 1 }
+{ "a": [ "Squash", "Bass", "Cooking" ], "b": [ "Base Jumping", "Bass", "Cooking" ], "ed": 1 }
+{ "a": [ "Databases", "Fishing", "Movies" ], "b": [ "Databases", "Fishing", "Skiing" ], "ed": 1 }
+{ "a": [ "Databases", "Fishing", "Movies" ], "b": [ "Databases", "Fishing", "Wine" ], "ed": 1 }
+{ "a": [ "Coffee", "Computers", "Fishing" ], "b": [ "Coffee", "Movies", "Fishing" ], "ed": 1 }
+{ "a": [ "Coffee", "Computers", "Fishing" ], "b": [ "Coffee", "Computers", "Base Jumping" ], "ed": 1 }
+{ "a": [ "Base Jumping", "Wine", "Coffee" ], "b": [ "Base Jumping", "Wine", "Cigars" ], "ed": 1 }
+{ "a": [ "Tennis", "Movies", "Movies" ], "b": [ "Base Jumping", "Movies", "Movies" ], "ed": 1 }
+{ "a": [ "Tennis", "Movies", "Movies" ], "b": [ "Tennis", "Movies", "Bass" ], "ed": 1 }
+{ "a": [ "Wine", "Puzzles", "Tennis" ], "b": [ "Wine", "Skiing", "Puzzles", "Tennis" ], "ed": 1 }
+{ "a": [ "Books", "Tennis", "Base Jumping" ], "b": [ "Books", "Tennis", "Cooking" ], "ed": 1 }
+{ "a": [ "Basketball", "Bass", "Cigars" ], "b": [ "Wine", "Bass", "Cigars" ], "ed": 1 }
+{ "a": [ "Bass", "Movies", "Computers" ], "b": [ "Bass", "Movies", "Music" ], "ed": 1 }
+{ "a": [ "Bass", "Movies", "Computers" ], "b": [ "Squash", "Movies", "Computers" ], "ed": 1 }
+{ "a": [ "Walking", "Bass", "Fishing", "Movies" ], "b": [ "Walking", "Bass", "Fishing", "Video Games" ], "ed": 1 }
+{ "a": [ "Squash", "Squash", "Music" ], "b": [ "Squash", "Squash", "Video Games" ], "ed": 1 }
+{ "a": [ "Squash", "Squash", "Music" ], "b": [ "Video Games", "Squash", "Music" ], "ed": 1 }
+{ "a": [ "Bass", "Running", "Movies" ], "b": [ "Bass", "Running", "Walking" ], "ed": 1 }
+{ "a": [ "Bass", "Running", "Movies" ], "b": [ "Bass", "Running", "Puzzles" ], "ed": 1 }
+{ "a": [ "Coffee", "Tennis", "Bass" ], "b": [ "Coffee", "Tennis", "Bass", "Running" ], "ed": 1 }
+{ "a": [ "Bass", "Running", "Walking" ], "b": [ "Bass", "Running", "Puzzles" ], "ed": 1 }
+{ "a": [ "Databases", "Wine", "Cigars" ], "b": [ "Base Jumping", "Wine", "Cigars" ], "ed": 1 }
+{ "a": [ "Computers", "Skiing", "Music" ], "b": [ "Bass", "Skiing", "Music" ], "ed": 1 }
+{ "a": [ "Tennis", "Cigars", "Books" ], "b": [ "Tennis", "Cigars", "Music" ], "ed": 1 }
+{ "a": [ "Tennis", "Cigars", "Books" ], "b": [ "Cooking", "Cigars", "Books" ], "ed": 1 }
+{ "a": [ "Bass", "Books", "Books" ], "b": [ "Books", "Bass", "Books", "Books" ], "ed": 1 }
+{ "a": [ "Music", "Skiing", "Running" ], "b": [ "Basketball", "Skiing", "Running" ], "ed": 1 }
+{ "a": [ "Music", "Skiing", "Running" ], "b": [ "Movies", "Skiing", "Running" ], "ed": 1 }
+{ "a": [ "Basketball", "Skiing", "Wine", "Fishing" ], "b": [ "Wine", "Skiing", "Wine", "Fishing" ], "ed": 1 }
+{ "a": [ "Skiing", "Music", "Movies" ], "b": [ "Skiing", "Squash", "Movies" ], "ed": 1 }
+{ "a": [ "Databases", "Music", "Wine" ], "b": [ "Databases", "Music", "Cooking" ], "ed": 1 }
+{ "a": [ "Databases", "Music", "Wine" ], "b": [ "Databases", "Music", "Video Games" ], "ed": 1 }
+{ "a": [ "Databases", "Music", "Wine" ], "b": [ "Databases", "Music", "Puzzles" ], "ed": 1 }
+{ "a": [ "Databases", "Music", "Wine" ], "b": [ "Databases", "Cooking", "Wine" ], "ed": 1 }
+{ "a": [ "Databases", "Music", "Wine" ], "b": [ "Databases", "Fishing", "Wine" ], "ed": 1 }
+{ "a": [ "Computers", "Music", "Cigars" ], "b": [ "Cooking", "Music", "Cigars" ], "ed": 1 }
+{ "a": [ "Music", "Fishing", "Databases", "Wine" ], "b": [ "Fishing", "Databases", "Wine" ], "ed": 1 }
+{ "a": [ "Running", "Basketball", "Tennis" ], "b": [ "Running", "Basketball", "Walking" ], "ed": 1 }
+{ "a": [ "Running", "Basketball", "Tennis" ], "b": [ "Running", "Basketball", "Cooking" ], "ed": 1 }
+{ "a": [ "Base Jumping", "Wine", "Cigars" ], "b": [ "Base Jumping", "Coffee", "Cigars" ], "ed": 1 }
+{ "a": [ "Tennis", "Puzzles", "Base Jumping" ], "b": [ "Tennis", "Puzzles", "Cigars" ], "ed": 1 }
+{ "a": [ "Tennis", "Puzzles", "Base Jumping" ], "b": [ "Running", "Puzzles", "Base Jumping" ], "ed": 1 }
+{ "a": [ "Running", "Fishing", "Coffee" ], "b": [ "Running", "Fishing", "Coffee", "Basketball" ], "ed": 1 }
+{ "a": [ "Squash", "Music", "Bass", "Puzzles" ], "b": [ "Squash", "Cooking", "Bass", "Puzzles" ], "ed": 1 }
+{ "a": [ "Fishing", "Databases", "Wine" ], "b": [ "Movies", "Databases", "Wine" ], "ed": 1 }
+{ "a": [ "Walking", "Squash", "Wine" ], "b": [ "Walking", "Cigars", "Squash", "Wine" ], "ed": 1 }
+{ "a": [ "Coffee", "Bass", "Running" ], "b": [ "Coffee", "Bass", "Tennis" ], "ed": 1 }
+{ "a": [ "Coffee", "Bass", "Running" ], "b": [ "Coffee", "Tennis", "Bass", "Running" ], "ed": 1 }
+{ "a": [ "Coffee", "Movies", "Skiing" ], "b": [ "Coffee", "Movies", "Fishing" ], "ed": 1 }
+{ "a": [ "Coffee", "Movies", "Skiing" ], "b": [ "Coffee", "Movies", "Squash" ], "ed": 1 }
+{ "a": [ "Squash", "Base Jumping", "Tennis" ], "b": [ "Music", "Base Jumping", "Tennis" ], "ed": 1 }
+{ "a": [ "Squash", "Base Jumping", "Tennis" ], "b": [ "Video Games", "Base Jumping", "Tennis" ], "ed": 1 }
+{ "a": [ "Fishing", "Skiing", "Skiing" ], "b": [ "Squash", "Skiing", "Skiing" ], "ed": 1 }
+{ "a": [ "Books", "Tennis", "Cooking" ], "b": [ "Books", "Databases", "Cooking" ], "ed": 1 }
+{ "a": [ "Coffee", "Bass", "Tennis" ], "b": [ "Coffee", "Books", "Tennis" ], "ed": 1 }
+{ "a": [ "Databases", "Cigars", "Music", "Video Games" ], "b": [ "Databases", "Music", "Video Games" ], "ed": 1 }
+{ "a": [ "Books", "Fishing", "Video Games" ], "b": [ "Books", "Cooking", "Video Games" ], "ed": 1 }
+{ "a": [ "Wine", "Running", "Computers" ], "b": [ "Wine", "Cooking", "Running", "Computers" ], "ed": 1 }
+{ "a": [ "Coffee", "Books", "Tennis" ], "b": [ "Music", "Books", "Tennis" ], "ed": 1 }
+{ "a": [ "Tennis", "Music", "Running", "Music" ], "b": [ "Tennis", "Music", "Running", "Cooking" ], "ed": 1 }
+{ "a": [ "Basketball", "Fishing", "Walking" ], "b": [ "Basketball", "Fishing", "Puzzles" ], "ed": 1 }
+{ "a": [ "Databases", "Music", "Cooking" ], "b": [ "Databases", "Music", "Video Games" ], "ed": 1 }
+{ "a": [ "Databases", "Music", "Cooking" ], "b": [ "Databases", "Music", "Puzzles" ], "ed": 1 }
+{ "a": [ "Tennis", "Walking", "Databases" ], "b": [ "Tennis", "Walking", "Basketball" ], "ed": 1 }
+{ "a": [ "Squash", "Skiing", "Skiing" ], "b": [ "Squash", "Basketball", "Skiing" ], "ed": 1 }
+{ "a": [ "Movies", "Skiing", "Cooking" ], "b": [ "Movies", "Skiing", "Running" ], "ed": 1 }
+{ "a": [ "Bass", "Movies", "Music" ], "b": [ "Cooking", "Movies", "Music" ], "ed": 1 }
+{ "a": [ "Bass", "Movies", "Music" ], "b": [ "Bass", "Skiing", "Music" ], "ed": 1 }
+{ "a": [ "Wine", "Skiing", "Wine", "Fishing" ], "b": [ "Wine", "Wine", "Fishing" ], "ed": 1 }
+{ "a": [ "Databases", "Music", "Video Games" ], "b": [ "Databases", "Music", "Puzzles" ], "ed": 1 }
+{ "a": [ "Basketball", "Skiing", "Running" ], "b": [ "Movies", "Skiing", "Running" ], "ed": 1 }
+{ "a": [ "Music", "Base Jumping", "Tennis" ], "b": [ "Music", "Books", "Tennis" ], "ed": 1 }
+{ "a": [ "Music", "Base Jumping", "Tennis" ], "b": [ "Video Games", "Base Jumping", "Tennis" ], "ed": 1 }
+{ "a": [ "Tennis", "Databases", "Bass" ], "b": [ "Tennis", "Movies", "Bass" ], "ed": 1 }
+{ "a": [ "Tennis", "Databases", "Bass" ], "b": [ "Base Jumping", "Databases", "Bass" ], "ed": 1 }
+{ "a": [ "Skiing", "Computers", "Base Jumping" ], "b": [ "Coffee", "Computers", "Base Jumping" ], "ed": 1 }
+{ "a": [ "Computers", "Bass", "Walking" ], "b": [ "Computers", "Movies", "Walking" ], "ed": 1 }
+{ "a": [ "Tennis", "Cooking", "Computers" ], "b": [ "Tennis", "Wine", "Computers" ], "ed": 1 }
+{ "a": [ "Wine", "Music", "Fishing" ], "b": [ "Wine", "Wine", "Fishing" ], "ed": 1 }
+{ "a": [ "Databases", "Music", "Puzzles" ], "b": [ "Movies", "Music", "Puzzles" ], "ed": 1 }
+{ "a": [ "Base Jumping", "Tennis", "Video Games" ], "b": [ "Running", "Tennis", "Video Games" ], "ed": 1 }
+{ "a": [ "Base Jumping", "Tennis", "Video Games" ], "b": [ "Base Jumping", "Tennis", "Wine" ], "ed": 1 }
+{ "a": [ "Movies", "Coffee", "Walking" ], "b": [ "Movies", "Books", "Walking" ], "ed": 1 }
+{ "a": [ "Basketball", "Squash", "Base Jumping" ], "b": [ "Basketball", "Squash", "Movies", "Base Jumping" ], "ed": 1 }
+{ "a": [ "Wine", "Fishing", "Base Jumping" ], "b": [ "Wine", "Basketball", "Base Jumping" ], "ed": 1 }
+{ "a": [ "Basketball", "Running", "Wine" ], "b": [ "Base Jumping", "Running", "Wine" ], "ed": 1 }
+{ "a": [ "Running", "Puzzles", "Base Jumping" ], "b": [ "Puzzles", "Running", "Puzzles", "Base Jumping" ], "ed": 1 }
+{ "a": [ "Basketball", "Cigars", "Cooking" ], "b": [ "Skiing", "Cigars", "Cooking" ], "ed": 1 }
+{ "a": [ "Basketball", "Cigars", "Cooking" ], "b": [ "Basketball", "Cigars", "Cooking", "Running" ], "ed": 1 }
+{ "a": [ "Running", "Basketball", "Walking" ], "b": [ "Running", "Basketball", "Cooking" ], "ed": 1 }
+{ "a": [ "Tennis", "Walking", "Basketball" ], "b": [ "Skiing", "Walking", "Basketball" ], "ed": 1 }
+{ "a": [ "Coffee", "Movies", "Fishing" ], "b": [ "Coffee", "Movies", "Skiing" ], "ed": 1 }
+{ "a": [ "Coffee", "Movies", "Fishing" ], "b": [ "Coffee", "Movies", "Squash" ], "ed": 1 }
+{ "a": [ "Databases", "Cooking", "Wine" ], "b": [ "Databases", "Fishing", "Wine" ], "ed": 1 }
+{ "a": [ "Coffee", "Movies", "Skiing" ], "b": [ "Coffee", "Movies", "Squash" ], "ed": 1 }
+{ "a": [ "Databases", "Fishing", "Skiing" ], "b": [ "Databases", "Fishing", "Wine" ], "ed": 1 }
+{ "a": [ "Base Jumping", "Running", "Wine" ], "b": [ "Base Jumping", "Tennis", "Wine" ], "ed": 1 }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/olist-edit-distance.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/olist-edit-distance.adm
new file mode 100644
index 0000000..57ec2a3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/olist-edit-distance.adm
@@ -0,0 +1,157 @@
+{ "a": [ "Cooking", "Fishing", "Video Games" ], "b": [ "Books", "Fishing", "Video Games" ] }
+{ "a": [ "Skiing", "Coffee", "Wine" ], "b": [ "Puzzles", "Coffee", "Wine" ] }
+{ "a": [ "Skiing", "Coffee", "Wine" ], "b": [ "Skiing", "Coffee", "Skiing" ] }
+{ "a": [ "Base Jumping", "Cigars", "Movies" ], "b": [ "Base Jumping", "Cigars", "Movies" ] }
+{ "a": [ "Base Jumping", "Cigars", "Movies" ], "b": [ "Base Jumping", "Movies", "Movies" ] }
+{ "a": [ "Base Jumping", "Cigars", "Movies" ], "b": [ "Squash", "Cigars", "Movies" ] }
+{ "a": [ "Wine", "Walking", "Bass" ], "b": [ "Wine", "Walking", "Puzzles" ] }
+{ "a": [ "Cigars", "Skiing", "Video Games", "Books" ], "b": [ "Cigars", "Skiing", "Video Games", "Coffee" ] }
+{ "a": [ "Bass", "Bass", "Books" ], "b": [ "Bass", "Bass", "Base Jumping" ] }
+{ "a": [ "Bass", "Bass", "Books" ], "b": [ "Bass", "Books", "Books" ] }
+{ "a": [ "Bass", "Running", "Databases" ], "b": [ "Bass", "Basketball", "Databases" ] }
+{ "a": [ "Bass", "Running", "Databases" ], "b": [ "Bass", "Running", "Movies" ] }
+{ "a": [ "Bass", "Running", "Databases" ], "b": [ "Bass", "Running", "Walking" ] }
+{ "a": [ "Bass", "Running", "Databases" ], "b": [ "Bass", "Running", "Puzzles" ] }
+{ "a": [ "Cigars", "Walking", "Databases", "Video Games" ], "b": [ "Wine", "Walking", "Databases", "Video Games" ] }
+{ "a": [ "Tennis", "Puzzles", "Video Games" ], "b": [ "Tennis", "Puzzles", "Base Jumping" ] }
+{ "a": [ "Tennis", "Puzzles", "Video Games" ], "b": [ "Tennis", "Puzzles", "Cigars" ] }
+{ "a": [ "Squash", "Movies", "Coffee" ], "b": [ "Squash", "Movies", "Computers" ] }
+{ "a": [ "Base Jumping", "Movies", "Skiing" ], "b": [ "Wine", "Movies", "Skiing" ] }
+{ "a": [ "Base Jumping", "Movies", "Skiing" ], "b": [ "Base Jumping", "Movies", "Movies" ] }
+{ "a": [ "Base Jumping", "Movies", "Skiing" ], "b": [ "Coffee", "Movies", "Skiing" ] }
+{ "a": [ "Base Jumping", "Movies", "Skiing" ], "b": [ "Coffee", "Movies", "Skiing" ] }
+{ "a": [ "Music", "Tennis", "Base Jumping" ], "b": [ "Books", "Tennis", "Base Jumping" ] }
+{ "a": [ "Wine", "Movies", "Skiing" ], "b": [ "Coffee", "Movies", "Skiing" ] }
+{ "a": [ "Wine", "Movies", "Skiing" ], "b": [ "Coffee", "Movies", "Skiing" ] }
+{ "a": [ "Music", "Base Jumping", "Books" ], "b": [ "Music", "Base Jumping", "Tennis" ] }
+{ "a": [ "Music", "Base Jumping", "Books" ], "b": [ "Music", "Base Jumping", "Coffee", "Books" ] }
+{ "a": [ "Music", "Basketball", "Movies" ], "b": [ "Music", "Basketball", "Cigars" ] }
+{ "a": [ "Databases", "Movies", "Cigars" ], "b": [ "Databases", "Wine", "Cigars" ] }
+{ "a": [ "Databases", "Movies", "Cigars" ], "b": [ "Databases", "Movies", "Tennis" ] }
+{ "a": [ "Databases", "Movies", "Cigars" ], "b": [ "Databases", "Movies", "Tennis" ] }
+{ "a": [ "Movies", "Books", "Bass" ], "b": [ "Movies", "Books", "Walking" ] }
+{ "a": [ "Bass", "Walking", "Movies" ], "b": [ "Bass", "Running", "Movies" ] }
+{ "a": [ "Skiing", "Computers", "Bass", "Cigars" ], "b": [ "Bass", "Computers", "Bass", "Cigars" ] }
+{ "a": [ "Base Jumping", "Cigars", "Movies" ], "b": [ "Base Jumping", "Movies", "Movies" ] }
+{ "a": [ "Base Jumping", "Cigars", "Movies" ], "b": [ "Squash", "Cigars", "Movies" ] }
+{ "a": [ "Bass", "Wine", "Coffee" ], "b": [ "Base Jumping", "Wine", "Coffee" ] }
+{ "a": [ "Bass", "Wine", "Coffee" ], "b": [ "Bass", "Squash", "Coffee" ] }
+{ "a": [ "Music", "Fishing", "Music" ], "b": [ "Music", "Fishing", "Computers" ] }
+{ "a": [ "Puzzles", "Cooking", "Squash" ], "b": [ "Puzzles", "Puzzles", "Squash" ] }
+{ "a": [ "Puzzles", "Cooking", "Squash" ], "b": [ "Puzzles", "Cooking", "Bass" ] }
+{ "a": [ "Running", "Computers", "Basketball" ], "b": [ "Running", "Basketball", "Computers", "Basketball" ] }
+{ "a": [ "Coffee", "Coffee", "Cigars" ], "b": [ "Coffee", "Walking", "Cigars" ] }
+{ "a": [ "Coffee", "Coffee", "Cigars" ], "b": [ "Base Jumping", "Coffee", "Cigars" ] }
+{ "a": [ "Basketball", "Movies", "Cooking" ], "b": [ "Basketball", "Cigars", "Cooking" ] }
+{ "a": [ "Cooking", "Music", "Books" ], "b": [ "Cooking", "Music", "Cigars" ] }
+{ "a": [ "Cooking", "Music", "Books" ], "b": [ "Cooking", "Cigars", "Books" ] }
+{ "a": [ "Wine", "Databases", "Basketball" ], "b": [ "Wine", "Puzzles", "Basketball" ] }
+{ "a": [ "Wine", "Puzzles", "Basketball" ], "b": [ "Wine", "Puzzles", "Tennis" ] }
+{ "a": [ "Base Jumping", "Base Jumping", "Walking", "Computers" ], "b": [ "Base Jumping", "Fishing", "Walking", "Computers" ] }
+{ "a": [ "Base Jumping", "Base Jumping", "Walking", "Computers" ], "b": [ "Base Jumping", "Base Jumping", "Books", "Computers" ] }
+{ "a": [ "Computers", "Squash", "Coffee" ], "b": [ "Bass", "Squash", "Coffee" ] }
+{ "a": [ "Puzzles", "Puzzles", "Skiing" ], "b": [ "Puzzles", "Puzzles", "Squash" ] }
+{ "a": [ "Tennis", "Fishing", "Movies" ], "b": [ "Databases", "Fishing", "Movies" ] }
+{ "a": [ "Tennis", "Fishing", "Movies" ], "b": [ "Tennis", "Movies", "Movies" ] }
+{ "a": [ "Bass", "Coffee", "Skiing" ], "b": [ "Skiing", "Coffee", "Skiing" ] }
+{ "a": [ "Running", "Books", "Running" ], "b": [ "Running", "Wine", "Running" ] }
+{ "a": [ "Computers", "Tennis", "Books" ], "b": [ "Computers", "Tennis", "Puzzles", "Books" ] }
+{ "a": [ "Puzzles", "Coffee", "Wine" ], "b": [ "Puzzles", "Computers", "Wine" ] }
+{ "a": [ "Squash", "Bass", "Cooking" ], "b": [ "Base Jumping", "Bass", "Cooking" ] }
+{ "a": [ "Databases", "Fishing", "Movies" ], "b": [ "Databases", "Fishing", "Skiing" ] }
+{ "a": [ "Databases", "Fishing", "Movies" ], "b": [ "Databases", "Fishing", "Wine" ] }
+{ "a": [ "Coffee", "Computers", "Fishing" ], "b": [ "Coffee", "Movies", "Fishing" ] }
+{ "a": [ "Coffee", "Computers", "Fishing" ], "b": [ "Coffee", "Computers", "Base Jumping" ] }
+{ "a": [ "Base Jumping", "Wine", "Coffee" ], "b": [ "Base Jumping", "Wine", "Cigars" ] }
+{ "a": [ "Tennis", "Movies", "Movies" ], "b": [ "Base Jumping", "Movies", "Movies" ] }
+{ "a": [ "Tennis", "Movies", "Movies" ], "b": [ "Tennis", "Movies", "Bass" ] }
+{ "a": [ "Wine", "Puzzles", "Tennis" ], "b": [ "Wine", "Skiing", "Puzzles", "Tennis" ] }
+{ "a": [ "Books", "Tennis", "Base Jumping" ], "b": [ "Books", "Tennis", "Cooking" ] }
+{ "a": [ "Basketball", "Bass", "Cigars" ], "b": [ "Wine", "Bass", "Cigars" ] }
+{ "a": [ "Bass", "Movies", "Computers" ], "b": [ "Bass", "Movies", "Music" ] }
+{ "a": [ "Bass", "Movies", "Computers" ], "b": [ "Squash", "Movies", "Computers" ] }
+{ "a": [ "Walking", "Bass", "Fishing", "Movies" ], "b": [ "Walking", "Bass", "Fishing", "Video Games" ] }
+{ "a": [ "Squash", "Squash", "Music" ], "b": [ "Squash", "Squash", "Video Games" ] }
+{ "a": [ "Squash", "Squash", "Music" ], "b": [ "Video Games", "Squash", "Music" ] }
+{ "a": [ "Bass", "Running", "Movies" ], "b": [ "Bass", "Running", "Walking" ] }
+{ "a": [ "Bass", "Running", "Movies" ], "b": [ "Bass", "Running", "Puzzles" ] }
+{ "a": [ "Coffee", "Tennis", "Bass" ], "b": [ "Coffee", "Tennis", "Bass", "Running" ] }
+{ "a": [ "Bass", "Running", "Walking" ], "b": [ "Bass", "Running", "Puzzles" ] }
+{ "a": [ "Databases", "Wine", "Cigars" ], "b": [ "Base Jumping", "Wine", "Cigars" ] }
+{ "a": [ "Computers", "Skiing", "Music" ], "b": [ "Bass", "Skiing", "Music" ] }
+{ "a": [ "Tennis", "Cigars", "Books" ], "b": [ "Tennis", "Cigars", "Music" ] }
+{ "a": [ "Tennis", "Cigars", "Books" ], "b": [ "Cooking", "Cigars", "Books" ] }
+{ "a": [ "Bass", "Books", "Books" ], "b": [ "Books", "Bass", "Books", "Books" ] }
+{ "a": [ "Music", "Skiing", "Running" ], "b": [ "Basketball", "Skiing", "Running" ] }
+{ "a": [ "Music", "Skiing", "Running" ], "b": [ "Movies", "Skiing", "Running" ] }
+{ "a": [ "Basketball", "Skiing", "Wine", "Fishing" ], "b": [ "Wine", "Skiing", "Wine", "Fishing" ] }
+{ "a": [ "Skiing", "Music", "Movies" ], "b": [ "Skiing", "Squash", "Movies" ] }
+{ "a": [ "Databases", "Music", "Wine" ], "b": [ "Databases", "Music", "Cooking" ] }
+{ "a": [ "Databases", "Music", "Wine" ], "b": [ "Databases", "Music", "Video Games" ] }
+{ "a": [ "Databases", "Music", "Wine" ], "b": [ "Databases", "Music", "Puzzles" ] }
+{ "a": [ "Databases", "Music", "Wine" ], "b": [ "Databases", "Cooking", "Wine" ] }
+{ "a": [ "Databases", "Music", "Wine" ], "b": [ "Databases", "Fishing", "Wine" ] }
+{ "a": [ "Computers", "Music", "Cigars" ], "b": [ "Cooking", "Music", "Cigars" ] }
+{ "a": [ "Music", "Fishing", "Databases", "Wine" ], "b": [ "Fishing", "Databases", "Wine" ] }
+{ "a": [ "Running", "Basketball", "Tennis" ], "b": [ "Running", "Basketball", "Walking" ] }
+{ "a": [ "Running", "Basketball", "Tennis" ], "b": [ "Running", "Basketball", "Cooking" ] }
+{ "a": [ "Base Jumping", "Wine", "Cigars" ], "b": [ "Base Jumping", "Coffee", "Cigars" ] }
+{ "a": [ "Tennis", "Puzzles", "Base Jumping" ], "b": [ "Tennis", "Puzzles", "Cigars" ] }
+{ "a": [ "Tennis", "Puzzles", "Base Jumping" ], "b": [ "Running", "Puzzles", "Base Jumping" ] }
+{ "a": [ "Running", "Fishing", "Coffee" ], "b": [ "Running", "Fishing", "Coffee", "Basketball" ] }
+{ "a": [ "Squash", "Music", "Bass", "Puzzles" ], "b": [ "Squash", "Cooking", "Bass", "Puzzles" ] }
+{ "a": [ "Fishing", "Databases", "Wine" ], "b": [ "Movies", "Databases", "Wine" ] }
+{ "a": [ "Walking", "Squash", "Wine" ], "b": [ "Walking", "Cigars", "Squash", "Wine" ] }
+{ "a": [ "Coffee", "Bass", "Running" ], "b": [ "Coffee", "Bass", "Tennis" ] }
+{ "a": [ "Coffee", "Bass", "Running" ], "b": [ "Coffee", "Tennis", "Bass", "Running" ] }
+{ "a": [ "Coffee", "Movies", "Skiing" ], "b": [ "Coffee", "Movies", "Fishing" ] }
+{ "a": [ "Coffee", "Movies", "Skiing" ], "b": [ "Coffee", "Movies", "Skiing" ] }
+{ "a": [ "Coffee", "Movies", "Skiing" ], "b": [ "Coffee", "Movies", "Squash" ] }
+{ "a": [ "Squash", "Base Jumping", "Tennis" ], "b": [ "Music", "Base Jumping", "Tennis" ] }
+{ "a": [ "Squash", "Base Jumping", "Tennis" ], "b": [ "Video Games", "Base Jumping", "Tennis" ] }
+{ "a": [ "Fishing", "Skiing", "Skiing" ], "b": [ "Squash", "Skiing", "Skiing" ] }
+{ "a": [ "Books", "Tennis", "Cooking" ], "b": [ "Books", "Databases", "Cooking" ] }
+{ "a": [ "Coffee", "Bass", "Tennis" ], "b": [ "Coffee", "Books", "Tennis" ] }
+{ "a": [ "Databases", "Cigars", "Music", "Video Games" ], "b": [ "Databases", "Music", "Video Games" ] }
+{ "a": [ "Books", "Fishing", "Video Games" ], "b": [ "Books", "Cooking", "Video Games" ] }
+{ "a": [ "Wine", "Running", "Computers" ], "b": [ "Wine", "Cooking", "Running", "Computers" ] }
+{ "a": [ "Coffee", "Books", "Tennis" ], "b": [ "Music", "Books", "Tennis" ] }
+{ "a": [ "Tennis", "Music", "Running", "Music" ], "b": [ "Tennis", "Music", "Running", "Cooking" ] }
+{ "a": [ "Basketball", "Fishing", "Walking" ], "b": [ "Basketball", "Fishing", "Puzzles" ] }
+{ "a": [ "Databases", "Music", "Cooking" ], "b": [ "Databases", "Music", "Video Games" ] }
+{ "a": [ "Databases", "Music", "Cooking" ], "b": [ "Databases", "Music", "Puzzles" ] }
+{ "a": [ "Tennis", "Walking", "Databases" ], "b": [ "Tennis", "Walking", "Basketball" ] }
+{ "a": [ "Squash", "Skiing", "Skiing" ], "b": [ "Squash", "Basketball", "Skiing" ] }
+{ "a": [ "Movies", "Skiing", "Cooking" ], "b": [ "Movies", "Skiing", "Running" ] }
+{ "a": [ "Bass", "Movies", "Music" ], "b": [ "Cooking", "Movies", "Music" ] }
+{ "a": [ "Bass", "Movies", "Music" ], "b": [ "Bass", "Skiing", "Music" ] }
+{ "a": [ "Wine", "Skiing", "Wine", "Fishing" ], "b": [ "Wine", "Wine", "Fishing" ] }
+{ "a": [ "Databases", "Music", "Video Games" ], "b": [ "Databases", "Music", "Puzzles" ] }
+{ "a": [ "Basketball", "Skiing", "Running" ], "b": [ "Movies", "Skiing", "Running" ] }
+{ "a": [ "Music", "Base Jumping", "Tennis" ], "b": [ "Music", "Books", "Tennis" ] }
+{ "a": [ "Music", "Base Jumping", "Tennis" ], "b": [ "Video Games", "Base Jumping", "Tennis" ] }
+{ "a": [ "Databases", "Movies", "Tennis" ], "b": [ "Databases", "Movies", "Tennis" ] }
+{ "a": [ "Tennis", "Databases", "Bass" ], "b": [ "Tennis", "Movies", "Bass" ] }
+{ "a": [ "Tennis", "Databases", "Bass" ], "b": [ "Base Jumping", "Databases", "Bass" ] }
+{ "a": [ "Skiing", "Computers", "Base Jumping" ], "b": [ "Coffee", "Computers", "Base Jumping" ] }
+{ "a": [ "Computers", "Bass", "Walking" ], "b": [ "Computers", "Movies", "Walking" ] }
+{ "a": [ "Tennis", "Cooking", "Computers" ], "b": [ "Tennis", "Wine", "Computers" ] }
+{ "a": [ "Wine", "Music", "Fishing" ], "b": [ "Wine", "Wine", "Fishing" ] }
+{ "a": [ "Databases", "Music", "Puzzles" ], "b": [ "Movies", "Music", "Puzzles" ] }
+{ "a": [ "Base Jumping", "Tennis", "Video Games" ], "b": [ "Running", "Tennis", "Video Games" ] }
+{ "a": [ "Base Jumping", "Tennis", "Video Games" ], "b": [ "Base Jumping", "Tennis", "Wine" ] }
+{ "a": [ "Movies", "Coffee", "Walking" ], "b": [ "Movies", "Books", "Walking" ] }
+{ "a": [ "Basketball", "Squash", "Base Jumping" ], "b": [ "Basketball", "Squash", "Movies", "Base Jumping" ] }
+{ "a": [ "Wine", "Fishing", "Base Jumping" ], "b": [ "Wine", "Basketball", "Base Jumping" ] }
+{ "a": [ "Basketball", "Running", "Wine" ], "b": [ "Base Jumping", "Running", "Wine" ] }
+{ "a": [ "Running", "Puzzles", "Base Jumping" ], "b": [ "Puzzles", "Running", "Puzzles", "Base Jumping" ] }
+{ "a": [ "Basketball", "Cigars", "Cooking" ], "b": [ "Skiing", "Cigars", "Cooking" ] }
+{ "a": [ "Basketball", "Cigars", "Cooking" ], "b": [ "Basketball", "Cigars", "Cooking", "Running" ] }
+{ "a": [ "Running", "Basketball", "Walking" ], "b": [ "Running", "Basketball", "Cooking" ] }
+{ "a": [ "Tennis", "Walking", "Basketball" ], "b": [ "Skiing", "Walking", "Basketball" ] }
+{ "a": [ "Coffee", "Movies", "Fishing" ], "b": [ "Coffee", "Movies", "Skiing" ] }
+{ "a": [ "Coffee", "Movies", "Fishing" ], "b": [ "Coffee", "Movies", "Squash" ] }
+{ "a": [ "Databases", "Cooking", "Wine" ], "b": [ "Databases", "Fishing", "Wine" ] }
+{ "a": [ "Coffee", "Movies", "Skiing" ], "b": [ "Coffee", "Movies", "Squash" ] }
+{ "a": [ "Databases", "Fishing", "Skiing" ], "b": [ "Databases", "Fishing", "Wine" ] }
+{ "a": [ "Base Jumping", "Running", "Wine" ], "b": [ "Base Jumping", "Tennis", "Wine" ] }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/olist-jaccard-inline.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/olist-jaccard-inline.adm
new file mode 100644
index 0000000..547a0e7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/olist-jaccard-inline.adm
@@ -0,0 +1,115 @@
+{ "a": [ "Bass", "Wine" ], "b": [ "Bass", "Wine" ], "jacc": 1.0f }
+{ "a": [ "Music", "Databases" ], "b": [ "Databases", "Music" ], "jacc": 1.0f }
+{ "a": [ "Music", "Databases" ], "b": [ "Databases", "Music" ], "jacc": 1.0f }
+{ "a": [ "Music", "Databases" ], "b": [ "Music", "Databases" ], "jacc": 1.0f }
+{ "a": [ "Music", "Databases" ], "b": [ "Databases", "Music" ], "jacc": 1.0f }
+{ "a": [ "Wine", "Walking" ], "b": [ "Wine", "Walking" ], "jacc": 1.0f }
+{ "a": [ "Wine", "Walking" ], "b": [ "Walking", "Wine" ], "jacc": 1.0f }
+{ "a": [ "Base Jumping", "Cigars", "Movies" ], "b": [ "Base Jumping", "Cigars", "Movies" ], "jacc": 1.0f }
+{ "a": [ "Skiing", "Walking" ], "b": [ "Skiing", "Walking" ], "jacc": 1.0f }
+{ "a": [ "Base Jumping", "Music" ], "b": [ "Music", "Base Jumping" ], "jacc": 1.0f }
+{ "a": [ "Base Jumping", "Music" ], "b": [ "Music", "Base Jumping" ], "jacc": 1.0f }
+{ "a": [ "Fishing", "Video Games" ], "b": [ "Video Games", "Fishing" ], "jacc": 1.0f }
+{ "a": [ "Base Jumping", "Skiing" ], "b": [ "Skiing", "Base Jumping" ], "jacc": 1.0f }
+{ "a": [ "Base Jumping", "Skiing" ], "b": [ "Base Jumping", "Skiing" ], "jacc": 1.0f }
+{ "a": [ "Skiing", "Bass" ], "b": [ "Skiing", "Bass" ], "jacc": 1.0f }
+{ "a": [ "Skiing", "Bass" ], "b": [ "Skiing", "Bass" ], "jacc": 1.0f }
+{ "a": [ "Skiing", "Bass" ], "b": [ "Bass", "Skiing" ], "jacc": 1.0f }
+{ "a": [ "Fishing", "Running", "Cigars" ], "b": [ "Fishing", "Cigars", "Running" ], "jacc": 1.0f }
+{ "a": [ "Cigars", "Skiing" ], "b": [ "Skiing", "Cigars" ], "jacc": 1.0f }
+{ "a": [ "Movies", "Walking" ], "b": [ "Movies", "Walking" ], "jacc": 1.0f }
+{ "a": [ "Music", "Coffee" ], "b": [ "Coffee", "Music" ], "jacc": 1.0f }
+{ "a": [ "Running", "Coffee", "Fishing" ], "b": [ "Running", "Fishing", "Coffee" ], "jacc": 1.0f }
+{ "a": [ "Squash", "Movies", "Coffee" ], "b": [ "Coffee", "Movies", "Squash" ], "jacc": 1.0f }
+{ "a": [ "Music", "Tennis", "Base Jumping" ], "b": [ "Music", "Base Jumping", "Tennis" ], "jacc": 1.0f }
+{ "a": [ "Music", "Base Jumping", "Books" ], "b": [ "Books", "Base Jumping", "Music" ], "jacc": 1.0f }
+{ "a": [ "Bass", "Books" ], "b": [ "Bass", "Books" ], "jacc": 1.0f }
+{ "a": [ "Bass", "Books" ], "b": [ "Books", "Bass" ], "jacc": 1.0f }
+{ "a": [ "Puzzles", "Squash" ], "b": [ "Squash", "Puzzles" ], "jacc": 1.0f }
+{ "a": [ "Computers", "Wine" ], "b": [ "Wine", "Computers" ], "jacc": 1.0f }
+{ "a": [ "Computers", "Wine" ], "b": [ "Computers", "Wine" ], "jacc": 1.0f }
+{ "a": [ "Computers", "Wine" ], "b": [ "Wine", "Computers" ], "jacc": 1.0f }
+{ "a": [ "Walking", "Cooking" ], "b": [ "Walking", "Cooking" ], "jacc": 1.0f }
+{ "a": [ "Walking", "Cooking" ], "b": [ "Walking", "Cooking" ], "jacc": 1.0f }
+{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Databases" ], "jacc": 1.0f }
+{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Databases" ], "jacc": 1.0f }
+{ "a": [ "Squash", "Databases" ], "b": [ "Squash", "Databases" ], "jacc": 1.0f }
+{ "a": [ "Wine", "Computers" ], "b": [ "Computers", "Wine" ], "jacc": 1.0f }
+{ "a": [ "Wine", "Computers" ], "b": [ "Wine", "Computers" ], "jacc": 1.0f }
+{ "a": [ "Skiing", "Bass" ], "b": [ "Skiing", "Bass" ], "jacc": 1.0f }
+{ "a": [ "Skiing", "Bass" ], "b": [ "Bass", "Skiing" ], "jacc": 1.0f }
+{ "a": [ "Movies", "Books" ], "b": [ "Movies", "Books" ], "jacc": 1.0f }
+{ "a": [ "Movies", "Books" ], "b": [ "Books", "Movies" ], "jacc": 1.0f }
+{ "a": [ "Movies", "Books" ], "b": [ "Movies", "Books" ], "jacc": 1.0f }
+{ "a": [ "Wine", "Squash" ], "b": [ "Wine", "Squash" ], "jacc": 1.0f }
+{ "a": [ "Coffee", "Tennis" ], "b": [ "Tennis", "Coffee" ], "jacc": 1.0f }
+{ "a": [ "Coffee", "Tennis" ], "b": [ "Tennis", "Coffee" ], "jacc": 1.0f }
+{ "a": [ "Skiing", "Books" ], "b": [ "Books", "Skiing" ], "jacc": 1.0f }
+{ "a": [ "Databases", "Music" ], "b": [ "Databases", "Music" ], "jacc": 1.0f }
+{ "a": [ "Databases", "Music" ], "b": [ "Music", "Databases" ], "jacc": 1.0f }
+{ "a": [ "Databases", "Music" ], "b": [ "Databases", "Music" ], "jacc": 1.0f }
+{ "a": [ "Video Games", "Cigars" ], "b": [ "Cigars", "Video Games" ], "jacc": 1.0f }
+{ "a": [ "Video Games", "Cigars" ], "b": [ "Video Games", "Cigars" ], "jacc": 1.0f }
+{ "a": [ "Databases", "Skiing" ], "b": [ "Databases", "Skiing" ], "jacc": 1.0f }
+{ "a": [ "Running", "Fishing" ], "b": [ "Running", "Fishing" ], "jacc": 1.0f }
+{ "a": [ "Databases", "Music" ], "b": [ "Music", "Databases" ], "jacc": 1.0f }
+{ "a": [ "Databases", "Music" ], "b": [ "Databases", "Music" ], "jacc": 1.0f }
+{ "a": [ "Base Jumping", "Running" ], "b": [ "Running", "Base Jumping" ], "jacc": 1.0f }
+{ "a": [ "Base Jumping", "Running" ], "b": [ "Base Jumping", "Running" ], "jacc": 1.0f }
+{ "a": [ "Books", "Base Jumping" ], "b": [ "Books", "Base Jumping" ], "jacc": 1.0f }
+{ "a": [ "Books", "Base Jumping" ], "b": [ "Books", "Base Jumping" ], "jacc": 1.0f }
+{ "a": [ "Cooking", "Running" ], "b": [ "Cooking", "Running" ], "jacc": 1.0f }
+{ "a": [ "Video Games", "Databases" ], "b": [ "Databases", "Video Games" ], "jacc": 1.0f }
+{ "a": [ "Video Games", "Databases" ], "b": [ "Databases", "Video Games" ], "jacc": 1.0f }
+{ "a": [ "Cigars", "Video Games" ], "b": [ "Video Games", "Cigars" ], "jacc": 1.0f }
+{ "a": [ "Running", "Base Jumping" ], "b": [ "Base Jumping", "Running" ], "jacc": 1.0f }
+{ "a": [ "Coffee", "Databases" ], "b": [ "Databases", "Coffee" ], "jacc": 1.0f }
+{ "a": [ "Movies", "Books" ], "b": [ "Books", "Movies" ], "jacc": 1.0f }
+{ "a": [ "Movies", "Books" ], "b": [ "Movies", "Books" ], "jacc": 1.0f }
+{ "a": [ "Databases", "Video Games" ], "b": [ "Databases", "Video Games" ], "jacc": 1.0f }
+{ "a": [ "Music", "Base Jumping" ], "b": [ "Music", "Base Jumping" ], "jacc": 1.0f }
+{ "a": [ "Bass", "Squash" ], "b": [ "Bass", "Squash" ], "jacc": 1.0f }
+{ "a": [ "Computers", "Tennis" ], "b": [ "Tennis", "Computers" ], "jacc": 1.0f }
+{ "a": [ "Tennis", "Coffee" ], "b": [ "Tennis", "Coffee" ], "jacc": 1.0f }
+{ "a": [ "Puzzles", "Books" ], "b": [ "Puzzles", "Books" ], "jacc": 1.0f }
+{ "a": [ "Puzzles", "Books" ], "b": [ "Puzzles", "Books" ], "jacc": 1.0f }
+{ "a": [ "Skiing", "Wine" ], "b": [ "Wine", "Skiing" ], "jacc": 1.0f }
+{ "a": [ "Squash", "Tennis" ], "b": [ "Squash", "Tennis" ], "jacc": 1.0f }
+{ "a": [ "Walking", "Cooking" ], "b": [ "Walking", "Cooking" ], "jacc": 1.0f }
+{ "a": [ "Coffee", "Tennis", "Bass" ], "b": [ "Coffee", "Bass", "Tennis" ], "jacc": 1.0f }
+{ "a": [ "Music", "Squash" ], "b": [ "Music", "Squash" ], "jacc": 1.0f }
+{ "a": [ "Computers", "Fishing" ], "b": [ "Fishing", "Computers" ], "jacc": 1.0f }
+{ "a": [ "Computers", "Fishing" ], "b": [ "Computers", "Fishing" ], "jacc": 1.0f }
+{ "a": [ "Wine", "Walking" ], "b": [ "Walking", "Wine" ], "jacc": 1.0f }
+{ "a": [ "Skiing", "Base Jumping" ], "b": [ "Base Jumping", "Skiing" ], "jacc": 1.0f }
+{ "a": [ "Bass", "Books" ], "b": [ "Books", "Bass" ], "jacc": 1.0f }
+{ "a": [ "Fishing", "Music" ], "b": [ "Fishing", "Music" ], "jacc": 1.0f }
+{ "a": [ "Books", "Tennis" ], "b": [ "Books", "Tennis" ], "jacc": 1.0f }
+{ "a": [ "Books", "Tennis" ], "b": [ "Tennis", "Books" ], "jacc": 1.0f }
+{ "a": [ "Books", "Tennis" ], "b": [ "Tennis", "Books" ], "jacc": 1.0f }
+{ "a": [ "Fishing", "Databases" ], "b": [ "Fishing", "Databases" ], "jacc": 1.0f }
+{ "a": [ "Walking", "Computers" ], "b": [ "Computers", "Walking" ], "jacc": 1.0f }
+{ "a": [ "Books", "Base Jumping" ], "b": [ "Books", "Base Jumping" ], "jacc": 1.0f }
+{ "a": [ "Movies", "Cooking", "Skiing" ], "b": [ "Movies", "Skiing", "Cooking" ], "jacc": 1.0f }
+{ "a": [ "Puzzles", "Books" ], "b": [ "Puzzles", "Books" ], "jacc": 1.0f }
+{ "a": [ "Wine", "Databases" ], "b": [ "Databases", "Wine" ], "jacc": 1.0f }
+{ "a": [ "Fishing", "Databases", "Wine" ], "b": [ "Fishing", "Wine", "Databases" ], "jacc": 1.0f }
+{ "a": [ "Fishing", "Databases", "Wine" ], "b": [ "Databases", "Fishing", "Wine" ], "jacc": 1.0f }
+{ "a": [ "Coffee", "Movies", "Skiing" ], "b": [ "Coffee", "Movies", "Skiing" ], "jacc": 1.0f }
+{ "a": [ "Cigars", "Cigars" ], "b": [ "Cigars", "Cigars" ], "jacc": 1.0f }
+{ "a": [ "Bass", "Walking" ], "b": [ "Walking", "Bass" ], "jacc": 1.0f }
+{ "a": [ "Wine", "Base Jumping", "Running" ], "b": [ "Base Jumping", "Running", "Wine" ], "jacc": 1.0f }
+{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Databases" ], "jacc": 1.0f }
+{ "a": [ "Movies", "Running" ], "b": [ "Movies", "Running" ], "jacc": 1.0f }
+{ "a": [ "Wine", "Puzzles" ], "b": [ "Puzzles", "Wine" ], "jacc": 1.0f }
+{ "a": [ "Squash", "Cigars" ], "b": [ "Squash", "Cigars" ], "jacc": 1.0f }
+{ "a": [ "Cooking", "Bass" ], "b": [ "Cooking", "Bass" ], "jacc": 1.0f }
+{ "a": [ "Databases", "Movies", "Tennis" ], "b": [ "Databases", "Movies", "Tennis" ], "jacc": 1.0f }
+{ "a": [ "Fishing", "Computers" ], "b": [ "Computers", "Fishing" ], "jacc": 1.0f }
+{ "a": [ "Fishing", "Movies" ], "b": [ "Fishing", "Movies" ], "jacc": 1.0f }
+{ "a": [ "Base Jumping", "Tennis", "Video Games" ], "b": [ "Video Games", "Base Jumping", "Tennis" ], "jacc": 1.0f }
+{ "a": [ "Computers", "Wine" ], "b": [ "Wine", "Computers" ], "jacc": 1.0f }
+{ "a": [ "Skiing", "Bass" ], "b": [ "Bass", "Skiing" ], "jacc": 1.0f }
+{ "a": [ "Music", "Databases" ], "b": [ "Databases", "Music" ], "jacc": 1.0f }
+{ "a": [ "Fishing", "Wine", "Databases" ], "b": [ "Databases", "Fishing", "Wine" ], "jacc": 1.0f }
+{ "a": [ "Books", "Movies" ], "b": [ "Movies", "Books" ], "jacc": 1.0f }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/olist-jaccard.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/olist-jaccard.adm
new file mode 100644
index 0000000..f70a077
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/olist-jaccard.adm
@@ -0,0 +1,115 @@
+{ "a": [ "Bass", "Wine" ], "b": [ "Bass", "Wine" ] }
+{ "a": [ "Music", "Databases" ], "b": [ "Databases", "Music" ] }
+{ "a": [ "Music", "Databases" ], "b": [ "Databases", "Music" ] }
+{ "a": [ "Music", "Databases" ], "b": [ "Music", "Databases" ] }
+{ "a": [ "Music", "Databases" ], "b": [ "Databases", "Music" ] }
+{ "a": [ "Wine", "Walking" ], "b": [ "Wine", "Walking" ] }
+{ "a": [ "Wine", "Walking" ], "b": [ "Walking", "Wine" ] }
+{ "a": [ "Base Jumping", "Cigars", "Movies" ], "b": [ "Base Jumping", "Cigars", "Movies" ] }
+{ "a": [ "Skiing", "Walking" ], "b": [ "Skiing", "Walking" ] }
+{ "a": [ "Base Jumping", "Music" ], "b": [ "Music", "Base Jumping" ] }
+{ "a": [ "Base Jumping", "Music" ], "b": [ "Music", "Base Jumping" ] }
+{ "a": [ "Fishing", "Video Games" ], "b": [ "Video Games", "Fishing" ] }
+{ "a": [ "Base Jumping", "Skiing" ], "b": [ "Skiing", "Base Jumping" ] }
+{ "a": [ "Base Jumping", "Skiing" ], "b": [ "Base Jumping", "Skiing" ] }
+{ "a": [ "Skiing", "Bass" ], "b": [ "Skiing", "Bass" ] }
+{ "a": [ "Skiing", "Bass" ], "b": [ "Skiing", "Bass" ] }
+{ "a": [ "Skiing", "Bass" ], "b": [ "Bass", "Skiing" ] }
+{ "a": [ "Fishing", "Running", "Cigars" ], "b": [ "Fishing", "Cigars", "Running" ] }
+{ "a": [ "Cigars", "Skiing" ], "b": [ "Skiing", "Cigars" ] }
+{ "a": [ "Movies", "Walking" ], "b": [ "Movies", "Walking" ] }
+{ "a": [ "Music", "Coffee" ], "b": [ "Coffee", "Music" ] }
+{ "a": [ "Running", "Coffee", "Fishing" ], "b": [ "Running", "Fishing", "Coffee" ] }
+{ "a": [ "Squash", "Movies", "Coffee" ], "b": [ "Coffee", "Movies", "Squash" ] }
+{ "a": [ "Music", "Tennis", "Base Jumping" ], "b": [ "Music", "Base Jumping", "Tennis" ] }
+{ "a": [ "Music", "Base Jumping", "Books" ], "b": [ "Books", "Base Jumping", "Music" ] }
+{ "a": [ "Bass", "Books" ], "b": [ "Bass", "Books" ] }
+{ "a": [ "Bass", "Books" ], "b": [ "Books", "Bass" ] }
+{ "a": [ "Puzzles", "Squash" ], "b": [ "Squash", "Puzzles" ] }
+{ "a": [ "Computers", "Wine" ], "b": [ "Wine", "Computers" ] }
+{ "a": [ "Computers", "Wine" ], "b": [ "Computers", "Wine" ] }
+{ "a": [ "Computers", "Wine" ], "b": [ "Wine", "Computers" ] }
+{ "a": [ "Walking", "Cooking" ], "b": [ "Walking", "Cooking" ] }
+{ "a": [ "Walking", "Cooking" ], "b": [ "Walking", "Cooking" ] }
+{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Databases" ] }
+{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Databases" ] }
+{ "a": [ "Squash", "Databases" ], "b": [ "Squash", "Databases" ] }
+{ "a": [ "Wine", "Computers" ], "b": [ "Computers", "Wine" ] }
+{ "a": [ "Wine", "Computers" ], "b": [ "Wine", "Computers" ] }
+{ "a": [ "Skiing", "Bass" ], "b": [ "Skiing", "Bass" ] }
+{ "a": [ "Skiing", "Bass" ], "b": [ "Bass", "Skiing" ] }
+{ "a": [ "Movies", "Books" ], "b": [ "Movies", "Books" ] }
+{ "a": [ "Movies", "Books" ], "b": [ "Books", "Movies" ] }
+{ "a": [ "Movies", "Books" ], "b": [ "Movies", "Books" ] }
+{ "a": [ "Wine", "Squash" ], "b": [ "Wine", "Squash" ] }
+{ "a": [ "Coffee", "Tennis" ], "b": [ "Tennis", "Coffee" ] }
+{ "a": [ "Coffee", "Tennis" ], "b": [ "Tennis", "Coffee" ] }
+{ "a": [ "Skiing", "Books" ], "b": [ "Books", "Skiing" ] }
+{ "a": [ "Databases", "Music" ], "b": [ "Databases", "Music" ] }
+{ "a": [ "Databases", "Music" ], "b": [ "Music", "Databases" ] }
+{ "a": [ "Databases", "Music" ], "b": [ "Databases", "Music" ] }
+{ "a": [ "Video Games", "Cigars" ], "b": [ "Cigars", "Video Games" ] }
+{ "a": [ "Video Games", "Cigars" ], "b": [ "Video Games", "Cigars" ] }
+{ "a": [ "Databases", "Skiing" ], "b": [ "Databases", "Skiing" ] }
+{ "a": [ "Running", "Fishing" ], "b": [ "Running", "Fishing" ] }
+{ "a": [ "Databases", "Music" ], "b": [ "Music", "Databases" ] }
+{ "a": [ "Databases", "Music" ], "b": [ "Databases", "Music" ] }
+{ "a": [ "Base Jumping", "Running" ], "b": [ "Running", "Base Jumping" ] }
+{ "a": [ "Base Jumping", "Running" ], "b": [ "Base Jumping", "Running" ] }
+{ "a": [ "Books", "Base Jumping" ], "b": [ "Books", "Base Jumping" ] }
+{ "a": [ "Books", "Base Jumping" ], "b": [ "Books", "Base Jumping" ] }
+{ "a": [ "Cooking", "Running" ], "b": [ "Cooking", "Running" ] }
+{ "a": [ "Video Games", "Databases" ], "b": [ "Databases", "Video Games" ] }
+{ "a": [ "Video Games", "Databases" ], "b": [ "Databases", "Video Games" ] }
+{ "a": [ "Cigars", "Video Games" ], "b": [ "Video Games", "Cigars" ] }
+{ "a": [ "Running", "Base Jumping" ], "b": [ "Base Jumping", "Running" ] }
+{ "a": [ "Coffee", "Databases" ], "b": [ "Databases", "Coffee" ] }
+{ "a": [ "Movies", "Books" ], "b": [ "Books", "Movies" ] }
+{ "a": [ "Movies", "Books" ], "b": [ "Movies", "Books" ] }
+{ "a": [ "Databases", "Video Games" ], "b": [ "Databases", "Video Games" ] }
+{ "a": [ "Music", "Base Jumping" ], "b": [ "Music", "Base Jumping" ] }
+{ "a": [ "Bass", "Squash" ], "b": [ "Bass", "Squash" ] }
+{ "a": [ "Computers", "Tennis" ], "b": [ "Tennis", "Computers" ] }
+{ "a": [ "Tennis", "Coffee" ], "b": [ "Tennis", "Coffee" ] }
+{ "a": [ "Puzzles", "Books" ], "b": [ "Puzzles", "Books" ] }
+{ "a": [ "Puzzles", "Books" ], "b": [ "Puzzles", "Books" ] }
+{ "a": [ "Skiing", "Wine" ], "b": [ "Wine", "Skiing" ] }
+{ "a": [ "Squash", "Tennis" ], "b": [ "Squash", "Tennis" ] }
+{ "a": [ "Walking", "Cooking" ], "b": [ "Walking", "Cooking" ] }
+{ "a": [ "Coffee", "Tennis", "Bass" ], "b": [ "Coffee", "Bass", "Tennis" ] }
+{ "a": [ "Music", "Squash" ], "b": [ "Music", "Squash" ] }
+{ "a": [ "Computers", "Fishing" ], "b": [ "Fishing", "Computers" ] }
+{ "a": [ "Computers", "Fishing" ], "b": [ "Computers", "Fishing" ] }
+{ "a": [ "Wine", "Walking" ], "b": [ "Walking", "Wine" ] }
+{ "a": [ "Skiing", "Base Jumping" ], "b": [ "Base Jumping", "Skiing" ] }
+{ "a": [ "Bass", "Books" ], "b": [ "Books", "Bass" ] }
+{ "a": [ "Fishing", "Music" ], "b": [ "Fishing", "Music" ] }
+{ "a": [ "Books", "Tennis" ], "b": [ "Books", "Tennis" ] }
+{ "a": [ "Books", "Tennis" ], "b": [ "Tennis", "Books" ] }
+{ "a": [ "Books", "Tennis" ], "b": [ "Tennis", "Books" ] }
+{ "a": [ "Fishing", "Databases" ], "b": [ "Fishing", "Databases" ] }
+{ "a": [ "Walking", "Computers" ], "b": [ "Computers", "Walking" ] }
+{ "a": [ "Books", "Base Jumping" ], "b": [ "Books", "Base Jumping" ] }
+{ "a": [ "Movies", "Cooking", "Skiing" ], "b": [ "Movies", "Skiing", "Cooking" ] }
+{ "a": [ "Puzzles", "Books" ], "b": [ "Puzzles", "Books" ] }
+{ "a": [ "Wine", "Databases" ], "b": [ "Databases", "Wine" ] }
+{ "a": [ "Fishing", "Databases", "Wine" ], "b": [ "Fishing", "Wine", "Databases" ] }
+{ "a": [ "Fishing", "Databases", "Wine" ], "b": [ "Databases", "Fishing", "Wine" ] }
+{ "a": [ "Coffee", "Movies", "Skiing" ], "b": [ "Coffee", "Movies", "Skiing" ] }
+{ "a": [ "Cigars", "Cigars" ], "b": [ "Cigars", "Cigars" ] }
+{ "a": [ "Bass", "Walking" ], "b": [ "Walking", "Bass" ] }
+{ "a": [ "Wine", "Base Jumping", "Running" ], "b": [ "Base Jumping", "Running", "Wine" ] }
+{ "a": [ "Databases", "Databases" ], "b": [ "Databases", "Databases" ] }
+{ "a": [ "Movies", "Running" ], "b": [ "Movies", "Running" ] }
+{ "a": [ "Wine", "Puzzles" ], "b": [ "Puzzles", "Wine" ] }
+{ "a": [ "Squash", "Cigars" ], "b": [ "Squash", "Cigars" ] }
+{ "a": [ "Cooking", "Bass" ], "b": [ "Cooking", "Bass" ] }
+{ "a": [ "Databases", "Movies", "Tennis" ], "b": [ "Databases", "Movies", "Tennis" ] }
+{ "a": [ "Fishing", "Computers" ], "b": [ "Computers", "Fishing" ] }
+{ "a": [ "Fishing", "Movies" ], "b": [ "Fishing", "Movies" ] }
+{ "a": [ "Base Jumping", "Tennis", "Video Games" ], "b": [ "Video Games", "Base Jumping", "Tennis" ] }
+{ "a": [ "Computers", "Wine" ], "b": [ "Wine", "Computers" ] }
+{ "a": [ "Skiing", "Bass" ], "b": [ "Bass", "Skiing" ] }
+{ "a": [ "Music", "Databases" ], "b": [ "Databases", "Music" ] }
+{ "a": [ "Fishing", "Wine", "Databases" ], "b": [ "Databases", "Fishing", "Wine" ] }
+{ "a": [ "Books", "Movies" ], "b": [ "Movies", "Books" ] }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/ulist-jaccard-inline.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/ulist-jaccard-inline.adm
new file mode 100644
index 0000000..2321799
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/ulist-jaccard-inline.adm
@@ -0,0 +1,115 @@
+{ "a": {{ "Bass", "Wine" }}, "b": {{ "Bass", "Wine" }}, "jacc": 1.0f }
+{ "a": {{ "Music", "Databases" }}, "b": {{ "Databases", "Music" }}, "jacc": 1.0f }
+{ "a": {{ "Music", "Databases" }}, "b": {{ "Databases", "Music" }}, "jacc": 1.0f }
+{ "a": {{ "Music", "Databases" }}, "b": {{ "Music", "Databases" }}, "jacc": 1.0f }
+{ "a": {{ "Music", "Databases" }}, "b": {{ "Databases", "Music" }}, "jacc": 1.0f }
+{ "a": {{ "Wine", "Walking" }}, "b": {{ "Wine", "Walking" }}, "jacc": 1.0f }
+{ "a": {{ "Wine", "Walking" }}, "b": {{ "Walking", "Wine" }}, "jacc": 1.0f }
+{ "a": {{ "Base Jumping", "Cigars", "Movies" }}, "b": {{ "Base Jumping", "Cigars", "Movies" }}, "jacc": 1.0f }
+{ "a": {{ "Skiing", "Walking" }}, "b": {{ "Skiing", "Walking" }}, "jacc": 1.0f }
+{ "a": {{ "Base Jumping", "Music" }}, "b": {{ "Music", "Base Jumping" }}, "jacc": 1.0f }
+{ "a": {{ "Base Jumping", "Music" }}, "b": {{ "Music", "Base Jumping" }}, "jacc": 1.0f }
+{ "a": {{ "Fishing", "Video Games" }}, "b": {{ "Video Games", "Fishing" }}, "jacc": 1.0f }
+{ "a": {{ "Base Jumping", "Skiing" }}, "b": {{ "Skiing", "Base Jumping" }}, "jacc": 1.0f }
+{ "a": {{ "Base Jumping", "Skiing" }}, "b": {{ "Base Jumping", "Skiing" }}, "jacc": 1.0f }
+{ "a": {{ "Skiing", "Bass" }}, "b": {{ "Skiing", "Bass" }}, "jacc": 1.0f }
+{ "a": {{ "Skiing", "Bass" }}, "b": {{ "Skiing", "Bass" }}, "jacc": 1.0f }
+{ "a": {{ "Skiing", "Bass" }}, "b": {{ "Bass", "Skiing" }}, "jacc": 1.0f }
+{ "a": {{ "Fishing", "Running", "Cigars" }}, "b": {{ "Fishing", "Cigars", "Running" }}, "jacc": 1.0f }
+{ "a": {{ "Cigars", "Skiing" }}, "b": {{ "Skiing", "Cigars" }}, "jacc": 1.0f }
+{ "a": {{ "Movies", "Walking" }}, "b": {{ "Movies", "Walking" }}, "jacc": 1.0f }
+{ "a": {{ "Music", "Coffee" }}, "b": {{ "Coffee", "Music" }}, "jacc": 1.0f }
+{ "a": {{ "Running", "Coffee", "Fishing" }}, "b": {{ "Running", "Fishing", "Coffee" }}, "jacc": 1.0f }
+{ "a": {{ "Squash", "Movies", "Coffee" }}, "b": {{ "Coffee", "Movies", "Squash" }}, "jacc": 1.0f }
+{ "a": {{ "Music", "Tennis", "Base Jumping" }}, "b": {{ "Music", "Base Jumping", "Tennis" }}, "jacc": 1.0f }
+{ "a": {{ "Music", "Base Jumping", "Books" }}, "b": {{ "Books", "Base Jumping", "Music" }}, "jacc": 1.0f }
+{ "a": {{ "Bass", "Books" }}, "b": {{ "Bass", "Books" }}, "jacc": 1.0f }
+{ "a": {{ "Bass", "Books" }}, "b": {{ "Books", "Bass" }}, "jacc": 1.0f }
+{ "a": {{ "Puzzles", "Squash" }}, "b": {{ "Squash", "Puzzles" }}, "jacc": 1.0f }
+{ "a": {{ "Computers", "Wine" }}, "b": {{ "Wine", "Computers" }}, "jacc": 1.0f }
+{ "a": {{ "Computers", "Wine" }}, "b": {{ "Computers", "Wine" }}, "jacc": 1.0f }
+{ "a": {{ "Computers", "Wine" }}, "b": {{ "Wine", "Computers" }}, "jacc": 1.0f }
+{ "a": {{ "Walking", "Cooking" }}, "b": {{ "Walking", "Cooking" }}, "jacc": 1.0f }
+{ "a": {{ "Walking", "Cooking" }}, "b": {{ "Walking", "Cooking" }}, "jacc": 1.0f }
+{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Databases" }}, "jacc": 1.0f }
+{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Databases" }}, "jacc": 1.0f }
+{ "a": {{ "Squash", "Databases" }}, "b": {{ "Squash", "Databases" }}, "jacc": 1.0f }
+{ "a": {{ "Wine", "Computers" }}, "b": {{ "Computers", "Wine" }}, "jacc": 1.0f }
+{ "a": {{ "Wine", "Computers" }}, "b": {{ "Wine", "Computers" }}, "jacc": 1.0f }
+{ "a": {{ "Skiing", "Bass" }}, "b": {{ "Skiing", "Bass" }}, "jacc": 1.0f }
+{ "a": {{ "Skiing", "Bass" }}, "b": {{ "Bass", "Skiing" }}, "jacc": 1.0f }
+{ "a": {{ "Movies", "Books" }}, "b": {{ "Movies", "Books" }}, "jacc": 1.0f }
+{ "a": {{ "Movies", "Books" }}, "b": {{ "Books", "Movies" }}, "jacc": 1.0f }
+{ "a": {{ "Movies", "Books" }}, "b": {{ "Movies", "Books" }}, "jacc": 1.0f }
+{ "a": {{ "Wine", "Squash" }}, "b": {{ "Wine", "Squash" }}, "jacc": 1.0f }
+{ "a": {{ "Coffee", "Tennis" }}, "b": {{ "Tennis", "Coffee" }}, "jacc": 1.0f }
+{ "a": {{ "Coffee", "Tennis" }}, "b": {{ "Tennis", "Coffee" }}, "jacc": 1.0f }
+{ "a": {{ "Skiing", "Books" }}, "b": {{ "Books", "Skiing" }}, "jacc": 1.0f }
+{ "a": {{ "Databases", "Music" }}, "b": {{ "Databases", "Music" }}, "jacc": 1.0f }
+{ "a": {{ "Databases", "Music" }}, "b": {{ "Music", "Databases" }}, "jacc": 1.0f }
+{ "a": {{ "Databases", "Music" }}, "b": {{ "Databases", "Music" }}, "jacc": 1.0f }
+{ "a": {{ "Video Games", "Cigars" }}, "b": {{ "Cigars", "Video Games" }}, "jacc": 1.0f }
+{ "a": {{ "Video Games", "Cigars" }}, "b": {{ "Video Games", "Cigars" }}, "jacc": 1.0f }
+{ "a": {{ "Databases", "Skiing" }}, "b": {{ "Databases", "Skiing" }}, "jacc": 1.0f }
+{ "a": {{ "Running", "Fishing" }}, "b": {{ "Running", "Fishing" }}, "jacc": 1.0f }
+{ "a": {{ "Databases", "Music" }}, "b": {{ "Music", "Databases" }}, "jacc": 1.0f }
+{ "a": {{ "Databases", "Music" }}, "b": {{ "Databases", "Music" }}, "jacc": 1.0f }
+{ "a": {{ "Base Jumping", "Running" }}, "b": {{ "Running", "Base Jumping" }}, "jacc": 1.0f }
+{ "a": {{ "Base Jumping", "Running" }}, "b": {{ "Base Jumping", "Running" }}, "jacc": 1.0f }
+{ "a": {{ "Books", "Base Jumping" }}, "b": {{ "Books", "Base Jumping" }}, "jacc": 1.0f }
+{ "a": {{ "Books", "Base Jumping" }}, "b": {{ "Books", "Base Jumping" }}, "jacc": 1.0f }
+{ "a": {{ "Cooking", "Running" }}, "b": {{ "Cooking", "Running" }}, "jacc": 1.0f }
+{ "a": {{ "Video Games", "Databases" }}, "b": {{ "Databases", "Video Games" }}, "jacc": 1.0f }
+{ "a": {{ "Video Games", "Databases" }}, "b": {{ "Databases", "Video Games" }}, "jacc": 1.0f }
+{ "a": {{ "Cigars", "Video Games" }}, "b": {{ "Video Games", "Cigars" }}, "jacc": 1.0f }
+{ "a": {{ "Running", "Base Jumping" }}, "b": {{ "Base Jumping", "Running" }}, "jacc": 1.0f }
+{ "a": {{ "Coffee", "Databases" }}, "b": {{ "Databases", "Coffee" }}, "jacc": 1.0f }
+{ "a": {{ "Movies", "Books" }}, "b": {{ "Books", "Movies" }}, "jacc": 1.0f }
+{ "a": {{ "Movies", "Books" }}, "b": {{ "Movies", "Books" }}, "jacc": 1.0f }
+{ "a": {{ "Databases", "Video Games" }}, "b": {{ "Databases", "Video Games" }}, "jacc": 1.0f }
+{ "a": {{ "Music", "Base Jumping" }}, "b": {{ "Music", "Base Jumping" }}, "jacc": 1.0f }
+{ "a": {{ "Bass", "Squash" }}, "b": {{ "Bass", "Squash" }}, "jacc": 1.0f }
+{ "a": {{ "Computers", "Tennis" }}, "b": {{ "Tennis", "Computers" }}, "jacc": 1.0f }
+{ "a": {{ "Tennis", "Coffee" }}, "b": {{ "Tennis", "Coffee" }}, "jacc": 1.0f }
+{ "a": {{ "Puzzles", "Books" }}, "b": {{ "Puzzles", "Books" }}, "jacc": 1.0f }
+{ "a": {{ "Puzzles", "Books" }}, "b": {{ "Puzzles", "Books" }}, "jacc": 1.0f }
+{ "a": {{ "Skiing", "Wine" }}, "b": {{ "Wine", "Skiing" }}, "jacc": 1.0f }
+{ "a": {{ "Squash", "Tennis" }}, "b": {{ "Squash", "Tennis" }}, "jacc": 1.0f }
+{ "a": {{ "Walking", "Cooking" }}, "b": {{ "Walking", "Cooking" }}, "jacc": 1.0f }
+{ "a": {{ "Coffee", "Tennis", "Bass" }}, "b": {{ "Coffee", "Bass", "Tennis" }}, "jacc": 1.0f }
+{ "a": {{ "Music", "Squash" }}, "b": {{ "Music", "Squash" }}, "jacc": 1.0f }
+{ "a": {{ "Computers", "Fishing" }}, "b": {{ "Fishing", "Computers" }}, "jacc": 1.0f }
+{ "a": {{ "Computers", "Fishing" }}, "b": {{ "Computers", "Fishing" }}, "jacc": 1.0f }
+{ "a": {{ "Wine", "Walking" }}, "b": {{ "Walking", "Wine" }}, "jacc": 1.0f }
+{ "a": {{ "Skiing", "Base Jumping" }}, "b": {{ "Base Jumping", "Skiing" }}, "jacc": 1.0f }
+{ "a": {{ "Bass", "Books" }}, "b": {{ "Books", "Bass" }}, "jacc": 1.0f }
+{ "a": {{ "Fishing", "Music" }}, "b": {{ "Fishing", "Music" }}, "jacc": 1.0f }
+{ "a": {{ "Books", "Tennis" }}, "b": {{ "Books", "Tennis" }}, "jacc": 1.0f }
+{ "a": {{ "Books", "Tennis" }}, "b": {{ "Tennis", "Books" }}, "jacc": 1.0f }
+{ "a": {{ "Books", "Tennis" }}, "b": {{ "Tennis", "Books" }}, "jacc": 1.0f }
+{ "a": {{ "Fishing", "Databases" }}, "b": {{ "Fishing", "Databases" }}, "jacc": 1.0f }
+{ "a": {{ "Walking", "Computers" }}, "b": {{ "Computers", "Walking" }}, "jacc": 1.0f }
+{ "a": {{ "Books", "Base Jumping" }}, "b": {{ "Books", "Base Jumping" }}, "jacc": 1.0f }
+{ "a": {{ "Movies", "Cooking", "Skiing" }}, "b": {{ "Movies", "Skiing", "Cooking" }}, "jacc": 1.0f }
+{ "a": {{ "Puzzles", "Books" }}, "b": {{ "Puzzles", "Books" }}, "jacc": 1.0f }
+{ "a": {{ "Wine", "Databases" }}, "b": {{ "Databases", "Wine" }}, "jacc": 1.0f }
+{ "a": {{ "Fishing", "Databases", "Wine" }}, "b": {{ "Fishing", "Wine", "Databases" }}, "jacc": 1.0f }
+{ "a": {{ "Fishing", "Databases", "Wine" }}, "b": {{ "Databases", "Fishing", "Wine" }}, "jacc": 1.0f }
+{ "a": {{ "Coffee", "Movies", "Skiing" }}, "b": {{ "Coffee", "Movies", "Skiing" }}, "jacc": 1.0f }
+{ "a": {{ "Cigars", "Cigars" }}, "b": {{ "Cigars", "Cigars" }}, "jacc": 1.0f }
+{ "a": {{ "Bass", "Walking" }}, "b": {{ "Walking", "Bass" }}, "jacc": 1.0f }
+{ "a": {{ "Wine", "Base Jumping", "Running" }}, "b": {{ "Base Jumping", "Running", "Wine" }}, "jacc": 1.0f }
+{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Databases" }}, "jacc": 1.0f }
+{ "a": {{ "Movies", "Running" }}, "b": {{ "Movies", "Running" }}, "jacc": 1.0f }
+{ "a": {{ "Wine", "Puzzles" }}, "b": {{ "Puzzles", "Wine" }}, "jacc": 1.0f }
+{ "a": {{ "Squash", "Cigars" }}, "b": {{ "Squash", "Cigars" }}, "jacc": 1.0f }
+{ "a": {{ "Cooking", "Bass" }}, "b": {{ "Cooking", "Bass" }}, "jacc": 1.0f }
+{ "a": {{ "Databases", "Movies", "Tennis" }}, "b": {{ "Databases", "Movies", "Tennis" }}, "jacc": 1.0f }
+{ "a": {{ "Fishing", "Computers" }}, "b": {{ "Computers", "Fishing" }}, "jacc": 1.0f }
+{ "a": {{ "Fishing", "Movies" }}, "b": {{ "Fishing", "Movies" }}, "jacc": 1.0f }
+{ "a": {{ "Base Jumping", "Tennis", "Video Games" }}, "b": {{ "Video Games", "Base Jumping", "Tennis" }}, "jacc": 1.0f }
+{ "a": {{ "Computers", "Wine" }}, "b": {{ "Wine", "Computers" }}, "jacc": 1.0f }
+{ "a": {{ "Skiing", "Bass" }}, "b": {{ "Bass", "Skiing" }}, "jacc": 1.0f }
+{ "a": {{ "Music", "Databases" }}, "b": {{ "Databases", "Music" }}, "jacc": 1.0f }
+{ "a": {{ "Fishing", "Wine", "Databases" }}, "b": {{ "Databases", "Fishing", "Wine" }}, "jacc": 1.0f }
+{ "a": {{ "Books", "Movies" }}, "b": {{ "Movies", "Books" }}, "jacc": 1.0f }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/ulist-jaccard.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/ulist-jaccard.adm
new file mode 100644
index 0000000..c7cc9fc
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/ulist-jaccard.adm
@@ -0,0 +1,115 @@
+{ "a": {{ "Bass", "Wine" }}, "b": {{ "Bass", "Wine" }} }
+{ "a": {{ "Music", "Databases" }}, "b": {{ "Databases", "Music" }} }
+{ "a": {{ "Music", "Databases" }}, "b": {{ "Databases", "Music" }} }
+{ "a": {{ "Music", "Databases" }}, "b": {{ "Music", "Databases" }} }
+{ "a": {{ "Music", "Databases" }}, "b": {{ "Databases", "Music" }} }
+{ "a": {{ "Wine", "Walking" }}, "b": {{ "Wine", "Walking" }} }
+{ "a": {{ "Wine", "Walking" }}, "b": {{ "Walking", "Wine" }} }
+{ "a": {{ "Base Jumping", "Cigars", "Movies" }}, "b": {{ "Base Jumping", "Cigars", "Movies" }} }
+{ "a": {{ "Skiing", "Walking" }}, "b": {{ "Skiing", "Walking" }} }
+{ "a": {{ "Base Jumping", "Music" }}, "b": {{ "Music", "Base Jumping" }} }
+{ "a": {{ "Base Jumping", "Music" }}, "b": {{ "Music", "Base Jumping" }} }
+{ "a": {{ "Fishing", "Video Games" }}, "b": {{ "Video Games", "Fishing" }} }
+{ "a": {{ "Base Jumping", "Skiing" }}, "b": {{ "Skiing", "Base Jumping" }} }
+{ "a": {{ "Base Jumping", "Skiing" }}, "b": {{ "Base Jumping", "Skiing" }} }
+{ "a": {{ "Skiing", "Bass" }}, "b": {{ "Skiing", "Bass" }} }
+{ "a": {{ "Skiing", "Bass" }}, "b": {{ "Skiing", "Bass" }} }
+{ "a": {{ "Skiing", "Bass" }}, "b": {{ "Bass", "Skiing" }} }
+{ "a": {{ "Fishing", "Running", "Cigars" }}, "b": {{ "Fishing", "Cigars", "Running" }} }
+{ "a": {{ "Cigars", "Skiing" }}, "b": {{ "Skiing", "Cigars" }} }
+{ "a": {{ "Movies", "Walking" }}, "b": {{ "Movies", "Walking" }} }
+{ "a": {{ "Music", "Coffee" }}, "b": {{ "Coffee", "Music" }} }
+{ "a": {{ "Running", "Coffee", "Fishing" }}, "b": {{ "Running", "Fishing", "Coffee" }} }
+{ "a": {{ "Squash", "Movies", "Coffee" }}, "b": {{ "Coffee", "Movies", "Squash" }} }
+{ "a": {{ "Music", "Tennis", "Base Jumping" }}, "b": {{ "Music", "Base Jumping", "Tennis" }} }
+{ "a": {{ "Music", "Base Jumping", "Books" }}, "b": {{ "Books", "Base Jumping", "Music" }} }
+{ "a": {{ "Bass", "Books" }}, "b": {{ "Bass", "Books" }} }
+{ "a": {{ "Bass", "Books" }}, "b": {{ "Books", "Bass" }} }
+{ "a": {{ "Puzzles", "Squash" }}, "b": {{ "Squash", "Puzzles" }} }
+{ "a": {{ "Computers", "Wine" }}, "b": {{ "Wine", "Computers" }} }
+{ "a": {{ "Computers", "Wine" }}, "b": {{ "Computers", "Wine" }} }
+{ "a": {{ "Computers", "Wine" }}, "b": {{ "Wine", "Computers" }} }
+{ "a": {{ "Walking", "Cooking" }}, "b": {{ "Walking", "Cooking" }} }
+{ "a": {{ "Walking", "Cooking" }}, "b": {{ "Walking", "Cooking" }} }
+{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Databases" }} }
+{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Databases" }} }
+{ "a": {{ "Squash", "Databases" }}, "b": {{ "Squash", "Databases" }} }
+{ "a": {{ "Wine", "Computers" }}, "b": {{ "Computers", "Wine" }} }
+{ "a": {{ "Wine", "Computers" }}, "b": {{ "Wine", "Computers" }} }
+{ "a": {{ "Skiing", "Bass" }}, "b": {{ "Skiing", "Bass" }} }
+{ "a": {{ "Skiing", "Bass" }}, "b": {{ "Bass", "Skiing" }} }
+{ "a": {{ "Movies", "Books" }}, "b": {{ "Movies", "Books" }} }
+{ "a": {{ "Movies", "Books" }}, "b": {{ "Books", "Movies" }} }
+{ "a": {{ "Movies", "Books" }}, "b": {{ "Movies", "Books" }} }
+{ "a": {{ "Wine", "Squash" }}, "b": {{ "Wine", "Squash" }} }
+{ "a": {{ "Coffee", "Tennis" }}, "b": {{ "Tennis", "Coffee" }} }
+{ "a": {{ "Coffee", "Tennis" }}, "b": {{ "Tennis", "Coffee" }} }
+{ "a": {{ "Skiing", "Books" }}, "b": {{ "Books", "Skiing" }} }
+{ "a": {{ "Databases", "Music" }}, "b": {{ "Databases", "Music" }} }
+{ "a": {{ "Databases", "Music" }}, "b": {{ "Music", "Databases" }} }
+{ "a": {{ "Databases", "Music" }}, "b": {{ "Databases", "Music" }} }
+{ "a": {{ "Video Games", "Cigars" }}, "b": {{ "Cigars", "Video Games" }} }
+{ "a": {{ "Video Games", "Cigars" }}, "b": {{ "Video Games", "Cigars" }} }
+{ "a": {{ "Databases", "Skiing" }}, "b": {{ "Databases", "Skiing" }} }
+{ "a": {{ "Running", "Fishing" }}, "b": {{ "Running", "Fishing" }} }
+{ "a": {{ "Databases", "Music" }}, "b": {{ "Music", "Databases" }} }
+{ "a": {{ "Databases", "Music" }}, "b": {{ "Databases", "Music" }} }
+{ "a": {{ "Base Jumping", "Running" }}, "b": {{ "Running", "Base Jumping" }} }
+{ "a": {{ "Base Jumping", "Running" }}, "b": {{ "Base Jumping", "Running" }} }
+{ "a": {{ "Books", "Base Jumping" }}, "b": {{ "Books", "Base Jumping" }} }
+{ "a": {{ "Books", "Base Jumping" }}, "b": {{ "Books", "Base Jumping" }} }
+{ "a": {{ "Cooking", "Running" }}, "b": {{ "Cooking", "Running" }} }
+{ "a": {{ "Video Games", "Databases" }}, "b": {{ "Databases", "Video Games" }} }
+{ "a": {{ "Video Games", "Databases" }}, "b": {{ "Databases", "Video Games" }} }
+{ "a": {{ "Cigars", "Video Games" }}, "b": {{ "Video Games", "Cigars" }} }
+{ "a": {{ "Running", "Base Jumping" }}, "b": {{ "Base Jumping", "Running" }} }
+{ "a": {{ "Coffee", "Databases" }}, "b": {{ "Databases", "Coffee" }} }
+{ "a": {{ "Movies", "Books" }}, "b": {{ "Books", "Movies" }} }
+{ "a": {{ "Movies", "Books" }}, "b": {{ "Movies", "Books" }} }
+{ "a": {{ "Databases", "Video Games" }}, "b": {{ "Databases", "Video Games" }} }
+{ "a": {{ "Music", "Base Jumping" }}, "b": {{ "Music", "Base Jumping" }} }
+{ "a": {{ "Bass", "Squash" }}, "b": {{ "Bass", "Squash" }} }
+{ "a": {{ "Computers", "Tennis" }}, "b": {{ "Tennis", "Computers" }} }
+{ "a": {{ "Tennis", "Coffee" }}, "b": {{ "Tennis", "Coffee" }} }
+{ "a": {{ "Puzzles", "Books" }}, "b": {{ "Puzzles", "Books" }} }
+{ "a": {{ "Puzzles", "Books" }}, "b": {{ "Puzzles", "Books" }} }
+{ "a": {{ "Skiing", "Wine" }}, "b": {{ "Wine", "Skiing" }} }
+{ "a": {{ "Squash", "Tennis" }}, "b": {{ "Squash", "Tennis" }} }
+{ "a": {{ "Walking", "Cooking" }}, "b": {{ "Walking", "Cooking" }} }
+{ "a": {{ "Coffee", "Tennis", "Bass" }}, "b": {{ "Coffee", "Bass", "Tennis" }} }
+{ "a": {{ "Music", "Squash" }}, "b": {{ "Music", "Squash" }} }
+{ "a": {{ "Computers", "Fishing" }}, "b": {{ "Fishing", "Computers" }} }
+{ "a": {{ "Computers", "Fishing" }}, "b": {{ "Computers", "Fishing" }} }
+{ "a": {{ "Wine", "Walking" }}, "b": {{ "Walking", "Wine" }} }
+{ "a": {{ "Skiing", "Base Jumping" }}, "b": {{ "Base Jumping", "Skiing" }} }
+{ "a": {{ "Bass", "Books" }}, "b": {{ "Books", "Bass" }} }
+{ "a": {{ "Fishing", "Music" }}, "b": {{ "Fishing", "Music" }} }
+{ "a": {{ "Books", "Tennis" }}, "b": {{ "Books", "Tennis" }} }
+{ "a": {{ "Books", "Tennis" }}, "b": {{ "Tennis", "Books" }} }
+{ "a": {{ "Books", "Tennis" }}, "b": {{ "Tennis", "Books" }} }
+{ "a": {{ "Fishing", "Databases" }}, "b": {{ "Fishing", "Databases" }} }
+{ "a": {{ "Walking", "Computers" }}, "b": {{ "Computers", "Walking" }} }
+{ "a": {{ "Books", "Base Jumping" }}, "b": {{ "Books", "Base Jumping" }} }
+{ "a": {{ "Movies", "Cooking", "Skiing" }}, "b": {{ "Movies", "Skiing", "Cooking" }} }
+{ "a": {{ "Puzzles", "Books" }}, "b": {{ "Puzzles", "Books" }} }
+{ "a": {{ "Wine", "Databases" }}, "b": {{ "Databases", "Wine" }} }
+{ "a": {{ "Fishing", "Databases", "Wine" }}, "b": {{ "Fishing", "Wine", "Databases" }} }
+{ "a": {{ "Fishing", "Databases", "Wine" }}, "b": {{ "Databases", "Fishing", "Wine" }} }
+{ "a": {{ "Coffee", "Movies", "Skiing" }}, "b": {{ "Coffee", "Movies", "Skiing" }} }
+{ "a": {{ "Cigars", "Cigars" }}, "b": {{ "Cigars", "Cigars" }} }
+{ "a": {{ "Bass", "Walking" }}, "b": {{ "Walking", "Bass" }} }
+{ "a": {{ "Wine", "Base Jumping", "Running" }}, "b": {{ "Base Jumping", "Running", "Wine" }} }
+{ "a": {{ "Databases", "Databases" }}, "b": {{ "Databases", "Databases" }} }
+{ "a": {{ "Movies", "Running" }}, "b": {{ "Movies", "Running" }} }
+{ "a": {{ "Wine", "Puzzles" }}, "b": {{ "Puzzles", "Wine" }} }
+{ "a": {{ "Squash", "Cigars" }}, "b": {{ "Squash", "Cigars" }} }
+{ "a": {{ "Cooking", "Bass" }}, "b": {{ "Cooking", "Bass" }} }
+{ "a": {{ "Databases", "Movies", "Tennis" }}, "b": {{ "Databases", "Movies", "Tennis" }} }
+{ "a": {{ "Fishing", "Computers" }}, "b": {{ "Computers", "Fishing" }} }
+{ "a": {{ "Fishing", "Movies" }}, "b": {{ "Fishing", "Movies" }} }
+{ "a": {{ "Base Jumping", "Tennis", "Video Games" }}, "b": {{ "Video Games", "Base Jumping", "Tennis" }} }
+{ "a": {{ "Computers", "Wine" }}, "b": {{ "Wine", "Computers" }} }
+{ "a": {{ "Skiing", "Bass" }}, "b": {{ "Bass", "Skiing" }} }
+{ "a": {{ "Music", "Databases" }}, "b": {{ "Databases", "Music" }} }
+{ "a": {{ "Fishing", "Wine", "Databases" }}, "b": {{ "Databases", "Fishing", "Wine" }} }
+{ "a": {{ "Books", "Movies" }}, "b": {{ "Movies", "Books" }} }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/word-jaccard-inline.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/word-jaccard-inline.adm
new file mode 100644
index 0000000..29e66a2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/word-jaccard-inline.adm
@@ -0,0 +1,5 @@
+{ "a": "Active Database Systems.", "b": "Active Database Systems", "jacc": 1.0f }
+{ "a": "Specification and Execution of Transactional Workflows.", "b": "Specification and Execution of Transactional Workflows", "jacc": 1.0f }
+{ "a": "Integrated Office Systems.", "b": "Integrated Office Systems", "jacc": 1.0f }
+{ "a": "Integrated Office Systems.", "b": "Integrated Office Systems", "jacc": 1.0f }
+{ "a": "A Shared View of Sharing The Treaty of Orlando.", "b": "A Shared View of Sharing The Treaty of Orlando", "jacc": 1.0f }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/word-jaccard.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/word-jaccard.adm
new file mode 100644
index 0000000..2bd52e3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/word-jaccard.adm
@@ -0,0 +1,5 @@
+{ "a": "Active Database Systems.", "b": "Active Database Systems" }
+{ "a": "Specification and Execution of Transactional Workflows.", "b": "Specification and Execution of Transactional Workflows" }
+{ "a": "Integrated Office Systems.", "b": "Integrated Office Systems" }
+{ "a": "Integrated Office Systems.", "b": "Integrated Office Systems" }
+{ "a": "A Shared View of Sharing The Treaty of Orlando.", "b": "A Shared View of Sharing The Treaty of Orlando" }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ngram-edit-distance-inline.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ngram-edit-distance-inline.adm
new file mode 100644
index 0000000..986c7be
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ngram-edit-distance-inline.adm
@@ -0,0 +1,13 @@
+{ "arec": { "cid": 8, "name": "Audria Haylett", "age": 44, "address": { "number": 4872, "street": "Washington St.", "city": "Portland" }, "interests": [ "Cooking", "Fishing", "Video Games" ], "children": [ { "name": "Lacie Haylett", "age": 19 } ] }, "brec": { "cid": 311, "name": "Ria Haflett", "age": 14, "address": { "number": 9513, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Walking" ], "children": [ { "name": "Jimmie Haflett", "age": null }, { "name": "Dario Haflett", "age": null }, { "name": "Robbyn Haflett", "age": null } ] }, "ed": 4 }
+{ "arec": { "cid": 102, "name": "Melany Rotan", "age": null, "address": null, "interests": [ ], "children": [ { "name": "Christiana Rotan", "age": 21 }, { "name": "Lavina Rotan", "age": null }, { "name": "Billy Rotan", "age": null } ] }, "brec": { "cid": 378, "name": "Melany Matias", "age": 10, "address": { "number": 8838, "street": "Main St.", "city": "Seattle" }, "interests": [ "Coffee", "Tennis", "Bass" ], "children": [ { "name": "Earnestine Matias", "age": null }, { "name": "Lore Matias", "age": null } ] }, "ed": 4 }
+{ "arec": { "cid": 104, "name": "Neda Dilts", "age": null, "address": null, "interests": [ "Basketball" ], "children": [ { "name": "Nona Dilts", "age": 28 }, { "name": "Wm Dilts", "age": null }, { "name": "Svetlana Dilts", "age": 46 }, { "name": "Iva Dilts", "age": 59 } ] }, "brec": { "cid": 569, "name": "Beata Diles", "age": 88, "address": { "number": 2198, "street": "Park St.", "city": "Mountain View" }, "interests": [ ], "children": [ { "name": "Myrtice Diles", "age": 46 }, { "name": "Stella Diles", "age": null }, { "name": "Rowena Diles", "age": 26 } ] }, "ed": 4 }
+{ "arec": { "cid": 135, "name": "Josette Dries", "age": null, "address": null, "interests": [ "Base Jumping", "Movies" ], "children": [ { "name": "Ben Dries", "age": 36 }, { "name": "Wm Dries", "age": 29 } ] }, "brec": { "cid": 855, "name": "Rosette Reen", "age": 57, "address": { "number": 2767, "street": "Lake St.", "city": "Mountain View" }, "interests": [ "Basketball" ], "children": [ ] }, "ed": 4 }
+{ "arec": { "cid": 204, "name": "Londa Herdt", "age": null, "address": null, "interests": [ ], "children": [ { "name": "Marnie Herdt", "age": 47 } ] }, "brec": { "cid": 247, "name": "Minda Heron", "age": 25, "address": { "number": 1629, "street": "Hill St.", "city": "Mountain View" }, "interests": [ "Tennis" ], "children": [ ] }, "ed": 4 }
+{ "arec": { "cid": 205, "name": "Moises Plake", "age": null, "address": null, "interests": [ "Puzzles", "Computers" ], "children": [ ] }, "brec": { "cid": 401, "name": "Moises Jago", "age": 27, "address": { "number": 3773, "street": "Main St.", "city": "San Jose" }, "interests": [ "Music" ], "children": [ { "name": "Shoshana Jago", "age": null }, { "name": "Juliet Jago", "age": null }, { "name": "Berneice Jago", "age": 13 } ] }, "ed": 4 }
+{ "arec": { "cid": 209, "name": "Donnette Kreb", "age": null, "address": null, "interests": [ "Puzzles", "Cooking", "Tennis", "Tennis" ], "children": [ { "name": "Hobert Kreb", "age": null }, { "name": "Ray Kreb", "age": null }, { "name": "Carmel Kreb", "age": 56 }, { "name": "Lise Kreb", "age": null } ] }, "brec": { "cid": 829, "name": "Donnette Lebel", "age": null, "address": null, "interests": [ "Tennis", "Coffee", "Running", "Fishing" ], "children": [ { "name": "Junior Lebel", "age": null } ] }, "ed": 4 }
+{ "arec": { "cid": 272, "name": "Frederick Valla", "age": 15, "address": { "number": 6805, "street": "Lake St.", "city": "San Jose" }, "interests": [ "Video Games" ], "children": [ { "name": "Carroll Valla", "age": null } ] }, "brec": { "cid": 797, "name": "Frederica Kale", "age": 77, "address": { "number": 6861, "street": "Oak St.", "city": "Los Angeles" }, "interests": [ "Puzzles", "Bass" ], "children": [ { "name": "Shanice Kale", "age": null }, { "name": "Soraya Kale", "age": 64 }, { "name": "Laurena Kale", "age": 57 } ] }, "ed": 4 }
+{ "arec": { "cid": 464, "name": "Petra Kinsel", "age": null, "address": null, "interests": [ "Wine" ], "children": [ { "name": "Janise Kinsel", "age": null }, { "name": "Donnie Kinsel", "age": 26 }, { "name": "Joana Kinsel", "age": 12 } ] }, "brec": { "cid": 748, "name": "Petra Ganes", "age": null, "address": null, "interests": [ ], "children": [ { "name": "Perry Ganes", "age": null }, { "name": "Krista Ganes", "age": 54 }, { "name": "Kayce Ganes", "age": 52 }, { "name": "Eleni Ganes", "age": null } ] }, "ed": 4 }
+{ "arec": { "cid": 470, "name": "Yesenia Doyon", "age": 78, "address": { "number": 3641, "street": "7th St.", "city": "Seattle" }, "interests": [ "Databases", "Puzzles" ], "children": [ { "name": "Halley Doyon", "age": null }, { "name": "Teisha Doyon", "age": 33 }, { "name": "Warren Doyon", "age": null } ] }, "brec": { "cid": 997, "name": "Yesenia Gao", "age": 38, "address": { "number": 5990, "street": "View St.", "city": "Portland" }, "interests": [ "Computers", "Computers", "Puzzles", "Puzzles" ], "children": [ { "name": "Jared Gao", "age": 11 }, { "name": "Sang Gao", "age": null }, { "name": "Jeanne Gao", "age": 13 }, { "name": "Lavona Gao", "age": 23 } ] }, "ed": 4 }
+{ "arec": { "cid": 486, "name": "Willa Patman", "age": null, "address": null, "interests": [ ], "children": [ { "name": "Ross Patman", "age": 42 }, { "name": "Erin Patman", "age": null }, { "name": "Vannessa Patman", "age": 11 }, { "name": "Hilaria Patman", "age": 28 } ] }, "brec": { "cid": 765, "name": "Mila Barman", "age": null, "address": null, "interests": [ "Coffee", "Puzzles", "Bass", "Wine" ], "children": [ { "name": "Lucienne Barman", "age": null }, { "name": "Marina Barman", "age": null } ] }, "ed": 4 }
+{ "arec": { "cid": 531, "name": "Camelia Yoes", "age": null, "address": null, "interests": [ ], "children": [ ] }, "brec": { "cid": 574, "name": "Camellia Toxey", "age": 52, "address": { "number": 5437, "street": "Hill St.", "city": "Portland" }, "interests": [ ], "children": [ { "name": "Deandrea Toxey", "age": null }, { "name": "Danille Toxey", "age": null } ] }, "ed": 4 }
+{ "arec": { "cid": 803, "name": "Yolonda Korf", "age": null, "address": null, "interests": [ "Bass", "Skiing", "Music" ], "children": [ { "name": "Ivette Korf", "age": null }, { "name": "Lashon Korf", "age": null } ] }, "brec": { "cid": 954, "name": "Yolonda Pu", "age": null, "address": null, "interests": [ "Video Games", "Music", "Cooking", "Skiing" ], "children": [ { "name": "Josephina Pu", "age": 35 } ] }, "ed": 4 }
diff --git a/asterix-app/src/test/resources/runtimets/results/index-join/inverted-index-ngram-edit-distance.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ngram-edit-distance.adm
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/results/index-join/inverted-index-ngram-edit-distance.adm
rename to asterix-app/src/test/resources/runtimets/results/inverted-index-join/ngram-edit-distance.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ngram-jaccard-inline.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ngram-jaccard-inline.adm
new file mode 100644
index 0000000..568272c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ngram-jaccard-inline.adm
@@ -0,0 +1,7 @@
+{ "arec": { "id": 3, "dblpid": "books/acm/kim95/BreitbartGS95", "title": "Transaction Management in Multidatabase Systems.", "authors": "Yuri Breitbart Hector Garcia-Molina Abraham Silberschatz", "misc": "2004-03-08 573-591 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#BreitbartGS95 1995" }, "brec": { "id": 85, "csxid": "oai CiteSeerXPSU 10.1.1.37.8818", "title": "Overview of Multidatabase Transaction Management", "authors": "Yuri Breitbart Hector Garcia-Molina Avi Silberschatz", "misc": "2009-06-22 A multidatabase system (MDBS) is a facility that allows users access to data located in multiple autonomous database management systems (DBMSs). In such a system, global transactions are executed under the control of the MDBS. Independently, local transactions are executed under the control of the local DBMSs. Each local DBMS integrated by the MDBS may employ a different transaction management scheme. In addition, each local DBMS has complete control over all transactions (global and local) executing at its site, including the ability to abort at any point any of the transactions executing at its site. Typically, no design or internal DBMS structure changes are allowed in order to accommodate the MDBS. Furthermore, the local DBMSs may not be aware of each other, and, as a consequence, cannot coordinate their actions. Thus, traditional techniques for ensuring transaction atomicity and consistency in homogeneous distributed database systems may not be appropriate for an MDBS environment.... CiteSeerX 2009-06-22 2007-11-22 1992 text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.37.8818 ftp //ftp.cs.utexas.edu/pub/avi/UT-CS-TR-92-21.PS.Z en 10.1.1.101.8988 10.1.1.130.1772 10.1.1.38.6210 10.1.1.34.3768 10.1.1.36.1275 10.1.1.104.3430 10.1.1.112.244 10.1.1.94.9106 10.1.1.41.4043 10.1.1.49.5143 10.1.1.59.2034 10.1.1.53.875 10.1.1.137.5642 10.1.1.41.8832 10.1.1.21.1100 10.1.1.105.3626 10.1.1.44.773 10.1.1.21.2576 10.1.1.40.6484 10.1.1.144.2713 10.1.1.48.6718 10.1.1.16.6166 10.1.1.40.832 10.1.1.36.2660 10.1.1.30.3087 10.1.1.47.322 10.1.1.17.6532 10.1.1.33.2301 10.1.1.20.4306 10.1.1.47.6258 10.1.1.39.9212 10.1.1.46.4334 10.1.1.71.485 10.1.1.43.1405 10.1.1.49.1308 10.1.1.35.6530 10.1.1.42.5177 10.1.1.54.4068 10.1.1.133.3692 10.1.1.40.4220 10.1.1.48.7743 10.1.1.26.575 10.1.1.107.596 10.1.1.116.3495 10.1.1.33.2074 10.1.1.38.7229 10.1.1.59.4464 10.1.1.103.9562 10.1.1.36.5887 10.1.1.40.9658 10.1.1.53.6783 10.1.1.29.5010 10.1.1.107.876 10.1.1.46.2273 10.1.1.46.3657 10.1.1.49.5281 10.1.1.50.4114 10.1.1.63.3234 10.1.1.79.9607 10.1.1.83.4819 10.1.1.83.4980 10.1.1.84.8136 10.1.1.90.953 10.1.1.90.9785 10.1.1.92.2397 10.1.1.93.8911 10.1.1.94.3702 10.1.1.97.672 10.1.1.98.4604 10.1.1.117.6190 10.1.1.118.4814 10.1.1.130.880 10.1.1.137.1167 10.1.1.51.5111 10.1.1.45.2774 10.1.1.45.9165 10.1.1.40.4684 10.1.1.35.5866 10.1.1.38.3606 10.1.1.29.9166 10.1.1.31.3667 10.1.1.21.7181 10.1.1.33.2343 10.1.1.23.3117 10.1.1.24.7879 10.1.1.18.8936 10.1.1.19.3770 10.1.1.19.5246 10.1.1.12.3293 10.1.1.2.2325 10.1.1.60.116 10.1.1.140.5244 10.1.1.143.3448 Metadata may be used without restrictions as long as the oai identifier remains attached to it." }, "jacc": 0.55932206f }
+{ "arec": { "id": 3, "dblpid": "books/acm/kim95/BreitbartGS95", "title": "Transaction Management in Multidatabase Systems.", "authors": "Yuri Breitbart Hector Garcia-Molina Abraham Silberschatz", "misc": "2004-03-08 573-591 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#BreitbartGS95 1995" }, "brec": { "id": 86, "csxid": "oai CiteSeerXPSU 10.1.1.54.6302", "title": "Overview of Multidatabase Transaction Management", "authors": "Yuri Breitbart Hector Garcia-molina Avi Silberschatz", "misc": "2009-04-12 A multidatabase system (MDBS) is a facility that allows users access to data located in multiple autonomous database management systems (DBMSs). In such a system, global transactions are executed under the control of the MDBS. Independently, local transactions are executed under the control of the local DBMSs. Each local DBMS integrated by the MDBS may employ a different transaction management scheme. In addition, each local DBMS has complete control over all transactions (global and local) executing at its site, including the ability to abort at any point any of the transactions executing at its site. Typically, no design or internal DBMS structure changes are allowed in order to accommodate the MDBS. Furthermore, the local DBMSs may not be aware of each other, and, as a consequence, cannot coordinate their actions. Thus, traditional techniques for ensuring transaction atomicity and consistency in homogeneous distributed database systems may not be appropriate for an MDBS environment.... CiteSeerX 2009-04-12 2007-11-22 1992 application/postscript text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.54.6302 http //www-db.stanford.edu/pub/papers/multidatabase.ps en 10.1.1.101.8988 10.1.1.130.1772 10.1.1.38.6210 10.1.1.34.3768 10.1.1.36.1275 10.1.1.104.3430 10.1.1.112.244 10.1.1.94.9106 10.1.1.41.4043 10.1.1.49.5143 10.1.1.59.2034 10.1.1.53.875 10.1.1.137.5642 10.1.1.41.8832 10.1.1.21.1100 10.1.1.105.3626 10.1.1.44.773 10.1.1.21.2576 10.1.1.40.6484 10.1.1.144.2713 10.1.1.48.6718 10.1.1.16.6166 10.1.1.40.832 10.1.1.36.2660 10.1.1.30.3087 10.1.1.47.322 10.1.1.17.6532 10.1.1.33.2301 10.1.1.20.4306 10.1.1.47.6258 10.1.1.39.9212 10.1.1.46.4334 10.1.1.71.485 10.1.1.43.1405 10.1.1.49.1308 10.1.1.35.6530 10.1.1.42.5177 10.1.1.54.4068 10.1.1.133.3692 10.1.1.40.4220 10.1.1.48.7743 10.1.1.26.575 10.1.1.107.596 10.1.1.116.3495 10.1.1.33.2074 10.1.1.38.7229 10.1.1.59.4464 10.1.1.103.9562 10.1.1.36.5887 10.1.1.40.9658 10.1.1.53.6783 10.1.1.29.5010 10.1.1.107.876 10.1.1.46.2273 10.1.1.46.3657 10.1.1.49.5281 10.1.1.50.4114 10.1.1.63.3234 10.1.1.79.9607 10.1.1.83.4819 10.1.1.83.4980 10.1.1.84.8136 10.1.1.90.953 10.1.1.90.9785 10.1.1.92.2397 10.1.1.93.8911 10.1.1.94.3702 10.1.1.97.672 10.1.1.98.4604 10.1.1.117.6190 10.1.1.118.4814 10.1.1.130.880 10.1.1.137.1167 10.1.1.51.5111 10.1.1.45.2774 10.1.1.45.9165 10.1.1.40.4684 10.1.1.35.5866 10.1.1.38.3606 10.1.1.29.9166 10.1.1.31.3667 10.1.1.21.7181 10.1.1.33.2343 10.1.1.23.3117 10.1.1.24.7879 10.1.1.18.8936 10.1.1.19.3770 10.1.1.19.5246 10.1.1.12.3293 10.1.1.2.2325 10.1.1.60.116 10.1.1.140.5244 10.1.1.143.3448 Metadata may be used without restrictions as long as the oai identifier remains attached to it." }, "jacc": 0.55932206f }
+{ "arec": { "id": 5, "dblpid": "books/acm/kim95/DayalHW95", "title": "Active Database Systems.", "authors": "Umeshwar Dayal Eric N. Hanson Jennifer Widom", "misc": "2002-01-03 434-456 1995 Modern Database Systems db/books/collections/kim95.html#DayalHW95" }, "brec": { "id": 98, "csxid": "oai CiteSeerXPSU 10.1.1.49.2910", "title": "Active Database Systems", "authors": "Umeshwar Dayal Eric N. Hanson Jennifer Widom", "misc": "2009-04-12 In Won Kim editor Modern Database Systems The Object Model Integrating a production rules facility into a database system provides a uniform mechanism for a number of advanced database features including integrity constraint enforcement, derived data maintenance, triggers, alerters, protection, version control, and others. In addition, a database system with rule processing capabilities provides a useful platform for large and efficient knowledge-base and expert systems. Database systems with production rules are referred to as active database systems, and the field of active database systems has indeed been active. This chapter summarizes current work in active database systems topics covered include active database rule models and languages, rule execution semantics, and implementation issues. 1 Introduction Conventional database systems are passive they only execute queries or transactions explicitly submitted by a user or an application program. For many applications, however, it is important to monitor situations of interest, and to ... CiteSeerX ACM Press 2009-04-12 2007-11-22 1994 application/postscript text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.49.2910 http //www-db.stanford.edu/pub/papers/book-chapter.ps en 10.1.1.17.1323 10.1.1.143.7196 10.1.1.50.3821 10.1.1.51.9946 10.1.1.41.2030 10.1.1.46.2504 10.1.1.52.4421 10.1.1.38.2083 10.1.1.34.661 10.1.1.103.7630 10.1.1.100.9015 10.1.1.97.1699 10.1.1.107.4220 10.1.1.47.9217 10.1.1.133.7157 10.1.1.101.5051 10.1.1.30.9989 10.1.1.53.6941 10.1.1.50.8529 10.1.1.133.4287 10.1.1.50.7278 10.1.1.10.1688 10.1.1.19.8669 10.1.1.44.7600 10.1.1.144.376 10.1.1.44.1348 10.1.1.47.9998 10.1.1.90.4428 10.1.1.108.344 10.1.1.48.9470 10.1.1.53.5472 10.1.1.52.4872 10.1.1.144.4965 10.1.1.31.7578 10.1.1.32.6426 10.1.1.58.6335 10.1.1.85.8052 10.1.1.93.1931 10.1.1.55.4610 10.1.1.21.3821 10.1.1.26.9208 10.1.1.31.4869 10.1.1.48.1833 10.1.1.83.8628 10.1.1.87.9318 10.1.1.90.2195 10.1.1.36.5184 10.1.1.21.1704 10.1.1.53.1733 10.1.1.90.3181 10.1.1.53.6783 10.1.1.52.6151 10.1.1.104.6911 10.1.1.105.1691 10.1.1.21.1984 10.1.1.23.2775 10.1.1.62.5556 10.1.1.68.9063 10.1.1.74.4746 10.1.1.78.5097 10.1.1.84.743 10.1.1.84.904 10.1.1.87.6019 10.1.1.88.3907 10.1.1.89.9631 10.1.1.90.4147 10.1.1.92.365 10.1.1.100.2747 10.1.1.98.5083 10.1.1.98.6663 10.1.1.99.1894 10.1.1.99.8174 10.1.1.133.8073 10.1.1.52.7823 10.1.1.39.5341 10.1.1.35.3458 10.1.1.26.4620 10.1.1.18.8936 10.1.1.19.3694 10.1.1.12.631 10.1.1.48.6394 Metadata may be used without restrictions as long as the oai identifier remains attached to it." }, "jacc": 0.95454544f }
+{ "arec": { "id": 51, "dblpid": "books/aw/kimL89/NierstraszT89", "title": "Integrated Office Systems.", "authors": "Oscar Nierstrasz Dennis Tsichritzis", "misc": "2002-01-03 199-215 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#NierstraszT89" }, "brec": { "id": 92, "csxid": "oai CiteSeerXPSU 10.1.1.13.2374", "title": "Integrated Office Systems", "authors": "O. M. Nierstrasz D. C. Tsichritzis", "misc": "2009-04-17 Introduction New techniques are sorely needed to aid in the development and maintenance of large application systems. The problem with traditional approaches to software engineering is well in evidence in the field of o#ce information systems it is costly and di#cult to extend existing applications, and to get unrelated applications to \"talk\" to each other. The objectoriented approach is already being tentatively applied in the modeling of \"o#ce objects\" and in the presentation of these entities to users as such in \"desktop\" interfaces to o#ce software. In order to fully exploit the approach to achieve integrated o#ce systems, we need to use object-oriented programming languages, object-oriented run-time support, and object-oriented software engineering environments. We can view the fundamental idea behind the object-oriented approach as that of encapsulation object-oriented languages and systems exploit encapsulation in various ways in an attempt to enhance productivity through, f CiteSeerX 2009-04-17 2007-11-21 1988 application/pdf text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.13.2374 http //www.iam.unibe.ch/~scg/Archive/OSG/Nier89bIntegOfficeSystems.pdf en 10.1.1.26.9545 10.1.1.65.5865 10.1.1.34.624 10.1.1.12.8544 10.1.1.144.6983 10.1.1.26.6746 10.1.1.49.3064 10.1.1.30.4607 10.1.1.38.4894 10.1.1.20.8197 10.1.1.26.4381 10.1.1.29.1890 Metadata may be used without restrictions as long as the oai identifier remains attached to it." }, "jacc": 0.9583333f }
+{ "arec": { "id": 51, "dblpid": "books/aw/kimL89/NierstraszT89", "title": "Integrated Office Systems.", "authors": "Oscar Nierstrasz Dennis Tsichritzis", "misc": "2002-01-03 199-215 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#NierstraszT89" }, "brec": { "id": 93, "csxid": "oai CiteSeerXPSU 10.1.1.42.9253", "title": "Integrated Office Systems", "authors": "O. M. Nierstrasz D. C. Tsichritzis", "misc": "2009-04-11 Introduction New techniques are sorely needed to aid in the development and maintenance of large application systems. The problem with traditional approaches to software engineering is well in evidence in the field of office information systems it is costly and difficult to extend existing applications, and to get unrelated applications to \"talk\" to each other. The objectoriented approach is already being tentatively applied in the modeling of \"office objects\" and in the presentation of these entities to users as such in \"desktop\" interfaces to office software. In order to fully exploit the approach to achieve integrated office systems, we need to use object-oriented programming languages, object-oriented run-time support, and object-oriented software engineering environments. We can view the fundamental idea behind the object-oriented approach as that of encapsulation object-oriented languages and systems exploit encapsulation in various ways in an attempt t CiteSeerX ACM Press and Addison-Wesley 2009-04-11 2007-11-22 1988 application/postscript text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.42.9253 ftp //ftp.iam.unibe.ch/pub/scg/Papers/integratedOfficeSystems.ps.gz en 10.1.1.26.9545 10.1.1.65.5865 10.1.1.34.624 10.1.1.12.8544 10.1.1.144.6983 10.1.1.26.6746 10.1.1.49.3064 10.1.1.30.4607 10.1.1.38.4894 10.1.1.20.8197 10.1.1.26.4381 10.1.1.29.1890 Metadata may be used without restrictions as long as the oai identifier remains attached to it." }, "jacc": 0.9583333f }
+{ "arec": { "id": 54, "dblpid": "books/aw/kimL89/SteinLU89", "title": "A Shared View of Sharing The Treaty of Orlando.", "authors": "Lynn Andrea Stein Henry Lieberman David Ungar", "misc": "2002-01-03 31-48 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#SteinLU89" }, "brec": { "id": 91, "csxid": "oai CiteSeerXPSU 10.1.1.55.482", "title": "A Shared View of Sharing The Treaty of Orlando", "authors": "Lynn Andrea Stein Henry Lieberman David Ungar", "misc": "2009-04-12 Introduction For the past few years, researchers have been debating the relative merits of object-oriented languages with classes and inheritance as opposed to those with prototypes and delegation. It has become clear that the object-oriented programming language design space is not a dichotomy. Instead, we have identified two fundamental mechanisms---templates and empathy---and several different independent degrees of freedom for each. Templates create new objects in their own image, providing guarantees about the similarity of group members. Empathy allows an object to act as if it were some other object, thus providing sharing of state and behavior. The Smalltalk-80 TM language, 1 Actors, Lieberman's Delegation system, Self, and Hybrid each take differing stands on the forms of templates 1 Smalltalk-80 TM is a trademark of Par CiteSeerX ACM Press 2009-04-12 2007-11-22 1989 application/postscript text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.55.482 http //lcs.www.media.mit.edu/people/lieber/Lieberary/OOP/Treaty/Treaty.ps en 10.1.1.26.9545 10.1.1.118.6579 10.1.1.48.69 10.1.1.57.5195 10.1.1.9.570 10.1.1.47.511 10.1.1.127.5320 10.1.1.100.4334 10.1.1.5.3348 10.1.1.39.3374 10.1.1.56.4713 10.1.1.61.2065 10.1.1.27.3015 10.1.1.1.5960 10.1.1.67.5433 10.1.1.31.8109 10.1.1.68.4062 10.1.1.49.3986 10.1.1.122.9331 10.1.1.46.8283 10.1.1.54.5230 10.1.1.16.2055 10.1.1.137.5180 10.1.1.43.5722 10.1.1.68.2105 10.1.1.35.1247 10.1.1.30.1415 10.1.1.7.5014 10.1.1.102.3946 10.1.1.105.6469 10.1.1.26.223 10.1.1.26.8645 10.1.1.35.4104 10.1.1.39.6986 10.1.1.41.7822 10.1.1.42.9056 10.1.1.53.9325 10.1.1.71.1802 10.1.1.76.6993 10.1.1.89.9613 10.1.1.121.5599 10.1.1.122.3737 10.1.1.127.1894 10.1.1.55.5674 10.1.1.37.8260 10.1.1.2.2077 10.1.1.24.5782 10.1.1.19.780 10.1.1.2.4148 10.1.1.2.4173 10.1.1.131.902 10.1.1.30.2927 Metadata may be used without restrictions as long as the oai identifier remains attached to it." }, "jacc": 0.9782609f }
+{ "arec": { "id": 25, "dblpid": "books/acm/kim95/RusinkiewiczS95", "title": "Specification and Execution of Transactional Workflows.", "authors": "Marek Rusinkiewicz Amit P. Sheth", "misc": "2004-03-08 592-620 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#RusinkiewiczS95 1995" }, "brec": { "id": 88, "csxid": "oai CiteSeerXPSU 10.1.1.43.3839", "title": "Specification and Execution of Transactional Workflows", "authors": "Marek Rusinkiewicz Amit Sheth", "misc": "2009-04-13 The basic transaction model has evolved over time to incorporate more complex transaction structures and to selectively modify the atomicity and isolation properties. In this chapter we discuss the application of transaction concepts to activities that involve coordinated execution of multiple tasks (possibly of different types) over different processing entities. Such applications are referred to as transactional workflows. In this chapter we discuss the specification of such workflows and the issues involved in their execution. 1 What is a Workflow? Workflows are activities involving the coordinated execution of multiple tasks performed by different processing entities. A task defines some work to be done and can be specified in a number of ways, including a textual description in a file or an email, a form, a message, or a computer program. A processing entity that performs the tasks may be a person or a software system (e.g., a mailer, an application program, a database mana... CiteSeerX ACM Press 2009-04-13 2007-11-22 1995 application/postscript text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.43.3839 http //lsdis.cs.uga.edu/lib/././download/RS93.ps en 10.1.1.17.1323 10.1.1.59.5051 10.1.1.38.6210 10.1.1.68.7445 10.1.1.109.5175 10.1.1.17.7962 10.1.1.44.7778 10.1.1.112.244 10.1.1.13.7602 10.1.1.102.7874 10.1.1.41.4043 10.1.1.49.5143 10.1.1.41.7252 10.1.1.17.3225 10.1.1.54.7761 10.1.1.55.5255 10.1.1.108.958 10.1.1.35.7733 10.1.1.52.3682 10.1.1.36.1618 10.1.1.45.6317 10.1.1.43.3180 10.1.1.35.8718 10.1.1.44.6365 10.1.1.51.2883 10.1.1.50.9206 10.1.1.6.9085 10.1.1.30.1707 10.1.1.80.6634 10.1.1.49.355 10.1.1.127.3550 10.1.1.35.3562 10.1.1.137.8832 10.1.1.49.4085 10.1.1.41.5506 10.1.1.40.4657 10.1.1.43.2369 10.1.1.40.832 10.1.1.74.5411 10.1.1.90.4428 10.1.1.110.6967 10.1.1.27.2122 10.1.1.15.5605 10.1.1.54.727 10.1.1.49.7512 10.1.1.45.8796 10.1.1.50.5984 10.1.1.53.137 10.1.1.30.3262 10.1.1.28.1680 10.1.1.21.7110 10.1.1.29.3148 10.1.1.57.687 10.1.1.59.5924 10.1.1.46.2812 10.1.1.51.5552 10.1.1.17.7375 10.1.1.40.1598 10.1.1.52.9787 10.1.1.1.3496 10.1.1.50.6791 10.1.1.55.3358 10.1.1.137.7582 10.1.1.118.4127 10.1.1.49.3580 10.1.1.35.5825 10.1.1.46.9382 10.1.1.31.7411 10.1.1.48.5504 10.1.1.55.5163 10.1.1.18.1603 10.1.1.52.8129 10.1.1.1.9723 10.1.1.21.9113 10.1.1.49.7644 10.1.1.52.6646 10.1.1.75.3106 10.1.1.80.2072 10.1.1.55.8770 10.1.1.54.8188 10.1.1.101.7919 10.1.1.104.8176 10.1.1.24.5741 10.1.1.29.4667 10.1.1.4.1055 10.1.1.48.9175 10.1.1.56.792 10.1.1.65.3172 10.1.1.66.5947 10.1.1.73.8532 10.1.1.83.8299 10.1.1.86.8521 10.1.1.87.2402 10.1.1.87.4648 10.1.1.90.5638 10.1.1.91.1709 10.1.1.94.4248 10.1.1.114.511 10.1.1.119.5037 10.1.1.124.7957 10.1.1.49.215 10.1.1.53.7777 10.1.1.53.9711 10.1.1.45.9409 10.1.1.40.8789 10.1.1.43.4845 10.1.1.34.8273 10.1.1.35.4783 10.1.1.28.3176 10.1.1.16.8151 10.1.1.8.9117 10.1.1.58.3449 10.1.1.142.7041 Metadata may be used without restrictions as long as the oai identifier remains attached to it." }, "jacc": 0.9811321f }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ngram-jaccard.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ngram-jaccard.adm
new file mode 100644
index 0000000..f48c6c9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ngram-jaccard.adm
@@ -0,0 +1,7 @@
+{ "arec": { "id": 3, "dblpid": "books/acm/kim95/BreitbartGS95", "title": "Transaction Management in Multidatabase Systems.", "authors": "Yuri Breitbart Hector Garcia-Molina Abraham Silberschatz", "misc": "2004-03-08 573-591 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#BreitbartGS95 1995" }, "brec": { "id": 85, "csxid": "oai CiteSeerXPSU 10.1.1.37.8818", "title": "Overview of Multidatabase Transaction Management", "authors": "Yuri Breitbart Hector Garcia-Molina Avi Silberschatz", "misc": "2009-06-22 A multidatabase system (MDBS) is a facility that allows users access to data located in multiple autonomous database management systems (DBMSs). In such a system, global transactions are executed under the control of the MDBS. Independently, local transactions are executed under the control of the local DBMSs. Each local DBMS integrated by the MDBS may employ a different transaction management scheme. In addition, each local DBMS has complete control over all transactions (global and local) executing at its site, including the ability to abort at any point any of the transactions executing at its site. Typically, no design or internal DBMS structure changes are allowed in order to accommodate the MDBS. Furthermore, the local DBMSs may not be aware of each other, and, as a consequence, cannot coordinate their actions. Thus, traditional techniques for ensuring transaction atomicity and consistency in homogeneous distributed database systems may not be appropriate for an MDBS environment.... CiteSeerX 2009-06-22 2007-11-22 1992 text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.37.8818 ftp //ftp.cs.utexas.edu/pub/avi/UT-CS-TR-92-21.PS.Z en 10.1.1.101.8988 10.1.1.130.1772 10.1.1.38.6210 10.1.1.34.3768 10.1.1.36.1275 10.1.1.104.3430 10.1.1.112.244 10.1.1.94.9106 10.1.1.41.4043 10.1.1.49.5143 10.1.1.59.2034 10.1.1.53.875 10.1.1.137.5642 10.1.1.41.8832 10.1.1.21.1100 10.1.1.105.3626 10.1.1.44.773 10.1.1.21.2576 10.1.1.40.6484 10.1.1.144.2713 10.1.1.48.6718 10.1.1.16.6166 10.1.1.40.832 10.1.1.36.2660 10.1.1.30.3087 10.1.1.47.322 10.1.1.17.6532 10.1.1.33.2301 10.1.1.20.4306 10.1.1.47.6258 10.1.1.39.9212 10.1.1.46.4334 10.1.1.71.485 10.1.1.43.1405 10.1.1.49.1308 10.1.1.35.6530 10.1.1.42.5177 10.1.1.54.4068 10.1.1.133.3692 10.1.1.40.4220 10.1.1.48.7743 10.1.1.26.575 10.1.1.107.596 10.1.1.116.3495 10.1.1.33.2074 10.1.1.38.7229 10.1.1.59.4464 10.1.1.103.9562 10.1.1.36.5887 10.1.1.40.9658 10.1.1.53.6783 10.1.1.29.5010 10.1.1.107.876 10.1.1.46.2273 10.1.1.46.3657 10.1.1.49.5281 10.1.1.50.4114 10.1.1.63.3234 10.1.1.79.9607 10.1.1.83.4819 10.1.1.83.4980 10.1.1.84.8136 10.1.1.90.953 10.1.1.90.9785 10.1.1.92.2397 10.1.1.93.8911 10.1.1.94.3702 10.1.1.97.672 10.1.1.98.4604 10.1.1.117.6190 10.1.1.118.4814 10.1.1.130.880 10.1.1.137.1167 10.1.1.51.5111 10.1.1.45.2774 10.1.1.45.9165 10.1.1.40.4684 10.1.1.35.5866 10.1.1.38.3606 10.1.1.29.9166 10.1.1.31.3667 10.1.1.21.7181 10.1.1.33.2343 10.1.1.23.3117 10.1.1.24.7879 10.1.1.18.8936 10.1.1.19.3770 10.1.1.19.5246 10.1.1.12.3293 10.1.1.2.2325 10.1.1.60.116 10.1.1.140.5244 10.1.1.143.3448 Metadata may be used without restrictions as long as the oai identifier remains attached to it." } }
+{ "arec": { "id": 3, "dblpid": "books/acm/kim95/BreitbartGS95", "title": "Transaction Management in Multidatabase Systems.", "authors": "Yuri Breitbart Hector Garcia-Molina Abraham Silberschatz", "misc": "2004-03-08 573-591 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#BreitbartGS95 1995" }, "brec": { "id": 86, "csxid": "oai CiteSeerXPSU 10.1.1.54.6302", "title": "Overview of Multidatabase Transaction Management", "authors": "Yuri Breitbart Hector Garcia-molina Avi Silberschatz", "misc": "2009-04-12 A multidatabase system (MDBS) is a facility that allows users access to data located in multiple autonomous database management systems (DBMSs). In such a system, global transactions are executed under the control of the MDBS. Independently, local transactions are executed under the control of the local DBMSs. Each local DBMS integrated by the MDBS may employ a different transaction management scheme. In addition, each local DBMS has complete control over all transactions (global and local) executing at its site, including the ability to abort at any point any of the transactions executing at its site. Typically, no design or internal DBMS structure changes are allowed in order to accommodate the MDBS. Furthermore, the local DBMSs may not be aware of each other, and, as a consequence, cannot coordinate their actions. Thus, traditional techniques for ensuring transaction atomicity and consistency in homogeneous distributed database systems may not be appropriate for an MDBS environment.... CiteSeerX 2009-04-12 2007-11-22 1992 application/postscript text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.54.6302 http //www-db.stanford.edu/pub/papers/multidatabase.ps en 10.1.1.101.8988 10.1.1.130.1772 10.1.1.38.6210 10.1.1.34.3768 10.1.1.36.1275 10.1.1.104.3430 10.1.1.112.244 10.1.1.94.9106 10.1.1.41.4043 10.1.1.49.5143 10.1.1.59.2034 10.1.1.53.875 10.1.1.137.5642 10.1.1.41.8832 10.1.1.21.1100 10.1.1.105.3626 10.1.1.44.773 10.1.1.21.2576 10.1.1.40.6484 10.1.1.144.2713 10.1.1.48.6718 10.1.1.16.6166 10.1.1.40.832 10.1.1.36.2660 10.1.1.30.3087 10.1.1.47.322 10.1.1.17.6532 10.1.1.33.2301 10.1.1.20.4306 10.1.1.47.6258 10.1.1.39.9212 10.1.1.46.4334 10.1.1.71.485 10.1.1.43.1405 10.1.1.49.1308 10.1.1.35.6530 10.1.1.42.5177 10.1.1.54.4068 10.1.1.133.3692 10.1.1.40.4220 10.1.1.48.7743 10.1.1.26.575 10.1.1.107.596 10.1.1.116.3495 10.1.1.33.2074 10.1.1.38.7229 10.1.1.59.4464 10.1.1.103.9562 10.1.1.36.5887 10.1.1.40.9658 10.1.1.53.6783 10.1.1.29.5010 10.1.1.107.876 10.1.1.46.2273 10.1.1.46.3657 10.1.1.49.5281 10.1.1.50.4114 10.1.1.63.3234 10.1.1.79.9607 10.1.1.83.4819 10.1.1.83.4980 10.1.1.84.8136 10.1.1.90.953 10.1.1.90.9785 10.1.1.92.2397 10.1.1.93.8911 10.1.1.94.3702 10.1.1.97.672 10.1.1.98.4604 10.1.1.117.6190 10.1.1.118.4814 10.1.1.130.880 10.1.1.137.1167 10.1.1.51.5111 10.1.1.45.2774 10.1.1.45.9165 10.1.1.40.4684 10.1.1.35.5866 10.1.1.38.3606 10.1.1.29.9166 10.1.1.31.3667 10.1.1.21.7181 10.1.1.33.2343 10.1.1.23.3117 10.1.1.24.7879 10.1.1.18.8936 10.1.1.19.3770 10.1.1.19.5246 10.1.1.12.3293 10.1.1.2.2325 10.1.1.60.116 10.1.1.140.5244 10.1.1.143.3448 Metadata may be used without restrictions as long as the oai identifier remains attached to it." } }
+{ "arec": { "id": 5, "dblpid": "books/acm/kim95/DayalHW95", "title": "Active Database Systems.", "authors": "Umeshwar Dayal Eric N. Hanson Jennifer Widom", "misc": "2002-01-03 434-456 1995 Modern Database Systems db/books/collections/kim95.html#DayalHW95" }, "brec": { "id": 98, "csxid": "oai CiteSeerXPSU 10.1.1.49.2910", "title": "Active Database Systems", "authors": "Umeshwar Dayal Eric N. Hanson Jennifer Widom", "misc": "2009-04-12 In Won Kim editor Modern Database Systems The Object Model Integrating a production rules facility into a database system provides a uniform mechanism for a number of advanced database features including integrity constraint enforcement, derived data maintenance, triggers, alerters, protection, version control, and others. In addition, a database system with rule processing capabilities provides a useful platform for large and efficient knowledge-base and expert systems. Database systems with production rules are referred to as active database systems, and the field of active database systems has indeed been active. This chapter summarizes current work in active database systems topics covered include active database rule models and languages, rule execution semantics, and implementation issues. 1 Introduction Conventional database systems are passive they only execute queries or transactions explicitly submitted by a user or an application program. For many applications, however, it is important to monitor situations of interest, and to ... CiteSeerX ACM Press 2009-04-12 2007-11-22 1994 application/postscript text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.49.2910 http //www-db.stanford.edu/pub/papers/book-chapter.ps en 10.1.1.17.1323 10.1.1.143.7196 10.1.1.50.3821 10.1.1.51.9946 10.1.1.41.2030 10.1.1.46.2504 10.1.1.52.4421 10.1.1.38.2083 10.1.1.34.661 10.1.1.103.7630 10.1.1.100.9015 10.1.1.97.1699 10.1.1.107.4220 10.1.1.47.9217 10.1.1.133.7157 10.1.1.101.5051 10.1.1.30.9989 10.1.1.53.6941 10.1.1.50.8529 10.1.1.133.4287 10.1.1.50.7278 10.1.1.10.1688 10.1.1.19.8669 10.1.1.44.7600 10.1.1.144.376 10.1.1.44.1348 10.1.1.47.9998 10.1.1.90.4428 10.1.1.108.344 10.1.1.48.9470 10.1.1.53.5472 10.1.1.52.4872 10.1.1.144.4965 10.1.1.31.7578 10.1.1.32.6426 10.1.1.58.6335 10.1.1.85.8052 10.1.1.93.1931 10.1.1.55.4610 10.1.1.21.3821 10.1.1.26.9208 10.1.1.31.4869 10.1.1.48.1833 10.1.1.83.8628 10.1.1.87.9318 10.1.1.90.2195 10.1.1.36.5184 10.1.1.21.1704 10.1.1.53.1733 10.1.1.90.3181 10.1.1.53.6783 10.1.1.52.6151 10.1.1.104.6911 10.1.1.105.1691 10.1.1.21.1984 10.1.1.23.2775 10.1.1.62.5556 10.1.1.68.9063 10.1.1.74.4746 10.1.1.78.5097 10.1.1.84.743 10.1.1.84.904 10.1.1.87.6019 10.1.1.88.3907 10.1.1.89.9631 10.1.1.90.4147 10.1.1.92.365 10.1.1.100.2747 10.1.1.98.5083 10.1.1.98.6663 10.1.1.99.1894 10.1.1.99.8174 10.1.1.133.8073 10.1.1.52.7823 10.1.1.39.5341 10.1.1.35.3458 10.1.1.26.4620 10.1.1.18.8936 10.1.1.19.3694 10.1.1.12.631 10.1.1.48.6394 Metadata may be used without restrictions as long as the oai identifier remains attached to it." } }
+{ "arec": { "id": 25, "dblpid": "books/acm/kim95/RusinkiewiczS95", "title": "Specification and Execution of Transactional Workflows.", "authors": "Marek Rusinkiewicz Amit P. Sheth", "misc": "2004-03-08 592-620 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#RusinkiewiczS95 1995" }, "brec": { "id": 88, "csxid": "oai CiteSeerXPSU 10.1.1.43.3839", "title": "Specification and Execution of Transactional Workflows", "authors": "Marek Rusinkiewicz Amit Sheth", "misc": "2009-04-13 The basic transaction model has evolved over time to incorporate more complex transaction structures and to selectively modify the atomicity and isolation properties. In this chapter we discuss the application of transaction concepts to activities that involve coordinated execution of multiple tasks (possibly of different types) over different processing entities. Such applications are referred to as transactional workflows. In this chapter we discuss the specification of such workflows and the issues involved in their execution. 1 What is a Workflow? Workflows are activities involving the coordinated execution of multiple tasks performed by different processing entities. A task defines some work to be done and can be specified in a number of ways, including a textual description in a file or an email, a form, a message, or a computer program. A processing entity that performs the tasks may be a person or a software system (e.g., a mailer, an application program, a database mana... CiteSeerX ACM Press 2009-04-13 2007-11-22 1995 application/postscript text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.43.3839 http //lsdis.cs.uga.edu/lib/././download/RS93.ps en 10.1.1.17.1323 10.1.1.59.5051 10.1.1.38.6210 10.1.1.68.7445 10.1.1.109.5175 10.1.1.17.7962 10.1.1.44.7778 10.1.1.112.244 10.1.1.13.7602 10.1.1.102.7874 10.1.1.41.4043 10.1.1.49.5143 10.1.1.41.7252 10.1.1.17.3225 10.1.1.54.7761 10.1.1.55.5255 10.1.1.108.958 10.1.1.35.7733 10.1.1.52.3682 10.1.1.36.1618 10.1.1.45.6317 10.1.1.43.3180 10.1.1.35.8718 10.1.1.44.6365 10.1.1.51.2883 10.1.1.50.9206 10.1.1.6.9085 10.1.1.30.1707 10.1.1.80.6634 10.1.1.49.355 10.1.1.127.3550 10.1.1.35.3562 10.1.1.137.8832 10.1.1.49.4085 10.1.1.41.5506 10.1.1.40.4657 10.1.1.43.2369 10.1.1.40.832 10.1.1.74.5411 10.1.1.90.4428 10.1.1.110.6967 10.1.1.27.2122 10.1.1.15.5605 10.1.1.54.727 10.1.1.49.7512 10.1.1.45.8796 10.1.1.50.5984 10.1.1.53.137 10.1.1.30.3262 10.1.1.28.1680 10.1.1.21.7110 10.1.1.29.3148 10.1.1.57.687 10.1.1.59.5924 10.1.1.46.2812 10.1.1.51.5552 10.1.1.17.7375 10.1.1.40.1598 10.1.1.52.9787 10.1.1.1.3496 10.1.1.50.6791 10.1.1.55.3358 10.1.1.137.7582 10.1.1.118.4127 10.1.1.49.3580 10.1.1.35.5825 10.1.1.46.9382 10.1.1.31.7411 10.1.1.48.5504 10.1.1.55.5163 10.1.1.18.1603 10.1.1.52.8129 10.1.1.1.9723 10.1.1.21.9113 10.1.1.49.7644 10.1.1.52.6646 10.1.1.75.3106 10.1.1.80.2072 10.1.1.55.8770 10.1.1.54.8188 10.1.1.101.7919 10.1.1.104.8176 10.1.1.24.5741 10.1.1.29.4667 10.1.1.4.1055 10.1.1.48.9175 10.1.1.56.792 10.1.1.65.3172 10.1.1.66.5947 10.1.1.73.8532 10.1.1.83.8299 10.1.1.86.8521 10.1.1.87.2402 10.1.1.87.4648 10.1.1.90.5638 10.1.1.91.1709 10.1.1.94.4248 10.1.1.114.511 10.1.1.119.5037 10.1.1.124.7957 10.1.1.49.215 10.1.1.53.7777 10.1.1.53.9711 10.1.1.45.9409 10.1.1.40.8789 10.1.1.43.4845 10.1.1.34.8273 10.1.1.35.4783 10.1.1.28.3176 10.1.1.16.8151 10.1.1.8.9117 10.1.1.58.3449 10.1.1.142.7041 Metadata may be used without restrictions as long as the oai identifier remains attached to it." } }
+{ "arec": { "id": 51, "dblpid": "books/aw/kimL89/NierstraszT89", "title": "Integrated Office Systems.", "authors": "Oscar Nierstrasz Dennis Tsichritzis", "misc": "2002-01-03 199-215 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#NierstraszT89" }, "brec": { "id": 92, "csxid": "oai CiteSeerXPSU 10.1.1.13.2374", "title": "Integrated Office Systems", "authors": "O. M. Nierstrasz D. C. Tsichritzis", "misc": "2009-04-17 Introduction New techniques are sorely needed to aid in the development and maintenance of large application systems. The problem with traditional approaches to software engineering is well in evidence in the field of o#ce information systems it is costly and di#cult to extend existing applications, and to get unrelated applications to \"talk\" to each other. The objectoriented approach is already being tentatively applied in the modeling of \"o#ce objects\" and in the presentation of these entities to users as such in \"desktop\" interfaces to o#ce software. In order to fully exploit the approach to achieve integrated o#ce systems, we need to use object-oriented programming languages, object-oriented run-time support, and object-oriented software engineering environments. We can view the fundamental idea behind the object-oriented approach as that of encapsulation object-oriented languages and systems exploit encapsulation in various ways in an attempt to enhance productivity through, f CiteSeerX 2009-04-17 2007-11-21 1988 application/pdf text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.13.2374 http //www.iam.unibe.ch/~scg/Archive/OSG/Nier89bIntegOfficeSystems.pdf en 10.1.1.26.9545 10.1.1.65.5865 10.1.1.34.624 10.1.1.12.8544 10.1.1.144.6983 10.1.1.26.6746 10.1.1.49.3064 10.1.1.30.4607 10.1.1.38.4894 10.1.1.20.8197 10.1.1.26.4381 10.1.1.29.1890 Metadata may be used without restrictions as long as the oai identifier remains attached to it." } }
+{ "arec": { "id": 51, "dblpid": "books/aw/kimL89/NierstraszT89", "title": "Integrated Office Systems.", "authors": "Oscar Nierstrasz Dennis Tsichritzis", "misc": "2002-01-03 199-215 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#NierstraszT89" }, "brec": { "id": 93, "csxid": "oai CiteSeerXPSU 10.1.1.42.9253", "title": "Integrated Office Systems", "authors": "O. M. Nierstrasz D. C. Tsichritzis", "misc": "2009-04-11 Introduction New techniques are sorely needed to aid in the development and maintenance of large application systems. The problem with traditional approaches to software engineering is well in evidence in the field of office information systems it is costly and difficult to extend existing applications, and to get unrelated applications to \"talk\" to each other. The objectoriented approach is already being tentatively applied in the modeling of \"office objects\" and in the presentation of these entities to users as such in \"desktop\" interfaces to office software. In order to fully exploit the approach to achieve integrated office systems, we need to use object-oriented programming languages, object-oriented run-time support, and object-oriented software engineering environments. We can view the fundamental idea behind the object-oriented approach as that of encapsulation object-oriented languages and systems exploit encapsulation in various ways in an attempt t CiteSeerX ACM Press and Addison-Wesley 2009-04-11 2007-11-22 1988 application/postscript text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.42.9253 ftp //ftp.iam.unibe.ch/pub/scg/Papers/integratedOfficeSystems.ps.gz en 10.1.1.26.9545 10.1.1.65.5865 10.1.1.34.624 10.1.1.12.8544 10.1.1.144.6983 10.1.1.26.6746 10.1.1.49.3064 10.1.1.30.4607 10.1.1.38.4894 10.1.1.20.8197 10.1.1.26.4381 10.1.1.29.1890 Metadata may be used without restrictions as long as the oai identifier remains attached to it." } }
+{ "arec": { "id": 54, "dblpid": "books/aw/kimL89/SteinLU89", "title": "A Shared View of Sharing The Treaty of Orlando.", "authors": "Lynn Andrea Stein Henry Lieberman David Ungar", "misc": "2002-01-03 31-48 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#SteinLU89" }, "brec": { "id": 91, "csxid": "oai CiteSeerXPSU 10.1.1.55.482", "title": "A Shared View of Sharing The Treaty of Orlando", "authors": "Lynn Andrea Stein Henry Lieberman David Ungar", "misc": "2009-04-12 Introduction For the past few years, researchers have been debating the relative merits of object-oriented languages with classes and inheritance as opposed to those with prototypes and delegation. It has become clear that the object-oriented programming language design space is not a dichotomy. Instead, we have identified two fundamental mechanisms---templates and empathy---and several different independent degrees of freedom for each. Templates create new objects in their own image, providing guarantees about the similarity of group members. Empathy allows an object to act as if it were some other object, thus providing sharing of state and behavior. The Smalltalk-80 TM language, 1 Actors, Lieberman's Delegation system, Self, and Hybrid each take differing stands on the forms of templates 1 Smalltalk-80 TM is a trademark of Par CiteSeerX ACM Press 2009-04-12 2007-11-22 1989 application/postscript text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.55.482 http //lcs.www.media.mit.edu/people/lieber/Lieberary/OOP/Treaty/Treaty.ps en 10.1.1.26.9545 10.1.1.118.6579 10.1.1.48.69 10.1.1.57.5195 10.1.1.9.570 10.1.1.47.511 10.1.1.127.5320 10.1.1.100.4334 10.1.1.5.3348 10.1.1.39.3374 10.1.1.56.4713 10.1.1.61.2065 10.1.1.27.3015 10.1.1.1.5960 10.1.1.67.5433 10.1.1.31.8109 10.1.1.68.4062 10.1.1.49.3986 10.1.1.122.9331 10.1.1.46.8283 10.1.1.54.5230 10.1.1.16.2055 10.1.1.137.5180 10.1.1.43.5722 10.1.1.68.2105 10.1.1.35.1247 10.1.1.30.1415 10.1.1.7.5014 10.1.1.102.3946 10.1.1.105.6469 10.1.1.26.223 10.1.1.26.8645 10.1.1.35.4104 10.1.1.39.6986 10.1.1.41.7822 10.1.1.42.9056 10.1.1.53.9325 10.1.1.71.1802 10.1.1.76.6993 10.1.1.89.9613 10.1.1.121.5599 10.1.1.122.3737 10.1.1.127.1894 10.1.1.55.5674 10.1.1.37.8260 10.1.1.2.2077 10.1.1.24.5782 10.1.1.19.780 10.1.1.2.4148 10.1.1.2.4173 10.1.1.131.902 10.1.1.30.2927 Metadata may be used without restrictions as long as the oai identifier remains attached to it." } }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join/olist-edit-distance-inline.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/olist-edit-distance-inline.adm
new file mode 100644
index 0000000..eadf56e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/olist-edit-distance-inline.adm
@@ -0,0 +1,157 @@
+{ "arec": { "cid": 17, "name": "Ingeborg Monkhouse", "age": null, "address": null, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] }, "brec": { "cid": 156, "name": "Bobbye Kauppi", "age": 79, "address": { "number": 2051, "street": "Hill St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] }, "ed": 0 }
+{ "arec": { "cid": 498, "name": "Arleen Sultzer", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Norine Sultzer", "age": 29 } ] }, "brec": { "cid": 875, "name": "Ramon Crepps", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Elisha Crepps", "age": null } ] }, "ed": 0 }
+{ "arec": { "cid": 636, "name": "Babara Shore", "age": 83, "address": { "number": 9452, "street": "Oak St.", "city": "Los Angeles" }, "interests": [ "Databases", "Movies", "Tennis" ], "children": [ { "name": "Candy Shore", "age": 58 }, { "name": "Nanci Shore", "age": null }, { "name": "Asia Shore", "age": null } ] }, "brec": { "cid": 992, "name": "Staci Alexandropoul", "age": null, "address": null, "interests": [ "Databases", "Movies", "Tennis" ], "children": [ { "name": "Casimira Alexandropoul", "age": null }, { "name": "Kena Alexandropoul", "age": 54 }, { "name": "Ellie Alexandropoul", "age": null }, { "name": "Ambrose Alexandropoul", "age": null } ] }, "ed": 0 }
+{ "arec": { "cid": 8, "name": "Audria Haylett", "age": 44, "address": { "number": 4872, "street": "Washington St.", "city": "Portland" }, "interests": [ "Cooking", "Fishing", "Video Games" ], "children": [ { "name": "Lacie Haylett", "age": 19 } ] }, "brec": { "cid": 563, "name": "Deirdre Landero", "age": null, "address": null, "interests": [ "Books", "Fishing", "Video Games" ], "children": [ { "name": "Norman Landero", "age": 59 }, { "name": "Jennine Landero", "age": 45 }, { "name": "Rutha Landero", "age": 19 }, { "name": "Jackie Landero", "age": 29 } ] }, "ed": 1 }
+{ "arec": { "cid": 16, "name": "Felisa Auletta", "age": 55, "address": { "number": 7737, "street": "View St.", "city": "San Jose" }, "interests": [ "Skiing", "Coffee", "Wine" ], "children": [ { "name": "Rosalia Auletta", "age": 36 } ] }, "brec": { "cid": 273, "name": "Corrinne Seaquist", "age": 24, "address": { "number": 6712, "street": "7th St.", "city": "Portland" }, "interests": [ "Puzzles", "Coffee", "Wine" ], "children": [ { "name": "Mignon Seaquist", "age": null }, { "name": "Leo Seaquist", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 16, "name": "Felisa Auletta", "age": 55, "address": { "number": 7737, "street": "View St.", "city": "San Jose" }, "interests": [ "Skiing", "Coffee", "Wine" ], "children": [ { "name": "Rosalia Auletta", "age": 36 } ] }, "brec": { "cid": 618, "name": "Janella Hurtt", "age": null, "address": null, "interests": [ "Skiing", "Coffee", "Skiing" ], "children": [ { "name": "Lupe Hurtt", "age": 17 }, { "name": "Jae Hurtt", "age": 14 }, { "name": "Evan Hurtt", "age": 45 } ] }, "ed": 1 }
+{ "arec": { "cid": 17, "name": "Ingeborg Monkhouse", "age": null, "address": null, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] }, "brec": { "cid": 462, "name": "Margaret Galvis", "age": null, "address": null, "interests": [ "Base Jumping", "Movies", "Movies" ], "children": [ { "name": "Isaac Galvis", "age": 48 }, { "name": "Mei Galvis", "age": null }, { "name": "Asha Galvis", "age": null }, { "name": "Zachery Galvis", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 17, "name": "Ingeborg Monkhouse", "age": null, "address": null, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] }, "brec": { "cid": 666, "name": "Pamila Burzlaff", "age": 68, "address": { "number": 6543, "street": "View St.", "city": "Portland" }, "interests": [ "Squash", "Cigars", "Movies" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 18, "name": "Dewayne Ardan", "age": 32, "address": { "number": 8229, "street": "Hill St.", "city": "San Jose" }, "interests": [ "Wine", "Walking", "Bass" ], "children": [ { "name": "Wen Ardan", "age": null }, { "name": "Sachiko Ardan", "age": 11 }, { "name": "Francis Ardan", "age": 20 } ] }, "brec": { "cid": 846, "name": "Kieth Norlund", "age": 15, "address": { "number": 4039, "street": "Park St.", "city": "Mountain View" }, "interests": [ "Wine", "Walking", "Puzzles" ], "children": [ { "name": "Shawn Norlund", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 35, "name": "Saundra Aparo", "age": 86, "address": { "number": 9550, "street": "Lake St.", "city": "Portland" }, "interests": [ "Cigars", "Skiing", "Video Games", "Books" ], "children": [ ] }, "brec": { "cid": 926, "name": "Krishna Barkdull", "age": 31, "address": { "number": 2640, "street": "Cedar St.", "city": "Sunnyvale" }, "interests": [ "Cigars", "Skiing", "Video Games", "Coffee" ], "children": [ { "name": "Nilsa Barkdull", "age": null }, { "name": "Denver Barkdull", "age": 10 }, { "name": "Jenell Barkdull", "age": 15 } ] }, "ed": 1 }
+{ "arec": { "cid": 51, "name": "Simonne Cape", "age": null, "address": null, "interests": [ "Bass", "Bass", "Books" ], "children": [ { "name": "Leland Cape", "age": null }, { "name": "Gearldine Cape", "age": null } ] }, "brec": { "cid": 232, "name": "Joey Potes", "age": null, "address": null, "interests": [ "Bass", "Bass", "Base Jumping" ], "children": [ { "name": "Bobby Potes", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 51, "name": "Simonne Cape", "age": null, "address": null, "interests": [ "Bass", "Bass", "Books" ], "children": [ { "name": "Leland Cape", "age": null }, { "name": "Gearldine Cape", "age": null } ] }, "brec": { "cid": 412, "name": "Devon Szalai", "age": 26, "address": { "number": 2384, "street": "Lake St.", "city": "Los Angeles" }, "interests": [ "Bass", "Books", "Books" ], "children": [ { "name": "Yolonda Szalai", "age": null }, { "name": "Denita Szalai", "age": null }, { "name": "Priscila Szalai", "age": 10 }, { "name": "Cassondra Szalai", "age": 12 } ] }, "ed": 1 }
+{ "arec": { "cid": 70, "name": "Mellisa Lek", "age": 62, "address": { "number": 4281, "street": "Oak St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Databases" ], "children": [ ] }, "brec": { "cid": 229, "name": "Raymundo Meurin", "age": null, "address": null, "interests": [ "Bass", "Basketball", "Databases" ], "children": [ { "name": "Mariela Meurin", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 70, "name": "Mellisa Lek", "age": 62, "address": { "number": 4281, "street": "Oak St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Databases" ], "children": [ ] }, "brec": { "cid": 371, "name": "Agatha Tensley", "age": 13, "address": { "number": 1810, "street": "Hill St.", "city": "San Jose" }, "interests": [ "Bass", "Running", "Movies" ], "children": [ { "name": "Launa Tensley", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 70, "name": "Mellisa Lek", "age": 62, "address": { "number": 4281, "street": "Oak St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Databases" ], "children": [ ] }, "brec": { "cid": 387, "name": "Leonard Mabie", "age": 33, "address": { "number": 6703, "street": "View St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Walking" ], "children": [ { "name": "Jone Mabie", "age": 16 }, { "name": "Claire Mabie", "age": null }, { "name": "Larraine Mabie", "age": null }, { "name": "Corrina Mabie", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 70, "name": "Mellisa Lek", "age": 62, "address": { "number": 4281, "street": "Oak St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Databases" ], "children": [ ] }, "brec": { "cid": 424, "name": "Camila Rightmire", "age": 25, "address": { "number": 7542, "street": "Oak St.", "city": "Sunnyvale" }, "interests": [ "Bass", "Running", "Puzzles" ], "children": [ { "name": "Donny Rightmire", "age": 14 }, { "name": "Karlene Rightmire", "age": 10 }, { "name": "Nicholas Rightmire", "age": null }, { "name": "Margareta Rightmire", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 72, "name": "Clarissa Geraldes", "age": 67, "address": { "number": 8248, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Cigars", "Walking", "Databases", "Video Games" ], "children": [ { "name": "Vina Geraldes", "age": 51 } ] }, "brec": { "cid": 919, "name": "Fairy Wansley", "age": 45, "address": { "number": 9020, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Wine", "Walking", "Databases", "Video Games" ], "children": [ { "name": "Marvella Wansley", "age": null }, { "name": "Hisako Wansley", "age": null }, { "name": "Shaunta Wansley", "age": null }, { "name": "Gemma Wansley", "age": 21 } ] }, "ed": 1 }
+{ "arec": { "cid": 73, "name": "Kelsey Flever", "age": 20, "address": { "number": 3555, "street": "Main St.", "city": "Portland" }, "interests": [ "Tennis", "Puzzles", "Video Games" ], "children": [ { "name": "Isis Flever", "age": null }, { "name": "Gonzalo Flever", "age": null } ] }, "brec": { "cid": 453, "name": "Sherlyn Deadmond", "age": null, "address": null, "interests": [ "Tennis", "Puzzles", "Base Jumping" ], "children": [ { "name": "Torrie Deadmond", "age": 46 }, { "name": "Cleotilde Deadmond", "age": 55 }, { "name": "Garry Deadmond", "age": 34 }, { "name": "Valrie Deadmond", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 73, "name": "Kelsey Flever", "age": 20, "address": { "number": 3555, "street": "Main St.", "city": "Portland" }, "interests": [ "Tennis", "Puzzles", "Video Games" ], "children": [ { "name": "Isis Flever", "age": null }, { "name": "Gonzalo Flever", "age": null } ] }, "brec": { "cid": 734, "name": "Lera Korn", "age": null, "address": null, "interests": [ "Tennis", "Puzzles", "Cigars" ], "children": [ { "name": "Criselda Korn", "age": 37 } ] }, "ed": 1 }
+{ "arec": { "cid": 77, "name": "Chantal Parriera", "age": 78, "address": { "number": 5967, "street": "Lake St.", "city": "San Jose" }, "interests": [ "Squash", "Movies", "Coffee" ], "children": [ ] }, "brec": { "cid": 909, "name": "Mariko Sharar", "age": null, "address": null, "interests": [ "Squash", "Movies", "Computers" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 78, "name": "Wesley Huggler", "age": 80, "address": { "number": 3078, "street": "7th St.", "city": "Los Angeles" }, "interests": [ "Base Jumping", "Movies", "Skiing" ], "children": [ { "name": "Chassidy Huggler", "age": null }, { "name": "Emogene Huggler", "age": null }, { "name": "Cheryle Huggler", "age": null } ] }, "brec": { "cid": 88, "name": "Courtney Muckleroy", "age": null, "address": null, "interests": [ "Wine", "Movies", "Skiing" ], "children": [ { "name": "Alona Muckleroy", "age": 30 }, { "name": "Flora Muckleroy", "age": 41 }, { "name": "Angel Muckleroy", "age": null }, { "name": "Daniella Muckleroy", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 78, "name": "Wesley Huggler", "age": 80, "address": { "number": 3078, "street": "7th St.", "city": "Los Angeles" }, "interests": [ "Base Jumping", "Movies", "Skiing" ], "children": [ { "name": "Chassidy Huggler", "age": null }, { "name": "Emogene Huggler", "age": null }, { "name": "Cheryle Huggler", "age": null } ] }, "brec": { "cid": 462, "name": "Margaret Galvis", "age": null, "address": null, "interests": [ "Base Jumping", "Movies", "Movies" ], "children": [ { "name": "Isaac Galvis", "age": 48 }, { "name": "Mei Galvis", "age": null }, { "name": "Asha Galvis", "age": null }, { "name": "Zachery Galvis", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 78, "name": "Wesley Huggler", "age": 80, "address": { "number": 3078, "street": "7th St.", "city": "Los Angeles" }, "interests": [ "Base Jumping", "Movies", "Skiing" ], "children": [ { "name": "Chassidy Huggler", "age": null }, { "name": "Emogene Huggler", "age": null }, { "name": "Cheryle Huggler", "age": null } ] }, "brec": { "cid": 498, "name": "Arleen Sultzer", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Norine Sultzer", "age": 29 } ] }, "ed": 1 }
+{ "arec": { "cid": 78, "name": "Wesley Huggler", "age": 80, "address": { "number": 3078, "street": "7th St.", "city": "Los Angeles" }, "interests": [ "Base Jumping", "Movies", "Skiing" ], "children": [ { "name": "Chassidy Huggler", "age": null }, { "name": "Emogene Huggler", "age": null }, { "name": "Cheryle Huggler", "age": null } ] }, "brec": { "cid": 875, "name": "Ramon Crepps", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Elisha Crepps", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 84, "name": "Huong Kachel", "age": null, "address": null, "interests": [ "Music", "Tennis", "Base Jumping" ], "children": [ { "name": "Katlyn Kachel", "age": 40 }, { "name": "Sherman Kachel", "age": null }, { "name": "Susana Kachel", "age": 32 } ] }, "brec": { "cid": 326, "name": "Tad Tellers", "age": null, "address": null, "interests": [ "Books", "Tennis", "Base Jumping" ], "children": [ { "name": "Fannie Tellers", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 88, "name": "Courtney Muckleroy", "age": null, "address": null, "interests": [ "Wine", "Movies", "Skiing" ], "children": [ { "name": "Alona Muckleroy", "age": 30 }, { "name": "Flora Muckleroy", "age": 41 }, { "name": "Angel Muckleroy", "age": null }, { "name": "Daniella Muckleroy", "age": null } ] }, "brec": { "cid": 498, "name": "Arleen Sultzer", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Norine Sultzer", "age": 29 } ] }, "ed": 1 }
+{ "arec": { "cid": 88, "name": "Courtney Muckleroy", "age": null, "address": null, "interests": [ "Wine", "Movies", "Skiing" ], "children": [ { "name": "Alona Muckleroy", "age": 30 }, { "name": "Flora Muckleroy", "age": 41 }, { "name": "Angel Muckleroy", "age": null }, { "name": "Daniella Muckleroy", "age": null } ] }, "brec": { "cid": 875, "name": "Ramon Crepps", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Elisha Crepps", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 101, "name": "Meaghan Vandel", "age": null, "address": null, "interests": [ "Music", "Base Jumping", "Books" ], "children": [ { "name": "Larissa Vandel", "age": null } ] }, "brec": { "cid": 633, "name": "Shalon Grauberger", "age": 34, "address": { "number": 765, "street": "Washington St.", "city": "Sunnyvale" }, "interests": [ "Music", "Base Jumping", "Tennis" ], "children": [ { "name": "Kris Grauberger", "age": 14 }, { "name": "Stuart Grauberger", "age": 12 }, { "name": "Billy Grauberger", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 101, "name": "Meaghan Vandel", "age": null, "address": null, "interests": [ "Music", "Base Jumping", "Books" ], "children": [ { "name": "Larissa Vandel", "age": null } ] }, "brec": { "cid": 967, "name": "Melida Laliotis", "age": null, "address": null, "interests": [ "Music", "Base Jumping", "Coffee", "Books" ], "children": [ { "name": "Lai Laliotis", "age": 52 }, { "name": "Jillian Laliotis", "age": 11 } ] }, "ed": 1 }
+{ "arec": { "cid": 115, "name": "Jason Oakden", "age": 89, "address": { "number": 8182, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Music", "Basketball", "Movies" ], "children": [ { "name": "Johnson Oakden", "age": null }, { "name": "Neva Oakden", "age": null }, { "name": "Juliann Oakden", "age": null }, { "name": "Elmer Oakden", "age": null } ] }, "brec": { "cid": 827, "name": "Clementina Papin", "age": null, "address": null, "interests": [ "Music", "Basketball", "Cigars" ], "children": [ { "name": "Catina Papin", "age": null }, { "name": "Demetrius Papin", "age": 59 }, { "name": "Marylou Papin", "age": 12 }, { "name": "Apryl Papin", "age": 16 } ] }, "ed": 1 }
+{ "arec": { "cid": 120, "name": "Jan Gianandrea", "age": null, "address": null, "interests": [ "Databases", "Movies", "Cigars" ], "children": [ { "name": "Keesha Gianandrea", "age": null }, { "name": "Vashti Gianandrea", "age": 35 }, { "name": "Larry Gianandrea", "age": 29 } ] }, "brec": { "cid": 397, "name": "Blake Kealy", "age": 34, "address": { "number": 2156, "street": "Cedar St.", "city": "Los Angeles" }, "interests": [ "Databases", "Wine", "Cigars" ], "children": [ { "name": "Lorenza Kealy", "age": null }, { "name": "Beula Kealy", "age": 15 }, { "name": "Kristofer Kealy", "age": null }, { "name": "Shayne Kealy", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 120, "name": "Jan Gianandrea", "age": null, "address": null, "interests": [ "Databases", "Movies", "Cigars" ], "children": [ { "name": "Keesha Gianandrea", "age": null }, { "name": "Vashti Gianandrea", "age": 35 }, { "name": "Larry Gianandrea", "age": 29 } ] }, "brec": { "cid": 636, "name": "Babara Shore", "age": 83, "address": { "number": 9452, "street": "Oak St.", "city": "Los Angeles" }, "interests": [ "Databases", "Movies", "Tennis" ], "children": [ { "name": "Candy Shore", "age": 58 }, { "name": "Nanci Shore", "age": null }, { "name": "Asia Shore", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 120, "name": "Jan Gianandrea", "age": null, "address": null, "interests": [ "Databases", "Movies", "Cigars" ], "children": [ { "name": "Keesha Gianandrea", "age": null }, { "name": "Vashti Gianandrea", "age": 35 }, { "name": "Larry Gianandrea", "age": 29 } ] }, "brec": { "cid": 992, "name": "Staci Alexandropoul", "age": null, "address": null, "interests": [ "Databases", "Movies", "Tennis" ], "children": [ { "name": "Casimira Alexandropoul", "age": null }, { "name": "Kena Alexandropoul", "age": 54 }, { "name": "Ellie Alexandropoul", "age": null }, { "name": "Ambrose Alexandropoul", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 137, "name": "Camellia Pressman", "age": 81, "address": { "number": 3947, "street": "Park St.", "city": "Seattle" }, "interests": [ "Movies", "Books", "Bass" ], "children": [ { "name": "Dwana Pressman", "age": null }, { "name": "Johnathan Pressman", "age": null }, { "name": "Kasey Pressman", "age": null }, { "name": "Mitch Pressman", "age": null } ] }, "brec": { "cid": 923, "name": "Bobbi Ursino", "age": null, "address": null, "interests": [ "Movies", "Books", "Walking" ], "children": [ { "name": "Shon Ursino", "age": null }, { "name": "Lorean Ursino", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 139, "name": "Micheline Argenal", "age": null, "address": null, "interests": [ "Bass", "Walking", "Movies" ], "children": [ { "name": "Joye Argenal", "age": 51 }, { "name": "Richard Argenal", "age": 46 }, { "name": "Sarah Argenal", "age": 21 }, { "name": "Jacinda Argenal", "age": 21 } ] }, "brec": { "cid": 371, "name": "Agatha Tensley", "age": 13, "address": { "number": 1810, "street": "Hill St.", "city": "San Jose" }, "interests": [ "Bass", "Running", "Movies" ], "children": [ { "name": "Launa Tensley", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 141, "name": "Adena Klockars", "age": null, "address": null, "interests": [ "Skiing", "Computers", "Bass", "Cigars" ], "children": [ ] }, "brec": { "cid": 794, "name": "Annabel Leins", "age": 75, "address": { "number": 9761, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Bass", "Computers", "Bass", "Cigars" ], "children": [ { "name": "Oswaldo Leins", "age": 21 } ] }, "ed": 1 }
+{ "arec": { "cid": 156, "name": "Bobbye Kauppi", "age": 79, "address": { "number": 2051, "street": "Hill St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] }, "brec": { "cid": 462, "name": "Margaret Galvis", "age": null, "address": null, "interests": [ "Base Jumping", "Movies", "Movies" ], "children": [ { "name": "Isaac Galvis", "age": 48 }, { "name": "Mei Galvis", "age": null }, { "name": "Asha Galvis", "age": null }, { "name": "Zachery Galvis", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 156, "name": "Bobbye Kauppi", "age": 79, "address": { "number": 2051, "street": "Hill St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] }, "brec": { "cid": 666, "name": "Pamila Burzlaff", "age": 68, "address": { "number": 6543, "street": "View St.", "city": "Portland" }, "interests": [ "Squash", "Cigars", "Movies" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 160, "name": "Yevette Chanez", "age": null, "address": null, "interests": [ "Bass", "Wine", "Coffee" ], "children": [ { "name": "Walter Chanez", "age": 11 }, { "name": "Pa Chanez", "age": 27 } ] }, "brec": { "cid": 299, "name": "Jacob Wainman", "age": 76, "address": { "number": 4551, "street": "Washington St.", "city": "Portland" }, "interests": [ "Base Jumping", "Wine", "Coffee" ], "children": [ { "name": "Abram Wainman", "age": 28 }, { "name": "Ramonita Wainman", "age": 18 }, { "name": "Sheryll Wainman", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 160, "name": "Yevette Chanez", "age": null, "address": null, "interests": [ "Bass", "Wine", "Coffee" ], "children": [ { "name": "Walter Chanez", "age": 11 }, { "name": "Pa Chanez", "age": 27 } ] }, "brec": { "cid": 898, "name": "Thao Seufert", "age": 78, "address": { "number": 3529, "street": "Hill St.", "city": "Seattle" }, "interests": [ "Bass", "Squash", "Coffee" ], "children": [ { "name": "Classie Seufert", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 172, "name": "Weldon Alquesta", "age": null, "address": null, "interests": [ "Music", "Fishing", "Music" ], "children": [ { "name": "Kip Alquesta", "age": null } ] }, "brec": { "cid": 961, "name": "Mirian Herpolsheimer", "age": null, "address": null, "interests": [ "Music", "Fishing", "Computers" ], "children": [ { "name": "Larissa Herpolsheimer", "age": 41 }, { "name": "Markus Herpolsheimer", "age": null }, { "name": "Natacha Herpolsheimer", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 173, "name": "Annamae Lucien", "age": 46, "address": { "number": 1253, "street": "Hill St.", "city": "Mountain View" }, "interests": [ "Puzzles", "Cooking", "Squash" ], "children": [ { "name": "Sanjuana Lucien", "age": 21 }, { "name": "Nathanael Lucien", "age": 27 }, { "name": "Jae Lucien", "age": null }, { "name": "Judith Lucien", "age": null } ] }, "brec": { "cid": 507, "name": "Yuk Flanegan", "age": null, "address": null, "interests": [ "Puzzles", "Puzzles", "Squash" ], "children": [ { "name": "Alexander Flanegan", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 173, "name": "Annamae Lucien", "age": 46, "address": { "number": 1253, "street": "Hill St.", "city": "Mountain View" }, "interests": [ "Puzzles", "Cooking", "Squash" ], "children": [ { "name": "Sanjuana Lucien", "age": 21 }, { "name": "Nathanael Lucien", "age": 27 }, { "name": "Jae Lucien", "age": null }, { "name": "Judith Lucien", "age": null } ] }, "brec": { "cid": 691, "name": "Sharee Charrier", "age": 17, "address": { "number": 6693, "street": "Main St.", "city": "Mountain View" }, "interests": [ "Puzzles", "Cooking", "Bass" ], "children": [ { "name": "Odessa Charrier", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 178, "name": "Athena Kaluna", "age": null, "address": null, "interests": [ "Running", "Computers", "Basketball" ], "children": [ { "name": "Rosalba Kaluna", "age": 48 }, { "name": "Max Kaluna", "age": 10 } ] }, "brec": { "cid": 345, "name": "Derick Rippel", "age": 79, "address": { "number": 6843, "street": "Oak St.", "city": "Portland" }, "interests": [ "Running", "Basketball", "Computers", "Basketball" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 187, "name": "Seema Hartsch", "age": 80, "address": { "number": 6629, "street": "Lake St.", "city": "Portland" }, "interests": [ "Coffee", "Coffee", "Cigars" ], "children": [ { "name": "Suellen Hartsch", "age": null }, { "name": "Pennie Hartsch", "age": 20 }, { "name": "Aubrey Hartsch", "age": null }, { "name": "Randy Hartsch", "age": 32 } ] }, "brec": { "cid": 598, "name": "Venus Peat", "age": null, "address": null, "interests": [ "Coffee", "Walking", "Cigars" ], "children": [ { "name": "Antonetta Peat", "age": null }, { "name": "Shane Peat", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 187, "name": "Seema Hartsch", "age": 80, "address": { "number": 6629, "street": "Lake St.", "city": "Portland" }, "interests": [ "Coffee", "Coffee", "Cigars" ], "children": [ { "name": "Suellen Hartsch", "age": null }, { "name": "Pennie Hartsch", "age": 20 }, { "name": "Aubrey Hartsch", "age": null }, { "name": "Randy Hartsch", "age": 32 } ] }, "brec": { "cid": 927, "name": "Lillia Hartlein", "age": 55, "address": { "number": 5856, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Coffee", "Cigars" ], "children": [ { "name": "Nicky Hartlein", "age": null }, { "name": "Cassaundra Hartlein", "age": 10 }, { "name": "Micheline Hartlein", "age": 26 }, { "name": "Anton Hartlein", "age": 32 } ] }, "ed": 1 }
+{ "arec": { "cid": 198, "name": "Thelma Youkers", "age": null, "address": null, "interests": [ "Basketball", "Movies", "Cooking" ], "children": [ { "name": "Shamika Youkers", "age": 28 } ] }, "brec": { "cid": 806, "name": "Corliss Sharratt", "age": null, "address": null, "interests": [ "Basketball", "Cigars", "Cooking" ], "children": [ { "name": "Albertine Sharratt", "age": null }, { "name": "Nobuko Sharratt", "age": 29 }, { "name": "Neil Sharratt", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 207, "name": "Phyliss Honda", "age": 22, "address": { "number": 8387, "street": "Lake St.", "city": "Seattle" }, "interests": [ "Cooking", "Music", "Books" ], "children": [ { "name": "Bee Honda", "age": null }, { "name": "Cyril Honda", "age": null }, { "name": "Vertie Honda", "age": null } ] }, "brec": { "cid": 440, "name": "Rosie Shappen", "age": null, "address": null, "interests": [ "Cooking", "Music", "Cigars" ], "children": [ { "name": "Jung Shappen", "age": 11 } ] }, "ed": 1 }
+{ "arec": { "cid": 207, "name": "Phyliss Honda", "age": 22, "address": { "number": 8387, "street": "Lake St.", "city": "Seattle" }, "interests": [ "Cooking", "Music", "Books" ], "children": [ { "name": "Bee Honda", "age": null }, { "name": "Cyril Honda", "age": null }, { "name": "Vertie Honda", "age": null } ] }, "brec": { "cid": 825, "name": "Kirstie Rinebold", "age": 57, "address": { "number": 9463, "street": "Oak St.", "city": "Portland" }, "interests": [ "Cooking", "Cigars", "Books" ], "children": [ { "name": "Vonda Rinebold", "age": null }, { "name": "Man Rinebold", "age": 21 } ] }, "ed": 1 }
+{ "arec": { "cid": 216, "name": "Odilia Lampson", "age": null, "address": null, "interests": [ "Wine", "Databases", "Basketball" ], "children": [ { "name": "Callie Lampson", "age": null } ] }, "brec": { "cid": 220, "name": "Soila Hannemann", "age": null, "address": null, "interests": [ "Wine", "Puzzles", "Basketball" ], "children": [ { "name": "Piper Hannemann", "age": 44 } ] }, "ed": 1 }
+{ "arec": { "cid": 220, "name": "Soila Hannemann", "age": null, "address": null, "interests": [ "Wine", "Puzzles", "Basketball" ], "children": [ { "name": "Piper Hannemann", "age": 44 } ] }, "brec": { "cid": 312, "name": "Epifania Chorney", "age": 62, "address": { "number": 9749, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Wine", "Puzzles", "Tennis" ], "children": [ { "name": "Lizeth Chorney", "age": 22 } ] }, "ed": 1 }
+{ "arec": { "cid": 224, "name": "Rene Rowey", "age": null, "address": null, "interests": [ "Base Jumping", "Base Jumping", "Walking", "Computers" ], "children": [ { "name": "Necole Rowey", "age": 26 }, { "name": "Sharyl Rowey", "age": 20 }, { "name": "Yvone Rowey", "age": 36 } ] }, "brec": { "cid": 538, "name": "Mack Vollick", "age": null, "address": null, "interests": [ "Base Jumping", "Fishing", "Walking", "Computers" ], "children": [ { "name": "Gil Vollick", "age": 11 }, { "name": "Marica Vollick", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 224, "name": "Rene Rowey", "age": null, "address": null, "interests": [ "Base Jumping", "Base Jumping", "Walking", "Computers" ], "children": [ { "name": "Necole Rowey", "age": 26 }, { "name": "Sharyl Rowey", "age": 20 }, { "name": "Yvone Rowey", "age": 36 } ] }, "brec": { "cid": 788, "name": "Franklyn Crowner", "age": 56, "address": { "number": 4186, "street": "Lake St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Base Jumping", "Books", "Computers" ], "children": [ { "name": "Adrian Crowner", "age": 43 }, { "name": "Vasiliki Crowner", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 237, "name": "Sona Hehn", "age": 47, "address": { "number": 3720, "street": "Oak St.", "city": "Portland" }, "interests": [ "Computers", "Squash", "Coffee" ], "children": [ { "name": "Marquerite Hehn", "age": null }, { "name": "Suellen Hehn", "age": 29 }, { "name": "Herb Hehn", "age": 29 } ] }, "brec": { "cid": 898, "name": "Thao Seufert", "age": 78, "address": { "number": 3529, "street": "Hill St.", "city": "Seattle" }, "interests": [ "Bass", "Squash", "Coffee" ], "children": [ { "name": "Classie Seufert", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 244, "name": "Rene Shenk", "age": null, "address": null, "interests": [ "Puzzles", "Puzzles", "Skiing" ], "children": [ { "name": "Victor Shenk", "age": 28 }, { "name": "Doris Shenk", "age": null }, { "name": "Max Shenk", "age": 51 } ] }, "brec": { "cid": 507, "name": "Yuk Flanegan", "age": null, "address": null, "interests": [ "Puzzles", "Puzzles", "Squash" ], "children": [ { "name": "Alexander Flanegan", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 250, "name": "Angeles Saltonstall", "age": null, "address": null, "interests": [ "Tennis", "Fishing", "Movies" ], "children": [ { "name": "Suzanna Saltonstall", "age": null } ] }, "brec": { "cid": 276, "name": "Denyse Groth", "age": 81, "address": { "number": 6825, "street": "Main St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Fishing", "Movies" ], "children": [ { "name": "Marilee Groth", "age": 12 }, { "name": "Lyla Groth", "age": 46 }, { "name": "Sarah Groth", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 250, "name": "Angeles Saltonstall", "age": null, "address": null, "interests": [ "Tennis", "Fishing", "Movies" ], "children": [ { "name": "Suzanna Saltonstall", "age": null } ] }, "brec": { "cid": 302, "name": "Rosalie Laderer", "age": null, "address": null, "interests": [ "Tennis", "Movies", "Movies" ], "children": [ { "name": "Moriah Laderer", "age": null }, { "name": "Liana Laderer", "age": 21 }, { "name": "Genia Laderer", "age": 45 } ] }, "ed": 1 }
+{ "arec": { "cid": 263, "name": "Mellisa Machalek", "age": null, "address": null, "interests": [ "Bass", "Coffee", "Skiing" ], "children": [ ] }, "brec": { "cid": 618, "name": "Janella Hurtt", "age": null, "address": null, "interests": [ "Skiing", "Coffee", "Skiing" ], "children": [ { "name": "Lupe Hurtt", "age": 17 }, { "name": "Jae Hurtt", "age": 14 }, { "name": "Evan Hurtt", "age": 45 } ] }, "ed": 1 }
+{ "arec": { "cid": 264, "name": "Leon Yoshizawa", "age": 81, "address": { "number": 608, "street": "Washington St.", "city": "San Jose" }, "interests": [ "Running", "Books", "Running" ], "children": [ { "name": "Carmela Yoshizawa", "age": 34 } ] }, "brec": { "cid": 804, "name": "Joaquina Burlin", "age": 77, "address": { "number": 5479, "street": "7th St.", "city": "Sunnyvale" }, "interests": [ "Running", "Wine", "Running" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 268, "name": "Fernando Pingel", "age": null, "address": null, "interests": [ "Computers", "Tennis", "Books" ], "children": [ { "name": "Latrice Pingel", "age": null }, { "name": "Wade Pingel", "age": 13 }, { "name": "Christal Pingel", "age": null }, { "name": "Melania Pingel", "age": null } ] }, "brec": { "cid": 446, "name": "Lilly Grannell", "age": 21, "address": { "number": 5894, "street": "Washington St.", "city": "San Jose" }, "interests": [ "Computers", "Tennis", "Puzzles", "Books" ], "children": [ { "name": "Victor Grannell", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 273, "name": "Corrinne Seaquist", "age": 24, "address": { "number": 6712, "street": "7th St.", "city": "Portland" }, "interests": [ "Puzzles", "Coffee", "Wine" ], "children": [ { "name": "Mignon Seaquist", "age": null }, { "name": "Leo Seaquist", "age": null } ] }, "brec": { "cid": 709, "name": "Jazmine Twiddy", "age": null, "address": null, "interests": [ "Puzzles", "Computers", "Wine" ], "children": [ { "name": "Veronika Twiddy", "age": 21 } ] }, "ed": 1 }
+{ "arec": { "cid": 274, "name": "Claude Harral", "age": null, "address": null, "interests": [ "Squash", "Bass", "Cooking" ], "children": [ { "name": "Archie Harral", "age": null }, { "name": "Royal Harral", "age": null } ] }, "brec": { "cid": 654, "name": "Louis Laubersheimer", "age": 76, "address": { "number": 8010, "street": "7th St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Bass", "Cooking" ], "children": [ { "name": "Jewel Laubersheimer", "age": 22 }, { "name": "Toccara Laubersheimer", "age": 45 }, { "name": "Eve Laubersheimer", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 276, "name": "Denyse Groth", "age": 81, "address": { "number": 6825, "street": "Main St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Fishing", "Movies" ], "children": [ { "name": "Marilee Groth", "age": 12 }, { "name": "Lyla Groth", "age": 46 }, { "name": "Sarah Groth", "age": null } ] }, "brec": { "cid": 892, "name": "Madge Hendson", "age": 79, "address": { "number": 8832, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Databases", "Fishing", "Skiing" ], "children": [ { "name": "Elia Hendson", "age": 48 }, { "name": "Lashawn Hendson", "age": 27 } ] }, "ed": 1 }
+{ "arec": { "cid": 276, "name": "Denyse Groth", "age": 81, "address": { "number": 6825, "street": "Main St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Fishing", "Movies" ], "children": [ { "name": "Marilee Groth", "age": 12 }, { "name": "Lyla Groth", "age": 46 }, { "name": "Sarah Groth", "age": null } ] }, "brec": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Databases", "Fishing", "Wine" ], "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 297, "name": "Adeline Frierson", "age": null, "address": null, "interests": [ "Coffee", "Computers", "Fishing" ], "children": [ { "name": "Marci Frierson", "age": null }, { "name": "Rolanda Frierson", "age": null }, { "name": "Del Frierson", "age": null } ] }, "brec": { "cid": 854, "name": "Angie Oyster", "age": 32, "address": { "number": 8860, "street": "Main St.", "city": "San Jose" }, "interests": [ "Coffee", "Movies", "Fishing" ], "children": [ { "name": "Hugh Oyster", "age": 10 } ] }, "ed": 1 }
+{ "arec": { "cid": 297, "name": "Adeline Frierson", "age": null, "address": null, "interests": [ "Coffee", "Computers", "Fishing" ], "children": [ { "name": "Marci Frierson", "age": null }, { "name": "Rolanda Frierson", "age": null }, { "name": "Del Frierson", "age": null } ] }, "brec": { "cid": 996, "name": "Elouise Wider", "age": null, "address": null, "interests": [ "Coffee", "Computers", "Base Jumping" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 299, "name": "Jacob Wainman", "age": 76, "address": { "number": 4551, "street": "Washington St.", "city": "Portland" }, "interests": [ "Base Jumping", "Wine", "Coffee" ], "children": [ { "name": "Abram Wainman", "age": 28 }, { "name": "Ramonita Wainman", "age": 18 }, { "name": "Sheryll Wainman", "age": null } ] }, "brec": { "cid": 448, "name": "Gracie Pekas", "age": 59, "address": { "number": 4732, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Wine", "Cigars" ], "children": [ { "name": "Jeanett Pekas", "age": 35 }, { "name": "Jennifer Pekas", "age": null }, { "name": "Carrol Pekas", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 302, "name": "Rosalie Laderer", "age": null, "address": null, "interests": [ "Tennis", "Movies", "Movies" ], "children": [ { "name": "Moriah Laderer", "age": null }, { "name": "Liana Laderer", "age": 21 }, { "name": "Genia Laderer", "age": 45 } ] }, "brec": { "cid": 462, "name": "Margaret Galvis", "age": null, "address": null, "interests": [ "Base Jumping", "Movies", "Movies" ], "children": [ { "name": "Isaac Galvis", "age": 48 }, { "name": "Mei Galvis", "age": null }, { "name": "Asha Galvis", "age": null }, { "name": "Zachery Galvis", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 302, "name": "Rosalie Laderer", "age": null, "address": null, "interests": [ "Tennis", "Movies", "Movies" ], "children": [ { "name": "Moriah Laderer", "age": null }, { "name": "Liana Laderer", "age": 21 }, { "name": "Genia Laderer", "age": 45 } ] }, "brec": { "cid": 661, "name": "Lorita Kraut", "age": 43, "address": { "number": 5017, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Tennis", "Movies", "Bass" ], "children": [ { "name": "Mirian Kraut", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 312, "name": "Epifania Chorney", "age": 62, "address": { "number": 9749, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Wine", "Puzzles", "Tennis" ], "children": [ { "name": "Lizeth Chorney", "age": 22 } ] }, "brec": { "cid": 895, "name": "Joie Siffert", "age": null, "address": null, "interests": [ "Wine", "Skiing", "Puzzles", "Tennis" ], "children": [ { "name": "Erma Siffert", "age": null }, { "name": "Natosha Siffert", "age": 38 }, { "name": "Somer Siffert", "age": 27 } ] }, "ed": 1 }
+{ "arec": { "cid": 326, "name": "Tad Tellers", "age": null, "address": null, "interests": [ "Books", "Tennis", "Base Jumping" ], "children": [ { "name": "Fannie Tellers", "age": null } ] }, "brec": { "cid": 541, "name": "Sammy Adamitis", "age": 71, "address": { "number": 5593, "street": "Washington St.", "city": "Seattle" }, "interests": [ "Books", "Tennis", "Cooking" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 335, "name": "Odessa Dammeyer", "age": 18, "address": { "number": 6828, "street": "Cedar St.", "city": "Los Angeles" }, "interests": [ "Basketball", "Bass", "Cigars" ], "children": [ { "name": "Lindsey Dammeyer", "age": null } ] }, "brec": { "cid": 660, "name": "Israel Aday", "age": null, "address": null, "interests": [ "Wine", "Bass", "Cigars" ], "children": [ { "name": "Mi Aday", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 352, "name": "Bonny Sischo", "age": null, "address": null, "interests": [ "Bass", "Movies", "Computers" ], "children": [ { "name": "Judith Sischo", "age": 43 }, { "name": "Adeline Sischo", "age": null }, { "name": "Dayna Sischo", "age": null } ] }, "brec": { "cid": 614, "name": "Wallace Chaidy", "age": null, "address": null, "interests": [ "Bass", "Movies", "Music" ], "children": [ { "name": "Refugio Chaidy", "age": null }, { "name": "Hae Chaidy", "age": 55 }, { "name": "Julian Chaidy", "age": null }, { "name": "Tabatha Chaidy", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 352, "name": "Bonny Sischo", "age": null, "address": null, "interests": [ "Bass", "Movies", "Computers" ], "children": [ { "name": "Judith Sischo", "age": 43 }, { "name": "Adeline Sischo", "age": null }, { "name": "Dayna Sischo", "age": null } ] }, "brec": { "cid": 909, "name": "Mariko Sharar", "age": null, "address": null, "interests": [ "Squash", "Movies", "Computers" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 359, "name": "Sharika Vientos", "age": 42, "address": { "number": 5981, "street": "Hill St.", "city": "Mountain View" }, "interests": [ "Walking", "Bass", "Fishing", "Movies" ], "children": [ { "name": "Clifton Vientos", "age": 21 }, { "name": "Renae Vientos", "age": null }, { "name": "Marcelo Vientos", "age": 31 }, { "name": "Jacalyn Vientos", "age": null } ] }, "brec": { "cid": 969, "name": "Laurinda Gnerre", "age": 42, "address": { "number": 2284, "street": "Hill St.", "city": "Mountain View" }, "interests": [ "Walking", "Bass", "Fishing", "Video Games" ], "children": [ { "name": "Veronica Gnerre", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 363, "name": "Merlene Hoying", "age": 25, "address": { "number": 2105, "street": "Cedar St.", "city": "Portland" }, "interests": [ "Squash", "Squash", "Music" ], "children": [ { "name": "Andrew Hoying", "age": 10 } ] }, "brec": { "cid": 415, "name": "Valentin Mclarney", "age": null, "address": null, "interests": [ "Squash", "Squash", "Video Games" ], "children": [ { "name": "Vanda Mclarney", "age": 17 } ] }, "ed": 1 }
+{ "arec": { "cid": 363, "name": "Merlene Hoying", "age": 25, "address": { "number": 2105, "street": "Cedar St.", "city": "Portland" }, "interests": [ "Squash", "Squash", "Music" ], "children": [ { "name": "Andrew Hoying", "age": 10 } ] }, "brec": { "cid": 642, "name": "Odell Nova", "age": 25, "address": { "number": 896, "street": "Park St.", "city": "San Jose" }, "interests": [ "Video Games", "Squash", "Music" ], "children": [ { "name": "Leopoldo Nova", "age": null }, { "name": "Rickey Nova", "age": null }, { "name": "Mike Nova", "age": 14 }, { "name": "Tamie Nova", "age": 14 } ] }, "ed": 1 }
+{ "arec": { "cid": 371, "name": "Agatha Tensley", "age": 13, "address": { "number": 1810, "street": "Hill St.", "city": "San Jose" }, "interests": [ "Bass", "Running", "Movies" ], "children": [ { "name": "Launa Tensley", "age": null } ] }, "brec": { "cid": 387, "name": "Leonard Mabie", "age": 33, "address": { "number": 6703, "street": "View St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Walking" ], "children": [ { "name": "Jone Mabie", "age": 16 }, { "name": "Claire Mabie", "age": null }, { "name": "Larraine Mabie", "age": null }, { "name": "Corrina Mabie", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 371, "name": "Agatha Tensley", "age": 13, "address": { "number": 1810, "street": "Hill St.", "city": "San Jose" }, "interests": [ "Bass", "Running", "Movies" ], "children": [ { "name": "Launa Tensley", "age": null } ] }, "brec": { "cid": 424, "name": "Camila Rightmire", "age": 25, "address": { "number": 7542, "street": "Oak St.", "city": "Sunnyvale" }, "interests": [ "Bass", "Running", "Puzzles" ], "children": [ { "name": "Donny Rightmire", "age": 14 }, { "name": "Karlene Rightmire", "age": 10 }, { "name": "Nicholas Rightmire", "age": null }, { "name": "Margareta Rightmire", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 378, "name": "Melany Matias", "age": 10, "address": { "number": 8838, "street": "Main St.", "city": "Seattle" }, "interests": [ "Coffee", "Tennis", "Bass" ], "children": [ { "name": "Earnestine Matias", "age": null }, { "name": "Lore Matias", "age": null } ] }, "brec": { "cid": 580, "name": "Liana Gabbert", "age": null, "address": null, "interests": [ "Coffee", "Tennis", "Bass", "Running" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 387, "name": "Leonard Mabie", "age": 33, "address": { "number": 6703, "street": "View St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Walking" ], "children": [ { "name": "Jone Mabie", "age": 16 }, { "name": "Claire Mabie", "age": null }, { "name": "Larraine Mabie", "age": null }, { "name": "Corrina Mabie", "age": null } ] }, "brec": { "cid": 424, "name": "Camila Rightmire", "age": 25, "address": { "number": 7542, "street": "Oak St.", "city": "Sunnyvale" }, "interests": [ "Bass", "Running", "Puzzles" ], "children": [ { "name": "Donny Rightmire", "age": 14 }, { "name": "Karlene Rightmire", "age": 10 }, { "name": "Nicholas Rightmire", "age": null }, { "name": "Margareta Rightmire", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 397, "name": "Blake Kealy", "age": 34, "address": { "number": 2156, "street": "Cedar St.", "city": "Los Angeles" }, "interests": [ "Databases", "Wine", "Cigars" ], "children": [ { "name": "Lorenza Kealy", "age": null }, { "name": "Beula Kealy", "age": 15 }, { "name": "Kristofer Kealy", "age": null }, { "name": "Shayne Kealy", "age": null } ] }, "brec": { "cid": 448, "name": "Gracie Pekas", "age": 59, "address": { "number": 4732, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Wine", "Cigars" ], "children": [ { "name": "Jeanett Pekas", "age": 35 }, { "name": "Jennifer Pekas", "age": null }, { "name": "Carrol Pekas", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 402, "name": "Terrilyn Shinall", "age": null, "address": null, "interests": [ "Computers", "Skiing", "Music" ], "children": [ { "name": "Minh Shinall", "age": null }, { "name": "Diedre Shinall", "age": 22 } ] }, "brec": { "cid": 803, "name": "Yolonda Korf", "age": null, "address": null, "interests": [ "Bass", "Skiing", "Music" ], "children": [ { "name": "Ivette Korf", "age": null }, { "name": "Lashon Korf", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 406, "name": "Addie Mandez", "age": null, "address": null, "interests": [ "Tennis", "Cigars", "Books" ], "children": [ { "name": "Rosendo Mandez", "age": 34 } ] }, "brec": { "cid": 489, "name": "Brigid Delosier", "age": 31, "address": { "number": 6082, "street": "Oak St.", "city": "Portland" }, "interests": [ "Tennis", "Cigars", "Music" ], "children": [ { "name": "Allegra Delosier", "age": null }, { "name": "Yong Delosier", "age": 10 }, { "name": "Steffanie Delosier", "age": 13 } ] }, "ed": 1 }
+{ "arec": { "cid": 406, "name": "Addie Mandez", "age": null, "address": null, "interests": [ "Tennis", "Cigars", "Books" ], "children": [ { "name": "Rosendo Mandez", "age": 34 } ] }, "brec": { "cid": 825, "name": "Kirstie Rinebold", "age": 57, "address": { "number": 9463, "street": "Oak St.", "city": "Portland" }, "interests": [ "Cooking", "Cigars", "Books" ], "children": [ { "name": "Vonda Rinebold", "age": null }, { "name": "Man Rinebold", "age": 21 } ] }, "ed": 1 }
+{ "arec": { "cid": 412, "name": "Devon Szalai", "age": 26, "address": { "number": 2384, "street": "Lake St.", "city": "Los Angeles" }, "interests": [ "Bass", "Books", "Books" ], "children": [ { "name": "Yolonda Szalai", "age": null }, { "name": "Denita Szalai", "age": null }, { "name": "Priscila Szalai", "age": 10 }, { "name": "Cassondra Szalai", "age": 12 } ] }, "brec": { "cid": 722, "name": "Noel Goncalves", "age": null, "address": null, "interests": [ "Books", "Bass", "Books", "Books" ], "children": [ { "name": "Latrice Goncalves", "age": null }, { "name": "Evelia Goncalves", "age": 36 }, { "name": "Etta Goncalves", "age": 11 }, { "name": "Collin Goncalves", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 417, "name": "Irene Funderberg", "age": 45, "address": { "number": 8503, "street": "Hill St.", "city": "Seattle" }, "interests": [ "Music", "Skiing", "Running" ], "children": [ { "name": "Lyndia Funderberg", "age": 14 }, { "name": "Herta Funderberg", "age": null } ] }, "brec": { "cid": 629, "name": "Mayola Clabo", "age": null, "address": null, "interests": [ "Basketball", "Skiing", "Running" ], "children": [ { "name": "Rigoberto Clabo", "age": 58 } ] }, "ed": 1 }
+{ "arec": { "cid": 417, "name": "Irene Funderberg", "age": 45, "address": { "number": 8503, "street": "Hill St.", "city": "Seattle" }, "interests": [ "Music", "Skiing", "Running" ], "children": [ { "name": "Lyndia Funderberg", "age": 14 }, { "name": "Herta Funderberg", "age": null } ] }, "brec": { "cid": 678, "name": "Lekisha Barnell", "age": null, "address": null, "interests": [ "Movies", "Skiing", "Running" ], "children": [ { "name": "August Barnell", "age": null }, { "name": "Tiffany Barnell", "age": 55 }, { "name": "Meghan Barnell", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 418, "name": "Gavin Delpino", "age": null, "address": null, "interests": [ "Basketball", "Skiing", "Wine", "Fishing" ], "children": [ { "name": "Gianna Delpino", "age": null }, { "name": "Carmella Delpino", "age": 55 } ] }, "brec": { "cid": 621, "name": "Theresa Satterthwaite", "age": 16, "address": { "number": 3249, "street": "Main St.", "city": "Mountain View" }, "interests": [ "Wine", "Skiing", "Wine", "Fishing" ], "children": [ { "name": "Rickie Satterthwaite", "age": null }, { "name": "Rina Satterthwaite", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 429, "name": "Eladia Scannell", "age": 20, "address": { "number": 5036, "street": "Main St.", "city": "Portland" }, "interests": [ "Skiing", "Music", "Movies" ], "children": [ ] }, "brec": { "cid": 518, "name": "Cora Ingargiola", "age": null, "address": null, "interests": [ "Skiing", "Squash", "Movies" ], "children": [ { "name": "Katlyn Ingargiola", "age": null }, { "name": "Mike Ingargiola", "age": null }, { "name": "Lawrence Ingargiola", "age": null }, { "name": "Isabelle Ingargiola", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 435, "name": "Britni Kazemi", "age": 69, "address": { "number": 7868, "street": "Main St.", "city": "San Jose" }, "interests": [ "Databases", "Music", "Wine" ], "children": [ ] }, "brec": { "cid": 587, "name": "Santos Monterio", "age": 36, "address": { "number": 4454, "street": "Oak St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Music", "Cooking" ], "children": [ { "name": "Lashonda Monterio", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 435, "name": "Britni Kazemi", "age": 69, "address": { "number": 7868, "street": "Main St.", "city": "San Jose" }, "interests": [ "Databases", "Music", "Wine" ], "children": [ ] }, "brec": { "cid": 624, "name": "Bong Lyall", "age": null, "address": null, "interests": [ "Databases", "Music", "Video Games" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 435, "name": "Britni Kazemi", "age": 69, "address": { "number": 7868, "street": "Main St.", "city": "San Jose" }, "interests": [ "Databases", "Music", "Wine" ], "children": [ ] }, "brec": { "cid": 694, "name": "Ariel Soltani", "age": null, "address": null, "interests": [ "Databases", "Music", "Puzzles" ], "children": [ { "name": "Aldo Soltani", "age": null }, { "name": "Anglea Soltani", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 435, "name": "Britni Kazemi", "age": 69, "address": { "number": 7868, "street": "Main St.", "city": "San Jose" }, "interests": [ "Databases", "Music", "Wine" ], "children": [ ] }, "brec": { "cid": 859, "name": "Mozelle Catillo", "age": 61, "address": { "number": 253, "street": "View St.", "city": "Los Angeles" }, "interests": [ "Databases", "Cooking", "Wine" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 435, "name": "Britni Kazemi", "age": 69, "address": { "number": 7868, "street": "Main St.", "city": "San Jose" }, "interests": [ "Databases", "Music", "Wine" ], "children": [ ] }, "brec": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Databases", "Fishing", "Wine" ], "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 438, "name": "Allegra Pefanis", "age": null, "address": null, "interests": [ "Computers", "Music", "Cigars" ], "children": [ ] }, "brec": { "cid": 440, "name": "Rosie Shappen", "age": null, "address": null, "interests": [ "Cooking", "Music", "Cigars" ], "children": [ { "name": "Jung Shappen", "age": 11 } ] }, "ed": 1 }
+{ "arec": { "cid": 444, "name": "Demetra Sava", "age": null, "address": null, "interests": [ "Music", "Fishing", "Databases", "Wine" ], "children": [ { "name": "Fidel Sava", "age": 16 } ] }, "brec": { "cid": 484, "name": "Bennie Dragaj", "age": null, "address": null, "interests": [ "Fishing", "Databases", "Wine" ], "children": [ { "name": "Viva Dragaj", "age": 13 } ] }, "ed": 1 }
+{ "arec": { "cid": 445, "name": "Walton Komo", "age": 16, "address": { "number": 8769, "street": "Main St.", "city": "Seattle" }, "interests": [ "Running", "Basketball", "Tennis" ], "children": [ ] }, "brec": { "cid": 828, "name": "Marcelle Steinhour", "age": null, "address": null, "interests": [ "Running", "Basketball", "Walking" ], "children": [ { "name": "Jimmie Steinhour", "age": 13 }, { "name": "Kirstie Steinhour", "age": 19 } ] }, "ed": 1 }
+{ "arec": { "cid": 445, "name": "Walton Komo", "age": 16, "address": { "number": 8769, "street": "Main St.", "city": "Seattle" }, "interests": [ "Running", "Basketball", "Tennis" ], "children": [ ] }, "brec": { "cid": 962, "name": "Taryn Coley", "age": null, "address": null, "interests": [ "Running", "Basketball", "Cooking" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 448, "name": "Gracie Pekas", "age": 59, "address": { "number": 4732, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Wine", "Cigars" ], "children": [ { "name": "Jeanett Pekas", "age": 35 }, { "name": "Jennifer Pekas", "age": null }, { "name": "Carrol Pekas", "age": null } ] }, "brec": { "cid": 927, "name": "Lillia Hartlein", "age": 55, "address": { "number": 5856, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Coffee", "Cigars" ], "children": [ { "name": "Nicky Hartlein", "age": null }, { "name": "Cassaundra Hartlein", "age": 10 }, { "name": "Micheline Hartlein", "age": 26 }, { "name": "Anton Hartlein", "age": 32 } ] }, "ed": 1 }
+{ "arec": { "cid": 453, "name": "Sherlyn Deadmond", "age": null, "address": null, "interests": [ "Tennis", "Puzzles", "Base Jumping" ], "children": [ { "name": "Torrie Deadmond", "age": 46 }, { "name": "Cleotilde Deadmond", "age": 55 }, { "name": "Garry Deadmond", "age": 34 }, { "name": "Valrie Deadmond", "age": null } ] }, "brec": { "cid": 734, "name": "Lera Korn", "age": null, "address": null, "interests": [ "Tennis", "Puzzles", "Cigars" ], "children": [ { "name": "Criselda Korn", "age": 37 } ] }, "ed": 1 }
+{ "arec": { "cid": 453, "name": "Sherlyn Deadmond", "age": null, "address": null, "interests": [ "Tennis", "Puzzles", "Base Jumping" ], "children": [ { "name": "Torrie Deadmond", "age": 46 }, { "name": "Cleotilde Deadmond", "age": 55 }, { "name": "Garry Deadmond", "age": 34 }, { "name": "Valrie Deadmond", "age": null } ] }, "brec": { "cid": 791, "name": "Jame Apresa", "age": 66, "address": { "number": 8417, "street": "Main St.", "city": "San Jose" }, "interests": [ "Running", "Puzzles", "Base Jumping" ], "children": [ { "name": "Awilda Apresa", "age": null }, { "name": "Nelle Apresa", "age": 40 }, { "name": "Terrell Apresa", "age": null }, { "name": "Malia Apresa", "age": 43 } ] }, "ed": 1 }
+{ "arec": { "cid": 455, "name": "Manual Altizer", "age": 70, "address": { "number": 6293, "street": "7th St.", "city": "Portland" }, "interests": [ "Running", "Fishing", "Coffee" ], "children": [ { "name": "Katherine Altizer", "age": null } ] }, "brec": { "cid": 488, "name": "Dannielle Wilkie", "age": null, "address": null, "interests": [ "Running", "Fishing", "Coffee", "Basketball" ], "children": [ { "name": "Vita Wilkie", "age": 17 }, { "name": "Marisa Wilkie", "age": null }, { "name": "Faustino Wilkie", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 473, "name": "Cordell Solas", "age": null, "address": null, "interests": [ "Squash", "Music", "Bass", "Puzzles" ], "children": [ { "name": "Douglass Solas", "age": null }, { "name": "Claribel Solas", "age": null }, { "name": "Fred Solas", "age": null }, { "name": "Ahmed Solas", "age": 21 } ] }, "brec": { "cid": 527, "name": "Lance Kenison", "age": 77, "address": { "number": 8750, "street": "Main St.", "city": "San Jose" }, "interests": [ "Squash", "Cooking", "Bass", "Puzzles" ], "children": [ { "name": "Youlanda Kenison", "age": null }, { "name": "Lavon Kenison", "age": null }, { "name": "Maryann Kenison", "age": 60 }, { "name": "Kecia Kenison", "age": 50 } ] }, "ed": 1 }
+{ "arec": { "cid": 484, "name": "Bennie Dragaj", "age": null, "address": null, "interests": [ "Fishing", "Databases", "Wine" ], "children": [ { "name": "Viva Dragaj", "age": 13 } ] }, "brec": { "cid": 986, "name": "Tennille Wikle", "age": 78, "address": { "number": 3428, "street": "View St.", "city": "Portland" }, "interests": [ "Movies", "Databases", "Wine" ], "children": [ { "name": "Lourie Wikle", "age": null }, { "name": "Laure Wikle", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 487, "name": "Zenia Virgilio", "age": 46, "address": { "number": 584, "street": "Main St.", "city": "Mountain View" }, "interests": [ "Walking", "Squash", "Wine" ], "children": [ { "name": "Quintin Virgilio", "age": null }, { "name": "Edith Virgilio", "age": null }, { "name": "Nicolle Virgilio", "age": 33 } ] }, "brec": { "cid": 735, "name": "Lonnie Bechel", "age": 36, "address": { "number": 592, "street": "Main St.", "city": "Sunnyvale" }, "interests": [ "Walking", "Cigars", "Squash", "Wine" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 496, "name": "Lonna Starkweather", "age": 80, "address": { "number": 1162, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Coffee", "Bass", "Running" ], "children": [ { "name": "Matilda Starkweather", "age": null } ] }, "brec": { "cid": 545, "name": "Dolores Ferer", "age": null, "address": null, "interests": [ "Coffee", "Bass", "Tennis" ], "children": [ { "name": "Bridgette Ferer", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 496, "name": "Lonna Starkweather", "age": 80, "address": { "number": 1162, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Coffee", "Bass", "Running" ], "children": [ { "name": "Matilda Starkweather", "age": null } ] }, "brec": { "cid": 580, "name": "Liana Gabbert", "age": null, "address": null, "interests": [ "Coffee", "Tennis", "Bass", "Running" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 498, "name": "Arleen Sultzer", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Norine Sultzer", "age": 29 } ] }, "brec": { "cid": 854, "name": "Angie Oyster", "age": 32, "address": { "number": 8860, "street": "Main St.", "city": "San Jose" }, "interests": [ "Coffee", "Movies", "Fishing" ], "children": [ { "name": "Hugh Oyster", "age": 10 } ] }, "ed": 1 }
+{ "arec": { "cid": 498, "name": "Arleen Sultzer", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Norine Sultzer", "age": 29 } ] }, "brec": { "cid": 984, "name": "Janett Kitchens", "age": 66, "address": { "number": 7558, "street": "View St.", "city": "Mountain View" }, "interests": [ "Coffee", "Movies", "Squash" ], "children": [ { "name": "Grayce Kitchens", "age": 14 }, { "name": "Dwayne Kitchens", "age": null }, { "name": "Wilber Kitchens", "age": 51 }, { "name": "Nancey Kitchens", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 522, "name": "Daryl Kissack", "age": 86, "address": { "number": 7825, "street": "Cedar St.", "city": "Mountain View" }, "interests": [ "Squash", "Base Jumping", "Tennis" ], "children": [ { "name": "Darrel Kissack", "age": 21 } ] }, "brec": { "cid": 633, "name": "Shalon Grauberger", "age": 34, "address": { "number": 765, "street": "Washington St.", "city": "Sunnyvale" }, "interests": [ "Music", "Base Jumping", "Tennis" ], "children": [ { "name": "Kris Grauberger", "age": 14 }, { "name": "Stuart Grauberger", "age": 12 }, { "name": "Billy Grauberger", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 522, "name": "Daryl Kissack", "age": 86, "address": { "number": 7825, "street": "Cedar St.", "city": "Mountain View" }, "interests": [ "Squash", "Base Jumping", "Tennis" ], "children": [ { "name": "Darrel Kissack", "age": 21 } ] }, "brec": { "cid": 812, "name": "Bee Godette", "age": 26, "address": { "number": 1757, "street": "Washington St.", "city": "Portland" }, "interests": [ "Video Games", "Base Jumping", "Tennis" ], "children": [ { "name": "Madaline Godette", "age": 10 }, { "name": "Shasta Godette", "age": 15 }, { "name": "Parthenia Godette", "age": 11 }, { "name": "Priscila Godette", "age": 13 } ] }, "ed": 1 }
+{ "arec": { "cid": 537, "name": "Mara Hugar", "age": null, "address": null, "interests": [ "Fishing", "Skiing", "Skiing" ], "children": [ { "name": "Krista Hugar", "age": null } ] }, "brec": { "cid": 600, "name": "Cordell Sherburn", "age": null, "address": null, "interests": [ "Squash", "Skiing", "Skiing" ], "children": [ { "name": "Shenna Sherburn", "age": 22 }, { "name": "Minna Sherburn", "age": 10 }, { "name": "Tari Sherburn", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 541, "name": "Sammy Adamitis", "age": 71, "address": { "number": 5593, "street": "Washington St.", "city": "Seattle" }, "interests": [ "Books", "Tennis", "Cooking" ], "children": [ ] }, "brec": { "cid": 913, "name": "Evelynn Fague", "age": 42, "address": { "number": 5729, "street": "7th St.", "city": "Seattle" }, "interests": [ "Books", "Databases", "Cooking" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 545, "name": "Dolores Ferer", "age": null, "address": null, "interests": [ "Coffee", "Bass", "Tennis" ], "children": [ { "name": "Bridgette Ferer", "age": null } ] }, "brec": { "cid": 566, "name": "Asley Grow", "age": null, "address": null, "interests": [ "Coffee", "Books", "Tennis" ], "children": [ { "name": "Dale Grow", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 562, "name": "Etta Hooton", "age": null, "address": null, "interests": [ "Databases", "Cigars", "Music", "Video Games" ], "children": [ { "name": "Sherice Hooton", "age": null }, { "name": "Estefana Hooton", "age": 38 }, { "name": "Nidia Hooton", "age": 47 }, { "name": "Erwin Hooton", "age": null } ] }, "brec": { "cid": 624, "name": "Bong Lyall", "age": null, "address": null, "interests": [ "Databases", "Music", "Video Games" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 563, "name": "Deirdre Landero", "age": null, "address": null, "interests": [ "Books", "Fishing", "Video Games" ], "children": [ { "name": "Norman Landero", "age": 59 }, { "name": "Jennine Landero", "age": 45 }, { "name": "Rutha Landero", "age": 19 }, { "name": "Jackie Landero", "age": 29 } ] }, "brec": { "cid": 941, "name": "Jamey Jakobson", "age": null, "address": null, "interests": [ "Books", "Cooking", "Video Games" ], "children": [ { "name": "Elmer Jakobson", "age": 14 }, { "name": "Minh Jakobson", "age": 30 } ] }, "ed": 1 }
+{ "arec": { "cid": 564, "name": "Inger Dargin", "age": 56, "address": { "number": 8704, "street": "View St.", "city": "Mountain View" }, "interests": [ "Wine", "Running", "Computers" ], "children": [ ] }, "brec": { "cid": 849, "name": "Kristen Zapalac", "age": 14, "address": { "number": 4087, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Wine", "Cooking", "Running", "Computers" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 566, "name": "Asley Grow", "age": null, "address": null, "interests": [ "Coffee", "Books", "Tennis" ], "children": [ { "name": "Dale Grow", "age": null } ] }, "brec": { "cid": 750, "name": "Rosaura Gaul", "age": null, "address": null, "interests": [ "Music", "Books", "Tennis" ], "children": [ { "name": "Letisha Gaul", "age": 41 } ] }, "ed": 1 }
+{ "arec": { "cid": 575, "name": "Phyliss Mattes", "age": 26, "address": { "number": 3956, "street": "Washington St.", "city": "Los Angeles" }, "interests": [ "Tennis", "Music", "Running", "Music" ], "children": [ ] }, "brec": { "cid": 757, "name": "Bertie Flemming", "age": null, "address": null, "interests": [ "Tennis", "Music", "Running", "Cooking" ], "children": [ { "name": "Temeka Flemming", "age": 46 }, { "name": "Terrance Flemming", "age": null }, { "name": "Jenette Flemming", "age": 23 }, { "name": "Debra Flemming", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 585, "name": "Young Drube", "age": 21, "address": { "number": 6960, "street": "View St.", "city": "Seattle" }, "interests": [ "Basketball", "Fishing", "Walking" ], "children": [ { "name": "Irwin Drube", "age": null }, { "name": "Gustavo Drube", "age": null } ] }, "brec": { "cid": 808, "name": "Brande Decius", "age": null, "address": null, "interests": [ "Basketball", "Fishing", "Puzzles" ], "children": [ { "name": "Li Decius", "age": 56 }, { "name": "Eusebio Decius", "age": 50 }, { "name": "Clementina Decius", "age": 29 } ] }, "ed": 1 }
+{ "arec": { "cid": 587, "name": "Santos Monterio", "age": 36, "address": { "number": 4454, "street": "Oak St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Music", "Cooking" ], "children": [ { "name": "Lashonda Monterio", "age": null } ] }, "brec": { "cid": 624, "name": "Bong Lyall", "age": null, "address": null, "interests": [ "Databases", "Music", "Video Games" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 587, "name": "Santos Monterio", "age": 36, "address": { "number": 4454, "street": "Oak St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Music", "Cooking" ], "children": [ { "name": "Lashonda Monterio", "age": null } ] }, "brec": { "cid": 694, "name": "Ariel Soltani", "age": null, "address": null, "interests": [ "Databases", "Music", "Puzzles" ], "children": [ { "name": "Aldo Soltani", "age": null }, { "name": "Anglea Soltani", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 588, "name": "Debora Laughinghouse", "age": 87, "address": { "number": 5099, "street": "View St.", "city": "San Jose" }, "interests": [ "Tennis", "Walking", "Databases" ], "children": [ { "name": "Frederica Laughinghouse", "age": 59 }, { "name": "Johnie Laughinghouse", "age": 12 }, { "name": "Numbers Laughinghouse", "age": 73 } ] }, "brec": { "cid": 853, "name": "Denisse Peralto", "age": 25, "address": { "number": 3931, "street": "7th St.", "city": "Portland" }, "interests": [ "Tennis", "Walking", "Basketball" ], "children": [ { "name": "Asha Peralto", "age": 14 }, { "name": "Clark Peralto", "age": null }, { "name": "Jessika Peralto", "age": null }, { "name": "Nadene Peralto", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 600, "name": "Cordell Sherburn", "age": null, "address": null, "interests": [ "Squash", "Skiing", "Skiing" ], "children": [ { "name": "Shenna Sherburn", "age": 22 }, { "name": "Minna Sherburn", "age": 10 }, { "name": "Tari Sherburn", "age": null } ] }, "brec": { "cid": 703, "name": "Susanne Pettey", "age": null, "address": null, "interests": [ "Squash", "Basketball", "Skiing" ], "children": [ { "name": "Nancey Pettey", "age": 35 }, { "name": "Lawana Pettey", "age": null }, { "name": "Percy Pettey", "age": 25 } ] }, "ed": 1 }
+{ "arec": { "cid": 602, "name": "Clyde Salada", "age": 59, "address": { "number": 8316, "street": "7th St.", "city": "Sunnyvale" }, "interests": [ "Movies", "Skiing", "Cooking" ], "children": [ ] }, "brec": { "cid": 678, "name": "Lekisha Barnell", "age": null, "address": null, "interests": [ "Movies", "Skiing", "Running" ], "children": [ { "name": "August Barnell", "age": null }, { "name": "Tiffany Barnell", "age": 55 }, { "name": "Meghan Barnell", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 614, "name": "Wallace Chaidy", "age": null, "address": null, "interests": [ "Bass", "Movies", "Music" ], "children": [ { "name": "Refugio Chaidy", "age": null }, { "name": "Hae Chaidy", "age": 55 }, { "name": "Julian Chaidy", "age": null }, { "name": "Tabatha Chaidy", "age": null } ] }, "brec": { "cid": 639, "name": "Zena Seehusen", "age": 24, "address": { "number": 6303, "street": "Hill St.", "city": "Mountain View" }, "interests": [ "Cooking", "Movies", "Music" ], "children": [ { "name": "Hester Seehusen", "age": null }, { "name": "Coreen Seehusen", "age": 12 } ] }, "ed": 1 }
+{ "arec": { "cid": 614, "name": "Wallace Chaidy", "age": null, "address": null, "interests": [ "Bass", "Movies", "Music" ], "children": [ { "name": "Refugio Chaidy", "age": null }, { "name": "Hae Chaidy", "age": 55 }, { "name": "Julian Chaidy", "age": null }, { "name": "Tabatha Chaidy", "age": null } ] }, "brec": { "cid": 803, "name": "Yolonda Korf", "age": null, "address": null, "interests": [ "Bass", "Skiing", "Music" ], "children": [ { "name": "Ivette Korf", "age": null }, { "name": "Lashon Korf", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 621, "name": "Theresa Satterthwaite", "age": 16, "address": { "number": 3249, "street": "Main St.", "city": "Mountain View" }, "interests": [ "Wine", "Skiing", "Wine", "Fishing" ], "children": [ { "name": "Rickie Satterthwaite", "age": null }, { "name": "Rina Satterthwaite", "age": null } ] }, "brec": { "cid": 929, "name": "Jean Guitierrez", "age": 75, "address": { "number": 9736, "street": "Lake St.", "city": "Mountain View" }, "interests": [ "Wine", "Wine", "Fishing" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 624, "name": "Bong Lyall", "age": null, "address": null, "interests": [ "Databases", "Music", "Video Games" ], "children": [ ] }, "brec": { "cid": 694, "name": "Ariel Soltani", "age": null, "address": null, "interests": [ "Databases", "Music", "Puzzles" ], "children": [ { "name": "Aldo Soltani", "age": null }, { "name": "Anglea Soltani", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 629, "name": "Mayola Clabo", "age": null, "address": null, "interests": [ "Basketball", "Skiing", "Running" ], "children": [ { "name": "Rigoberto Clabo", "age": 58 } ] }, "brec": { "cid": 678, "name": "Lekisha Barnell", "age": null, "address": null, "interests": [ "Movies", "Skiing", "Running" ], "children": [ { "name": "August Barnell", "age": null }, { "name": "Tiffany Barnell", "age": 55 }, { "name": "Meghan Barnell", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 633, "name": "Shalon Grauberger", "age": 34, "address": { "number": 765, "street": "Washington St.", "city": "Sunnyvale" }, "interests": [ "Music", "Base Jumping", "Tennis" ], "children": [ { "name": "Kris Grauberger", "age": 14 }, { "name": "Stuart Grauberger", "age": 12 }, { "name": "Billy Grauberger", "age": null } ] }, "brec": { "cid": 750, "name": "Rosaura Gaul", "age": null, "address": null, "interests": [ "Music", "Books", "Tennis" ], "children": [ { "name": "Letisha Gaul", "age": 41 } ] }, "ed": 1 }
+{ "arec": { "cid": 633, "name": "Shalon Grauberger", "age": 34, "address": { "number": 765, "street": "Washington St.", "city": "Sunnyvale" }, "interests": [ "Music", "Base Jumping", "Tennis" ], "children": [ { "name": "Kris Grauberger", "age": 14 }, { "name": "Stuart Grauberger", "age": 12 }, { "name": "Billy Grauberger", "age": null } ] }, "brec": { "cid": 812, "name": "Bee Godette", "age": 26, "address": { "number": 1757, "street": "Washington St.", "city": "Portland" }, "interests": [ "Video Games", "Base Jumping", "Tennis" ], "children": [ { "name": "Madaline Godette", "age": 10 }, { "name": "Shasta Godette", "age": 15 }, { "name": "Parthenia Godette", "age": 11 }, { "name": "Priscila Godette", "age": 13 } ] }, "ed": 1 }
+{ "arec": { "cid": 649, "name": "Anisha Sender", "age": null, "address": null, "interests": [ "Tennis", "Databases", "Bass" ], "children": [ { "name": "Viva Sender", "age": 40 }, { "name": "Terica Sender", "age": null } ] }, "brec": { "cid": 661, "name": "Lorita Kraut", "age": 43, "address": { "number": 5017, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Tennis", "Movies", "Bass" ], "children": [ { "name": "Mirian Kraut", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 649, "name": "Anisha Sender", "age": null, "address": null, "interests": [ "Tennis", "Databases", "Bass" ], "children": [ { "name": "Viva Sender", "age": 40 }, { "name": "Terica Sender", "age": null } ] }, "brec": { "cid": 928, "name": "Maddie Diclaudio", "age": 33, "address": { "number": 4674, "street": "Washington St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Databases", "Bass" ], "children": [ { "name": "Dominique Diclaudio", "age": 12 } ] }, "ed": 1 }
+{ "arec": { "cid": 655, "name": "Shaun Brandenburg", "age": null, "address": null, "interests": [ "Skiing", "Computers", "Base Jumping" ], "children": [ { "name": "Ned Brandenburg", "age": null }, { "name": "Takako Brandenburg", "age": 41 }, { "name": "Astrid Brandenburg", "age": null }, { "name": "Patience Brandenburg", "age": null } ] }, "brec": { "cid": 996, "name": "Elouise Wider", "age": null, "address": null, "interests": [ "Coffee", "Computers", "Base Jumping" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 658, "name": "Truman Leitner", "age": null, "address": null, "interests": [ "Computers", "Bass", "Walking" ], "children": [ ] }, "brec": { "cid": 838, "name": "Karan Aharon", "age": 88, "address": { "number": 8033, "street": "Washington St.", "city": "Portland" }, "interests": [ "Computers", "Movies", "Walking" ], "children": [ { "name": "Matha Aharon", "age": 16 } ] }, "ed": 1 }
+{ "arec": { "cid": 662, "name": "Domonique Corbi", "age": 13, "address": { "number": 7286, "street": "Hill St.", "city": "Seattle" }, "interests": [ "Tennis", "Cooking", "Computers" ], "children": [ { "name": "Katrice Corbi", "age": null }, { "name": "Idalia Corbi", "age": null }, { "name": "Hayley Corbi", "age": null } ] }, "brec": { "cid": 964, "name": "Stephany Soders", "age": null, "address": null, "interests": [ "Tennis", "Wine", "Computers" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 670, "name": "Angelo Kellar", "age": 22, "address": { "number": 3178, "street": "View St.", "city": "Seattle" }, "interests": [ "Wine", "Music", "Fishing" ], "children": [ { "name": "Zula Kellar", "age": null }, { "name": "Brittaney Kellar", "age": 10 }, { "name": "Fredia Kellar", "age": null } ] }, "brec": { "cid": 929, "name": "Jean Guitierrez", "age": 75, "address": { "number": 9736, "street": "Lake St.", "city": "Mountain View" }, "interests": [ "Wine", "Wine", "Fishing" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 694, "name": "Ariel Soltani", "age": null, "address": null, "interests": [ "Databases", "Music", "Puzzles" ], "children": [ { "name": "Aldo Soltani", "age": null }, { "name": "Anglea Soltani", "age": null } ] }, "brec": { "cid": 916, "name": "Kris Mcmarlin", "age": null, "address": null, "interests": [ "Movies", "Music", "Puzzles" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 704, "name": "Melodee Clemons", "age": null, "address": null, "interests": [ "Base Jumping", "Tennis", "Video Games" ], "children": [ { "name": "Doreatha Clemons", "age": 22 } ] }, "brec": { "cid": 901, "name": "Riva Ziko", "age": null, "address": null, "interests": [ "Running", "Tennis", "Video Games" ], "children": [ { "name": "Leandra Ziko", "age": 49 }, { "name": "Torrie Ziko", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 704, "name": "Melodee Clemons", "age": null, "address": null, "interests": [ "Base Jumping", "Tennis", "Video Games" ], "children": [ { "name": "Doreatha Clemons", "age": 22 } ] }, "brec": { "cid": 948, "name": "Thad Scialpi", "age": 22, "address": { "number": 8731, "street": "Washington St.", "city": "Portland" }, "interests": [ "Base Jumping", "Tennis", "Wine" ], "children": [ { "name": "Harlan Scialpi", "age": 10 }, { "name": "Lucile Scialpi", "age": 11 }, { "name": "Audria Scialpi", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 710, "name": "Arlen Horka", "age": null, "address": null, "interests": [ "Movies", "Coffee", "Walking" ], "children": [ { "name": "Valencia Horka", "age": null }, { "name": "Wesley Horka", "age": null } ] }, "brec": { "cid": 923, "name": "Bobbi Ursino", "age": null, "address": null, "interests": [ "Movies", "Books", "Walking" ], "children": [ { "name": "Shon Ursino", "age": null }, { "name": "Lorean Ursino", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 744, "name": "Crysta Christen", "age": 57, "address": { "number": 439, "street": "Hill St.", "city": "Portland" }, "interests": [ "Basketball", "Squash", "Base Jumping" ], "children": [ ] }, "brec": { "cid": 856, "name": "Inocencia Petzold", "age": 83, "address": { "number": 4631, "street": "Cedar St.", "city": "Mountain View" }, "interests": [ "Basketball", "Squash", "Movies", "Base Jumping" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 769, "name": "Isaias Tenny", "age": 71, "address": { "number": 270, "street": "Park St.", "city": "Portland" }, "interests": [ "Wine", "Fishing", "Base Jumping" ], "children": [ { "name": "Theo Tenny", "age": null }, { "name": "Shena Tenny", "age": null }, { "name": "Coralee Tenny", "age": null }, { "name": "Orval Tenny", "age": 39 } ] }, "brec": { "cid": 848, "name": "Myrta Kopf", "age": null, "address": null, "interests": [ "Wine", "Basketball", "Base Jumping" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 776, "name": "Dagmar Sarkis", "age": null, "address": null, "interests": [ "Basketball", "Running", "Wine" ], "children": [ { "name": "Tari Sarkis", "age": null }, { "name": "Rana Sarkis", "age": 56 }, { "name": "Merissa Sarkis", "age": null }, { "name": "Lori Sarkis", "age": 26 } ] }, "brec": { "cid": 908, "name": "Ferdinand Auila", "age": 82, "address": { "number": 1071, "street": "Lake St.", "city": "Portland" }, "interests": [ "Base Jumping", "Running", "Wine" ], "children": [ { "name": "Ai Auila", "age": 69 }, { "name": "Laurel Auila", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 791, "name": "Jame Apresa", "age": 66, "address": { "number": 8417, "street": "Main St.", "city": "San Jose" }, "interests": [ "Running", "Puzzles", "Base Jumping" ], "children": [ { "name": "Awilda Apresa", "age": null }, { "name": "Nelle Apresa", "age": 40 }, { "name": "Terrell Apresa", "age": null }, { "name": "Malia Apresa", "age": 43 } ] }, "brec": { "cid": 801, "name": "Julio Brun", "age": 13, "address": { "number": 9774, "street": "Main St.", "city": "Sunnyvale" }, "interests": [ "Puzzles", "Running", "Puzzles", "Base Jumping" ], "children": [ { "name": "Peter Brun", "age": null }, { "name": "Remona Brun", "age": null }, { "name": "Giovanni Brun", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 806, "name": "Corliss Sharratt", "age": null, "address": null, "interests": [ "Basketball", "Cigars", "Cooking" ], "children": [ { "name": "Albertine Sharratt", "age": null }, { "name": "Nobuko Sharratt", "age": 29 }, { "name": "Neil Sharratt", "age": null } ] }, "brec": { "cid": 861, "name": "Hugh Mcbrien", "age": null, "address": null, "interests": [ "Skiing", "Cigars", "Cooking" ], "children": [ { "name": "Otha Mcbrien", "age": 38 } ] }, "ed": 1 }
+{ "arec": { "cid": 806, "name": "Corliss Sharratt", "age": null, "address": null, "interests": [ "Basketball", "Cigars", "Cooking" ], "children": [ { "name": "Albertine Sharratt", "age": null }, { "name": "Nobuko Sharratt", "age": 29 }, { "name": "Neil Sharratt", "age": null } ] }, "brec": { "cid": 867, "name": "Denise Dipiero", "age": null, "address": null, "interests": [ "Basketball", "Cigars", "Cooking", "Running" ], "children": [ { "name": "Santa Dipiero", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 828, "name": "Marcelle Steinhour", "age": null, "address": null, "interests": [ "Running", "Basketball", "Walking" ], "children": [ { "name": "Jimmie Steinhour", "age": 13 }, { "name": "Kirstie Steinhour", "age": 19 } ] }, "brec": { "cid": 962, "name": "Taryn Coley", "age": null, "address": null, "interests": [ "Running", "Basketball", "Cooking" ], "children": [ ] }, "ed": 1 }
+{ "arec": { "cid": 853, "name": "Denisse Peralto", "age": 25, "address": { "number": 3931, "street": "7th St.", "city": "Portland" }, "interests": [ "Tennis", "Walking", "Basketball" ], "children": [ { "name": "Asha Peralto", "age": 14 }, { "name": "Clark Peralto", "age": null }, { "name": "Jessika Peralto", "age": null }, { "name": "Nadene Peralto", "age": null } ] }, "brec": { "cid": 912, "name": "Alessandra Kaskey", "age": 52, "address": { "number": 6906, "street": "View St.", "city": "Los Angeles" }, "interests": [ "Skiing", "Walking", "Basketball" ], "children": [ { "name": "Mack Kaskey", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 854, "name": "Angie Oyster", "age": 32, "address": { "number": 8860, "street": "Main St.", "city": "San Jose" }, "interests": [ "Coffee", "Movies", "Fishing" ], "children": [ { "name": "Hugh Oyster", "age": 10 } ] }, "brec": { "cid": 875, "name": "Ramon Crepps", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Elisha Crepps", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 854, "name": "Angie Oyster", "age": 32, "address": { "number": 8860, "street": "Main St.", "city": "San Jose" }, "interests": [ "Coffee", "Movies", "Fishing" ], "children": [ { "name": "Hugh Oyster", "age": 10 } ] }, "brec": { "cid": 984, "name": "Janett Kitchens", "age": 66, "address": { "number": 7558, "street": "View St.", "city": "Mountain View" }, "interests": [ "Coffee", "Movies", "Squash" ], "children": [ { "name": "Grayce Kitchens", "age": 14 }, { "name": "Dwayne Kitchens", "age": null }, { "name": "Wilber Kitchens", "age": 51 }, { "name": "Nancey Kitchens", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 859, "name": "Mozelle Catillo", "age": 61, "address": { "number": 253, "street": "View St.", "city": "Los Angeles" }, "interests": [ "Databases", "Cooking", "Wine" ], "children": [ ] }, "brec": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Databases", "Fishing", "Wine" ], "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 875, "name": "Ramon Crepps", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Elisha Crepps", "age": null } ] }, "brec": { "cid": 984, "name": "Janett Kitchens", "age": 66, "address": { "number": 7558, "street": "View St.", "city": "Mountain View" }, "interests": [ "Coffee", "Movies", "Squash" ], "children": [ { "name": "Grayce Kitchens", "age": 14 }, { "name": "Dwayne Kitchens", "age": null }, { "name": "Wilber Kitchens", "age": 51 }, { "name": "Nancey Kitchens", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 892, "name": "Madge Hendson", "age": 79, "address": { "number": 8832, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Databases", "Fishing", "Skiing" ], "children": [ { "name": "Elia Hendson", "age": 48 }, { "name": "Lashawn Hendson", "age": 27 } ] }, "brec": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Databases", "Fishing", "Wine" ], "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] }, "ed": 1 }
+{ "arec": { "cid": 908, "name": "Ferdinand Auila", "age": 82, "address": { "number": 1071, "street": "Lake St.", "city": "Portland" }, "interests": [ "Base Jumping", "Running", "Wine" ], "children": [ { "name": "Ai Auila", "age": 69 }, { "name": "Laurel Auila", "age": null } ] }, "brec": { "cid": 948, "name": "Thad Scialpi", "age": 22, "address": { "number": 8731, "street": "Washington St.", "city": "Portland" }, "interests": [ "Base Jumping", "Tennis", "Wine" ], "children": [ { "name": "Harlan Scialpi", "age": 10 }, { "name": "Lucile Scialpi", "age": 11 }, { "name": "Audria Scialpi", "age": null } ] }, "ed": 1 }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join/olist-edit-distance.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/olist-edit-distance.adm
new file mode 100644
index 0000000..c7f3d4d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/olist-edit-distance.adm
@@ -0,0 +1,157 @@
+{ "arec": { "cid": 8, "name": "Audria Haylett", "age": 44, "address": { "number": 4872, "street": "Washington St.", "city": "Portland" }, "interests": [ "Cooking", "Fishing", "Video Games" ], "children": [ { "name": "Lacie Haylett", "age": 19 } ] }, "brec": { "cid": 563, "name": "Deirdre Landero", "age": null, "address": null, "interests": [ "Books", "Fishing", "Video Games" ], "children": [ { "name": "Norman Landero", "age": 59 }, { "name": "Jennine Landero", "age": 45 }, { "name": "Rutha Landero", "age": 19 }, { "name": "Jackie Landero", "age": 29 } ] } }
+{ "arec": { "cid": 16, "name": "Felisa Auletta", "age": 55, "address": { "number": 7737, "street": "View St.", "city": "San Jose" }, "interests": [ "Skiing", "Coffee", "Wine" ], "children": [ { "name": "Rosalia Auletta", "age": 36 } ] }, "brec": { "cid": 273, "name": "Corrinne Seaquist", "age": 24, "address": { "number": 6712, "street": "7th St.", "city": "Portland" }, "interests": [ "Puzzles", "Coffee", "Wine" ], "children": [ { "name": "Mignon Seaquist", "age": null }, { "name": "Leo Seaquist", "age": null } ] } }
+{ "arec": { "cid": 16, "name": "Felisa Auletta", "age": 55, "address": { "number": 7737, "street": "View St.", "city": "San Jose" }, "interests": [ "Skiing", "Coffee", "Wine" ], "children": [ { "name": "Rosalia Auletta", "age": 36 } ] }, "brec": { "cid": 618, "name": "Janella Hurtt", "age": null, "address": null, "interests": [ "Skiing", "Coffee", "Skiing" ], "children": [ { "name": "Lupe Hurtt", "age": 17 }, { "name": "Jae Hurtt", "age": 14 }, { "name": "Evan Hurtt", "age": 45 } ] } }
+{ "arec": { "cid": 17, "name": "Ingeborg Monkhouse", "age": null, "address": null, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] }, "brec": { "cid": 156, "name": "Bobbye Kauppi", "age": 79, "address": { "number": 2051, "street": "Hill St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] } }
+{ "arec": { "cid": 17, "name": "Ingeborg Monkhouse", "age": null, "address": null, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] }, "brec": { "cid": 462, "name": "Margaret Galvis", "age": null, "address": null, "interests": [ "Base Jumping", "Movies", "Movies" ], "children": [ { "name": "Isaac Galvis", "age": 48 }, { "name": "Mei Galvis", "age": null }, { "name": "Asha Galvis", "age": null }, { "name": "Zachery Galvis", "age": null } ] } }
+{ "arec": { "cid": 17, "name": "Ingeborg Monkhouse", "age": null, "address": null, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] }, "brec": { "cid": 666, "name": "Pamila Burzlaff", "age": 68, "address": { "number": 6543, "street": "View St.", "city": "Portland" }, "interests": [ "Squash", "Cigars", "Movies" ], "children": [ ] } }
+{ "arec": { "cid": 18, "name": "Dewayne Ardan", "age": 32, "address": { "number": 8229, "street": "Hill St.", "city": "San Jose" }, "interests": [ "Wine", "Walking", "Bass" ], "children": [ { "name": "Wen Ardan", "age": null }, { "name": "Sachiko Ardan", "age": 11 }, { "name": "Francis Ardan", "age": 20 } ] }, "brec": { "cid": 846, "name": "Kieth Norlund", "age": 15, "address": { "number": 4039, "street": "Park St.", "city": "Mountain View" }, "interests": [ "Wine", "Walking", "Puzzles" ], "children": [ { "name": "Shawn Norlund", "age": null } ] } }
+{ "arec": { "cid": 35, "name": "Saundra Aparo", "age": 86, "address": { "number": 9550, "street": "Lake St.", "city": "Portland" }, "interests": [ "Cigars", "Skiing", "Video Games", "Books" ], "children": [ ] }, "brec": { "cid": 926, "name": "Krishna Barkdull", "age": 31, "address": { "number": 2640, "street": "Cedar St.", "city": "Sunnyvale" }, "interests": [ "Cigars", "Skiing", "Video Games", "Coffee" ], "children": [ { "name": "Nilsa Barkdull", "age": null }, { "name": "Denver Barkdull", "age": 10 }, { "name": "Jenell Barkdull", "age": 15 } ] } }
+{ "arec": { "cid": 51, "name": "Simonne Cape", "age": null, "address": null, "interests": [ "Bass", "Bass", "Books" ], "children": [ { "name": "Leland Cape", "age": null }, { "name": "Gearldine Cape", "age": null } ] }, "brec": { "cid": 232, "name": "Joey Potes", "age": null, "address": null, "interests": [ "Bass", "Bass", "Base Jumping" ], "children": [ { "name": "Bobby Potes", "age": null } ] } }
+{ "arec": { "cid": 51, "name": "Simonne Cape", "age": null, "address": null, "interests": [ "Bass", "Bass", "Books" ], "children": [ { "name": "Leland Cape", "age": null }, { "name": "Gearldine Cape", "age": null } ] }, "brec": { "cid": 412, "name": "Devon Szalai", "age": 26, "address": { "number": 2384, "street": "Lake St.", "city": "Los Angeles" }, "interests": [ "Bass", "Books", "Books" ], "children": [ { "name": "Yolonda Szalai", "age": null }, { "name": "Denita Szalai", "age": null }, { "name": "Priscila Szalai", "age": 10 }, { "name": "Cassondra Szalai", "age": 12 } ] } }
+{ "arec": { "cid": 70, "name": "Mellisa Lek", "age": 62, "address": { "number": 4281, "street": "Oak St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Databases" ], "children": [ ] }, "brec": { "cid": 229, "name": "Raymundo Meurin", "age": null, "address": null, "interests": [ "Bass", "Basketball", "Databases" ], "children": [ { "name": "Mariela Meurin", "age": null } ] } }
+{ "arec": { "cid": 70, "name": "Mellisa Lek", "age": 62, "address": { "number": 4281, "street": "Oak St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Databases" ], "children": [ ] }, "brec": { "cid": 371, "name": "Agatha Tensley", "age": 13, "address": { "number": 1810, "street": "Hill St.", "city": "San Jose" }, "interests": [ "Bass", "Running", "Movies" ], "children": [ { "name": "Launa Tensley", "age": null } ] } }
+{ "arec": { "cid": 70, "name": "Mellisa Lek", "age": 62, "address": { "number": 4281, "street": "Oak St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Databases" ], "children": [ ] }, "brec": { "cid": 387, "name": "Leonard Mabie", "age": 33, "address": { "number": 6703, "street": "View St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Walking" ], "children": [ { "name": "Jone Mabie", "age": 16 }, { "name": "Claire Mabie", "age": null }, { "name": "Larraine Mabie", "age": null }, { "name": "Corrina Mabie", "age": null } ] } }
+{ "arec": { "cid": 70, "name": "Mellisa Lek", "age": 62, "address": { "number": 4281, "street": "Oak St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Databases" ], "children": [ ] }, "brec": { "cid": 424, "name": "Camila Rightmire", "age": 25, "address": { "number": 7542, "street": "Oak St.", "city": "Sunnyvale" }, "interests": [ "Bass", "Running", "Puzzles" ], "children": [ { "name": "Donny Rightmire", "age": 14 }, { "name": "Karlene Rightmire", "age": 10 }, { "name": "Nicholas Rightmire", "age": null }, { "name": "Margareta Rightmire", "age": null } ] } }
+{ "arec": { "cid": 72, "name": "Clarissa Geraldes", "age": 67, "address": { "number": 8248, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Cigars", "Walking", "Databases", "Video Games" ], "children": [ { "name": "Vina Geraldes", "age": 51 } ] }, "brec": { "cid": 919, "name": "Fairy Wansley", "age": 45, "address": { "number": 9020, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Wine", "Walking", "Databases", "Video Games" ], "children": [ { "name": "Marvella Wansley", "age": null }, { "name": "Hisako Wansley", "age": null }, { "name": "Shaunta Wansley", "age": null }, { "name": "Gemma Wansley", "age": 21 } ] } }
+{ "arec": { "cid": 73, "name": "Kelsey Flever", "age": 20, "address": { "number": 3555, "street": "Main St.", "city": "Portland" }, "interests": [ "Tennis", "Puzzles", "Video Games" ], "children": [ { "name": "Isis Flever", "age": null }, { "name": "Gonzalo Flever", "age": null } ] }, "brec": { "cid": 453, "name": "Sherlyn Deadmond", "age": null, "address": null, "interests": [ "Tennis", "Puzzles", "Base Jumping" ], "children": [ { "name": "Torrie Deadmond", "age": 46 }, { "name": "Cleotilde Deadmond", "age": 55 }, { "name": "Garry Deadmond", "age": 34 }, { "name": "Valrie Deadmond", "age": null } ] } }
+{ "arec": { "cid": 73, "name": "Kelsey Flever", "age": 20, "address": { "number": 3555, "street": "Main St.", "city": "Portland" }, "interests": [ "Tennis", "Puzzles", "Video Games" ], "children": [ { "name": "Isis Flever", "age": null }, { "name": "Gonzalo Flever", "age": null } ] }, "brec": { "cid": 734, "name": "Lera Korn", "age": null, "address": null, "interests": [ "Tennis", "Puzzles", "Cigars" ], "children": [ { "name": "Criselda Korn", "age": 37 } ] } }
+{ "arec": { "cid": 77, "name": "Chantal Parriera", "age": 78, "address": { "number": 5967, "street": "Lake St.", "city": "San Jose" }, "interests": [ "Squash", "Movies", "Coffee" ], "children": [ ] }, "brec": { "cid": 909, "name": "Mariko Sharar", "age": null, "address": null, "interests": [ "Squash", "Movies", "Computers" ], "children": [ ] } }
+{ "arec": { "cid": 78, "name": "Wesley Huggler", "age": 80, "address": { "number": 3078, "street": "7th St.", "city": "Los Angeles" }, "interests": [ "Base Jumping", "Movies", "Skiing" ], "children": [ { "name": "Chassidy Huggler", "age": null }, { "name": "Emogene Huggler", "age": null }, { "name": "Cheryle Huggler", "age": null } ] }, "brec": { "cid": 88, "name": "Courtney Muckleroy", "age": null, "address": null, "interests": [ "Wine", "Movies", "Skiing" ], "children": [ { "name": "Alona Muckleroy", "age": 30 }, { "name": "Flora Muckleroy", "age": 41 }, { "name": "Angel Muckleroy", "age": null }, { "name": "Daniella Muckleroy", "age": null } ] } }
+{ "arec": { "cid": 78, "name": "Wesley Huggler", "age": 80, "address": { "number": 3078, "street": "7th St.", "city": "Los Angeles" }, "interests": [ "Base Jumping", "Movies", "Skiing" ], "children": [ { "name": "Chassidy Huggler", "age": null }, { "name": "Emogene Huggler", "age": null }, { "name": "Cheryle Huggler", "age": null } ] }, "brec": { "cid": 462, "name": "Margaret Galvis", "age": null, "address": null, "interests": [ "Base Jumping", "Movies", "Movies" ], "children": [ { "name": "Isaac Galvis", "age": 48 }, { "name": "Mei Galvis", "age": null }, { "name": "Asha Galvis", "age": null }, { "name": "Zachery Galvis", "age": null } ] } }
+{ "arec": { "cid": 78, "name": "Wesley Huggler", "age": 80, "address": { "number": 3078, "street": "7th St.", "city": "Los Angeles" }, "interests": [ "Base Jumping", "Movies", "Skiing" ], "children": [ { "name": "Chassidy Huggler", "age": null }, { "name": "Emogene Huggler", "age": null }, { "name": "Cheryle Huggler", "age": null } ] }, "brec": { "cid": 498, "name": "Arleen Sultzer", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Norine Sultzer", "age": 29 } ] } }
+{ "arec": { "cid": 78, "name": "Wesley Huggler", "age": 80, "address": { "number": 3078, "street": "7th St.", "city": "Los Angeles" }, "interests": [ "Base Jumping", "Movies", "Skiing" ], "children": [ { "name": "Chassidy Huggler", "age": null }, { "name": "Emogene Huggler", "age": null }, { "name": "Cheryle Huggler", "age": null } ] }, "brec": { "cid": 875, "name": "Ramon Crepps", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Elisha Crepps", "age": null } ] } }
+{ "arec": { "cid": 84, "name": "Huong Kachel", "age": null, "address": null, "interests": [ "Music", "Tennis", "Base Jumping" ], "children": [ { "name": "Katlyn Kachel", "age": 40 }, { "name": "Sherman Kachel", "age": null }, { "name": "Susana Kachel", "age": 32 } ] }, "brec": { "cid": 326, "name": "Tad Tellers", "age": null, "address": null, "interests": [ "Books", "Tennis", "Base Jumping" ], "children": [ { "name": "Fannie Tellers", "age": null } ] } }
+{ "arec": { "cid": 88, "name": "Courtney Muckleroy", "age": null, "address": null, "interests": [ "Wine", "Movies", "Skiing" ], "children": [ { "name": "Alona Muckleroy", "age": 30 }, { "name": "Flora Muckleroy", "age": 41 }, { "name": "Angel Muckleroy", "age": null }, { "name": "Daniella Muckleroy", "age": null } ] }, "brec": { "cid": 498, "name": "Arleen Sultzer", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Norine Sultzer", "age": 29 } ] } }
+{ "arec": { "cid": 88, "name": "Courtney Muckleroy", "age": null, "address": null, "interests": [ "Wine", "Movies", "Skiing" ], "children": [ { "name": "Alona Muckleroy", "age": 30 }, { "name": "Flora Muckleroy", "age": 41 }, { "name": "Angel Muckleroy", "age": null }, { "name": "Daniella Muckleroy", "age": null } ] }, "brec": { "cid": 875, "name": "Ramon Crepps", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Elisha Crepps", "age": null } ] } }
+{ "arec": { "cid": 101, "name": "Meaghan Vandel", "age": null, "address": null, "interests": [ "Music", "Base Jumping", "Books" ], "children": [ { "name": "Larissa Vandel", "age": null } ] }, "brec": { "cid": 633, "name": "Shalon Grauberger", "age": 34, "address": { "number": 765, "street": "Washington St.", "city": "Sunnyvale" }, "interests": [ "Music", "Base Jumping", "Tennis" ], "children": [ { "name": "Kris Grauberger", "age": 14 }, { "name": "Stuart Grauberger", "age": 12 }, { "name": "Billy Grauberger", "age": null } ] } }
+{ "arec": { "cid": 101, "name": "Meaghan Vandel", "age": null, "address": null, "interests": [ "Music", "Base Jumping", "Books" ], "children": [ { "name": "Larissa Vandel", "age": null } ] }, "brec": { "cid": 967, "name": "Melida Laliotis", "age": null, "address": null, "interests": [ "Music", "Base Jumping", "Coffee", "Books" ], "children": [ { "name": "Lai Laliotis", "age": 52 }, { "name": "Jillian Laliotis", "age": 11 } ] } }
+{ "arec": { "cid": 115, "name": "Jason Oakden", "age": 89, "address": { "number": 8182, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Music", "Basketball", "Movies" ], "children": [ { "name": "Johnson Oakden", "age": null }, { "name": "Neva Oakden", "age": null }, { "name": "Juliann Oakden", "age": null }, { "name": "Elmer Oakden", "age": null } ] }, "brec": { "cid": 827, "name": "Clementina Papin", "age": null, "address": null, "interests": [ "Music", "Basketball", "Cigars" ], "children": [ { "name": "Catina Papin", "age": null }, { "name": "Demetrius Papin", "age": 59 }, { "name": "Marylou Papin", "age": 12 }, { "name": "Apryl Papin", "age": 16 } ] } }
+{ "arec": { "cid": 120, "name": "Jan Gianandrea", "age": null, "address": null, "interests": [ "Databases", "Movies", "Cigars" ], "children": [ { "name": "Keesha Gianandrea", "age": null }, { "name": "Vashti Gianandrea", "age": 35 }, { "name": "Larry Gianandrea", "age": 29 } ] }, "brec": { "cid": 397, "name": "Blake Kealy", "age": 34, "address": { "number": 2156, "street": "Cedar St.", "city": "Los Angeles" }, "interests": [ "Databases", "Wine", "Cigars" ], "children": [ { "name": "Lorenza Kealy", "age": null }, { "name": "Beula Kealy", "age": 15 }, { "name": "Kristofer Kealy", "age": null }, { "name": "Shayne Kealy", "age": null } ] } }
+{ "arec": { "cid": 120, "name": "Jan Gianandrea", "age": null, "address": null, "interests": [ "Databases", "Movies", "Cigars" ], "children": [ { "name": "Keesha Gianandrea", "age": null }, { "name": "Vashti Gianandrea", "age": 35 }, { "name": "Larry Gianandrea", "age": 29 } ] }, "brec": { "cid": 636, "name": "Babara Shore", "age": 83, "address": { "number": 9452, "street": "Oak St.", "city": "Los Angeles" }, "interests": [ "Databases", "Movies", "Tennis" ], "children": [ { "name": "Candy Shore", "age": 58 }, { "name": "Nanci Shore", "age": null }, { "name": "Asia Shore", "age": null } ] } }
+{ "arec": { "cid": 120, "name": "Jan Gianandrea", "age": null, "address": null, "interests": [ "Databases", "Movies", "Cigars" ], "children": [ { "name": "Keesha Gianandrea", "age": null }, { "name": "Vashti Gianandrea", "age": 35 }, { "name": "Larry Gianandrea", "age": 29 } ] }, "brec": { "cid": 992, "name": "Staci Alexandropoul", "age": null, "address": null, "interests": [ "Databases", "Movies", "Tennis" ], "children": [ { "name": "Casimira Alexandropoul", "age": null }, { "name": "Kena Alexandropoul", "age": 54 }, { "name": "Ellie Alexandropoul", "age": null }, { "name": "Ambrose Alexandropoul", "age": null } ] } }
+{ "arec": { "cid": 137, "name": "Camellia Pressman", "age": 81, "address": { "number": 3947, "street": "Park St.", "city": "Seattle" }, "interests": [ "Movies", "Books", "Bass" ], "children": [ { "name": "Dwana Pressman", "age": null }, { "name": "Johnathan Pressman", "age": null }, { "name": "Kasey Pressman", "age": null }, { "name": "Mitch Pressman", "age": null } ] }, "brec": { "cid": 923, "name": "Bobbi Ursino", "age": null, "address": null, "interests": [ "Movies", "Books", "Walking" ], "children": [ { "name": "Shon Ursino", "age": null }, { "name": "Lorean Ursino", "age": null } ] } }
+{ "arec": { "cid": 139, "name": "Micheline Argenal", "age": null, "address": null, "interests": [ "Bass", "Walking", "Movies" ], "children": [ { "name": "Joye Argenal", "age": 51 }, { "name": "Richard Argenal", "age": 46 }, { "name": "Sarah Argenal", "age": 21 }, { "name": "Jacinda Argenal", "age": 21 } ] }, "brec": { "cid": 371, "name": "Agatha Tensley", "age": 13, "address": { "number": 1810, "street": "Hill St.", "city": "San Jose" }, "interests": [ "Bass", "Running", "Movies" ], "children": [ { "name": "Launa Tensley", "age": null } ] } }
+{ "arec": { "cid": 141, "name": "Adena Klockars", "age": null, "address": null, "interests": [ "Skiing", "Computers", "Bass", "Cigars" ], "children": [ ] }, "brec": { "cid": 794, "name": "Annabel Leins", "age": 75, "address": { "number": 9761, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Bass", "Computers", "Bass", "Cigars" ], "children": [ { "name": "Oswaldo Leins", "age": 21 } ] } }
+{ "arec": { "cid": 156, "name": "Bobbye Kauppi", "age": 79, "address": { "number": 2051, "street": "Hill St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] }, "brec": { "cid": 462, "name": "Margaret Galvis", "age": null, "address": null, "interests": [ "Base Jumping", "Movies", "Movies" ], "children": [ { "name": "Isaac Galvis", "age": 48 }, { "name": "Mei Galvis", "age": null }, { "name": "Asha Galvis", "age": null }, { "name": "Zachery Galvis", "age": null } ] } }
+{ "arec": { "cid": 156, "name": "Bobbye Kauppi", "age": 79, "address": { "number": 2051, "street": "Hill St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] }, "brec": { "cid": 666, "name": "Pamila Burzlaff", "age": 68, "address": { "number": 6543, "street": "View St.", "city": "Portland" }, "interests": [ "Squash", "Cigars", "Movies" ], "children": [ ] } }
+{ "arec": { "cid": 160, "name": "Yevette Chanez", "age": null, "address": null, "interests": [ "Bass", "Wine", "Coffee" ], "children": [ { "name": "Walter Chanez", "age": 11 }, { "name": "Pa Chanez", "age": 27 } ] }, "brec": { "cid": 299, "name": "Jacob Wainman", "age": 76, "address": { "number": 4551, "street": "Washington St.", "city": "Portland" }, "interests": [ "Base Jumping", "Wine", "Coffee" ], "children": [ { "name": "Abram Wainman", "age": 28 }, { "name": "Ramonita Wainman", "age": 18 }, { "name": "Sheryll Wainman", "age": null } ] } }
+{ "arec": { "cid": 160, "name": "Yevette Chanez", "age": null, "address": null, "interests": [ "Bass", "Wine", "Coffee" ], "children": [ { "name": "Walter Chanez", "age": 11 }, { "name": "Pa Chanez", "age": 27 } ] }, "brec": { "cid": 898, "name": "Thao Seufert", "age": 78, "address": { "number": 3529, "street": "Hill St.", "city": "Seattle" }, "interests": [ "Bass", "Squash", "Coffee" ], "children": [ { "name": "Classie Seufert", "age": null } ] } }
+{ "arec": { "cid": 172, "name": "Weldon Alquesta", "age": null, "address": null, "interests": [ "Music", "Fishing", "Music" ], "children": [ { "name": "Kip Alquesta", "age": null } ] }, "brec": { "cid": 961, "name": "Mirian Herpolsheimer", "age": null, "address": null, "interests": [ "Music", "Fishing", "Computers" ], "children": [ { "name": "Larissa Herpolsheimer", "age": 41 }, { "name": "Markus Herpolsheimer", "age": null }, { "name": "Natacha Herpolsheimer", "age": null } ] } }
+{ "arec": { "cid": 173, "name": "Annamae Lucien", "age": 46, "address": { "number": 1253, "street": "Hill St.", "city": "Mountain View" }, "interests": [ "Puzzles", "Cooking", "Squash" ], "children": [ { "name": "Sanjuana Lucien", "age": 21 }, { "name": "Nathanael Lucien", "age": 27 }, { "name": "Jae Lucien", "age": null }, { "name": "Judith Lucien", "age": null } ] }, "brec": { "cid": 507, "name": "Yuk Flanegan", "age": null, "address": null, "interests": [ "Puzzles", "Puzzles", "Squash" ], "children": [ { "name": "Alexander Flanegan", "age": null } ] } }
+{ "arec": { "cid": 173, "name": "Annamae Lucien", "age": 46, "address": { "number": 1253, "street": "Hill St.", "city": "Mountain View" }, "interests": [ "Puzzles", "Cooking", "Squash" ], "children": [ { "name": "Sanjuana Lucien", "age": 21 }, { "name": "Nathanael Lucien", "age": 27 }, { "name": "Jae Lucien", "age": null }, { "name": "Judith Lucien", "age": null } ] }, "brec": { "cid": 691, "name": "Sharee Charrier", "age": 17, "address": { "number": 6693, "street": "Main St.", "city": "Mountain View" }, "interests": [ "Puzzles", "Cooking", "Bass" ], "children": [ { "name": "Odessa Charrier", "age": null } ] } }
+{ "arec": { "cid": 178, "name": "Athena Kaluna", "age": null, "address": null, "interests": [ "Running", "Computers", "Basketball" ], "children": [ { "name": "Rosalba Kaluna", "age": 48 }, { "name": "Max Kaluna", "age": 10 } ] }, "brec": { "cid": 345, "name": "Derick Rippel", "age": 79, "address": { "number": 6843, "street": "Oak St.", "city": "Portland" }, "interests": [ "Running", "Basketball", "Computers", "Basketball" ], "children": [ ] } }
+{ "arec": { "cid": 187, "name": "Seema Hartsch", "age": 80, "address": { "number": 6629, "street": "Lake St.", "city": "Portland" }, "interests": [ "Coffee", "Coffee", "Cigars" ], "children": [ { "name": "Suellen Hartsch", "age": null }, { "name": "Pennie Hartsch", "age": 20 }, { "name": "Aubrey Hartsch", "age": null }, { "name": "Randy Hartsch", "age": 32 } ] }, "brec": { "cid": 598, "name": "Venus Peat", "age": null, "address": null, "interests": [ "Coffee", "Walking", "Cigars" ], "children": [ { "name": "Antonetta Peat", "age": null }, { "name": "Shane Peat", "age": null } ] } }
+{ "arec": { "cid": 187, "name": "Seema Hartsch", "age": 80, "address": { "number": 6629, "street": "Lake St.", "city": "Portland" }, "interests": [ "Coffee", "Coffee", "Cigars" ], "children": [ { "name": "Suellen Hartsch", "age": null }, { "name": "Pennie Hartsch", "age": 20 }, { "name": "Aubrey Hartsch", "age": null }, { "name": "Randy Hartsch", "age": 32 } ] }, "brec": { "cid": 927, "name": "Lillia Hartlein", "age": 55, "address": { "number": 5856, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Coffee", "Cigars" ], "children": [ { "name": "Nicky Hartlein", "age": null }, { "name": "Cassaundra Hartlein", "age": 10 }, { "name": "Micheline Hartlein", "age": 26 }, { "name": "Anton Hartlein", "age": 32 } ] } }
+{ "arec": { "cid": 198, "name": "Thelma Youkers", "age": null, "address": null, "interests": [ "Basketball", "Movies", "Cooking" ], "children": [ { "name": "Shamika Youkers", "age": 28 } ] }, "brec": { "cid": 806, "name": "Corliss Sharratt", "age": null, "address": null, "interests": [ "Basketball", "Cigars", "Cooking" ], "children": [ { "name": "Albertine Sharratt", "age": null }, { "name": "Nobuko Sharratt", "age": 29 }, { "name": "Neil Sharratt", "age": null } ] } }
+{ "arec": { "cid": 207, "name": "Phyliss Honda", "age": 22, "address": { "number": 8387, "street": "Lake St.", "city": "Seattle" }, "interests": [ "Cooking", "Music", "Books" ], "children": [ { "name": "Bee Honda", "age": null }, { "name": "Cyril Honda", "age": null }, { "name": "Vertie Honda", "age": null } ] }, "brec": { "cid": 440, "name": "Rosie Shappen", "age": null, "address": null, "interests": [ "Cooking", "Music", "Cigars" ], "children": [ { "name": "Jung Shappen", "age": 11 } ] } }
+{ "arec": { "cid": 207, "name": "Phyliss Honda", "age": 22, "address": { "number": 8387, "street": "Lake St.", "city": "Seattle" }, "interests": [ "Cooking", "Music", "Books" ], "children": [ { "name": "Bee Honda", "age": null }, { "name": "Cyril Honda", "age": null }, { "name": "Vertie Honda", "age": null } ] }, "brec": { "cid": 825, "name": "Kirstie Rinebold", "age": 57, "address": { "number": 9463, "street": "Oak St.", "city": "Portland" }, "interests": [ "Cooking", "Cigars", "Books" ], "children": [ { "name": "Vonda Rinebold", "age": null }, { "name": "Man Rinebold", "age": 21 } ] } }
+{ "arec": { "cid": 216, "name": "Odilia Lampson", "age": null, "address": null, "interests": [ "Wine", "Databases", "Basketball" ], "children": [ { "name": "Callie Lampson", "age": null } ] }, "brec": { "cid": 220, "name": "Soila Hannemann", "age": null, "address": null, "interests": [ "Wine", "Puzzles", "Basketball" ], "children": [ { "name": "Piper Hannemann", "age": 44 } ] } }
+{ "arec": { "cid": 220, "name": "Soila Hannemann", "age": null, "address": null, "interests": [ "Wine", "Puzzles", "Basketball" ], "children": [ { "name": "Piper Hannemann", "age": 44 } ] }, "brec": { "cid": 312, "name": "Epifania Chorney", "age": 62, "address": { "number": 9749, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Wine", "Puzzles", "Tennis" ], "children": [ { "name": "Lizeth Chorney", "age": 22 } ] } }
+{ "arec": { "cid": 224, "name": "Rene Rowey", "age": null, "address": null, "interests": [ "Base Jumping", "Base Jumping", "Walking", "Computers" ], "children": [ { "name": "Necole Rowey", "age": 26 }, { "name": "Sharyl Rowey", "age": 20 }, { "name": "Yvone Rowey", "age": 36 } ] }, "brec": { "cid": 538, "name": "Mack Vollick", "age": null, "address": null, "interests": [ "Base Jumping", "Fishing", "Walking", "Computers" ], "children": [ { "name": "Gil Vollick", "age": 11 }, { "name": "Marica Vollick", "age": null } ] } }
+{ "arec": { "cid": 224, "name": "Rene Rowey", "age": null, "address": null, "interests": [ "Base Jumping", "Base Jumping", "Walking", "Computers" ], "children": [ { "name": "Necole Rowey", "age": 26 }, { "name": "Sharyl Rowey", "age": 20 }, { "name": "Yvone Rowey", "age": 36 } ] }, "brec": { "cid": 788, "name": "Franklyn Crowner", "age": 56, "address": { "number": 4186, "street": "Lake St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Base Jumping", "Books", "Computers" ], "children": [ { "name": "Adrian Crowner", "age": 43 }, { "name": "Vasiliki Crowner", "age": null } ] } }
+{ "arec": { "cid": 237, "name": "Sona Hehn", "age": 47, "address": { "number": 3720, "street": "Oak St.", "city": "Portland" }, "interests": [ "Computers", "Squash", "Coffee" ], "children": [ { "name": "Marquerite Hehn", "age": null }, { "name": "Suellen Hehn", "age": 29 }, { "name": "Herb Hehn", "age": 29 } ] }, "brec": { "cid": 898, "name": "Thao Seufert", "age": 78, "address": { "number": 3529, "street": "Hill St.", "city": "Seattle" }, "interests": [ "Bass", "Squash", "Coffee" ], "children": [ { "name": "Classie Seufert", "age": null } ] } }
+{ "arec": { "cid": 244, "name": "Rene Shenk", "age": null, "address": null, "interests": [ "Puzzles", "Puzzles", "Skiing" ], "children": [ { "name": "Victor Shenk", "age": 28 }, { "name": "Doris Shenk", "age": null }, { "name": "Max Shenk", "age": 51 } ] }, "brec": { "cid": 507, "name": "Yuk Flanegan", "age": null, "address": null, "interests": [ "Puzzles", "Puzzles", "Squash" ], "children": [ { "name": "Alexander Flanegan", "age": null } ] } }
+{ "arec": { "cid": 250, "name": "Angeles Saltonstall", "age": null, "address": null, "interests": [ "Tennis", "Fishing", "Movies" ], "children": [ { "name": "Suzanna Saltonstall", "age": null } ] }, "brec": { "cid": 276, "name": "Denyse Groth", "age": 81, "address": { "number": 6825, "street": "Main St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Fishing", "Movies" ], "children": [ { "name": "Marilee Groth", "age": 12 }, { "name": "Lyla Groth", "age": 46 }, { "name": "Sarah Groth", "age": null } ] } }
+{ "arec": { "cid": 250, "name": "Angeles Saltonstall", "age": null, "address": null, "interests": [ "Tennis", "Fishing", "Movies" ], "children": [ { "name": "Suzanna Saltonstall", "age": null } ] }, "brec": { "cid": 302, "name": "Rosalie Laderer", "age": null, "address": null, "interests": [ "Tennis", "Movies", "Movies" ], "children": [ { "name": "Moriah Laderer", "age": null }, { "name": "Liana Laderer", "age": 21 }, { "name": "Genia Laderer", "age": 45 } ] } }
+{ "arec": { "cid": 263, "name": "Mellisa Machalek", "age": null, "address": null, "interests": [ "Bass", "Coffee", "Skiing" ], "children": [ ] }, "brec": { "cid": 618, "name": "Janella Hurtt", "age": null, "address": null, "interests": [ "Skiing", "Coffee", "Skiing" ], "children": [ { "name": "Lupe Hurtt", "age": 17 }, { "name": "Jae Hurtt", "age": 14 }, { "name": "Evan Hurtt", "age": 45 } ] } }
+{ "arec": { "cid": 264, "name": "Leon Yoshizawa", "age": 81, "address": { "number": 608, "street": "Washington St.", "city": "San Jose" }, "interests": [ "Running", "Books", "Running" ], "children": [ { "name": "Carmela Yoshizawa", "age": 34 } ] }, "brec": { "cid": 804, "name": "Joaquina Burlin", "age": 77, "address": { "number": 5479, "street": "7th St.", "city": "Sunnyvale" }, "interests": [ "Running", "Wine", "Running" ], "children": [ ] } }
+{ "arec": { "cid": 268, "name": "Fernando Pingel", "age": null, "address": null, "interests": [ "Computers", "Tennis", "Books" ], "children": [ { "name": "Latrice Pingel", "age": null }, { "name": "Wade Pingel", "age": 13 }, { "name": "Christal Pingel", "age": null }, { "name": "Melania Pingel", "age": null } ] }, "brec": { "cid": 446, "name": "Lilly Grannell", "age": 21, "address": { "number": 5894, "street": "Washington St.", "city": "San Jose" }, "interests": [ "Computers", "Tennis", "Puzzles", "Books" ], "children": [ { "name": "Victor Grannell", "age": null } ] } }
+{ "arec": { "cid": 273, "name": "Corrinne Seaquist", "age": 24, "address": { "number": 6712, "street": "7th St.", "city": "Portland" }, "interests": [ "Puzzles", "Coffee", "Wine" ], "children": [ { "name": "Mignon Seaquist", "age": null }, { "name": "Leo Seaquist", "age": null } ] }, "brec": { "cid": 709, "name": "Jazmine Twiddy", "age": null, "address": null, "interests": [ "Puzzles", "Computers", "Wine" ], "children": [ { "name": "Veronika Twiddy", "age": 21 } ] } }
+{ "arec": { "cid": 274, "name": "Claude Harral", "age": null, "address": null, "interests": [ "Squash", "Bass", "Cooking" ], "children": [ { "name": "Archie Harral", "age": null }, { "name": "Royal Harral", "age": null } ] }, "brec": { "cid": 654, "name": "Louis Laubersheimer", "age": 76, "address": { "number": 8010, "street": "7th St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Bass", "Cooking" ], "children": [ { "name": "Jewel Laubersheimer", "age": 22 }, { "name": "Toccara Laubersheimer", "age": 45 }, { "name": "Eve Laubersheimer", "age": null } ] } }
+{ "arec": { "cid": 276, "name": "Denyse Groth", "age": 81, "address": { "number": 6825, "street": "Main St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Fishing", "Movies" ], "children": [ { "name": "Marilee Groth", "age": 12 }, { "name": "Lyla Groth", "age": 46 }, { "name": "Sarah Groth", "age": null } ] }, "brec": { "cid": 892, "name": "Madge Hendson", "age": 79, "address": { "number": 8832, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Databases", "Fishing", "Skiing" ], "children": [ { "name": "Elia Hendson", "age": 48 }, { "name": "Lashawn Hendson", "age": 27 } ] } }
+{ "arec": { "cid": 276, "name": "Denyse Groth", "age": 81, "address": { "number": 6825, "street": "Main St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Fishing", "Movies" ], "children": [ { "name": "Marilee Groth", "age": 12 }, { "name": "Lyla Groth", "age": 46 }, { "name": "Sarah Groth", "age": null } ] }, "brec": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Databases", "Fishing", "Wine" ], "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] } }
+{ "arec": { "cid": 297, "name": "Adeline Frierson", "age": null, "address": null, "interests": [ "Coffee", "Computers", "Fishing" ], "children": [ { "name": "Marci Frierson", "age": null }, { "name": "Rolanda Frierson", "age": null }, { "name": "Del Frierson", "age": null } ] }, "brec": { "cid": 854, "name": "Angie Oyster", "age": 32, "address": { "number": 8860, "street": "Main St.", "city": "San Jose" }, "interests": [ "Coffee", "Movies", "Fishing" ], "children": [ { "name": "Hugh Oyster", "age": 10 } ] } }
+{ "arec": { "cid": 297, "name": "Adeline Frierson", "age": null, "address": null, "interests": [ "Coffee", "Computers", "Fishing" ], "children": [ { "name": "Marci Frierson", "age": null }, { "name": "Rolanda Frierson", "age": null }, { "name": "Del Frierson", "age": null } ] }, "brec": { "cid": 996, "name": "Elouise Wider", "age": null, "address": null, "interests": [ "Coffee", "Computers", "Base Jumping" ], "children": [ ] } }
+{ "arec": { "cid": 299, "name": "Jacob Wainman", "age": 76, "address": { "number": 4551, "street": "Washington St.", "city": "Portland" }, "interests": [ "Base Jumping", "Wine", "Coffee" ], "children": [ { "name": "Abram Wainman", "age": 28 }, { "name": "Ramonita Wainman", "age": 18 }, { "name": "Sheryll Wainman", "age": null } ] }, "brec": { "cid": 448, "name": "Gracie Pekas", "age": 59, "address": { "number": 4732, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Wine", "Cigars" ], "children": [ { "name": "Jeanett Pekas", "age": 35 }, { "name": "Jennifer Pekas", "age": null }, { "name": "Carrol Pekas", "age": null } ] } }
+{ "arec": { "cid": 302, "name": "Rosalie Laderer", "age": null, "address": null, "interests": [ "Tennis", "Movies", "Movies" ], "children": [ { "name": "Moriah Laderer", "age": null }, { "name": "Liana Laderer", "age": 21 }, { "name": "Genia Laderer", "age": 45 } ] }, "brec": { "cid": 462, "name": "Margaret Galvis", "age": null, "address": null, "interests": [ "Base Jumping", "Movies", "Movies" ], "children": [ { "name": "Isaac Galvis", "age": 48 }, { "name": "Mei Galvis", "age": null }, { "name": "Asha Galvis", "age": null }, { "name": "Zachery Galvis", "age": null } ] } }
+{ "arec": { "cid": 302, "name": "Rosalie Laderer", "age": null, "address": null, "interests": [ "Tennis", "Movies", "Movies" ], "children": [ { "name": "Moriah Laderer", "age": null }, { "name": "Liana Laderer", "age": 21 }, { "name": "Genia Laderer", "age": 45 } ] }, "brec": { "cid": 661, "name": "Lorita Kraut", "age": 43, "address": { "number": 5017, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Tennis", "Movies", "Bass" ], "children": [ { "name": "Mirian Kraut", "age": null } ] } }
+{ "arec": { "cid": 312, "name": "Epifania Chorney", "age": 62, "address": { "number": 9749, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Wine", "Puzzles", "Tennis" ], "children": [ { "name": "Lizeth Chorney", "age": 22 } ] }, "brec": { "cid": 895, "name": "Joie Siffert", "age": null, "address": null, "interests": [ "Wine", "Skiing", "Puzzles", "Tennis" ], "children": [ { "name": "Erma Siffert", "age": null }, { "name": "Natosha Siffert", "age": 38 }, { "name": "Somer Siffert", "age": 27 } ] } }
+{ "arec": { "cid": 326, "name": "Tad Tellers", "age": null, "address": null, "interests": [ "Books", "Tennis", "Base Jumping" ], "children": [ { "name": "Fannie Tellers", "age": null } ] }, "brec": { "cid": 541, "name": "Sammy Adamitis", "age": 71, "address": { "number": 5593, "street": "Washington St.", "city": "Seattle" }, "interests": [ "Books", "Tennis", "Cooking" ], "children": [ ] } }
+{ "arec": { "cid": 335, "name": "Odessa Dammeyer", "age": 18, "address": { "number": 6828, "street": "Cedar St.", "city": "Los Angeles" }, "interests": [ "Basketball", "Bass", "Cigars" ], "children": [ { "name": "Lindsey Dammeyer", "age": null } ] }, "brec": { "cid": 660, "name": "Israel Aday", "age": null, "address": null, "interests": [ "Wine", "Bass", "Cigars" ], "children": [ { "name": "Mi Aday", "age": null } ] } }
+{ "arec": { "cid": 352, "name": "Bonny Sischo", "age": null, "address": null, "interests": [ "Bass", "Movies", "Computers" ], "children": [ { "name": "Judith Sischo", "age": 43 }, { "name": "Adeline Sischo", "age": null }, { "name": "Dayna Sischo", "age": null } ] }, "brec": { "cid": 614, "name": "Wallace Chaidy", "age": null, "address": null, "interests": [ "Bass", "Movies", "Music" ], "children": [ { "name": "Refugio Chaidy", "age": null }, { "name": "Hae Chaidy", "age": 55 }, { "name": "Julian Chaidy", "age": null }, { "name": "Tabatha Chaidy", "age": null } ] } }
+{ "arec": { "cid": 352, "name": "Bonny Sischo", "age": null, "address": null, "interests": [ "Bass", "Movies", "Computers" ], "children": [ { "name": "Judith Sischo", "age": 43 }, { "name": "Adeline Sischo", "age": null }, { "name": "Dayna Sischo", "age": null } ] }, "brec": { "cid": 909, "name": "Mariko Sharar", "age": null, "address": null, "interests": [ "Squash", "Movies", "Computers" ], "children": [ ] } }
+{ "arec": { "cid": 359, "name": "Sharika Vientos", "age": 42, "address": { "number": 5981, "street": "Hill St.", "city": "Mountain View" }, "interests": [ "Walking", "Bass", "Fishing", "Movies" ], "children": [ { "name": "Clifton Vientos", "age": 21 }, { "name": "Renae Vientos", "age": null }, { "name": "Marcelo Vientos", "age": 31 }, { "name": "Jacalyn Vientos", "age": null } ] }, "brec": { "cid": 969, "name": "Laurinda Gnerre", "age": 42, "address": { "number": 2284, "street": "Hill St.", "city": "Mountain View" }, "interests": [ "Walking", "Bass", "Fishing", "Video Games" ], "children": [ { "name": "Veronica Gnerre", "age": null } ] } }
+{ "arec": { "cid": 363, "name": "Merlene Hoying", "age": 25, "address": { "number": 2105, "street": "Cedar St.", "city": "Portland" }, "interests": [ "Squash", "Squash", "Music" ], "children": [ { "name": "Andrew Hoying", "age": 10 } ] }, "brec": { "cid": 415, "name": "Valentin Mclarney", "age": null, "address": null, "interests": [ "Squash", "Squash", "Video Games" ], "children": [ { "name": "Vanda Mclarney", "age": 17 } ] } }
+{ "arec": { "cid": 363, "name": "Merlene Hoying", "age": 25, "address": { "number": 2105, "street": "Cedar St.", "city": "Portland" }, "interests": [ "Squash", "Squash", "Music" ], "children": [ { "name": "Andrew Hoying", "age": 10 } ] }, "brec": { "cid": 642, "name": "Odell Nova", "age": 25, "address": { "number": 896, "street": "Park St.", "city": "San Jose" }, "interests": [ "Video Games", "Squash", "Music" ], "children": [ { "name": "Leopoldo Nova", "age": null }, { "name": "Rickey Nova", "age": null }, { "name": "Mike Nova", "age": 14 }, { "name": "Tamie Nova", "age": 14 } ] } }
+{ "arec": { "cid": 371, "name": "Agatha Tensley", "age": 13, "address": { "number": 1810, "street": "Hill St.", "city": "San Jose" }, "interests": [ "Bass", "Running", "Movies" ], "children": [ { "name": "Launa Tensley", "age": null } ] }, "brec": { "cid": 387, "name": "Leonard Mabie", "age": 33, "address": { "number": 6703, "street": "View St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Walking" ], "children": [ { "name": "Jone Mabie", "age": 16 }, { "name": "Claire Mabie", "age": null }, { "name": "Larraine Mabie", "age": null }, { "name": "Corrina Mabie", "age": null } ] } }
+{ "arec": { "cid": 371, "name": "Agatha Tensley", "age": 13, "address": { "number": 1810, "street": "Hill St.", "city": "San Jose" }, "interests": [ "Bass", "Running", "Movies" ], "children": [ { "name": "Launa Tensley", "age": null } ] }, "brec": { "cid": 424, "name": "Camila Rightmire", "age": 25, "address": { "number": 7542, "street": "Oak St.", "city": "Sunnyvale" }, "interests": [ "Bass", "Running", "Puzzles" ], "children": [ { "name": "Donny Rightmire", "age": 14 }, { "name": "Karlene Rightmire", "age": 10 }, { "name": "Nicholas Rightmire", "age": null }, { "name": "Margareta Rightmire", "age": null } ] } }
+{ "arec": { "cid": 378, "name": "Melany Matias", "age": 10, "address": { "number": 8838, "street": "Main St.", "city": "Seattle" }, "interests": [ "Coffee", "Tennis", "Bass" ], "children": [ { "name": "Earnestine Matias", "age": null }, { "name": "Lore Matias", "age": null } ] }, "brec": { "cid": 580, "name": "Liana Gabbert", "age": null, "address": null, "interests": [ "Coffee", "Tennis", "Bass", "Running" ], "children": [ ] } }
+{ "arec": { "cid": 387, "name": "Leonard Mabie", "age": 33, "address": { "number": 6703, "street": "View St.", "city": "Mountain View" }, "interests": [ "Bass", "Running", "Walking" ], "children": [ { "name": "Jone Mabie", "age": 16 }, { "name": "Claire Mabie", "age": null }, { "name": "Larraine Mabie", "age": null }, { "name": "Corrina Mabie", "age": null } ] }, "brec": { "cid": 424, "name": "Camila Rightmire", "age": 25, "address": { "number": 7542, "street": "Oak St.", "city": "Sunnyvale" }, "interests": [ "Bass", "Running", "Puzzles" ], "children": [ { "name": "Donny Rightmire", "age": 14 }, { "name": "Karlene Rightmire", "age": 10 }, { "name": "Nicholas Rightmire", "age": null }, { "name": "Margareta Rightmire", "age": null } ] } }
+{ "arec": { "cid": 397, "name": "Blake Kealy", "age": 34, "address": { "number": 2156, "street": "Cedar St.", "city": "Los Angeles" }, "interests": [ "Databases", "Wine", "Cigars" ], "children": [ { "name": "Lorenza Kealy", "age": null }, { "name": "Beula Kealy", "age": 15 }, { "name": "Kristofer Kealy", "age": null }, { "name": "Shayne Kealy", "age": null } ] }, "brec": { "cid": 448, "name": "Gracie Pekas", "age": 59, "address": { "number": 4732, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Wine", "Cigars" ], "children": [ { "name": "Jeanett Pekas", "age": 35 }, { "name": "Jennifer Pekas", "age": null }, { "name": "Carrol Pekas", "age": null } ] } }
+{ "arec": { "cid": 402, "name": "Terrilyn Shinall", "age": null, "address": null, "interests": [ "Computers", "Skiing", "Music" ], "children": [ { "name": "Minh Shinall", "age": null }, { "name": "Diedre Shinall", "age": 22 } ] }, "brec": { "cid": 803, "name": "Yolonda Korf", "age": null, "address": null, "interests": [ "Bass", "Skiing", "Music" ], "children": [ { "name": "Ivette Korf", "age": null }, { "name": "Lashon Korf", "age": null } ] } }
+{ "arec": { "cid": 406, "name": "Addie Mandez", "age": null, "address": null, "interests": [ "Tennis", "Cigars", "Books" ], "children": [ { "name": "Rosendo Mandez", "age": 34 } ] }, "brec": { "cid": 489, "name": "Brigid Delosier", "age": 31, "address": { "number": 6082, "street": "Oak St.", "city": "Portland" }, "interests": [ "Tennis", "Cigars", "Music" ], "children": [ { "name": "Allegra Delosier", "age": null }, { "name": "Yong Delosier", "age": 10 }, { "name": "Steffanie Delosier", "age": 13 } ] } }
+{ "arec": { "cid": 406, "name": "Addie Mandez", "age": null, "address": null, "interests": [ "Tennis", "Cigars", "Books" ], "children": [ { "name": "Rosendo Mandez", "age": 34 } ] }, "brec": { "cid": 825, "name": "Kirstie Rinebold", "age": 57, "address": { "number": 9463, "street": "Oak St.", "city": "Portland" }, "interests": [ "Cooking", "Cigars", "Books" ], "children": [ { "name": "Vonda Rinebold", "age": null }, { "name": "Man Rinebold", "age": 21 } ] } }
+{ "arec": { "cid": 412, "name": "Devon Szalai", "age": 26, "address": { "number": 2384, "street": "Lake St.", "city": "Los Angeles" }, "interests": [ "Bass", "Books", "Books" ], "children": [ { "name": "Yolonda Szalai", "age": null }, { "name": "Denita Szalai", "age": null }, { "name": "Priscila Szalai", "age": 10 }, { "name": "Cassondra Szalai", "age": 12 } ] }, "brec": { "cid": 722, "name": "Noel Goncalves", "age": null, "address": null, "interests": [ "Books", "Bass", "Books", "Books" ], "children": [ { "name": "Latrice Goncalves", "age": null }, { "name": "Evelia Goncalves", "age": 36 }, { "name": "Etta Goncalves", "age": 11 }, { "name": "Collin Goncalves", "age": null } ] } }
+{ "arec": { "cid": 417, "name": "Irene Funderberg", "age": 45, "address": { "number": 8503, "street": "Hill St.", "city": "Seattle" }, "interests": [ "Music", "Skiing", "Running" ], "children": [ { "name": "Lyndia Funderberg", "age": 14 }, { "name": "Herta Funderberg", "age": null } ] }, "brec": { "cid": 629, "name": "Mayola Clabo", "age": null, "address": null, "interests": [ "Basketball", "Skiing", "Running" ], "children": [ { "name": "Rigoberto Clabo", "age": 58 } ] } }
+{ "arec": { "cid": 417, "name": "Irene Funderberg", "age": 45, "address": { "number": 8503, "street": "Hill St.", "city": "Seattle" }, "interests": [ "Music", "Skiing", "Running" ], "children": [ { "name": "Lyndia Funderberg", "age": 14 }, { "name": "Herta Funderberg", "age": null } ] }, "brec": { "cid": 678, "name": "Lekisha Barnell", "age": null, "address": null, "interests": [ "Movies", "Skiing", "Running" ], "children": [ { "name": "August Barnell", "age": null }, { "name": "Tiffany Barnell", "age": 55 }, { "name": "Meghan Barnell", "age": null } ] } }
+{ "arec": { "cid": 418, "name": "Gavin Delpino", "age": null, "address": null, "interests": [ "Basketball", "Skiing", "Wine", "Fishing" ], "children": [ { "name": "Gianna Delpino", "age": null }, { "name": "Carmella Delpino", "age": 55 } ] }, "brec": { "cid": 621, "name": "Theresa Satterthwaite", "age": 16, "address": { "number": 3249, "street": "Main St.", "city": "Mountain View" }, "interests": [ "Wine", "Skiing", "Wine", "Fishing" ], "children": [ { "name": "Rickie Satterthwaite", "age": null }, { "name": "Rina Satterthwaite", "age": null } ] } }
+{ "arec": { "cid": 429, "name": "Eladia Scannell", "age": 20, "address": { "number": 5036, "street": "Main St.", "city": "Portland" }, "interests": [ "Skiing", "Music", "Movies" ], "children": [ ] }, "brec": { "cid": 518, "name": "Cora Ingargiola", "age": null, "address": null, "interests": [ "Skiing", "Squash", "Movies" ], "children": [ { "name": "Katlyn Ingargiola", "age": null }, { "name": "Mike Ingargiola", "age": null }, { "name": "Lawrence Ingargiola", "age": null }, { "name": "Isabelle Ingargiola", "age": null } ] } }
+{ "arec": { "cid": 435, "name": "Britni Kazemi", "age": 69, "address": { "number": 7868, "street": "Main St.", "city": "San Jose" }, "interests": [ "Databases", "Music", "Wine" ], "children": [ ] }, "brec": { "cid": 587, "name": "Santos Monterio", "age": 36, "address": { "number": 4454, "street": "Oak St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Music", "Cooking" ], "children": [ { "name": "Lashonda Monterio", "age": null } ] } }
+{ "arec": { "cid": 435, "name": "Britni Kazemi", "age": 69, "address": { "number": 7868, "street": "Main St.", "city": "San Jose" }, "interests": [ "Databases", "Music", "Wine" ], "children": [ ] }, "brec": { "cid": 624, "name": "Bong Lyall", "age": null, "address": null, "interests": [ "Databases", "Music", "Video Games" ], "children": [ ] } }
+{ "arec": { "cid": 435, "name": "Britni Kazemi", "age": 69, "address": { "number": 7868, "street": "Main St.", "city": "San Jose" }, "interests": [ "Databases", "Music", "Wine" ], "children": [ ] }, "brec": { "cid": 694, "name": "Ariel Soltani", "age": null, "address": null, "interests": [ "Databases", "Music", "Puzzles" ], "children": [ { "name": "Aldo Soltani", "age": null }, { "name": "Anglea Soltani", "age": null } ] } }
+{ "arec": { "cid": 435, "name": "Britni Kazemi", "age": 69, "address": { "number": 7868, "street": "Main St.", "city": "San Jose" }, "interests": [ "Databases", "Music", "Wine" ], "children": [ ] }, "brec": { "cid": 859, "name": "Mozelle Catillo", "age": 61, "address": { "number": 253, "street": "View St.", "city": "Los Angeles" }, "interests": [ "Databases", "Cooking", "Wine" ], "children": [ ] } }
+{ "arec": { "cid": 435, "name": "Britni Kazemi", "age": 69, "address": { "number": 7868, "street": "Main St.", "city": "San Jose" }, "interests": [ "Databases", "Music", "Wine" ], "children": [ ] }, "brec": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Databases", "Fishing", "Wine" ], "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] } }
+{ "arec": { "cid": 438, "name": "Allegra Pefanis", "age": null, "address": null, "interests": [ "Computers", "Music", "Cigars" ], "children": [ ] }, "brec": { "cid": 440, "name": "Rosie Shappen", "age": null, "address": null, "interests": [ "Cooking", "Music", "Cigars" ], "children": [ { "name": "Jung Shappen", "age": 11 } ] } }
+{ "arec": { "cid": 444, "name": "Demetra Sava", "age": null, "address": null, "interests": [ "Music", "Fishing", "Databases", "Wine" ], "children": [ { "name": "Fidel Sava", "age": 16 } ] }, "brec": { "cid": 484, "name": "Bennie Dragaj", "age": null, "address": null, "interests": [ "Fishing", "Databases", "Wine" ], "children": [ { "name": "Viva Dragaj", "age": 13 } ] } }
+{ "arec": { "cid": 445, "name": "Walton Komo", "age": 16, "address": { "number": 8769, "street": "Main St.", "city": "Seattle" }, "interests": [ "Running", "Basketball", "Tennis" ], "children": [ ] }, "brec": { "cid": 828, "name": "Marcelle Steinhour", "age": null, "address": null, "interests": [ "Running", "Basketball", "Walking" ], "children": [ { "name": "Jimmie Steinhour", "age": 13 }, { "name": "Kirstie Steinhour", "age": 19 } ] } }
+{ "arec": { "cid": 445, "name": "Walton Komo", "age": 16, "address": { "number": 8769, "street": "Main St.", "city": "Seattle" }, "interests": [ "Running", "Basketball", "Tennis" ], "children": [ ] }, "brec": { "cid": 962, "name": "Taryn Coley", "age": null, "address": null, "interests": [ "Running", "Basketball", "Cooking" ], "children": [ ] } }
+{ "arec": { "cid": 448, "name": "Gracie Pekas", "age": 59, "address": { "number": 4732, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Wine", "Cigars" ], "children": [ { "name": "Jeanett Pekas", "age": 35 }, { "name": "Jennifer Pekas", "age": null }, { "name": "Carrol Pekas", "age": null } ] }, "brec": { "cid": 927, "name": "Lillia Hartlein", "age": 55, "address": { "number": 5856, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Coffee", "Cigars" ], "children": [ { "name": "Nicky Hartlein", "age": null }, { "name": "Cassaundra Hartlein", "age": 10 }, { "name": "Micheline Hartlein", "age": 26 }, { "name": "Anton Hartlein", "age": 32 } ] } }
+{ "arec": { "cid": 453, "name": "Sherlyn Deadmond", "age": null, "address": null, "interests": [ "Tennis", "Puzzles", "Base Jumping" ], "children": [ { "name": "Torrie Deadmond", "age": 46 }, { "name": "Cleotilde Deadmond", "age": 55 }, { "name": "Garry Deadmond", "age": 34 }, { "name": "Valrie Deadmond", "age": null } ] }, "brec": { "cid": 734, "name": "Lera Korn", "age": null, "address": null, "interests": [ "Tennis", "Puzzles", "Cigars" ], "children": [ { "name": "Criselda Korn", "age": 37 } ] } }
+{ "arec": { "cid": 453, "name": "Sherlyn Deadmond", "age": null, "address": null, "interests": [ "Tennis", "Puzzles", "Base Jumping" ], "children": [ { "name": "Torrie Deadmond", "age": 46 }, { "name": "Cleotilde Deadmond", "age": 55 }, { "name": "Garry Deadmond", "age": 34 }, { "name": "Valrie Deadmond", "age": null } ] }, "brec": { "cid": 791, "name": "Jame Apresa", "age": 66, "address": { "number": 8417, "street": "Main St.", "city": "San Jose" }, "interests": [ "Running", "Puzzles", "Base Jumping" ], "children": [ { "name": "Awilda Apresa", "age": null }, { "name": "Nelle Apresa", "age": 40 }, { "name": "Terrell Apresa", "age": null }, { "name": "Malia Apresa", "age": 43 } ] } }
+{ "arec": { "cid": 455, "name": "Manual Altizer", "age": 70, "address": { "number": 6293, "street": "7th St.", "city": "Portland" }, "interests": [ "Running", "Fishing", "Coffee" ], "children": [ { "name": "Katherine Altizer", "age": null } ] }, "brec": { "cid": 488, "name": "Dannielle Wilkie", "age": null, "address": null, "interests": [ "Running", "Fishing", "Coffee", "Basketball" ], "children": [ { "name": "Vita Wilkie", "age": 17 }, { "name": "Marisa Wilkie", "age": null }, { "name": "Faustino Wilkie", "age": null } ] } }
+{ "arec": { "cid": 473, "name": "Cordell Solas", "age": null, "address": null, "interests": [ "Squash", "Music", "Bass", "Puzzles" ], "children": [ { "name": "Douglass Solas", "age": null }, { "name": "Claribel Solas", "age": null }, { "name": "Fred Solas", "age": null }, { "name": "Ahmed Solas", "age": 21 } ] }, "brec": { "cid": 527, "name": "Lance Kenison", "age": 77, "address": { "number": 8750, "street": "Main St.", "city": "San Jose" }, "interests": [ "Squash", "Cooking", "Bass", "Puzzles" ], "children": [ { "name": "Youlanda Kenison", "age": null }, { "name": "Lavon Kenison", "age": null }, { "name": "Maryann Kenison", "age": 60 }, { "name": "Kecia Kenison", "age": 50 } ] } }
+{ "arec": { "cid": 484, "name": "Bennie Dragaj", "age": null, "address": null, "interests": [ "Fishing", "Databases", "Wine" ], "children": [ { "name": "Viva Dragaj", "age": 13 } ] }, "brec": { "cid": 986, "name": "Tennille Wikle", "age": 78, "address": { "number": 3428, "street": "View St.", "city": "Portland" }, "interests": [ "Movies", "Databases", "Wine" ], "children": [ { "name": "Lourie Wikle", "age": null }, { "name": "Laure Wikle", "age": null } ] } }
+{ "arec": { "cid": 487, "name": "Zenia Virgilio", "age": 46, "address": { "number": 584, "street": "Main St.", "city": "Mountain View" }, "interests": [ "Walking", "Squash", "Wine" ], "children": [ { "name": "Quintin Virgilio", "age": null }, { "name": "Edith Virgilio", "age": null }, { "name": "Nicolle Virgilio", "age": 33 } ] }, "brec": { "cid": 735, "name": "Lonnie Bechel", "age": 36, "address": { "number": 592, "street": "Main St.", "city": "Sunnyvale" }, "interests": [ "Walking", "Cigars", "Squash", "Wine" ], "children": [ ] } }
+{ "arec": { "cid": 496, "name": "Lonna Starkweather", "age": 80, "address": { "number": 1162, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Coffee", "Bass", "Running" ], "children": [ { "name": "Matilda Starkweather", "age": null } ] }, "brec": { "cid": 545, "name": "Dolores Ferer", "age": null, "address": null, "interests": [ "Coffee", "Bass", "Tennis" ], "children": [ { "name": "Bridgette Ferer", "age": null } ] } }
+{ "arec": { "cid": 496, "name": "Lonna Starkweather", "age": 80, "address": { "number": 1162, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Coffee", "Bass", "Running" ], "children": [ { "name": "Matilda Starkweather", "age": null } ] }, "brec": { "cid": 580, "name": "Liana Gabbert", "age": null, "address": null, "interests": [ "Coffee", "Tennis", "Bass", "Running" ], "children": [ ] } }
+{ "arec": { "cid": 498, "name": "Arleen Sultzer", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Norine Sultzer", "age": 29 } ] }, "brec": { "cid": 854, "name": "Angie Oyster", "age": 32, "address": { "number": 8860, "street": "Main St.", "city": "San Jose" }, "interests": [ "Coffee", "Movies", "Fishing" ], "children": [ { "name": "Hugh Oyster", "age": 10 } ] } }
+{ "arec": { "cid": 498, "name": "Arleen Sultzer", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Norine Sultzer", "age": 29 } ] }, "brec": { "cid": 875, "name": "Ramon Crepps", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Elisha Crepps", "age": null } ] } }
+{ "arec": { "cid": 498, "name": "Arleen Sultzer", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Norine Sultzer", "age": 29 } ] }, "brec": { "cid": 984, "name": "Janett Kitchens", "age": 66, "address": { "number": 7558, "street": "View St.", "city": "Mountain View" }, "interests": [ "Coffee", "Movies", "Squash" ], "children": [ { "name": "Grayce Kitchens", "age": 14 }, { "name": "Dwayne Kitchens", "age": null }, { "name": "Wilber Kitchens", "age": 51 }, { "name": "Nancey Kitchens", "age": null } ] } }
+{ "arec": { "cid": 522, "name": "Daryl Kissack", "age": 86, "address": { "number": 7825, "street": "Cedar St.", "city": "Mountain View" }, "interests": [ "Squash", "Base Jumping", "Tennis" ], "children": [ { "name": "Darrel Kissack", "age": 21 } ] }, "brec": { "cid": 633, "name": "Shalon Grauberger", "age": 34, "address": { "number": 765, "street": "Washington St.", "city": "Sunnyvale" }, "interests": [ "Music", "Base Jumping", "Tennis" ], "children": [ { "name": "Kris Grauberger", "age": 14 }, { "name": "Stuart Grauberger", "age": 12 }, { "name": "Billy Grauberger", "age": null } ] } }
+{ "arec": { "cid": 522, "name": "Daryl Kissack", "age": 86, "address": { "number": 7825, "street": "Cedar St.", "city": "Mountain View" }, "interests": [ "Squash", "Base Jumping", "Tennis" ], "children": [ { "name": "Darrel Kissack", "age": 21 } ] }, "brec": { "cid": 812, "name": "Bee Godette", "age": 26, "address": { "number": 1757, "street": "Washington St.", "city": "Portland" }, "interests": [ "Video Games", "Base Jumping", "Tennis" ], "children": [ { "name": "Madaline Godette", "age": 10 }, { "name": "Shasta Godette", "age": 15 }, { "name": "Parthenia Godette", "age": 11 }, { "name": "Priscila Godette", "age": 13 } ] } }
+{ "arec": { "cid": 537, "name": "Mara Hugar", "age": null, "address": null, "interests": [ "Fishing", "Skiing", "Skiing" ], "children": [ { "name": "Krista Hugar", "age": null } ] }, "brec": { "cid": 600, "name": "Cordell Sherburn", "age": null, "address": null, "interests": [ "Squash", "Skiing", "Skiing" ], "children": [ { "name": "Shenna Sherburn", "age": 22 }, { "name": "Minna Sherburn", "age": 10 }, { "name": "Tari Sherburn", "age": null } ] } }
+{ "arec": { "cid": 541, "name": "Sammy Adamitis", "age": 71, "address": { "number": 5593, "street": "Washington St.", "city": "Seattle" }, "interests": [ "Books", "Tennis", "Cooking" ], "children": [ ] }, "brec": { "cid": 913, "name": "Evelynn Fague", "age": 42, "address": { "number": 5729, "street": "7th St.", "city": "Seattle" }, "interests": [ "Books", "Databases", "Cooking" ], "children": [ ] } }
+{ "arec": { "cid": 545, "name": "Dolores Ferer", "age": null, "address": null, "interests": [ "Coffee", "Bass", "Tennis" ], "children": [ { "name": "Bridgette Ferer", "age": null } ] }, "brec": { "cid": 566, "name": "Asley Grow", "age": null, "address": null, "interests": [ "Coffee", "Books", "Tennis" ], "children": [ { "name": "Dale Grow", "age": null } ] } }
+{ "arec": { "cid": 562, "name": "Etta Hooton", "age": null, "address": null, "interests": [ "Databases", "Cigars", "Music", "Video Games" ], "children": [ { "name": "Sherice Hooton", "age": null }, { "name": "Estefana Hooton", "age": 38 }, { "name": "Nidia Hooton", "age": 47 }, { "name": "Erwin Hooton", "age": null } ] }, "brec": { "cid": 624, "name": "Bong Lyall", "age": null, "address": null, "interests": [ "Databases", "Music", "Video Games" ], "children": [ ] } }
+{ "arec": { "cid": 563, "name": "Deirdre Landero", "age": null, "address": null, "interests": [ "Books", "Fishing", "Video Games" ], "children": [ { "name": "Norman Landero", "age": 59 }, { "name": "Jennine Landero", "age": 45 }, { "name": "Rutha Landero", "age": 19 }, { "name": "Jackie Landero", "age": 29 } ] }, "brec": { "cid": 941, "name": "Jamey Jakobson", "age": null, "address": null, "interests": [ "Books", "Cooking", "Video Games" ], "children": [ { "name": "Elmer Jakobson", "age": 14 }, { "name": "Minh Jakobson", "age": 30 } ] } }
+{ "arec": { "cid": 564, "name": "Inger Dargin", "age": 56, "address": { "number": 8704, "street": "View St.", "city": "Mountain View" }, "interests": [ "Wine", "Running", "Computers" ], "children": [ ] }, "brec": { "cid": 849, "name": "Kristen Zapalac", "age": 14, "address": { "number": 4087, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Wine", "Cooking", "Running", "Computers" ], "children": [ ] } }
+{ "arec": { "cid": 566, "name": "Asley Grow", "age": null, "address": null, "interests": [ "Coffee", "Books", "Tennis" ], "children": [ { "name": "Dale Grow", "age": null } ] }, "brec": { "cid": 750, "name": "Rosaura Gaul", "age": null, "address": null, "interests": [ "Music", "Books", "Tennis" ], "children": [ { "name": "Letisha Gaul", "age": 41 } ] } }
+{ "arec": { "cid": 575, "name": "Phyliss Mattes", "age": 26, "address": { "number": 3956, "street": "Washington St.", "city": "Los Angeles" }, "interests": [ "Tennis", "Music", "Running", "Music" ], "children": [ ] }, "brec": { "cid": 757, "name": "Bertie Flemming", "age": null, "address": null, "interests": [ "Tennis", "Music", "Running", "Cooking" ], "children": [ { "name": "Temeka Flemming", "age": 46 }, { "name": "Terrance Flemming", "age": null }, { "name": "Jenette Flemming", "age": 23 }, { "name": "Debra Flemming", "age": null } ] } }
+{ "arec": { "cid": 585, "name": "Young Drube", "age": 21, "address": { "number": 6960, "street": "View St.", "city": "Seattle" }, "interests": [ "Basketball", "Fishing", "Walking" ], "children": [ { "name": "Irwin Drube", "age": null }, { "name": "Gustavo Drube", "age": null } ] }, "brec": { "cid": 808, "name": "Brande Decius", "age": null, "address": null, "interests": [ "Basketball", "Fishing", "Puzzles" ], "children": [ { "name": "Li Decius", "age": 56 }, { "name": "Eusebio Decius", "age": 50 }, { "name": "Clementina Decius", "age": 29 } ] } }
+{ "arec": { "cid": 587, "name": "Santos Monterio", "age": 36, "address": { "number": 4454, "street": "Oak St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Music", "Cooking" ], "children": [ { "name": "Lashonda Monterio", "age": null } ] }, "brec": { "cid": 624, "name": "Bong Lyall", "age": null, "address": null, "interests": [ "Databases", "Music", "Video Games" ], "children": [ ] } }
+{ "arec": { "cid": 587, "name": "Santos Monterio", "age": 36, "address": { "number": 4454, "street": "Oak St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Music", "Cooking" ], "children": [ { "name": "Lashonda Monterio", "age": null } ] }, "brec": { "cid": 694, "name": "Ariel Soltani", "age": null, "address": null, "interests": [ "Databases", "Music", "Puzzles" ], "children": [ { "name": "Aldo Soltani", "age": null }, { "name": "Anglea Soltani", "age": null } ] } }
+{ "arec": { "cid": 588, "name": "Debora Laughinghouse", "age": 87, "address": { "number": 5099, "street": "View St.", "city": "San Jose" }, "interests": [ "Tennis", "Walking", "Databases" ], "children": [ { "name": "Frederica Laughinghouse", "age": 59 }, { "name": "Johnie Laughinghouse", "age": 12 }, { "name": "Numbers Laughinghouse", "age": 73 } ] }, "brec": { "cid": 853, "name": "Denisse Peralto", "age": 25, "address": { "number": 3931, "street": "7th St.", "city": "Portland" }, "interests": [ "Tennis", "Walking", "Basketball" ], "children": [ { "name": "Asha Peralto", "age": 14 }, { "name": "Clark Peralto", "age": null }, { "name": "Jessika Peralto", "age": null }, { "name": "Nadene Peralto", "age": null } ] } }
+{ "arec": { "cid": 600, "name": "Cordell Sherburn", "age": null, "address": null, "interests": [ "Squash", "Skiing", "Skiing" ], "children": [ { "name": "Shenna Sherburn", "age": 22 }, { "name": "Minna Sherburn", "age": 10 }, { "name": "Tari Sherburn", "age": null } ] }, "brec": { "cid": 703, "name": "Susanne Pettey", "age": null, "address": null, "interests": [ "Squash", "Basketball", "Skiing" ], "children": [ { "name": "Nancey Pettey", "age": 35 }, { "name": "Lawana Pettey", "age": null }, { "name": "Percy Pettey", "age": 25 } ] } }
+{ "arec": { "cid": 602, "name": "Clyde Salada", "age": 59, "address": { "number": 8316, "street": "7th St.", "city": "Sunnyvale" }, "interests": [ "Movies", "Skiing", "Cooking" ], "children": [ ] }, "brec": { "cid": 678, "name": "Lekisha Barnell", "age": null, "address": null, "interests": [ "Movies", "Skiing", "Running" ], "children": [ { "name": "August Barnell", "age": null }, { "name": "Tiffany Barnell", "age": 55 }, { "name": "Meghan Barnell", "age": null } ] } }
+{ "arec": { "cid": 614, "name": "Wallace Chaidy", "age": null, "address": null, "interests": [ "Bass", "Movies", "Music" ], "children": [ { "name": "Refugio Chaidy", "age": null }, { "name": "Hae Chaidy", "age": 55 }, { "name": "Julian Chaidy", "age": null }, { "name": "Tabatha Chaidy", "age": null } ] }, "brec": { "cid": 639, "name": "Zena Seehusen", "age": 24, "address": { "number": 6303, "street": "Hill St.", "city": "Mountain View" }, "interests": [ "Cooking", "Movies", "Music" ], "children": [ { "name": "Hester Seehusen", "age": null }, { "name": "Coreen Seehusen", "age": 12 } ] } }
+{ "arec": { "cid": 614, "name": "Wallace Chaidy", "age": null, "address": null, "interests": [ "Bass", "Movies", "Music" ], "children": [ { "name": "Refugio Chaidy", "age": null }, { "name": "Hae Chaidy", "age": 55 }, { "name": "Julian Chaidy", "age": null }, { "name": "Tabatha Chaidy", "age": null } ] }, "brec": { "cid": 803, "name": "Yolonda Korf", "age": null, "address": null, "interests": [ "Bass", "Skiing", "Music" ], "children": [ { "name": "Ivette Korf", "age": null }, { "name": "Lashon Korf", "age": null } ] } }
+{ "arec": { "cid": 621, "name": "Theresa Satterthwaite", "age": 16, "address": { "number": 3249, "street": "Main St.", "city": "Mountain View" }, "interests": [ "Wine", "Skiing", "Wine", "Fishing" ], "children": [ { "name": "Rickie Satterthwaite", "age": null }, { "name": "Rina Satterthwaite", "age": null } ] }, "brec": { "cid": 929, "name": "Jean Guitierrez", "age": 75, "address": { "number": 9736, "street": "Lake St.", "city": "Mountain View" }, "interests": [ "Wine", "Wine", "Fishing" ], "children": [ ] } }
+{ "arec": { "cid": 624, "name": "Bong Lyall", "age": null, "address": null, "interests": [ "Databases", "Music", "Video Games" ], "children": [ ] }, "brec": { "cid": 694, "name": "Ariel Soltani", "age": null, "address": null, "interests": [ "Databases", "Music", "Puzzles" ], "children": [ { "name": "Aldo Soltani", "age": null }, { "name": "Anglea Soltani", "age": null } ] } }
+{ "arec": { "cid": 629, "name": "Mayola Clabo", "age": null, "address": null, "interests": [ "Basketball", "Skiing", "Running" ], "children": [ { "name": "Rigoberto Clabo", "age": 58 } ] }, "brec": { "cid": 678, "name": "Lekisha Barnell", "age": null, "address": null, "interests": [ "Movies", "Skiing", "Running" ], "children": [ { "name": "August Barnell", "age": null }, { "name": "Tiffany Barnell", "age": 55 }, { "name": "Meghan Barnell", "age": null } ] } }
+{ "arec": { "cid": 633, "name": "Shalon Grauberger", "age": 34, "address": { "number": 765, "street": "Washington St.", "city": "Sunnyvale" }, "interests": [ "Music", "Base Jumping", "Tennis" ], "children": [ { "name": "Kris Grauberger", "age": 14 }, { "name": "Stuart Grauberger", "age": 12 }, { "name": "Billy Grauberger", "age": null } ] }, "brec": { "cid": 750, "name": "Rosaura Gaul", "age": null, "address": null, "interests": [ "Music", "Books", "Tennis" ], "children": [ { "name": "Letisha Gaul", "age": 41 } ] } }
+{ "arec": { "cid": 633, "name": "Shalon Grauberger", "age": 34, "address": { "number": 765, "street": "Washington St.", "city": "Sunnyvale" }, "interests": [ "Music", "Base Jumping", "Tennis" ], "children": [ { "name": "Kris Grauberger", "age": 14 }, { "name": "Stuart Grauberger", "age": 12 }, { "name": "Billy Grauberger", "age": null } ] }, "brec": { "cid": 812, "name": "Bee Godette", "age": 26, "address": { "number": 1757, "street": "Washington St.", "city": "Portland" }, "interests": [ "Video Games", "Base Jumping", "Tennis" ], "children": [ { "name": "Madaline Godette", "age": 10 }, { "name": "Shasta Godette", "age": 15 }, { "name": "Parthenia Godette", "age": 11 }, { "name": "Priscila Godette", "age": 13 } ] } }
+{ "arec": { "cid": 636, "name": "Babara Shore", "age": 83, "address": { "number": 9452, "street": "Oak St.", "city": "Los Angeles" }, "interests": [ "Databases", "Movies", "Tennis" ], "children": [ { "name": "Candy Shore", "age": 58 }, { "name": "Nanci Shore", "age": null }, { "name": "Asia Shore", "age": null } ] }, "brec": { "cid": 992, "name": "Staci Alexandropoul", "age": null, "address": null, "interests": [ "Databases", "Movies", "Tennis" ], "children": [ { "name": "Casimira Alexandropoul", "age": null }, { "name": "Kena Alexandropoul", "age": 54 }, { "name": "Ellie Alexandropoul", "age": null }, { "name": "Ambrose Alexandropoul", "age": null } ] } }
+{ "arec": { "cid": 649, "name": "Anisha Sender", "age": null, "address": null, "interests": [ "Tennis", "Databases", "Bass" ], "children": [ { "name": "Viva Sender", "age": 40 }, { "name": "Terica Sender", "age": null } ] }, "brec": { "cid": 661, "name": "Lorita Kraut", "age": 43, "address": { "number": 5017, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Tennis", "Movies", "Bass" ], "children": [ { "name": "Mirian Kraut", "age": null } ] } }
+{ "arec": { "cid": 649, "name": "Anisha Sender", "age": null, "address": null, "interests": [ "Tennis", "Databases", "Bass" ], "children": [ { "name": "Viva Sender", "age": 40 }, { "name": "Terica Sender", "age": null } ] }, "brec": { "cid": 928, "name": "Maddie Diclaudio", "age": 33, "address": { "number": 4674, "street": "Washington St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Databases", "Bass" ], "children": [ { "name": "Dominique Diclaudio", "age": 12 } ] } }
+{ "arec": { "cid": 655, "name": "Shaun Brandenburg", "age": null, "address": null, "interests": [ "Skiing", "Computers", "Base Jumping" ], "children": [ { "name": "Ned Brandenburg", "age": null }, { "name": "Takako Brandenburg", "age": 41 }, { "name": "Astrid Brandenburg", "age": null }, { "name": "Patience Brandenburg", "age": null } ] }, "brec": { "cid": 996, "name": "Elouise Wider", "age": null, "address": null, "interests": [ "Coffee", "Computers", "Base Jumping" ], "children": [ ] } }
+{ "arec": { "cid": 658, "name": "Truman Leitner", "age": null, "address": null, "interests": [ "Computers", "Bass", "Walking" ], "children": [ ] }, "brec": { "cid": 838, "name": "Karan Aharon", "age": 88, "address": { "number": 8033, "street": "Washington St.", "city": "Portland" }, "interests": [ "Computers", "Movies", "Walking" ], "children": [ { "name": "Matha Aharon", "age": 16 } ] } }
+{ "arec": { "cid": 662, "name": "Domonique Corbi", "age": 13, "address": { "number": 7286, "street": "Hill St.", "city": "Seattle" }, "interests": [ "Tennis", "Cooking", "Computers" ], "children": [ { "name": "Katrice Corbi", "age": null }, { "name": "Idalia Corbi", "age": null }, { "name": "Hayley Corbi", "age": null } ] }, "brec": { "cid": 964, "name": "Stephany Soders", "age": null, "address": null, "interests": [ "Tennis", "Wine", "Computers" ], "children": [ ] } }
+{ "arec": { "cid": 670, "name": "Angelo Kellar", "age": 22, "address": { "number": 3178, "street": "View St.", "city": "Seattle" }, "interests": [ "Wine", "Music", "Fishing" ], "children": [ { "name": "Zula Kellar", "age": null }, { "name": "Brittaney Kellar", "age": 10 }, { "name": "Fredia Kellar", "age": null } ] }, "brec": { "cid": 929, "name": "Jean Guitierrez", "age": 75, "address": { "number": 9736, "street": "Lake St.", "city": "Mountain View" }, "interests": [ "Wine", "Wine", "Fishing" ], "children": [ ] } }
+{ "arec": { "cid": 694, "name": "Ariel Soltani", "age": null, "address": null, "interests": [ "Databases", "Music", "Puzzles" ], "children": [ { "name": "Aldo Soltani", "age": null }, { "name": "Anglea Soltani", "age": null } ] }, "brec": { "cid": 916, "name": "Kris Mcmarlin", "age": null, "address": null, "interests": [ "Movies", "Music", "Puzzles" ], "children": [ ] } }
+{ "arec": { "cid": 704, "name": "Melodee Clemons", "age": null, "address": null, "interests": [ "Base Jumping", "Tennis", "Video Games" ], "children": [ { "name": "Doreatha Clemons", "age": 22 } ] }, "brec": { "cid": 901, "name": "Riva Ziko", "age": null, "address": null, "interests": [ "Running", "Tennis", "Video Games" ], "children": [ { "name": "Leandra Ziko", "age": 49 }, { "name": "Torrie Ziko", "age": null } ] } }
+{ "arec": { "cid": 704, "name": "Melodee Clemons", "age": null, "address": null, "interests": [ "Base Jumping", "Tennis", "Video Games" ], "children": [ { "name": "Doreatha Clemons", "age": 22 } ] }, "brec": { "cid": 948, "name": "Thad Scialpi", "age": 22, "address": { "number": 8731, "street": "Washington St.", "city": "Portland" }, "interests": [ "Base Jumping", "Tennis", "Wine" ], "children": [ { "name": "Harlan Scialpi", "age": 10 }, { "name": "Lucile Scialpi", "age": 11 }, { "name": "Audria Scialpi", "age": null } ] } }
+{ "arec": { "cid": 710, "name": "Arlen Horka", "age": null, "address": null, "interests": [ "Movies", "Coffee", "Walking" ], "children": [ { "name": "Valencia Horka", "age": null }, { "name": "Wesley Horka", "age": null } ] }, "brec": { "cid": 923, "name": "Bobbi Ursino", "age": null, "address": null, "interests": [ "Movies", "Books", "Walking" ], "children": [ { "name": "Shon Ursino", "age": null }, { "name": "Lorean Ursino", "age": null } ] } }
+{ "arec": { "cid": 744, "name": "Crysta Christen", "age": 57, "address": { "number": 439, "street": "Hill St.", "city": "Portland" }, "interests": [ "Basketball", "Squash", "Base Jumping" ], "children": [ ] }, "brec": { "cid": 856, "name": "Inocencia Petzold", "age": 83, "address": { "number": 4631, "street": "Cedar St.", "city": "Mountain View" }, "interests": [ "Basketball", "Squash", "Movies", "Base Jumping" ], "children": [ ] } }
+{ "arec": { "cid": 769, "name": "Isaias Tenny", "age": 71, "address": { "number": 270, "street": "Park St.", "city": "Portland" }, "interests": [ "Wine", "Fishing", "Base Jumping" ], "children": [ { "name": "Theo Tenny", "age": null }, { "name": "Shena Tenny", "age": null }, { "name": "Coralee Tenny", "age": null }, { "name": "Orval Tenny", "age": 39 } ] }, "brec": { "cid": 848, "name": "Myrta Kopf", "age": null, "address": null, "interests": [ "Wine", "Basketball", "Base Jumping" ], "children": [ ] } }
+{ "arec": { "cid": 776, "name": "Dagmar Sarkis", "age": null, "address": null, "interests": [ "Basketball", "Running", "Wine" ], "children": [ { "name": "Tari Sarkis", "age": null }, { "name": "Rana Sarkis", "age": 56 }, { "name": "Merissa Sarkis", "age": null }, { "name": "Lori Sarkis", "age": 26 } ] }, "brec": { "cid": 908, "name": "Ferdinand Auila", "age": 82, "address": { "number": 1071, "street": "Lake St.", "city": "Portland" }, "interests": [ "Base Jumping", "Running", "Wine" ], "children": [ { "name": "Ai Auila", "age": 69 }, { "name": "Laurel Auila", "age": null } ] } }
+{ "arec": { "cid": 791, "name": "Jame Apresa", "age": 66, "address": { "number": 8417, "street": "Main St.", "city": "San Jose" }, "interests": [ "Running", "Puzzles", "Base Jumping" ], "children": [ { "name": "Awilda Apresa", "age": null }, { "name": "Nelle Apresa", "age": 40 }, { "name": "Terrell Apresa", "age": null }, { "name": "Malia Apresa", "age": 43 } ] }, "brec": { "cid": 801, "name": "Julio Brun", "age": 13, "address": { "number": 9774, "street": "Main St.", "city": "Sunnyvale" }, "interests": [ "Puzzles", "Running", "Puzzles", "Base Jumping" ], "children": [ { "name": "Peter Brun", "age": null }, { "name": "Remona Brun", "age": null }, { "name": "Giovanni Brun", "age": null } ] } }
+{ "arec": { "cid": 806, "name": "Corliss Sharratt", "age": null, "address": null, "interests": [ "Basketball", "Cigars", "Cooking" ], "children": [ { "name": "Albertine Sharratt", "age": null }, { "name": "Nobuko Sharratt", "age": 29 }, { "name": "Neil Sharratt", "age": null } ] }, "brec": { "cid": 861, "name": "Hugh Mcbrien", "age": null, "address": null, "interests": [ "Skiing", "Cigars", "Cooking" ], "children": [ { "name": "Otha Mcbrien", "age": 38 } ] } }
+{ "arec": { "cid": 806, "name": "Corliss Sharratt", "age": null, "address": null, "interests": [ "Basketball", "Cigars", "Cooking" ], "children": [ { "name": "Albertine Sharratt", "age": null }, { "name": "Nobuko Sharratt", "age": 29 }, { "name": "Neil Sharratt", "age": null } ] }, "brec": { "cid": 867, "name": "Denise Dipiero", "age": null, "address": null, "interests": [ "Basketball", "Cigars", "Cooking", "Running" ], "children": [ { "name": "Santa Dipiero", "age": null } ] } }
+{ "arec": { "cid": 828, "name": "Marcelle Steinhour", "age": null, "address": null, "interests": [ "Running", "Basketball", "Walking" ], "children": [ { "name": "Jimmie Steinhour", "age": 13 }, { "name": "Kirstie Steinhour", "age": 19 } ] }, "brec": { "cid": 962, "name": "Taryn Coley", "age": null, "address": null, "interests": [ "Running", "Basketball", "Cooking" ], "children": [ ] } }
+{ "arec": { "cid": 853, "name": "Denisse Peralto", "age": 25, "address": { "number": 3931, "street": "7th St.", "city": "Portland" }, "interests": [ "Tennis", "Walking", "Basketball" ], "children": [ { "name": "Asha Peralto", "age": 14 }, { "name": "Clark Peralto", "age": null }, { "name": "Jessika Peralto", "age": null }, { "name": "Nadene Peralto", "age": null } ] }, "brec": { "cid": 912, "name": "Alessandra Kaskey", "age": 52, "address": { "number": 6906, "street": "View St.", "city": "Los Angeles" }, "interests": [ "Skiing", "Walking", "Basketball" ], "children": [ { "name": "Mack Kaskey", "age": null } ] } }
+{ "arec": { "cid": 854, "name": "Angie Oyster", "age": 32, "address": { "number": 8860, "street": "Main St.", "city": "San Jose" }, "interests": [ "Coffee", "Movies", "Fishing" ], "children": [ { "name": "Hugh Oyster", "age": 10 } ] }, "brec": { "cid": 875, "name": "Ramon Crepps", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Elisha Crepps", "age": null } ] } }
+{ "arec": { "cid": 854, "name": "Angie Oyster", "age": 32, "address": { "number": 8860, "street": "Main St.", "city": "San Jose" }, "interests": [ "Coffee", "Movies", "Fishing" ], "children": [ { "name": "Hugh Oyster", "age": 10 } ] }, "brec": { "cid": 984, "name": "Janett Kitchens", "age": 66, "address": { "number": 7558, "street": "View St.", "city": "Mountain View" }, "interests": [ "Coffee", "Movies", "Squash" ], "children": [ { "name": "Grayce Kitchens", "age": 14 }, { "name": "Dwayne Kitchens", "age": null }, { "name": "Wilber Kitchens", "age": 51 }, { "name": "Nancey Kitchens", "age": null } ] } }
+{ "arec": { "cid": 859, "name": "Mozelle Catillo", "age": 61, "address": { "number": 253, "street": "View St.", "city": "Los Angeles" }, "interests": [ "Databases", "Cooking", "Wine" ], "children": [ ] }, "brec": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Databases", "Fishing", "Wine" ], "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] } }
+{ "arec": { "cid": 875, "name": "Ramon Crepps", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Elisha Crepps", "age": null } ] }, "brec": { "cid": 984, "name": "Janett Kitchens", "age": 66, "address": { "number": 7558, "street": "View St.", "city": "Mountain View" }, "interests": [ "Coffee", "Movies", "Squash" ], "children": [ { "name": "Grayce Kitchens", "age": 14 }, { "name": "Dwayne Kitchens", "age": null }, { "name": "Wilber Kitchens", "age": 51 }, { "name": "Nancey Kitchens", "age": null } ] } }
+{ "arec": { "cid": 892, "name": "Madge Hendson", "age": 79, "address": { "number": 8832, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Databases", "Fishing", "Skiing" ], "children": [ { "name": "Elia Hendson", "age": 48 }, { "name": "Lashawn Hendson", "age": 27 } ] }, "brec": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Databases", "Fishing", "Wine" ], "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] } }
+{ "arec": { "cid": 908, "name": "Ferdinand Auila", "age": 82, "address": { "number": 1071, "street": "Lake St.", "city": "Portland" }, "interests": [ "Base Jumping", "Running", "Wine" ], "children": [ { "name": "Ai Auila", "age": 69 }, { "name": "Laurel Auila", "age": null } ] }, "brec": { "cid": 948, "name": "Thad Scialpi", "age": 22, "address": { "number": 8731, "street": "Washington St.", "city": "Portland" }, "interests": [ "Base Jumping", "Tennis", "Wine" ], "children": [ { "name": "Harlan Scialpi", "age": 10 }, { "name": "Lucile Scialpi", "age": 11 }, { "name": "Audria Scialpi", "age": null } ] } }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join/olist-jaccard-inline.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/olist-jaccard-inline.adm
new file mode 100644
index 0000000..1db0814
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/olist-jaccard-inline.adm
@@ -0,0 +1,115 @@
+{ "a": { "cid": 2, "name": "Elin Debell", "age": 82, "address": { "number": 5649, "street": "Hill St.", "city": "Portland" }, "interests": [ "Bass", "Wine" ], "children": [ { "name": "Elvina Debell", "age": null }, { "name": "Renaldo Debell", "age": 51 }, { "name": "Divina Debell", "age": 57 } ] }, "b": { "cid": 897, "name": "Gerald Roehrman", "age": null, "address": null, "interests": [ "Bass", "Wine" ], "children": [ { "name": "Virgie Roehrman", "age": 28 }, { "name": "Akiko Roehrman", "age": 59 }, { "name": "Robbie Roehrman", "age": 10 }, { "name": "Flavia Roehrman", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 5, "name": "Heide Naifeh", "age": null, "address": null, "interests": [ "Music", "Databases" ], "children": [ { "name": "Deirdre Naifeh", "age": null }, { "name": "Jacquelyne Naifeh", "age": 39 } ] }, "b": { "cid": 215, "name": "Ashton Schadegg", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Ciara Schadegg", "age": null }, { "name": "Karisa Schadegg", "age": 11 }, { "name": "Hayden Schadegg", "age": 44 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 5, "name": "Heide Naifeh", "age": null, "address": null, "interests": [ "Music", "Databases" ], "children": [ { "name": "Deirdre Naifeh", "age": null }, { "name": "Jacquelyne Naifeh", "age": 39 } ] }, "b": { "cid": 228, "name": "Donnette Brumbley", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Madlyn Brumbley", "age": null }, { "name": "Apolonia Brumbley", "age": 13 }, { "name": "Stephine Brumbley", "age": null }, { "name": "Zelma Brumbley", "age": 51 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 5, "name": "Heide Naifeh", "age": null, "address": null, "interests": [ "Music", "Databases" ], "children": [ { "name": "Deirdre Naifeh", "age": null }, { "name": "Jacquelyne Naifeh", "age": 39 } ] }, "b": { "cid": 731, "name": "Yajaira Orto", "age": null, "address": null, "interests": [ "Music", "Databases" ], "children": [ { "name": "Eliz Orto", "age": 17 }, { "name": "Gisela Orto", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 5, "name": "Heide Naifeh", "age": null, "address": null, "interests": [ "Music", "Databases" ], "children": [ { "name": "Deirdre Naifeh", "age": null }, { "name": "Jacquelyne Naifeh", "age": 39 } ] }, "b": { "cid": 795, "name": "Sharilyn Branstad", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Ashlee Branstad", "age": 24 }, { "name": "Bobbye Branstad", "age": 26 }, { "name": "Natalya Branstad", "age": null }, { "name": "Edith Branstad", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 11, "name": "Meta Simek", "age": 13, "address": { "number": 4384, "street": "7th St.", "city": "San Jose" }, "interests": [ "Wine", "Walking" ], "children": [ { "name": "Oretha Simek", "age": null }, { "name": "Terence Simek", "age": null } ] }, "b": { "cid": 389, "name": "Loraine Morfee", "age": 72, "address": { "number": 2945, "street": "Lake St.", "city": "Seattle" }, "interests": [ "Wine", "Walking" ], "children": [ { "name": "Berry Morfee", "age": 30 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 11, "name": "Meta Simek", "age": 13, "address": { "number": 4384, "street": "7th St.", "city": "San Jose" }, "interests": [ "Wine", "Walking" ], "children": [ { "name": "Oretha Simek", "age": null }, { "name": "Terence Simek", "age": null } ] }, "b": { "cid": 607, "name": "Bert Garigliano", "age": 71, "address": { "number": 3881, "street": "Washington St.", "city": "San Jose" }, "interests": [ "Walking", "Wine" ], "children": [ { "name": "Junior Garigliano", "age": 42 }, { "name": "Willa Garigliano", "age": 21 }, { "name": "Carlo Garigliano", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 17, "name": "Ingeborg Monkhouse", "age": null, "address": null, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] }, "b": { "cid": 156, "name": "Bobbye Kauppi", "age": 79, "address": { "number": 2051, "street": "Hill St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 27, "name": "Hollie Hyun", "age": null, "address": null, "interests": [ "Skiing", "Walking" ], "children": [ { "name": "Morton Hyun", "age": null }, { "name": "Farrah Hyun", "age": 40 }, { "name": "Ali Hyun", "age": null } ] }, "b": { "cid": 542, "name": "Eveline Smedley", "age": 50, "address": { "number": 5513, "street": "Oak St.", "city": "San Jose" }, "interests": [ "Skiing", "Walking" ], "children": [ { "name": "Lynsey Smedley", "age": 26 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 32, "name": "Tia Berkley", "age": 30, "address": { "number": 4507, "street": "Park St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Music" ], "children": [ { "name": "Carmon Berkley", "age": null }, { "name": "Kristina Berkley", "age": null }, { "name": "Cristi Berkley", "age": 19 } ] }, "b": { "cid": 304, "name": "Francine Reddin", "age": 39, "address": { "number": 9392, "street": "Hill St.", "city": "Seattle" }, "interests": [ "Music", "Base Jumping" ], "children": [ { "name": "Millicent Reddin", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 32, "name": "Tia Berkley", "age": 30, "address": { "number": 4507, "street": "Park St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Music" ], "children": [ { "name": "Carmon Berkley", "age": null }, { "name": "Kristina Berkley", "age": null }, { "name": "Cristi Berkley", "age": 19 } ] }, "b": { "cid": 501, "name": "Alyce Coant", "age": null, "address": null, "interests": [ "Music", "Base Jumping" ], "children": [ { "name": "Elyse Coant", "age": 50 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 33, "name": "Rayford Velmontes", "age": null, "address": null, "interests": [ "Fishing", "Video Games" ], "children": [ ] }, "b": { "cid": 519, "name": "Julianna Goodsell", "age": 59, "address": { "number": 5594, "street": "Lake St.", "city": "Seattle" }, "interests": [ "Video Games", "Fishing" ], "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 39, "name": "Brock Froncillo", "age": 72, "address": { "number": 4645, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Skiing" ], "children": [ { "name": "Cole Froncillo", "age": null }, { "name": "Ivana Froncillo", "age": null }, { "name": "Hugh Froncillo", "age": 23 } ] }, "b": { "cid": 393, "name": "Rossana Monton", "age": 34, "address": { "number": 4490, "street": "Main St.", "city": "Portland" }, "interests": [ "Skiing", "Base Jumping" ], "children": [ { "name": "Glayds Monton", "age": null }, { "name": "Lily Monton", "age": null }, { "name": "Raina Monton", "age": null }, { "name": "Hilma Monton", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 39, "name": "Brock Froncillo", "age": 72, "address": { "number": 4645, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Skiing" ], "children": [ { "name": "Cole Froncillo", "age": null }, { "name": "Ivana Froncillo", "age": null }, { "name": "Hugh Froncillo", "age": 23 } ] }, "b": { "cid": 493, "name": "Lindsey Trout", "age": 86, "address": { "number": 7619, "street": "Cedar St.", "city": "Portland" }, "interests": [ "Base Jumping", "Skiing" ], "children": [ { "name": "Madlyn Trout", "age": 58 }, { "name": "Amie Trout", "age": 72 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 41, "name": "Kevin Giottonini", "age": null, "address": null, "interests": [ "Skiing", "Bass" ], "children": [ { "name": "Victor Giottonini", "age": 37 }, { "name": "Alverta Giottonini", "age": null } ] }, "b": { "cid": 182, "name": "Christiana Westlie", "age": null, "address": null, "interests": [ "Skiing", "Bass" ], "children": [ { "name": "Ilda Westlie", "age": 18 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 41, "name": "Kevin Giottonini", "age": null, "address": null, "interests": [ "Skiing", "Bass" ], "children": [ { "name": "Victor Giottonini", "age": 37 }, { "name": "Alverta Giottonini", "age": null } ] }, "b": { "cid": 730, "name": "Marti Vandoren", "age": null, "address": null, "interests": [ "Skiing", "Bass" ], "children": [ { "name": "Carroll Vandoren", "age": null }, { "name": "Lorretta Vandoren", "age": 30 }, { "name": "Chloe Vandoren", "age": 42 }, { "name": "Ilona Vandoren", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 41, "name": "Kevin Giottonini", "age": null, "address": null, "interests": [ "Skiing", "Bass" ], "children": [ { "name": "Victor Giottonini", "age": 37 }, { "name": "Alverta Giottonini", "age": null } ] }, "b": { "cid": 982, "name": "Jude Brandsrud", "age": 41, "address": { "number": 7133, "street": "Washington St.", "city": "Seattle" }, "interests": [ "Bass", "Skiing" ], "children": [ { "name": "Scottie Brandsrud", "age": null }, { "name": "Gennie Brandsrud", "age": 10 }, { "name": "Agnes Brandsrud", "age": null }, { "name": "Clarinda Brandsrud", "age": 17 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 42, "name": "Asley Simco", "age": 38, "address": { "number": 3322, "street": "Main St.", "city": "Mountain View" }, "interests": [ "Fishing", "Running", "Cigars" ], "children": [ { "name": "Micheal Simco", "age": null }, { "name": "Lawerence Simco", "age": null } ] }, "b": { "cid": 753, "name": "Maris Bannett", "age": null, "address": null, "interests": [ "Fishing", "Cigars", "Running" ], "children": [ { "name": "Libbie Bannett", "age": 11 }, { "name": "Francina Bannett", "age": 21 }, { "name": "Tuyet Bannett", "age": null }, { "name": "Zona Bannett", "age": 32 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 56, "name": "Andria Killelea", "age": null, "address": null, "interests": [ "Cigars", "Skiing" ], "children": [ ] }, "b": { "cid": 857, "name": "Kasie Fujioka", "age": null, "address": null, "interests": [ "Skiing", "Cigars" ], "children": [ { "name": "Leontine Fujioka", "age": null }, { "name": "Nga Fujioka", "age": 21 }, { "name": "Nathanael Fujioka", "age": 27 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 71, "name": "Alva Sieger", "age": null, "address": null, "interests": [ "Movies", "Walking" ], "children": [ { "name": "Renetta Sieger", "age": null }, { "name": "Shiloh Sieger", "age": 57 }, { "name": "Lavina Sieger", "age": null }, { "name": "Larraine Sieger", "age": null } ] }, "b": { "cid": 758, "name": "Akiko Hoenstine", "age": 56, "address": { "number": 8888, "street": "Lake St.", "city": "Portland" }, "interests": [ "Movies", "Walking" ], "children": [ { "name": "Maren Hoenstine", "age": null }, { "name": "Tyler Hoenstine", "age": null }, { "name": "Jesse Hoenstine", "age": 40 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 74, "name": "Lonnie Ercolani", "age": 79, "address": { "number": 2655, "street": "Lake St.", "city": "Los Angeles" }, "interests": [ "Music", "Coffee" ], "children": [ { "name": "Cassi Ercolani", "age": null } ] }, "b": { "cid": 325, "name": "Ai Tarleton", "age": null, "address": null, "interests": [ "Coffee", "Music" ], "children": [ { "name": "Risa Tarleton", "age": 24 }, { "name": "Leonila Tarleton", "age": null }, { "name": "Thomasina Tarleton", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 76, "name": "Opal Blewett", "age": null, "address": null, "interests": [ "Running", "Coffee", "Fishing" ], "children": [ { "name": "Violette Blewett", "age": null } ] }, "b": { "cid": 455, "name": "Manual Altizer", "age": 70, "address": { "number": 6293, "street": "7th St.", "city": "Portland" }, "interests": [ "Running", "Fishing", "Coffee" ], "children": [ { "name": "Katherine Altizer", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 77, "name": "Chantal Parriera", "age": 78, "address": { "number": 5967, "street": "Lake St.", "city": "San Jose" }, "interests": [ "Squash", "Movies", "Coffee" ], "children": [ ] }, "b": { "cid": 984, "name": "Janett Kitchens", "age": 66, "address": { "number": 7558, "street": "View St.", "city": "Mountain View" }, "interests": [ "Coffee", "Movies", "Squash" ], "children": [ { "name": "Grayce Kitchens", "age": 14 }, { "name": "Dwayne Kitchens", "age": null }, { "name": "Wilber Kitchens", "age": 51 }, { "name": "Nancey Kitchens", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 84, "name": "Huong Kachel", "age": null, "address": null, "interests": [ "Music", "Tennis", "Base Jumping" ], "children": [ { "name": "Katlyn Kachel", "age": 40 }, { "name": "Sherman Kachel", "age": null }, { "name": "Susana Kachel", "age": 32 } ] }, "b": { "cid": 633, "name": "Shalon Grauberger", "age": 34, "address": { "number": 765, "street": "Washington St.", "city": "Sunnyvale" }, "interests": [ "Music", "Base Jumping", "Tennis" ], "children": [ { "name": "Kris Grauberger", "age": 14 }, { "name": "Stuart Grauberger", "age": 12 }, { "name": "Billy Grauberger", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 101, "name": "Meaghan Vandel", "age": null, "address": null, "interests": [ "Music", "Base Jumping", "Books" ], "children": [ { "name": "Larissa Vandel", "age": null } ] }, "b": { "cid": 289, "name": "Clarence Milette", "age": 16, "address": { "number": 3778, "street": "Oak St.", "city": "Seattle" }, "interests": [ "Books", "Base Jumping", "Music" ], "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 106, "name": "Charles Verna", "age": null, "address": null, "interests": [ "Bass", "Books" ], "children": [ { "name": "Betsy Verna", "age": 37 }, { "name": "Chae Verna", "age": 35 }, { "name": "Naoma Verna", "age": 42 } ] }, "b": { "cid": 394, "name": "Lizette Roux", "age": 57, "address": { "number": 458, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Bass", "Books" ], "children": [ { "name": "Doloris Roux", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 106, "name": "Charles Verna", "age": null, "address": null, "interests": [ "Bass", "Books" ], "children": [ { "name": "Betsy Verna", "age": 37 }, { "name": "Chae Verna", "age": 35 }, { "name": "Naoma Verna", "age": 42 } ] }, "b": { "cid": 523, "name": "Johanne Huls", "age": null, "address": null, "interests": [ "Books", "Bass" ], "children": [ { "name": "Melynda Huls", "age": null }, { "name": "Vicky Huls", "age": 16 }, { "name": "Charlott Huls", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 119, "name": "Chan Morreau", "age": 22, "address": { "number": 1774, "street": "Lake St.", "city": "Mountain View" }, "interests": [ "Puzzles", "Squash" ], "children": [ { "name": "Arlette Morreau", "age": null } ] }, "b": { "cid": 592, "name": "Rachelle Spare", "age": 13, "address": { "number": 8088, "street": "Oak St.", "city": "Portland" }, "interests": [ "Squash", "Puzzles" ], "children": [ { "name": "Theo Spare", "age": null }, { "name": "Shizue Spare", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 132, "name": "Cindi Turntine", "age": 64, "address": { "number": 9432, "street": "Park St.", "city": "Portland" }, "interests": [ "Computers", "Wine" ], "children": [ { "name": "Howard Turntine", "age": null } ] }, "b": { "cid": 177, "name": "Wilda Hanisch", "age": null, "address": null, "interests": [ "Wine", "Computers" ], "children": [ { "name": "Shannan Hanisch", "age": null }, { "name": "Marissa Hanisch", "age": 30 }, { "name": "Keely Hanisch", "age": 54 }, { "name": "Humberto Hanisch", "age": 17 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 132, "name": "Cindi Turntine", "age": 64, "address": { "number": 9432, "street": "Park St.", "city": "Portland" }, "interests": [ "Computers", "Wine" ], "children": [ { "name": "Howard Turntine", "age": null } ] }, "b": { "cid": 716, "name": "Deirdre Bruderer", "age": null, "address": null, "interests": [ "Computers", "Wine" ], "children": [ { "name": "Coralee Bruderer", "age": null }, { "name": "Mina Bruderer", "age": null }, { "name": "Lindsey Bruderer", "age": 35 }, { "name": "Yi Bruderer", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 132, "name": "Cindi Turntine", "age": 64, "address": { "number": 9432, "street": "Park St.", "city": "Portland" }, "interests": [ "Computers", "Wine" ], "children": [ { "name": "Howard Turntine", "age": null } ] }, "b": { "cid": 890, "name": "Janise Maccarthy", "age": 66, "address": { "number": 7337, "street": "Main St.", "city": "San Jose" }, "interests": [ "Wine", "Computers" ], "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 138, "name": "Ora Villafane", "age": null, "address": null, "interests": [ "Walking", "Cooking" ], "children": [ { "name": "Deeann Villafane", "age": 22 }, { "name": "Cody Villafane", "age": 47 } ] }, "b": { "cid": 369, "name": "Nickole Dory", "age": 10, "address": { "number": 4761, "street": "View St.", "city": "Portland" }, "interests": [ "Walking", "Cooking" ], "children": [ { "name": "Annmarie Dory", "age": null }, { "name": "Michele Dory", "age": null }, { "name": "Annamae Dory", "age": null }, { "name": "Flora Dory", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 138, "name": "Ora Villafane", "age": null, "address": null, "interests": [ "Walking", "Cooking" ], "children": [ { "name": "Deeann Villafane", "age": 22 }, { "name": "Cody Villafane", "age": 47 } ] }, "b": { "cid": 816, "name": "Cheyenne Eddie", "age": null, "address": null, "interests": [ "Walking", "Cooking" ], "children": [ { "name": "Kathe Eddie", "age": null }, { "name": "Charles Eddie", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 144, "name": "Celesta Sosebee", "age": 19, "address": { "number": 2683, "street": "7th St.", "city": "Portland" }, "interests": [ "Databases", "Databases" ], "children": [ { "name": "Jesse Sosebee", "age": null }, { "name": "Oralee Sosebee", "age": null }, { "name": "Sunday Sosebee", "age": null } ] }, "b": { "cid": 513, "name": "Marianna Gortman", "age": 49, "address": { "number": 927, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Databases", "Databases" ], "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 144, "name": "Celesta Sosebee", "age": 19, "address": { "number": 2683, "street": "7th St.", "city": "Portland" }, "interests": [ "Databases", "Databases" ], "children": [ { "name": "Jesse Sosebee", "age": null }, { "name": "Oralee Sosebee", "age": null }, { "name": "Sunday Sosebee", "age": null } ] }, "b": { "cid": 520, "name": "Janay Bernbeck", "age": null, "address": null, "interests": [ "Databases", "Databases" ], "children": [ { "name": "Aurea Bernbeck", "age": null }, { "name": "Tiara Bernbeck", "age": null }, { "name": "Alfredia Bernbeck", "age": 26 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 146, "name": "Glennis Vanruiten", "age": 14, "address": { "number": 8272, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Squash", "Databases" ], "children": [ { "name": "Joanie Vanruiten", "age": null }, { "name": "Long Vanruiten", "age": null }, { "name": "Abdul Vanruiten", "age": null } ] }, "b": { "cid": 532, "name": "Tania Fraklin", "age": 38, "address": { "number": 2857, "street": "Washington St.", "city": "Seattle" }, "interests": [ "Squash", "Databases" ], "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 177, "name": "Wilda Hanisch", "age": null, "address": null, "interests": [ "Wine", "Computers" ], "children": [ { "name": "Shannan Hanisch", "age": null }, { "name": "Marissa Hanisch", "age": 30 }, { "name": "Keely Hanisch", "age": 54 }, { "name": "Humberto Hanisch", "age": 17 } ] }, "b": { "cid": 716, "name": "Deirdre Bruderer", "age": null, "address": null, "interests": [ "Computers", "Wine" ], "children": [ { "name": "Coralee Bruderer", "age": null }, { "name": "Mina Bruderer", "age": null }, { "name": "Lindsey Bruderer", "age": 35 }, { "name": "Yi Bruderer", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 177, "name": "Wilda Hanisch", "age": null, "address": null, "interests": [ "Wine", "Computers" ], "children": [ { "name": "Shannan Hanisch", "age": null }, { "name": "Marissa Hanisch", "age": 30 }, { "name": "Keely Hanisch", "age": 54 }, { "name": "Humberto Hanisch", "age": 17 } ] }, "b": { "cid": 890, "name": "Janise Maccarthy", "age": 66, "address": { "number": 7337, "street": "Main St.", "city": "San Jose" }, "interests": [ "Wine", "Computers" ], "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 182, "name": "Christiana Westlie", "age": null, "address": null, "interests": [ "Skiing", "Bass" ], "children": [ { "name": "Ilda Westlie", "age": 18 } ] }, "b": { "cid": 730, "name": "Marti Vandoren", "age": null, "address": null, "interests": [ "Skiing", "Bass" ], "children": [ { "name": "Carroll Vandoren", "age": null }, { "name": "Lorretta Vandoren", "age": 30 }, { "name": "Chloe Vandoren", "age": 42 }, { "name": "Ilona Vandoren", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 182, "name": "Christiana Westlie", "age": null, "address": null, "interests": [ "Skiing", "Bass" ], "children": [ { "name": "Ilda Westlie", "age": 18 } ] }, "b": { "cid": 982, "name": "Jude Brandsrud", "age": 41, "address": { "number": 7133, "street": "Washington St.", "city": "Seattle" }, "interests": [ "Bass", "Skiing" ], "children": [ { "name": "Scottie Brandsrud", "age": null }, { "name": "Gennie Brandsrud", "age": 10 }, { "name": "Agnes Brandsrud", "age": null }, { "name": "Clarinda Brandsrud", "age": 17 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 190, "name": "Kristel Axelson", "age": null, "address": null, "interests": [ "Movies", "Books" ], "children": [ { "name": "Deja Axelson", "age": null } ] }, "b": { "cid": 295, "name": "Guillermina Florek", "age": 61, "address": { "number": 3704, "street": "Washington St.", "city": "Mountain View" }, "interests": [ "Movies", "Books" ], "children": [ { "name": "Donnie Florek", "age": null }, { "name": "Jeannetta Florek", "age": 38 }, { "name": "Leigha Florek", "age": null }, { "name": "Zenobia Florek", "age": 10 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 190, "name": "Kristel Axelson", "age": null, "address": null, "interests": [ "Movies", "Books" ], "children": [ { "name": "Deja Axelson", "age": null } ] }, "b": { "cid": 877, "name": "Nicki Lipkind", "age": null, "address": null, "interests": [ "Books", "Movies" ], "children": [ { "name": "Yahaira Lipkind", "age": 12 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 190, "name": "Kristel Axelson", "age": null, "address": null, "interests": [ "Movies", "Books" ], "children": [ { "name": "Deja Axelson", "age": null } ] }, "b": { "cid": 974, "name": "Alexis Malcomson", "age": null, "address": null, "interests": [ "Movies", "Books" ], "children": [ { "name": "Kerri Malcomson", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 202, "name": "Evangelina Poloskey", "age": 46, "address": { "number": 8285, "street": "Main St.", "city": "Los Angeles" }, "interests": [ "Wine", "Squash" ], "children": [ { "name": "Anthony Poloskey", "age": 27 }, { "name": "Olga Poloskey", "age": 10 }, { "name": "Carmon Poloskey", "age": 13 }, { "name": "Tanja Poloskey", "age": 20 } ] }, "b": { "cid": 599, "name": "Alva Molaison", "age": 87, "address": { "number": 5974, "street": "Washington St.", "city": "Seattle" }, "interests": [ "Wine", "Squash" ], "children": [ { "name": "Milo Molaison", "age": 39 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 210, "name": "Jillian Roadruck", "age": null, "address": null, "interests": [ "Coffee", "Tennis" ], "children": [ { "name": "Marguerite Roadruck", "age": null }, { "name": "Ilana Roadruck", "age": null }, { "name": "Chantelle Roadruck", "age": 19 }, { "name": "Nikia Roadruck", "age": 43 } ] }, "b": { "cid": 317, "name": "Zona Caffarel", "age": 52, "address": { "number": 9419, "street": "Cedar St.", "city": "Seattle" }, "interests": [ "Tennis", "Coffee" ], "children": [ { "name": "Cortez Caffarel", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 210, "name": "Jillian Roadruck", "age": null, "address": null, "interests": [ "Coffee", "Tennis" ], "children": [ { "name": "Marguerite Roadruck", "age": null }, { "name": "Ilana Roadruck", "age": null }, { "name": "Chantelle Roadruck", "age": 19 }, { "name": "Nikia Roadruck", "age": 43 } ] }, "b": { "cid": 771, "name": "Marisela Tredo", "age": null, "address": null, "interests": [ "Tennis", "Coffee" ], "children": [ { "name": "Ardell Tredo", "age": 21 }, { "name": "Evelynn Tredo", "age": 16 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 214, "name": "Louvenia Zaffalon", "age": null, "address": null, "interests": [ "Skiing", "Books" ], "children": [ ] }, "b": { "cid": 270, "name": "Lavon Ascenzo", "age": null, "address": null, "interests": [ "Books", "Skiing" ], "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 215, "name": "Ashton Schadegg", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Ciara Schadegg", "age": null }, { "name": "Karisa Schadegg", "age": 11 }, { "name": "Hayden Schadegg", "age": 44 } ] }, "b": { "cid": 228, "name": "Donnette Brumbley", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Madlyn Brumbley", "age": null }, { "name": "Apolonia Brumbley", "age": 13 }, { "name": "Stephine Brumbley", "age": null }, { "name": "Zelma Brumbley", "age": 51 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 215, "name": "Ashton Schadegg", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Ciara Schadegg", "age": null }, { "name": "Karisa Schadegg", "age": 11 }, { "name": "Hayden Schadegg", "age": 44 } ] }, "b": { "cid": 731, "name": "Yajaira Orto", "age": null, "address": null, "interests": [ "Music", "Databases" ], "children": [ { "name": "Eliz Orto", "age": 17 }, { "name": "Gisela Orto", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 215, "name": "Ashton Schadegg", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Ciara Schadegg", "age": null }, { "name": "Karisa Schadegg", "age": 11 }, { "name": "Hayden Schadegg", "age": 44 } ] }, "b": { "cid": 795, "name": "Sharilyn Branstad", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Ashlee Branstad", "age": 24 }, { "name": "Bobbye Branstad", "age": 26 }, { "name": "Natalya Branstad", "age": null }, { "name": "Edith Branstad", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 218, "name": "Clarinda Stagliano", "age": 76, "address": { "number": 3258, "street": "Park St.", "city": "San Jose" }, "interests": [ "Video Games", "Cigars" ], "children": [ ] }, "b": { "cid": 271, "name": "Carey Ronin", "age": 44, "address": { "number": 8141, "street": "Oak St.", "city": "Mountain View" }, "interests": [ "Cigars", "Video Games" ], "children": [ { "name": "Lonny Ronin", "age": null }, { "name": "Armanda Ronin", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 218, "name": "Clarinda Stagliano", "age": 76, "address": { "number": 3258, "street": "Park St.", "city": "San Jose" }, "interests": [ "Video Games", "Cigars" ], "children": [ ] }, "b": { "cid": 689, "name": "Camila Cho", "age": 70, "address": { "number": 7731, "street": "Cedar St.", "city": "Mountain View" }, "interests": [ "Video Games", "Cigars" ], "children": [ { "name": "Myrtie Cho", "age": 57 }, { "name": "Merideth Cho", "age": 45 }, { "name": "Meta Cho", "age": 20 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 222, "name": "Malcom Bloomgren", "age": 39, "address": { "number": 4674, "street": "Hill St.", "city": "Mountain View" }, "interests": [ "Databases", "Skiing" ], "children": [ { "name": "Rosia Bloomgren", "age": null }, { "name": "Bryant Bloomgren", "age": 15 }, { "name": "Donnie Bloomgren", "age": null } ] }, "b": { "cid": 322, "name": "Jaclyn Ettl", "age": 83, "address": { "number": 4500, "street": "Main St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Skiing" ], "children": [ { "name": "Noah Ettl", "age": 30 }, { "name": "Kesha Ettl", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 223, "name": "Margurite Embelton", "age": 19, "address": { "number": 554, "street": "Oak St.", "city": "Portland" }, "interests": [ "Running", "Fishing" ], "children": [ { "name": "Sherie Embelton", "age": null }, { "name": "Monica Embelton", "age": null }, { "name": "Jeanne Embelton", "age": null }, { "name": "Santiago Embelton", "age": null } ] }, "b": { "cid": 571, "name": "Lenita Tentler", "age": null, "address": null, "interests": [ "Running", "Fishing" ], "children": [ { "name": "Damian Tentler", "age": 16 }, { "name": "Camellia Tentler", "age": null }, { "name": "Vern Tentler", "age": 15 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 228, "name": "Donnette Brumbley", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Madlyn Brumbley", "age": null }, { "name": "Apolonia Brumbley", "age": 13 }, { "name": "Stephine Brumbley", "age": null }, { "name": "Zelma Brumbley", "age": 51 } ] }, "b": { "cid": 731, "name": "Yajaira Orto", "age": null, "address": null, "interests": [ "Music", "Databases" ], "children": [ { "name": "Eliz Orto", "age": 17 }, { "name": "Gisela Orto", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 228, "name": "Donnette Brumbley", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Madlyn Brumbley", "age": null }, { "name": "Apolonia Brumbley", "age": 13 }, { "name": "Stephine Brumbley", "age": null }, { "name": "Zelma Brumbley", "age": 51 } ] }, "b": { "cid": 795, "name": "Sharilyn Branstad", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Ashlee Branstad", "age": 24 }, { "name": "Bobbye Branstad", "age": 26 }, { "name": "Natalya Branstad", "age": null }, { "name": "Edith Branstad", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 241, "name": "Lesha Ambrosia", "age": 49, "address": { "number": 6133, "street": "Cedar St.", "city": "Portland" }, "interests": [ "Base Jumping", "Running" ], "children": [ { "name": "Venice Ambrosia", "age": null } ] }, "b": { "cid": 277, "name": "Malena Smock", "age": null, "address": null, "interests": [ "Running", "Base Jumping" ], "children": [ { "name": "Inocencia Smock", "age": 50 }, { "name": "Cleveland Smock", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 241, "name": "Lesha Ambrosia", "age": 49, "address": { "number": 6133, "street": "Cedar St.", "city": "Portland" }, "interests": [ "Base Jumping", "Running" ], "children": [ { "name": "Venice Ambrosia", "age": null } ] }, "b": { "cid": 543, "name": "Pearl Nollette", "age": null, "address": null, "interests": [ "Base Jumping", "Running" ], "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 254, "name": "Jeanice Longanecker", "age": 74, "address": { "number": 2613, "street": "Oak St.", "city": "San Jose" }, "interests": [ "Books", "Base Jumping" ], "children": [ ] }, "b": { "cid": 467, "name": "Magali Ingerson", "age": null, "address": null, "interests": [ "Books", "Base Jumping" ], "children": [ { "name": "Monty Ingerson", "age": 11 }, { "name": "Noelia Ingerson", "age": 47 }, { "name": "Tennie Ingerson", "age": null }, { "name": "Merrill Ingerson", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 254, "name": "Jeanice Longanecker", "age": 74, "address": { "number": 2613, "street": "Oak St.", "city": "San Jose" }, "interests": [ "Books", "Base Jumping" ], "children": [ ] }, "b": { "cid": 632, "name": "Keeley Goga", "age": null, "address": null, "interests": [ "Books", "Base Jumping" ], "children": [ { "name": "Walter Goga", "age": 39 }, { "name": "Chaya Goga", "age": null }, { "name": "Melodie Goga", "age": null }, { "name": "Isidro Goga", "age": 32 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 259, "name": "Aurelio Darrigo", "age": 45, "address": { "number": 1114, "street": "Park St.", "city": "San Jose" }, "interests": [ "Cooking", "Running" ], "children": [ { "name": "Leonard Darrigo", "age": 22 }, { "name": "Aron Darrigo", "age": null }, { "name": "Pamelia Darrigo", "age": 14 } ] }, "b": { "cid": 379, "name": "Penney Huslander", "age": 58, "address": { "number": 6919, "street": "7th St.", "city": "Portland" }, "interests": [ "Cooking", "Running" ], "children": [ { "name": "Magaret Huslander", "age": null }, { "name": "Dodie Huslander", "age": 14 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 260, "name": "Hedwig Caminero", "age": 81, "address": { "number": 4305, "street": "7th St.", "city": "Portland" }, "interests": [ "Video Games", "Databases" ], "children": [ { "name": "Hal Caminero", "age": null }, { "name": "Cierra Caminero", "age": 32 } ] }, "b": { "cid": 298, "name": "Brittny Christin", "age": null, "address": null, "interests": [ "Databases", "Video Games" ], "children": [ { "name": "Hilario Christin", "age": null }, { "name": "Clarine Christin", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 260, "name": "Hedwig Caminero", "age": 81, "address": { "number": 4305, "street": "7th St.", "city": "Portland" }, "interests": [ "Video Games", "Databases" ], "children": [ { "name": "Hal Caminero", "age": null }, { "name": "Cierra Caminero", "age": 32 } ] }, "b": { "cid": 591, "name": "Matthew Tenhaeff", "age": null, "address": null, "interests": [ "Databases", "Video Games" ], "children": [ { "name": "Jan Tenhaeff", "age": 25 }, { "name": "Nana Tenhaeff", "age": null }, { "name": "Laticia Tenhaeff", "age": null }, { "name": "Ara Tenhaeff", "age": 44 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 271, "name": "Carey Ronin", "age": 44, "address": { "number": 8141, "street": "Oak St.", "city": "Mountain View" }, "interests": [ "Cigars", "Video Games" ], "children": [ { "name": "Lonny Ronin", "age": null }, { "name": "Armanda Ronin", "age": null } ] }, "b": { "cid": 689, "name": "Camila Cho", "age": 70, "address": { "number": 7731, "street": "Cedar St.", "city": "Mountain View" }, "interests": [ "Video Games", "Cigars" ], "children": [ { "name": "Myrtie Cho", "age": 57 }, { "name": "Merideth Cho", "age": 45 }, { "name": "Meta Cho", "age": 20 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 277, "name": "Malena Smock", "age": null, "address": null, "interests": [ "Running", "Base Jumping" ], "children": [ { "name": "Inocencia Smock", "age": 50 }, { "name": "Cleveland Smock", "age": null } ] }, "b": { "cid": 543, "name": "Pearl Nollette", "age": null, "address": null, "interests": [ "Base Jumping", "Running" ], "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 285, "name": "Edgar Farlin", "age": 75, "address": { "number": 3833, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Coffee", "Databases" ], "children": [ { "name": "Stefanie Farlin", "age": 60 }, { "name": "Catina Farlin", "age": null }, { "name": "Lizzie Farlin", "age": null }, { "name": "Beau Farlin", "age": null } ] }, "b": { "cid": 805, "name": "Gaylord Ginder", "age": null, "address": null, "interests": [ "Databases", "Coffee" ], "children": [ { "name": "Lucina Ginder", "age": null }, { "name": "Harriett Ginder", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 295, "name": "Guillermina Florek", "age": 61, "address": { "number": 3704, "street": "Washington St.", "city": "Mountain View" }, "interests": [ "Movies", "Books" ], "children": [ { "name": "Donnie Florek", "age": null }, { "name": "Jeannetta Florek", "age": 38 }, { "name": "Leigha Florek", "age": null }, { "name": "Zenobia Florek", "age": 10 } ] }, "b": { "cid": 877, "name": "Nicki Lipkind", "age": null, "address": null, "interests": [ "Books", "Movies" ], "children": [ { "name": "Yahaira Lipkind", "age": 12 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 295, "name": "Guillermina Florek", "age": 61, "address": { "number": 3704, "street": "Washington St.", "city": "Mountain View" }, "interests": [ "Movies", "Books" ], "children": [ { "name": "Donnie Florek", "age": null }, { "name": "Jeannetta Florek", "age": 38 }, { "name": "Leigha Florek", "age": null }, { "name": "Zenobia Florek", "age": 10 } ] }, "b": { "cid": 974, "name": "Alexis Malcomson", "age": null, "address": null, "interests": [ "Movies", "Books" ], "children": [ { "name": "Kerri Malcomson", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 298, "name": "Brittny Christin", "age": null, "address": null, "interests": [ "Databases", "Video Games" ], "children": [ { "name": "Hilario Christin", "age": null }, { "name": "Clarine Christin", "age": null } ] }, "b": { "cid": 591, "name": "Matthew Tenhaeff", "age": null, "address": null, "interests": [ "Databases", "Video Games" ], "children": [ { "name": "Jan Tenhaeff", "age": 25 }, { "name": "Nana Tenhaeff", "age": null }, { "name": "Laticia Tenhaeff", "age": null }, { "name": "Ara Tenhaeff", "age": 44 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 304, "name": "Francine Reddin", "age": 39, "address": { "number": 9392, "street": "Hill St.", "city": "Seattle" }, "interests": [ "Music", "Base Jumping" ], "children": [ { "name": "Millicent Reddin", "age": null } ] }, "b": { "cid": 501, "name": "Alyce Coant", "age": null, "address": null, "interests": [ "Music", "Base Jumping" ], "children": [ { "name": "Elyse Coant", "age": 50 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 309, "name": "Lise Baiz", "age": 46, "address": { "number": 352, "street": "Oak St.", "city": "San Jose" }, "interests": [ "Bass", "Squash" ], "children": [ { "name": "Alisa Baiz", "age": 18 }, { "name": "Elidia Baiz", "age": 28 }, { "name": "Ray Baiz", "age": 19 } ] }, "b": { "cid": 713, "name": "Galina Retterbush", "age": null, "address": null, "interests": [ "Bass", "Squash" ], "children": [ { "name": "Janene Retterbush", "age": null }, { "name": "Toby Retterbush", "age": 15 }, { "name": "Renato Retterbush", "age": null }, { "name": "Annice Retterbush", "age": 22 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 315, "name": "Kallie Eiselein", "age": null, "address": null, "interests": [ "Computers", "Tennis" ], "children": [ ] }, "b": { "cid": 737, "name": "Jeffrey Chesson", "age": 13, "address": { "number": 6833, "street": "Lake St.", "city": "Portland" }, "interests": [ "Tennis", "Computers" ], "children": [ { "name": "Clayton Chesson", "age": null }, { "name": "Yi Chesson", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 317, "name": "Zona Caffarel", "age": 52, "address": { "number": 9419, "street": "Cedar St.", "city": "Seattle" }, "interests": [ "Tennis", "Coffee" ], "children": [ { "name": "Cortez Caffarel", "age": null } ] }, "b": { "cid": 771, "name": "Marisela Tredo", "age": null, "address": null, "interests": [ "Tennis", "Coffee" ], "children": [ { "name": "Ardell Tredo", "age": 21 }, { "name": "Evelynn Tredo", "age": 16 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 347, "name": "Patrick Feighan", "age": 34, "address": { "number": 7613, "street": "Cedar St.", "city": "Los Angeles" }, "interests": [ "Puzzles", "Books" ], "children": [ { "name": "Madaline Feighan", "age": null } ] }, "b": { "cid": 480, "name": "Nigel Pitmon", "age": null, "address": null, "interests": [ "Puzzles", "Books" ], "children": [ { "name": "Janene Pitmon", "age": null }, { "name": "Louie Pitmon", "age": 19 }, { "name": "Genny Pitmon", "age": 24 }, { "name": "Robby Pitmon", "age": 55 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 347, "name": "Patrick Feighan", "age": 34, "address": { "number": 7613, "street": "Cedar St.", "city": "Los Angeles" }, "interests": [ "Puzzles", "Books" ], "children": [ { "name": "Madaline Feighan", "age": null } ] }, "b": { "cid": 860, "name": "Isabelle Sept", "age": 88, "address": { "number": 4382, "street": "Washington St.", "city": "Portland" }, "interests": [ "Puzzles", "Books" ], "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 355, "name": "Elois Leckband", "age": null, "address": null, "interests": [ "Skiing", "Wine" ], "children": [ ] }, "b": { "cid": 635, "name": "Angelena Braegelmann", "age": 36, "address": { "number": 4158, "street": "Park St.", "city": "San Jose" }, "interests": [ "Wine", "Skiing" ], "children": [ { "name": "Daisey Braegelmann", "age": 18 }, { "name": "Gaston Braegelmann", "age": 19 }, { "name": "Louella Braegelmann", "age": null }, { "name": "Leonie Braegelmann", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 367, "name": "Cassondra Fabiani", "age": null, "address": null, "interests": [ "Squash", "Tennis" ], "children": [ { "name": "Evia Fabiani", "age": null }, { "name": "Chaya Fabiani", "age": null }, { "name": "Sherman Fabiani", "age": null }, { "name": "Kathi Fabiani", "age": 54 } ] }, "b": { "cid": 503, "name": "Phyliss Cassani", "age": null, "address": null, "interests": [ "Squash", "Tennis" ], "children": [ { "name": "Rolando Cassani", "age": 44 }, { "name": "Rikki Cassani", "age": 18 }, { "name": "Monty Cassani", "age": 40 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 369, "name": "Nickole Dory", "age": 10, "address": { "number": 4761, "street": "View St.", "city": "Portland" }, "interests": [ "Walking", "Cooking" ], "children": [ { "name": "Annmarie Dory", "age": null }, { "name": "Michele Dory", "age": null }, { "name": "Annamae Dory", "age": null }, { "name": "Flora Dory", "age": null } ] }, "b": { "cid": 816, "name": "Cheyenne Eddie", "age": null, "address": null, "interests": [ "Walking", "Cooking" ], "children": [ { "name": "Kathe Eddie", "age": null }, { "name": "Charles Eddie", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 378, "name": "Melany Matias", "age": 10, "address": { "number": 8838, "street": "Main St.", "city": "Seattle" }, "interests": [ "Coffee", "Tennis", "Bass" ], "children": [ { "name": "Earnestine Matias", "age": null }, { "name": "Lore Matias", "age": null } ] }, "b": { "cid": 545, "name": "Dolores Ferer", "age": null, "address": null, "interests": [ "Coffee", "Bass", "Tennis" ], "children": [ { "name": "Bridgette Ferer", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 380, "name": "Silva Purdue", "age": 33, "address": { "number": 1759, "street": "7th St.", "city": "Portland" }, "interests": [ "Music", "Squash" ], "children": [ { "name": "Marshall Purdue", "age": null }, { "name": "Yuki Purdue", "age": null }, { "name": "Val Purdue", "age": 12 }, { "name": "Dominica Purdue", "age": null } ] }, "b": { "cid": 904, "name": "Holley Tofil", "age": 51, "address": { "number": 8946, "street": "Oak St.", "city": "Mountain View" }, "interests": [ "Music", "Squash" ], "children": [ { "name": "Kristal Tofil", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 386, "name": "Mao Gradowski", "age": 36, "address": { "number": 5116, "street": "Washington St.", "city": "Mountain View" }, "interests": [ "Computers", "Fishing" ], "children": [ { "name": "Jeneva Gradowski", "age": null }, { "name": "Thu Gradowski", "age": 22 }, { "name": "Daphine Gradowski", "age": null }, { "name": "Providencia Gradowski", "age": null } ] }, "b": { "cid": 646, "name": "Pablo Catterton", "age": null, "address": null, "interests": [ "Fishing", "Computers" ], "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 386, "name": "Mao Gradowski", "age": 36, "address": { "number": 5116, "street": "Washington St.", "city": "Mountain View" }, "interests": [ "Computers", "Fishing" ], "children": [ { "name": "Jeneva Gradowski", "age": null }, { "name": "Thu Gradowski", "age": 22 }, { "name": "Daphine Gradowski", "age": null }, { "name": "Providencia Gradowski", "age": null } ] }, "b": { "cid": 781, "name": "Christy Darcangelo", "age": 42, "address": { "number": 2178, "street": "Washington St.", "city": "Portland" }, "interests": [ "Computers", "Fishing" ], "children": [ { "name": "Luis Darcangelo", "age": 21 }, { "name": "Omega Darcangelo", "age": 26 }, { "name": "Remedios Darcangelo", "age": 28 }, { "name": "Domenic Darcangelo", "age": 21 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 389, "name": "Loraine Morfee", "age": 72, "address": { "number": 2945, "street": "Lake St.", "city": "Seattle" }, "interests": [ "Wine", "Walking" ], "children": [ { "name": "Berry Morfee", "age": 30 } ] }, "b": { "cid": 607, "name": "Bert Garigliano", "age": 71, "address": { "number": 3881, "street": "Washington St.", "city": "San Jose" }, "interests": [ "Walking", "Wine" ], "children": [ { "name": "Junior Garigliano", "age": 42 }, { "name": "Willa Garigliano", "age": 21 }, { "name": "Carlo Garigliano", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 393, "name": "Rossana Monton", "age": 34, "address": { "number": 4490, "street": "Main St.", "city": "Portland" }, "interests": [ "Skiing", "Base Jumping" ], "children": [ { "name": "Glayds Monton", "age": null }, { "name": "Lily Monton", "age": null }, { "name": "Raina Monton", "age": null }, { "name": "Hilma Monton", "age": null } ] }, "b": { "cid": 493, "name": "Lindsey Trout", "age": 86, "address": { "number": 7619, "street": "Cedar St.", "city": "Portland" }, "interests": [ "Base Jumping", "Skiing" ], "children": [ { "name": "Madlyn Trout", "age": 58 }, { "name": "Amie Trout", "age": 72 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 394, "name": "Lizette Roux", "age": 57, "address": { "number": 458, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Bass", "Books" ], "children": [ { "name": "Doloris Roux", "age": null } ] }, "b": { "cid": 523, "name": "Johanne Huls", "age": null, "address": null, "interests": [ "Books", "Bass" ], "children": [ { "name": "Melynda Huls", "age": null }, { "name": "Vicky Huls", "age": 16 }, { "name": "Charlott Huls", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 403, "name": "Kayleigh Houey", "age": null, "address": null, "interests": [ "Fishing", "Music" ], "children": [ { "name": "Ta Houey", "age": null }, { "name": "Ayana Houey", "age": null }, { "name": "Dominique Houey", "age": null }, { "name": "Denise Houey", "age": 48 } ] }, "b": { "cid": 949, "name": "Elissa Rogue", "age": null, "address": null, "interests": [ "Fishing", "Music" ], "children": [ { "name": "Noriko Rogue", "age": 41 }, { "name": "Lavona Rogue", "age": 39 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 407, "name": "Bebe Cotney", "age": null, "address": null, "interests": [ "Books", "Tennis" ], "children": [ { "name": "Daren Cotney", "age": null }, { "name": "Lady Cotney", "age": 48 } ] }, "b": { "cid": 420, "name": "Coralie Regueira", "age": null, "address": null, "interests": [ "Books", "Tennis" ], "children": [ { "name": "Latoyia Regueira", "age": 31 }, { "name": "Obdulia Regueira", "age": 12 }, { "name": "Herlinda Regueira", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 407, "name": "Bebe Cotney", "age": null, "address": null, "interests": [ "Books", "Tennis" ], "children": [ { "name": "Daren Cotney", "age": null }, { "name": "Lady Cotney", "age": 48 } ] }, "b": { "cid": 549, "name": "Kathrin Cruff", "age": 63, "address": { "number": 9002, "street": "Washington St.", "city": "Sunnyvale" }, "interests": [ "Tennis", "Books" ], "children": [ { "name": "Candi Cruff", "age": 49 }, { "name": "Barry Cruff", "age": 17 }, { "name": "Shane Cruff", "age": 18 }, { "name": "Brendon Cruff", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 420, "name": "Coralie Regueira", "age": null, "address": null, "interests": [ "Books", "Tennis" ], "children": [ { "name": "Latoyia Regueira", "age": 31 }, { "name": "Obdulia Regueira", "age": 12 }, { "name": "Herlinda Regueira", "age": null } ] }, "b": { "cid": 549, "name": "Kathrin Cruff", "age": 63, "address": { "number": 9002, "street": "Washington St.", "city": "Sunnyvale" }, "interests": [ "Tennis", "Books" ], "children": [ { "name": "Candi Cruff", "age": 49 }, { "name": "Barry Cruff", "age": 17 }, { "name": "Shane Cruff", "age": 18 }, { "name": "Brendon Cruff", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 450, "name": "Althea Mohammed", "age": null, "address": null, "interests": [ "Fishing", "Databases" ], "children": [ { "name": "Jasper Mohammed", "age": null } ] }, "b": { "cid": 478, "name": "Sophia Whitt", "age": 26, "address": { "number": 2787, "street": "Park St.", "city": "Mountain View" }, "interests": [ "Fishing", "Databases" ], "children": [ { "name": "Irving Whitt", "age": 13 }, { "name": "Jeannette Whitt", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 452, "name": "Casie Marasigan", "age": null, "address": null, "interests": [ "Walking", "Computers" ], "children": [ { "name": "Connie Marasigan", "age": null }, { "name": "Kimberlie Marasigan", "age": null } ] }, "b": { "cid": 573, "name": "Tyree Ketcher", "age": null, "address": null, "interests": [ "Computers", "Walking" ], "children": [ { "name": "Aleisha Ketcher", "age": null }, { "name": "Vonda Ketcher", "age": null }, { "name": "Cyndy Ketcher", "age": 13 }, { "name": "Chassidy Ketcher", "age": 30 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 467, "name": "Magali Ingerson", "age": null, "address": null, "interests": [ "Books", "Base Jumping" ], "children": [ { "name": "Monty Ingerson", "age": 11 }, { "name": "Noelia Ingerson", "age": 47 }, { "name": "Tennie Ingerson", "age": null }, { "name": "Merrill Ingerson", "age": null } ] }, "b": { "cid": 632, "name": "Keeley Goga", "age": null, "address": null, "interests": [ "Books", "Base Jumping" ], "children": [ { "name": "Walter Goga", "age": 39 }, { "name": "Chaya Goga", "age": null }, { "name": "Melodie Goga", "age": null }, { "name": "Isidro Goga", "age": 32 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 472, "name": "Kelley Mischler", "age": 38, "address": { "number": 7988, "street": "Lake St.", "city": "Los Angeles" }, "interests": [ "Movies", "Cooking", "Skiing" ], "children": [ { "name": "Keila Mischler", "age": 19 }, { "name": "Evie Mischler", "age": 15 } ] }, "b": { "cid": 602, "name": "Clyde Salada", "age": 59, "address": { "number": 8316, "street": "7th St.", "city": "Sunnyvale" }, "interests": [ "Movies", "Skiing", "Cooking" ], "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 480, "name": "Nigel Pitmon", "age": null, "address": null, "interests": [ "Puzzles", "Books" ], "children": [ { "name": "Janene Pitmon", "age": null }, { "name": "Louie Pitmon", "age": 19 }, { "name": "Genny Pitmon", "age": 24 }, { "name": "Robby Pitmon", "age": 55 } ] }, "b": { "cid": 860, "name": "Isabelle Sept", "age": 88, "address": { "number": 4382, "street": "Washington St.", "city": "Portland" }, "interests": [ "Puzzles", "Books" ], "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 483, "name": "Elsa Vigen", "age": null, "address": null, "interests": [ "Wine", "Databases" ], "children": [ { "name": "Larae Vigen", "age": null }, { "name": "Elwood Vigen", "age": null } ] }, "b": { "cid": 894, "name": "Reginald Julien", "age": 16, "address": { "number": 1107, "street": "Lake St.", "city": "Mountain View" }, "interests": [ "Databases", "Wine" ], "children": [ { "name": "Arthur Julien", "age": null }, { "name": "Evia Julien", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 484, "name": "Bennie Dragaj", "age": null, "address": null, "interests": [ "Fishing", "Databases", "Wine" ], "children": [ { "name": "Viva Dragaj", "age": 13 } ] }, "b": { "cid": 741, "name": "Lesia Risatti", "age": 48, "address": { "number": 7378, "street": "Cedar St.", "city": "Portland" }, "interests": [ "Fishing", "Wine", "Databases" ], "children": [ { "name": "Tangela Risatti", "age": null }, { "name": "Leonel Risatti", "age": 33 }, { "name": "Cythia Risatti", "age": 36 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 484, "name": "Bennie Dragaj", "age": null, "address": null, "interests": [ "Fishing", "Databases", "Wine" ], "children": [ { "name": "Viva Dragaj", "age": 13 } ] }, "b": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Databases", "Fishing", "Wine" ], "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 498, "name": "Arleen Sultzer", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Norine Sultzer", "age": 29 } ] }, "b": { "cid": 875, "name": "Ramon Crepps", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Elisha Crepps", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 502, "name": "Lawana Mulik", "age": 82, "address": { "number": 3071, "street": "Park St.", "city": "Portland" }, "interests": [ "Cigars", "Cigars" ], "children": [ { "name": "Carrie Mulik", "age": null }, { "name": "Sharlene Mulik", "age": 33 }, { "name": "Leone Mulik", "age": 46 } ] }, "b": { "cid": 774, "name": "Nadene Rigel", "age": null, "address": null, "interests": [ "Cigars", "Cigars" ], "children": [ { "name": "Rebbeca Rigel", "age": 33 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 508, "name": "Tiffany Kimmey", "age": 64, "address": { "number": 8625, "street": "7th St.", "city": "Mountain View" }, "interests": [ "Bass", "Walking" ], "children": [ ] }, "b": { "cid": 796, "name": "Daniele Brisk", "age": null, "address": null, "interests": [ "Walking", "Bass" ], "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 510, "name": "Candace Morello", "age": null, "address": null, "interests": [ "Wine", "Base Jumping", "Running" ], "children": [ { "name": "Sandy Morello", "age": 57 }, { "name": "Delois Morello", "age": 15 } ] }, "b": { "cid": 908, "name": "Ferdinand Auila", "age": 82, "address": { "number": 1071, "street": "Lake St.", "city": "Portland" }, "interests": [ "Base Jumping", "Running", "Wine" ], "children": [ { "name": "Ai Auila", "age": 69 }, { "name": "Laurel Auila", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 513, "name": "Marianna Gortman", "age": 49, "address": { "number": 927, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Databases", "Databases" ], "children": [ ] }, "b": { "cid": 520, "name": "Janay Bernbeck", "age": null, "address": null, "interests": [ "Databases", "Databases" ], "children": [ { "name": "Aurea Bernbeck", "age": null }, { "name": "Tiara Bernbeck", "age": null }, { "name": "Alfredia Bernbeck", "age": 26 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 559, "name": "Carolyne Shiroma", "age": null, "address": null, "interests": [ "Movies", "Running" ], "children": [ { "name": "Ying Shiroma", "age": 57 } ] }, "b": { "cid": 681, "name": "Iliana Nagele", "age": null, "address": null, "interests": [ "Movies", "Running" ], "children": [ { "name": "Sunny Nagele", "age": 55 }, { "name": "Waltraud Nagele", "age": 39 }, { "name": "Darron Nagele", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 560, "name": "Karin Dicesare", "age": null, "address": null, "interests": [ "Wine", "Puzzles" ], "children": [ ] }, "b": { "cid": 583, "name": "Bev Yerena", "age": null, "address": null, "interests": [ "Puzzles", "Wine" ], "children": [ { "name": "Larhonda Yerena", "age": 45 }, { "name": "Josefina Yerena", "age": null }, { "name": "Sydney Yerena", "age": 42 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 570, "name": "Lee Basora", "age": null, "address": null, "interests": [ "Squash", "Cigars" ], "children": [ ] }, "b": { "cid": 819, "name": "Twanna Finnley", "age": null, "address": null, "interests": [ "Squash", "Cigars" ], "children": [ { "name": "Reba Finnley", "age": null }, { "name": "Moises Finnley", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 620, "name": "Arielle Mackellar", "age": null, "address": null, "interests": [ "Cooking", "Bass" ], "children": [ { "name": "Evelin Mackellar", "age": 17 }, { "name": "Theresa Mackellar", "age": 53 }, { "name": "Ronnie Mackellar", "age": null }, { "name": "Elwanda Mackellar", "age": 54 } ] }, "b": { "cid": 761, "name": "Adele Henrikson", "age": null, "address": null, "interests": [ "Cooking", "Bass" ], "children": [ { "name": "Paulina Henrikson", "age": null }, { "name": "David Henrikson", "age": null }, { "name": "Jose Henrikson", "age": null }, { "name": "Meg Henrikson", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 636, "name": "Babara Shore", "age": 83, "address": { "number": 9452, "street": "Oak St.", "city": "Los Angeles" }, "interests": [ "Databases", "Movies", "Tennis" ], "children": [ { "name": "Candy Shore", "age": 58 }, { "name": "Nanci Shore", "age": null }, { "name": "Asia Shore", "age": null } ] }, "b": { "cid": 992, "name": "Staci Alexandropoul", "age": null, "address": null, "interests": [ "Databases", "Movies", "Tennis" ], "children": [ { "name": "Casimira Alexandropoul", "age": null }, { "name": "Kena Alexandropoul", "age": 54 }, { "name": "Ellie Alexandropoul", "age": null }, { "name": "Ambrose Alexandropoul", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 646, "name": "Pablo Catterton", "age": null, "address": null, "interests": [ "Fishing", "Computers" ], "children": [ ] }, "b": { "cid": 781, "name": "Christy Darcangelo", "age": 42, "address": { "number": 2178, "street": "Washington St.", "city": "Portland" }, "interests": [ "Computers", "Fishing" ], "children": [ { "name": "Luis Darcangelo", "age": 21 }, { "name": "Omega Darcangelo", "age": 26 }, { "name": "Remedios Darcangelo", "age": 28 }, { "name": "Domenic Darcangelo", "age": 21 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 647, "name": "Jodi Dearson", "age": null, "address": null, "interests": [ "Fishing", "Movies" ], "children": [ ] }, "b": { "cid": 884, "name": "Laila Marta", "age": null, "address": null, "interests": [ "Fishing", "Movies" ], "children": [ { "name": "Carlota Marta", "age": 19 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 704, "name": "Melodee Clemons", "age": null, "address": null, "interests": [ "Base Jumping", "Tennis", "Video Games" ], "children": [ { "name": "Doreatha Clemons", "age": 22 } ] }, "b": { "cid": 812, "name": "Bee Godette", "age": 26, "address": { "number": 1757, "street": "Washington St.", "city": "Portland" }, "interests": [ "Video Games", "Base Jumping", "Tennis" ], "children": [ { "name": "Madaline Godette", "age": 10 }, { "name": "Shasta Godette", "age": 15 }, { "name": "Parthenia Godette", "age": 11 }, { "name": "Priscila Godette", "age": 13 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 716, "name": "Deirdre Bruderer", "age": null, "address": null, "interests": [ "Computers", "Wine" ], "children": [ { "name": "Coralee Bruderer", "age": null }, { "name": "Mina Bruderer", "age": null }, { "name": "Lindsey Bruderer", "age": 35 }, { "name": "Yi Bruderer", "age": null } ] }, "b": { "cid": 890, "name": "Janise Maccarthy", "age": 66, "address": { "number": 7337, "street": "Main St.", "city": "San Jose" }, "interests": [ "Wine", "Computers" ], "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 730, "name": "Marti Vandoren", "age": null, "address": null, "interests": [ "Skiing", "Bass" ], "children": [ { "name": "Carroll Vandoren", "age": null }, { "name": "Lorretta Vandoren", "age": 30 }, { "name": "Chloe Vandoren", "age": 42 }, { "name": "Ilona Vandoren", "age": null } ] }, "b": { "cid": 982, "name": "Jude Brandsrud", "age": 41, "address": { "number": 7133, "street": "Washington St.", "city": "Seattle" }, "interests": [ "Bass", "Skiing" ], "children": [ { "name": "Scottie Brandsrud", "age": null }, { "name": "Gennie Brandsrud", "age": 10 }, { "name": "Agnes Brandsrud", "age": null }, { "name": "Clarinda Brandsrud", "age": 17 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 731, "name": "Yajaira Orto", "age": null, "address": null, "interests": [ "Music", "Databases" ], "children": [ { "name": "Eliz Orto", "age": 17 }, { "name": "Gisela Orto", "age": null } ] }, "b": { "cid": 795, "name": "Sharilyn Branstad", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Ashlee Branstad", "age": 24 }, { "name": "Bobbye Branstad", "age": 26 }, { "name": "Natalya Branstad", "age": null }, { "name": "Edith Branstad", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 741, "name": "Lesia Risatti", "age": 48, "address": { "number": 7378, "street": "Cedar St.", "city": "Portland" }, "interests": [ "Fishing", "Wine", "Databases" ], "children": [ { "name": "Tangela Risatti", "age": null }, { "name": "Leonel Risatti", "age": 33 }, { "name": "Cythia Risatti", "age": 36 } ] }, "b": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Databases", "Fishing", "Wine" ], "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 877, "name": "Nicki Lipkind", "age": null, "address": null, "interests": [ "Books", "Movies" ], "children": [ { "name": "Yahaira Lipkind", "age": 12 } ] }, "b": { "cid": 974, "name": "Alexis Malcomson", "age": null, "address": null, "interests": [ "Movies", "Books" ], "children": [ { "name": "Kerri Malcomson", "age": null } ] }, "jacc": 1.0f }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join/olist-jaccard.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/olist-jaccard.adm
new file mode 100644
index 0000000..59a4a42
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/olist-jaccard.adm
@@ -0,0 +1,115 @@
+{ "a": { "cid": 2, "name": "Elin Debell", "age": 82, "address": { "number": 5649, "street": "Hill St.", "city": "Portland" }, "interests": [ "Bass", "Wine" ], "children": [ { "name": "Elvina Debell", "age": null }, { "name": "Renaldo Debell", "age": 51 }, { "name": "Divina Debell", "age": 57 } ] }, "b": { "cid": 897, "name": "Gerald Roehrman", "age": null, "address": null, "interests": [ "Bass", "Wine" ], "children": [ { "name": "Virgie Roehrman", "age": 28 }, { "name": "Akiko Roehrman", "age": 59 }, { "name": "Robbie Roehrman", "age": 10 }, { "name": "Flavia Roehrman", "age": null } ] } }
+{ "a": { "cid": 5, "name": "Heide Naifeh", "age": null, "address": null, "interests": [ "Music", "Databases" ], "children": [ { "name": "Deirdre Naifeh", "age": null }, { "name": "Jacquelyne Naifeh", "age": 39 } ] }, "b": { "cid": 215, "name": "Ashton Schadegg", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Ciara Schadegg", "age": null }, { "name": "Karisa Schadegg", "age": 11 }, { "name": "Hayden Schadegg", "age": 44 } ] } }
+{ "a": { "cid": 5, "name": "Heide Naifeh", "age": null, "address": null, "interests": [ "Music", "Databases" ], "children": [ { "name": "Deirdre Naifeh", "age": null }, { "name": "Jacquelyne Naifeh", "age": 39 } ] }, "b": { "cid": 228, "name": "Donnette Brumbley", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Madlyn Brumbley", "age": null }, { "name": "Apolonia Brumbley", "age": 13 }, { "name": "Stephine Brumbley", "age": null }, { "name": "Zelma Brumbley", "age": 51 } ] } }
+{ "a": { "cid": 5, "name": "Heide Naifeh", "age": null, "address": null, "interests": [ "Music", "Databases" ], "children": [ { "name": "Deirdre Naifeh", "age": null }, { "name": "Jacquelyne Naifeh", "age": 39 } ] }, "b": { "cid": 731, "name": "Yajaira Orto", "age": null, "address": null, "interests": [ "Music", "Databases" ], "children": [ { "name": "Eliz Orto", "age": 17 }, { "name": "Gisela Orto", "age": null } ] } }
+{ "a": { "cid": 5, "name": "Heide Naifeh", "age": null, "address": null, "interests": [ "Music", "Databases" ], "children": [ { "name": "Deirdre Naifeh", "age": null }, { "name": "Jacquelyne Naifeh", "age": 39 } ] }, "b": { "cid": 795, "name": "Sharilyn Branstad", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Ashlee Branstad", "age": 24 }, { "name": "Bobbye Branstad", "age": 26 }, { "name": "Natalya Branstad", "age": null }, { "name": "Edith Branstad", "age": null } ] } }
+{ "a": { "cid": 11, "name": "Meta Simek", "age": 13, "address": { "number": 4384, "street": "7th St.", "city": "San Jose" }, "interests": [ "Wine", "Walking" ], "children": [ { "name": "Oretha Simek", "age": null }, { "name": "Terence Simek", "age": null } ] }, "b": { "cid": 389, "name": "Loraine Morfee", "age": 72, "address": { "number": 2945, "street": "Lake St.", "city": "Seattle" }, "interests": [ "Wine", "Walking" ], "children": [ { "name": "Berry Morfee", "age": 30 } ] } }
+{ "a": { "cid": 11, "name": "Meta Simek", "age": 13, "address": { "number": 4384, "street": "7th St.", "city": "San Jose" }, "interests": [ "Wine", "Walking" ], "children": [ { "name": "Oretha Simek", "age": null }, { "name": "Terence Simek", "age": null } ] }, "b": { "cid": 607, "name": "Bert Garigliano", "age": 71, "address": { "number": 3881, "street": "Washington St.", "city": "San Jose" }, "interests": [ "Walking", "Wine" ], "children": [ { "name": "Junior Garigliano", "age": 42 }, { "name": "Willa Garigliano", "age": 21 }, { "name": "Carlo Garigliano", "age": null } ] } }
+{ "a": { "cid": 17, "name": "Ingeborg Monkhouse", "age": null, "address": null, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] }, "b": { "cid": 156, "name": "Bobbye Kauppi", "age": 79, "address": { "number": 2051, "street": "Hill St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Cigars", "Movies" ], "children": [ ] } }
+{ "a": { "cid": 27, "name": "Hollie Hyun", "age": null, "address": null, "interests": [ "Skiing", "Walking" ], "children": [ { "name": "Morton Hyun", "age": null }, { "name": "Farrah Hyun", "age": 40 }, { "name": "Ali Hyun", "age": null } ] }, "b": { "cid": 542, "name": "Eveline Smedley", "age": 50, "address": { "number": 5513, "street": "Oak St.", "city": "San Jose" }, "interests": [ "Skiing", "Walking" ], "children": [ { "name": "Lynsey Smedley", "age": 26 } ] } }
+{ "a": { "cid": 32, "name": "Tia Berkley", "age": 30, "address": { "number": 4507, "street": "Park St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Music" ], "children": [ { "name": "Carmon Berkley", "age": null }, { "name": "Kristina Berkley", "age": null }, { "name": "Cristi Berkley", "age": 19 } ] }, "b": { "cid": 304, "name": "Francine Reddin", "age": 39, "address": { "number": 9392, "street": "Hill St.", "city": "Seattle" }, "interests": [ "Music", "Base Jumping" ], "children": [ { "name": "Millicent Reddin", "age": null } ] } }
+{ "a": { "cid": 32, "name": "Tia Berkley", "age": 30, "address": { "number": 4507, "street": "Park St.", "city": "Sunnyvale" }, "interests": [ "Base Jumping", "Music" ], "children": [ { "name": "Carmon Berkley", "age": null }, { "name": "Kristina Berkley", "age": null }, { "name": "Cristi Berkley", "age": 19 } ] }, "b": { "cid": 501, "name": "Alyce Coant", "age": null, "address": null, "interests": [ "Music", "Base Jumping" ], "children": [ { "name": "Elyse Coant", "age": 50 } ] } }
+{ "a": { "cid": 33, "name": "Rayford Velmontes", "age": null, "address": null, "interests": [ "Fishing", "Video Games" ], "children": [ ] }, "b": { "cid": 519, "name": "Julianna Goodsell", "age": 59, "address": { "number": 5594, "street": "Lake St.", "city": "Seattle" }, "interests": [ "Video Games", "Fishing" ], "children": [ ] } }
+{ "a": { "cid": 39, "name": "Brock Froncillo", "age": 72, "address": { "number": 4645, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Skiing" ], "children": [ { "name": "Cole Froncillo", "age": null }, { "name": "Ivana Froncillo", "age": null }, { "name": "Hugh Froncillo", "age": 23 } ] }, "b": { "cid": 393, "name": "Rossana Monton", "age": 34, "address": { "number": 4490, "street": "Main St.", "city": "Portland" }, "interests": [ "Skiing", "Base Jumping" ], "children": [ { "name": "Glayds Monton", "age": null }, { "name": "Lily Monton", "age": null }, { "name": "Raina Monton", "age": null }, { "name": "Hilma Monton", "age": null } ] } }
+{ "a": { "cid": 39, "name": "Brock Froncillo", "age": 72, "address": { "number": 4645, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Base Jumping", "Skiing" ], "children": [ { "name": "Cole Froncillo", "age": null }, { "name": "Ivana Froncillo", "age": null }, { "name": "Hugh Froncillo", "age": 23 } ] }, "b": { "cid": 493, "name": "Lindsey Trout", "age": 86, "address": { "number": 7619, "street": "Cedar St.", "city": "Portland" }, "interests": [ "Base Jumping", "Skiing" ], "children": [ { "name": "Madlyn Trout", "age": 58 }, { "name": "Amie Trout", "age": 72 } ] } }
+{ "a": { "cid": 41, "name": "Kevin Giottonini", "age": null, "address": null, "interests": [ "Skiing", "Bass" ], "children": [ { "name": "Victor Giottonini", "age": 37 }, { "name": "Alverta Giottonini", "age": null } ] }, "b": { "cid": 182, "name": "Christiana Westlie", "age": null, "address": null, "interests": [ "Skiing", "Bass" ], "children": [ { "name": "Ilda Westlie", "age": 18 } ] } }
+{ "a": { "cid": 41, "name": "Kevin Giottonini", "age": null, "address": null, "interests": [ "Skiing", "Bass" ], "children": [ { "name": "Victor Giottonini", "age": 37 }, { "name": "Alverta Giottonini", "age": null } ] }, "b": { "cid": 730, "name": "Marti Vandoren", "age": null, "address": null, "interests": [ "Skiing", "Bass" ], "children": [ { "name": "Carroll Vandoren", "age": null }, { "name": "Lorretta Vandoren", "age": 30 }, { "name": "Chloe Vandoren", "age": 42 }, { "name": "Ilona Vandoren", "age": null } ] } }
+{ "a": { "cid": 41, "name": "Kevin Giottonini", "age": null, "address": null, "interests": [ "Skiing", "Bass" ], "children": [ { "name": "Victor Giottonini", "age": 37 }, { "name": "Alverta Giottonini", "age": null } ] }, "b": { "cid": 982, "name": "Jude Brandsrud", "age": 41, "address": { "number": 7133, "street": "Washington St.", "city": "Seattle" }, "interests": [ "Bass", "Skiing" ], "children": [ { "name": "Scottie Brandsrud", "age": null }, { "name": "Gennie Brandsrud", "age": 10 }, { "name": "Agnes Brandsrud", "age": null }, { "name": "Clarinda Brandsrud", "age": 17 } ] } }
+{ "a": { "cid": 42, "name": "Asley Simco", "age": 38, "address": { "number": 3322, "street": "Main St.", "city": "Mountain View" }, "interests": [ "Fishing", "Running", "Cigars" ], "children": [ { "name": "Micheal Simco", "age": null }, { "name": "Lawerence Simco", "age": null } ] }, "b": { "cid": 753, "name": "Maris Bannett", "age": null, "address": null, "interests": [ "Fishing", "Cigars", "Running" ], "children": [ { "name": "Libbie Bannett", "age": 11 }, { "name": "Francina Bannett", "age": 21 }, { "name": "Tuyet Bannett", "age": null }, { "name": "Zona Bannett", "age": 32 } ] } }
+{ "a": { "cid": 56, "name": "Andria Killelea", "age": null, "address": null, "interests": [ "Cigars", "Skiing" ], "children": [ ] }, "b": { "cid": 857, "name": "Kasie Fujioka", "age": null, "address": null, "interests": [ "Skiing", "Cigars" ], "children": [ { "name": "Leontine Fujioka", "age": null }, { "name": "Nga Fujioka", "age": 21 }, { "name": "Nathanael Fujioka", "age": 27 } ] } }
+{ "a": { "cid": 71, "name": "Alva Sieger", "age": null, "address": null, "interests": [ "Movies", "Walking" ], "children": [ { "name": "Renetta Sieger", "age": null }, { "name": "Shiloh Sieger", "age": 57 }, { "name": "Lavina Sieger", "age": null }, { "name": "Larraine Sieger", "age": null } ] }, "b": { "cid": 758, "name": "Akiko Hoenstine", "age": 56, "address": { "number": 8888, "street": "Lake St.", "city": "Portland" }, "interests": [ "Movies", "Walking" ], "children": [ { "name": "Maren Hoenstine", "age": null }, { "name": "Tyler Hoenstine", "age": null }, { "name": "Jesse Hoenstine", "age": 40 } ] } }
+{ "a": { "cid": 74, "name": "Lonnie Ercolani", "age": 79, "address": { "number": 2655, "street": "Lake St.", "city": "Los Angeles" }, "interests": [ "Music", "Coffee" ], "children": [ { "name": "Cassi Ercolani", "age": null } ] }, "b": { "cid": 325, "name": "Ai Tarleton", "age": null, "address": null, "interests": [ "Coffee", "Music" ], "children": [ { "name": "Risa Tarleton", "age": 24 }, { "name": "Leonila Tarleton", "age": null }, { "name": "Thomasina Tarleton", "age": null } ] } }
+{ "a": { "cid": 76, "name": "Opal Blewett", "age": null, "address": null, "interests": [ "Running", "Coffee", "Fishing" ], "children": [ { "name": "Violette Blewett", "age": null } ] }, "b": { "cid": 455, "name": "Manual Altizer", "age": 70, "address": { "number": 6293, "street": "7th St.", "city": "Portland" }, "interests": [ "Running", "Fishing", "Coffee" ], "children": [ { "name": "Katherine Altizer", "age": null } ] } }
+{ "a": { "cid": 77, "name": "Chantal Parriera", "age": 78, "address": { "number": 5967, "street": "Lake St.", "city": "San Jose" }, "interests": [ "Squash", "Movies", "Coffee" ], "children": [ ] }, "b": { "cid": 984, "name": "Janett Kitchens", "age": 66, "address": { "number": 7558, "street": "View St.", "city": "Mountain View" }, "interests": [ "Coffee", "Movies", "Squash" ], "children": [ { "name": "Grayce Kitchens", "age": 14 }, { "name": "Dwayne Kitchens", "age": null }, { "name": "Wilber Kitchens", "age": 51 }, { "name": "Nancey Kitchens", "age": null } ] } }
+{ "a": { "cid": 84, "name": "Huong Kachel", "age": null, "address": null, "interests": [ "Music", "Tennis", "Base Jumping" ], "children": [ { "name": "Katlyn Kachel", "age": 40 }, { "name": "Sherman Kachel", "age": null }, { "name": "Susana Kachel", "age": 32 } ] }, "b": { "cid": 633, "name": "Shalon Grauberger", "age": 34, "address": { "number": 765, "street": "Washington St.", "city": "Sunnyvale" }, "interests": [ "Music", "Base Jumping", "Tennis" ], "children": [ { "name": "Kris Grauberger", "age": 14 }, { "name": "Stuart Grauberger", "age": 12 }, { "name": "Billy Grauberger", "age": null } ] } }
+{ "a": { "cid": 101, "name": "Meaghan Vandel", "age": null, "address": null, "interests": [ "Music", "Base Jumping", "Books" ], "children": [ { "name": "Larissa Vandel", "age": null } ] }, "b": { "cid": 289, "name": "Clarence Milette", "age": 16, "address": { "number": 3778, "street": "Oak St.", "city": "Seattle" }, "interests": [ "Books", "Base Jumping", "Music" ], "children": [ ] } }
+{ "a": { "cid": 106, "name": "Charles Verna", "age": null, "address": null, "interests": [ "Bass", "Books" ], "children": [ { "name": "Betsy Verna", "age": 37 }, { "name": "Chae Verna", "age": 35 }, { "name": "Naoma Verna", "age": 42 } ] }, "b": { "cid": 394, "name": "Lizette Roux", "age": 57, "address": { "number": 458, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Bass", "Books" ], "children": [ { "name": "Doloris Roux", "age": null } ] } }
+{ "a": { "cid": 106, "name": "Charles Verna", "age": null, "address": null, "interests": [ "Bass", "Books" ], "children": [ { "name": "Betsy Verna", "age": 37 }, { "name": "Chae Verna", "age": 35 }, { "name": "Naoma Verna", "age": 42 } ] }, "b": { "cid": 523, "name": "Johanne Huls", "age": null, "address": null, "interests": [ "Books", "Bass" ], "children": [ { "name": "Melynda Huls", "age": null }, { "name": "Vicky Huls", "age": 16 }, { "name": "Charlott Huls", "age": null } ] } }
+{ "a": { "cid": 119, "name": "Chan Morreau", "age": 22, "address": { "number": 1774, "street": "Lake St.", "city": "Mountain View" }, "interests": [ "Puzzles", "Squash" ], "children": [ { "name": "Arlette Morreau", "age": null } ] }, "b": { "cid": 592, "name": "Rachelle Spare", "age": 13, "address": { "number": 8088, "street": "Oak St.", "city": "Portland" }, "interests": [ "Squash", "Puzzles" ], "children": [ { "name": "Theo Spare", "age": null }, { "name": "Shizue Spare", "age": null } ] } }
+{ "a": { "cid": 132, "name": "Cindi Turntine", "age": 64, "address": { "number": 9432, "street": "Park St.", "city": "Portland" }, "interests": [ "Computers", "Wine" ], "children": [ { "name": "Howard Turntine", "age": null } ] }, "b": { "cid": 177, "name": "Wilda Hanisch", "age": null, "address": null, "interests": [ "Wine", "Computers" ], "children": [ { "name": "Shannan Hanisch", "age": null }, { "name": "Marissa Hanisch", "age": 30 }, { "name": "Keely Hanisch", "age": 54 }, { "name": "Humberto Hanisch", "age": 17 } ] } }
+{ "a": { "cid": 132, "name": "Cindi Turntine", "age": 64, "address": { "number": 9432, "street": "Park St.", "city": "Portland" }, "interests": [ "Computers", "Wine" ], "children": [ { "name": "Howard Turntine", "age": null } ] }, "b": { "cid": 716, "name": "Deirdre Bruderer", "age": null, "address": null, "interests": [ "Computers", "Wine" ], "children": [ { "name": "Coralee Bruderer", "age": null }, { "name": "Mina Bruderer", "age": null }, { "name": "Lindsey Bruderer", "age": 35 }, { "name": "Yi Bruderer", "age": null } ] } }
+{ "a": { "cid": 132, "name": "Cindi Turntine", "age": 64, "address": { "number": 9432, "street": "Park St.", "city": "Portland" }, "interests": [ "Computers", "Wine" ], "children": [ { "name": "Howard Turntine", "age": null } ] }, "b": { "cid": 890, "name": "Janise Maccarthy", "age": 66, "address": { "number": 7337, "street": "Main St.", "city": "San Jose" }, "interests": [ "Wine", "Computers" ], "children": [ ] } }
+{ "a": { "cid": 138, "name": "Ora Villafane", "age": null, "address": null, "interests": [ "Walking", "Cooking" ], "children": [ { "name": "Deeann Villafane", "age": 22 }, { "name": "Cody Villafane", "age": 47 } ] }, "b": { "cid": 369, "name": "Nickole Dory", "age": 10, "address": { "number": 4761, "street": "View St.", "city": "Portland" }, "interests": [ "Walking", "Cooking" ], "children": [ { "name": "Annmarie Dory", "age": null }, { "name": "Michele Dory", "age": null }, { "name": "Annamae Dory", "age": null }, { "name": "Flora Dory", "age": null } ] } }
+{ "a": { "cid": 138, "name": "Ora Villafane", "age": null, "address": null, "interests": [ "Walking", "Cooking" ], "children": [ { "name": "Deeann Villafane", "age": 22 }, { "name": "Cody Villafane", "age": 47 } ] }, "b": { "cid": 816, "name": "Cheyenne Eddie", "age": null, "address": null, "interests": [ "Walking", "Cooking" ], "children": [ { "name": "Kathe Eddie", "age": null }, { "name": "Charles Eddie", "age": null } ] } }
+{ "a": { "cid": 144, "name": "Celesta Sosebee", "age": 19, "address": { "number": 2683, "street": "7th St.", "city": "Portland" }, "interests": [ "Databases", "Databases" ], "children": [ { "name": "Jesse Sosebee", "age": null }, { "name": "Oralee Sosebee", "age": null }, { "name": "Sunday Sosebee", "age": null } ] }, "b": { "cid": 513, "name": "Marianna Gortman", "age": 49, "address": { "number": 927, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Databases", "Databases" ], "children": [ ] } }
+{ "a": { "cid": 144, "name": "Celesta Sosebee", "age": 19, "address": { "number": 2683, "street": "7th St.", "city": "Portland" }, "interests": [ "Databases", "Databases" ], "children": [ { "name": "Jesse Sosebee", "age": null }, { "name": "Oralee Sosebee", "age": null }, { "name": "Sunday Sosebee", "age": null } ] }, "b": { "cid": 520, "name": "Janay Bernbeck", "age": null, "address": null, "interests": [ "Databases", "Databases" ], "children": [ { "name": "Aurea Bernbeck", "age": null }, { "name": "Tiara Bernbeck", "age": null }, { "name": "Alfredia Bernbeck", "age": 26 } ] } }
+{ "a": { "cid": 146, "name": "Glennis Vanruiten", "age": 14, "address": { "number": 8272, "street": "Park St.", "city": "Los Angeles" }, "interests": [ "Squash", "Databases" ], "children": [ { "name": "Joanie Vanruiten", "age": null }, { "name": "Long Vanruiten", "age": null }, { "name": "Abdul Vanruiten", "age": null } ] }, "b": { "cid": 532, "name": "Tania Fraklin", "age": 38, "address": { "number": 2857, "street": "Washington St.", "city": "Seattle" }, "interests": [ "Squash", "Databases" ], "children": [ ] } }
+{ "a": { "cid": 177, "name": "Wilda Hanisch", "age": null, "address": null, "interests": [ "Wine", "Computers" ], "children": [ { "name": "Shannan Hanisch", "age": null }, { "name": "Marissa Hanisch", "age": 30 }, { "name": "Keely Hanisch", "age": 54 }, { "name": "Humberto Hanisch", "age": 17 } ] }, "b": { "cid": 716, "name": "Deirdre Bruderer", "age": null, "address": null, "interests": [ "Computers", "Wine" ], "children": [ { "name": "Coralee Bruderer", "age": null }, { "name": "Mina Bruderer", "age": null }, { "name": "Lindsey Bruderer", "age": 35 }, { "name": "Yi Bruderer", "age": null } ] } }
+{ "a": { "cid": 177, "name": "Wilda Hanisch", "age": null, "address": null, "interests": [ "Wine", "Computers" ], "children": [ { "name": "Shannan Hanisch", "age": null }, { "name": "Marissa Hanisch", "age": 30 }, { "name": "Keely Hanisch", "age": 54 }, { "name": "Humberto Hanisch", "age": 17 } ] }, "b": { "cid": 890, "name": "Janise Maccarthy", "age": 66, "address": { "number": 7337, "street": "Main St.", "city": "San Jose" }, "interests": [ "Wine", "Computers" ], "children": [ ] } }
+{ "a": { "cid": 182, "name": "Christiana Westlie", "age": null, "address": null, "interests": [ "Skiing", "Bass" ], "children": [ { "name": "Ilda Westlie", "age": 18 } ] }, "b": { "cid": 730, "name": "Marti Vandoren", "age": null, "address": null, "interests": [ "Skiing", "Bass" ], "children": [ { "name": "Carroll Vandoren", "age": null }, { "name": "Lorretta Vandoren", "age": 30 }, { "name": "Chloe Vandoren", "age": 42 }, { "name": "Ilona Vandoren", "age": null } ] } }
+{ "a": { "cid": 182, "name": "Christiana Westlie", "age": null, "address": null, "interests": [ "Skiing", "Bass" ], "children": [ { "name": "Ilda Westlie", "age": 18 } ] }, "b": { "cid": 982, "name": "Jude Brandsrud", "age": 41, "address": { "number": 7133, "street": "Washington St.", "city": "Seattle" }, "interests": [ "Bass", "Skiing" ], "children": [ { "name": "Scottie Brandsrud", "age": null }, { "name": "Gennie Brandsrud", "age": 10 }, { "name": "Agnes Brandsrud", "age": null }, { "name": "Clarinda Brandsrud", "age": 17 } ] } }
+{ "a": { "cid": 190, "name": "Kristel Axelson", "age": null, "address": null, "interests": [ "Movies", "Books" ], "children": [ { "name": "Deja Axelson", "age": null } ] }, "b": { "cid": 295, "name": "Guillermina Florek", "age": 61, "address": { "number": 3704, "street": "Washington St.", "city": "Mountain View" }, "interests": [ "Movies", "Books" ], "children": [ { "name": "Donnie Florek", "age": null }, { "name": "Jeannetta Florek", "age": 38 }, { "name": "Leigha Florek", "age": null }, { "name": "Zenobia Florek", "age": 10 } ] } }
+{ "a": { "cid": 190, "name": "Kristel Axelson", "age": null, "address": null, "interests": [ "Movies", "Books" ], "children": [ { "name": "Deja Axelson", "age": null } ] }, "b": { "cid": 877, "name": "Nicki Lipkind", "age": null, "address": null, "interests": [ "Books", "Movies" ], "children": [ { "name": "Yahaira Lipkind", "age": 12 } ] } }
+{ "a": { "cid": 190, "name": "Kristel Axelson", "age": null, "address": null, "interests": [ "Movies", "Books" ], "children": [ { "name": "Deja Axelson", "age": null } ] }, "b": { "cid": 974, "name": "Alexis Malcomson", "age": null, "address": null, "interests": [ "Movies", "Books" ], "children": [ { "name": "Kerri Malcomson", "age": null } ] } }
+{ "a": { "cid": 202, "name": "Evangelina Poloskey", "age": 46, "address": { "number": 8285, "street": "Main St.", "city": "Los Angeles" }, "interests": [ "Wine", "Squash" ], "children": [ { "name": "Anthony Poloskey", "age": 27 }, { "name": "Olga Poloskey", "age": 10 }, { "name": "Carmon Poloskey", "age": 13 }, { "name": "Tanja Poloskey", "age": 20 } ] }, "b": { "cid": 599, "name": "Alva Molaison", "age": 87, "address": { "number": 5974, "street": "Washington St.", "city": "Seattle" }, "interests": [ "Wine", "Squash" ], "children": [ { "name": "Milo Molaison", "age": 39 } ] } }
+{ "a": { "cid": 210, "name": "Jillian Roadruck", "age": null, "address": null, "interests": [ "Coffee", "Tennis" ], "children": [ { "name": "Marguerite Roadruck", "age": null }, { "name": "Ilana Roadruck", "age": null }, { "name": "Chantelle Roadruck", "age": 19 }, { "name": "Nikia Roadruck", "age": 43 } ] }, "b": { "cid": 317, "name": "Zona Caffarel", "age": 52, "address": { "number": 9419, "street": "Cedar St.", "city": "Seattle" }, "interests": [ "Tennis", "Coffee" ], "children": [ { "name": "Cortez Caffarel", "age": null } ] } }
+{ "a": { "cid": 210, "name": "Jillian Roadruck", "age": null, "address": null, "interests": [ "Coffee", "Tennis" ], "children": [ { "name": "Marguerite Roadruck", "age": null }, { "name": "Ilana Roadruck", "age": null }, { "name": "Chantelle Roadruck", "age": 19 }, { "name": "Nikia Roadruck", "age": 43 } ] }, "b": { "cid": 771, "name": "Marisela Tredo", "age": null, "address": null, "interests": [ "Tennis", "Coffee" ], "children": [ { "name": "Ardell Tredo", "age": 21 }, { "name": "Evelynn Tredo", "age": 16 } ] } }
+{ "a": { "cid": 214, "name": "Louvenia Zaffalon", "age": null, "address": null, "interests": [ "Skiing", "Books" ], "children": [ ] }, "b": { "cid": 270, "name": "Lavon Ascenzo", "age": null, "address": null, "interests": [ "Books", "Skiing" ], "children": [ ] } }
+{ "a": { "cid": 215, "name": "Ashton Schadegg", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Ciara Schadegg", "age": null }, { "name": "Karisa Schadegg", "age": 11 }, { "name": "Hayden Schadegg", "age": 44 } ] }, "b": { "cid": 228, "name": "Donnette Brumbley", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Madlyn Brumbley", "age": null }, { "name": "Apolonia Brumbley", "age": 13 }, { "name": "Stephine Brumbley", "age": null }, { "name": "Zelma Brumbley", "age": 51 } ] } }
+{ "a": { "cid": 215, "name": "Ashton Schadegg", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Ciara Schadegg", "age": null }, { "name": "Karisa Schadegg", "age": 11 }, { "name": "Hayden Schadegg", "age": 44 } ] }, "b": { "cid": 731, "name": "Yajaira Orto", "age": null, "address": null, "interests": [ "Music", "Databases" ], "children": [ { "name": "Eliz Orto", "age": 17 }, { "name": "Gisela Orto", "age": null } ] } }
+{ "a": { "cid": 215, "name": "Ashton Schadegg", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Ciara Schadegg", "age": null }, { "name": "Karisa Schadegg", "age": 11 }, { "name": "Hayden Schadegg", "age": 44 } ] }, "b": { "cid": 795, "name": "Sharilyn Branstad", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Ashlee Branstad", "age": 24 }, { "name": "Bobbye Branstad", "age": 26 }, { "name": "Natalya Branstad", "age": null }, { "name": "Edith Branstad", "age": null } ] } }
+{ "a": { "cid": 218, "name": "Clarinda Stagliano", "age": 76, "address": { "number": 3258, "street": "Park St.", "city": "San Jose" }, "interests": [ "Video Games", "Cigars" ], "children": [ ] }, "b": { "cid": 271, "name": "Carey Ronin", "age": 44, "address": { "number": 8141, "street": "Oak St.", "city": "Mountain View" }, "interests": [ "Cigars", "Video Games" ], "children": [ { "name": "Lonny Ronin", "age": null }, { "name": "Armanda Ronin", "age": null } ] } }
+{ "a": { "cid": 218, "name": "Clarinda Stagliano", "age": 76, "address": { "number": 3258, "street": "Park St.", "city": "San Jose" }, "interests": [ "Video Games", "Cigars" ], "children": [ ] }, "b": { "cid": 689, "name": "Camila Cho", "age": 70, "address": { "number": 7731, "street": "Cedar St.", "city": "Mountain View" }, "interests": [ "Video Games", "Cigars" ], "children": [ { "name": "Myrtie Cho", "age": 57 }, { "name": "Merideth Cho", "age": 45 }, { "name": "Meta Cho", "age": 20 } ] } }
+{ "a": { "cid": 222, "name": "Malcom Bloomgren", "age": 39, "address": { "number": 4674, "street": "Hill St.", "city": "Mountain View" }, "interests": [ "Databases", "Skiing" ], "children": [ { "name": "Rosia Bloomgren", "age": null }, { "name": "Bryant Bloomgren", "age": 15 }, { "name": "Donnie Bloomgren", "age": null } ] }, "b": { "cid": 322, "name": "Jaclyn Ettl", "age": 83, "address": { "number": 4500, "street": "Main St.", "city": "Sunnyvale" }, "interests": [ "Databases", "Skiing" ], "children": [ { "name": "Noah Ettl", "age": 30 }, { "name": "Kesha Ettl", "age": null } ] } }
+{ "a": { "cid": 223, "name": "Margurite Embelton", "age": 19, "address": { "number": 554, "street": "Oak St.", "city": "Portland" }, "interests": [ "Running", "Fishing" ], "children": [ { "name": "Sherie Embelton", "age": null }, { "name": "Monica Embelton", "age": null }, { "name": "Jeanne Embelton", "age": null }, { "name": "Santiago Embelton", "age": null } ] }, "b": { "cid": 571, "name": "Lenita Tentler", "age": null, "address": null, "interests": [ "Running", "Fishing" ], "children": [ { "name": "Damian Tentler", "age": 16 }, { "name": "Camellia Tentler", "age": null }, { "name": "Vern Tentler", "age": 15 } ] } }
+{ "a": { "cid": 228, "name": "Donnette Brumbley", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Madlyn Brumbley", "age": null }, { "name": "Apolonia Brumbley", "age": 13 }, { "name": "Stephine Brumbley", "age": null }, { "name": "Zelma Brumbley", "age": 51 } ] }, "b": { "cid": 731, "name": "Yajaira Orto", "age": null, "address": null, "interests": [ "Music", "Databases" ], "children": [ { "name": "Eliz Orto", "age": 17 }, { "name": "Gisela Orto", "age": null } ] } }
+{ "a": { "cid": 228, "name": "Donnette Brumbley", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Madlyn Brumbley", "age": null }, { "name": "Apolonia Brumbley", "age": 13 }, { "name": "Stephine Brumbley", "age": null }, { "name": "Zelma Brumbley", "age": 51 } ] }, "b": { "cid": 795, "name": "Sharilyn Branstad", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Ashlee Branstad", "age": 24 }, { "name": "Bobbye Branstad", "age": 26 }, { "name": "Natalya Branstad", "age": null }, { "name": "Edith Branstad", "age": null } ] } }
+{ "a": { "cid": 241, "name": "Lesha Ambrosia", "age": 49, "address": { "number": 6133, "street": "Cedar St.", "city": "Portland" }, "interests": [ "Base Jumping", "Running" ], "children": [ { "name": "Venice Ambrosia", "age": null } ] }, "b": { "cid": 277, "name": "Malena Smock", "age": null, "address": null, "interests": [ "Running", "Base Jumping" ], "children": [ { "name": "Inocencia Smock", "age": 50 }, { "name": "Cleveland Smock", "age": null } ] } }
+{ "a": { "cid": 241, "name": "Lesha Ambrosia", "age": 49, "address": { "number": 6133, "street": "Cedar St.", "city": "Portland" }, "interests": [ "Base Jumping", "Running" ], "children": [ { "name": "Venice Ambrosia", "age": null } ] }, "b": { "cid": 543, "name": "Pearl Nollette", "age": null, "address": null, "interests": [ "Base Jumping", "Running" ], "children": [ ] } }
+{ "a": { "cid": 254, "name": "Jeanice Longanecker", "age": 74, "address": { "number": 2613, "street": "Oak St.", "city": "San Jose" }, "interests": [ "Books", "Base Jumping" ], "children": [ ] }, "b": { "cid": 467, "name": "Magali Ingerson", "age": null, "address": null, "interests": [ "Books", "Base Jumping" ], "children": [ { "name": "Monty Ingerson", "age": 11 }, { "name": "Noelia Ingerson", "age": 47 }, { "name": "Tennie Ingerson", "age": null }, { "name": "Merrill Ingerson", "age": null } ] } }
+{ "a": { "cid": 254, "name": "Jeanice Longanecker", "age": 74, "address": { "number": 2613, "street": "Oak St.", "city": "San Jose" }, "interests": [ "Books", "Base Jumping" ], "children": [ ] }, "b": { "cid": 632, "name": "Keeley Goga", "age": null, "address": null, "interests": [ "Books", "Base Jumping" ], "children": [ { "name": "Walter Goga", "age": 39 }, { "name": "Chaya Goga", "age": null }, { "name": "Melodie Goga", "age": null }, { "name": "Isidro Goga", "age": 32 } ] } }
+{ "a": { "cid": 259, "name": "Aurelio Darrigo", "age": 45, "address": { "number": 1114, "street": "Park St.", "city": "San Jose" }, "interests": [ "Cooking", "Running" ], "children": [ { "name": "Leonard Darrigo", "age": 22 }, { "name": "Aron Darrigo", "age": null }, { "name": "Pamelia Darrigo", "age": 14 } ] }, "b": { "cid": 379, "name": "Penney Huslander", "age": 58, "address": { "number": 6919, "street": "7th St.", "city": "Portland" }, "interests": [ "Cooking", "Running" ], "children": [ { "name": "Magaret Huslander", "age": null }, { "name": "Dodie Huslander", "age": 14 } ] } }
+{ "a": { "cid": 260, "name": "Hedwig Caminero", "age": 81, "address": { "number": 4305, "street": "7th St.", "city": "Portland" }, "interests": [ "Video Games", "Databases" ], "children": [ { "name": "Hal Caminero", "age": null }, { "name": "Cierra Caminero", "age": 32 } ] }, "b": { "cid": 298, "name": "Brittny Christin", "age": null, "address": null, "interests": [ "Databases", "Video Games" ], "children": [ { "name": "Hilario Christin", "age": null }, { "name": "Clarine Christin", "age": null } ] } }
+{ "a": { "cid": 260, "name": "Hedwig Caminero", "age": 81, "address": { "number": 4305, "street": "7th St.", "city": "Portland" }, "interests": [ "Video Games", "Databases" ], "children": [ { "name": "Hal Caminero", "age": null }, { "name": "Cierra Caminero", "age": 32 } ] }, "b": { "cid": 591, "name": "Matthew Tenhaeff", "age": null, "address": null, "interests": [ "Databases", "Video Games" ], "children": [ { "name": "Jan Tenhaeff", "age": 25 }, { "name": "Nana Tenhaeff", "age": null }, { "name": "Laticia Tenhaeff", "age": null }, { "name": "Ara Tenhaeff", "age": 44 } ] } }
+{ "a": { "cid": 271, "name": "Carey Ronin", "age": 44, "address": { "number": 8141, "street": "Oak St.", "city": "Mountain View" }, "interests": [ "Cigars", "Video Games" ], "children": [ { "name": "Lonny Ronin", "age": null }, { "name": "Armanda Ronin", "age": null } ] }, "b": { "cid": 689, "name": "Camila Cho", "age": 70, "address": { "number": 7731, "street": "Cedar St.", "city": "Mountain View" }, "interests": [ "Video Games", "Cigars" ], "children": [ { "name": "Myrtie Cho", "age": 57 }, { "name": "Merideth Cho", "age": 45 }, { "name": "Meta Cho", "age": 20 } ] } }
+{ "a": { "cid": 277, "name": "Malena Smock", "age": null, "address": null, "interests": [ "Running", "Base Jumping" ], "children": [ { "name": "Inocencia Smock", "age": 50 }, { "name": "Cleveland Smock", "age": null } ] }, "b": { "cid": 543, "name": "Pearl Nollette", "age": null, "address": null, "interests": [ "Base Jumping", "Running" ], "children": [ ] } }
+{ "a": { "cid": 285, "name": "Edgar Farlin", "age": 75, "address": { "number": 3833, "street": "Lake St.", "city": "Sunnyvale" }, "interests": [ "Coffee", "Databases" ], "children": [ { "name": "Stefanie Farlin", "age": 60 }, { "name": "Catina Farlin", "age": null }, { "name": "Lizzie Farlin", "age": null }, { "name": "Beau Farlin", "age": null } ] }, "b": { "cid": 805, "name": "Gaylord Ginder", "age": null, "address": null, "interests": [ "Databases", "Coffee" ], "children": [ { "name": "Lucina Ginder", "age": null }, { "name": "Harriett Ginder", "age": null } ] } }
+{ "a": { "cid": 295, "name": "Guillermina Florek", "age": 61, "address": { "number": 3704, "street": "Washington St.", "city": "Mountain View" }, "interests": [ "Movies", "Books" ], "children": [ { "name": "Donnie Florek", "age": null }, { "name": "Jeannetta Florek", "age": 38 }, { "name": "Leigha Florek", "age": null }, { "name": "Zenobia Florek", "age": 10 } ] }, "b": { "cid": 877, "name": "Nicki Lipkind", "age": null, "address": null, "interests": [ "Books", "Movies" ], "children": [ { "name": "Yahaira Lipkind", "age": 12 } ] } }
+{ "a": { "cid": 295, "name": "Guillermina Florek", "age": 61, "address": { "number": 3704, "street": "Washington St.", "city": "Mountain View" }, "interests": [ "Movies", "Books" ], "children": [ { "name": "Donnie Florek", "age": null }, { "name": "Jeannetta Florek", "age": 38 }, { "name": "Leigha Florek", "age": null }, { "name": "Zenobia Florek", "age": 10 } ] }, "b": { "cid": 974, "name": "Alexis Malcomson", "age": null, "address": null, "interests": [ "Movies", "Books" ], "children": [ { "name": "Kerri Malcomson", "age": null } ] } }
+{ "a": { "cid": 298, "name": "Brittny Christin", "age": null, "address": null, "interests": [ "Databases", "Video Games" ], "children": [ { "name": "Hilario Christin", "age": null }, { "name": "Clarine Christin", "age": null } ] }, "b": { "cid": 591, "name": "Matthew Tenhaeff", "age": null, "address": null, "interests": [ "Databases", "Video Games" ], "children": [ { "name": "Jan Tenhaeff", "age": 25 }, { "name": "Nana Tenhaeff", "age": null }, { "name": "Laticia Tenhaeff", "age": null }, { "name": "Ara Tenhaeff", "age": 44 } ] } }
+{ "a": { "cid": 304, "name": "Francine Reddin", "age": 39, "address": { "number": 9392, "street": "Hill St.", "city": "Seattle" }, "interests": [ "Music", "Base Jumping" ], "children": [ { "name": "Millicent Reddin", "age": null } ] }, "b": { "cid": 501, "name": "Alyce Coant", "age": null, "address": null, "interests": [ "Music", "Base Jumping" ], "children": [ { "name": "Elyse Coant", "age": 50 } ] } }
+{ "a": { "cid": 309, "name": "Lise Baiz", "age": 46, "address": { "number": 352, "street": "Oak St.", "city": "San Jose" }, "interests": [ "Bass", "Squash" ], "children": [ { "name": "Alisa Baiz", "age": 18 }, { "name": "Elidia Baiz", "age": 28 }, { "name": "Ray Baiz", "age": 19 } ] }, "b": { "cid": 713, "name": "Galina Retterbush", "age": null, "address": null, "interests": [ "Bass", "Squash" ], "children": [ { "name": "Janene Retterbush", "age": null }, { "name": "Toby Retterbush", "age": 15 }, { "name": "Renato Retterbush", "age": null }, { "name": "Annice Retterbush", "age": 22 } ] } }
+{ "a": { "cid": 315, "name": "Kallie Eiselein", "age": null, "address": null, "interests": [ "Computers", "Tennis" ], "children": [ ] }, "b": { "cid": 737, "name": "Jeffrey Chesson", "age": 13, "address": { "number": 6833, "street": "Lake St.", "city": "Portland" }, "interests": [ "Tennis", "Computers" ], "children": [ { "name": "Clayton Chesson", "age": null }, { "name": "Yi Chesson", "age": null } ] } }
+{ "a": { "cid": 317, "name": "Zona Caffarel", "age": 52, "address": { "number": 9419, "street": "Cedar St.", "city": "Seattle" }, "interests": [ "Tennis", "Coffee" ], "children": [ { "name": "Cortez Caffarel", "age": null } ] }, "b": { "cid": 771, "name": "Marisela Tredo", "age": null, "address": null, "interests": [ "Tennis", "Coffee" ], "children": [ { "name": "Ardell Tredo", "age": 21 }, { "name": "Evelynn Tredo", "age": 16 } ] } }
+{ "a": { "cid": 347, "name": "Patrick Feighan", "age": 34, "address": { "number": 7613, "street": "Cedar St.", "city": "Los Angeles" }, "interests": [ "Puzzles", "Books" ], "children": [ { "name": "Madaline Feighan", "age": null } ] }, "b": { "cid": 480, "name": "Nigel Pitmon", "age": null, "address": null, "interests": [ "Puzzles", "Books" ], "children": [ { "name": "Janene Pitmon", "age": null }, { "name": "Louie Pitmon", "age": 19 }, { "name": "Genny Pitmon", "age": 24 }, { "name": "Robby Pitmon", "age": 55 } ] } }
+{ "a": { "cid": 347, "name": "Patrick Feighan", "age": 34, "address": { "number": 7613, "street": "Cedar St.", "city": "Los Angeles" }, "interests": [ "Puzzles", "Books" ], "children": [ { "name": "Madaline Feighan", "age": null } ] }, "b": { "cid": 860, "name": "Isabelle Sept", "age": 88, "address": { "number": 4382, "street": "Washington St.", "city": "Portland" }, "interests": [ "Puzzles", "Books" ], "children": [ ] } }
+{ "a": { "cid": 355, "name": "Elois Leckband", "age": null, "address": null, "interests": [ "Skiing", "Wine" ], "children": [ ] }, "b": { "cid": 635, "name": "Angelena Braegelmann", "age": 36, "address": { "number": 4158, "street": "Park St.", "city": "San Jose" }, "interests": [ "Wine", "Skiing" ], "children": [ { "name": "Daisey Braegelmann", "age": 18 }, { "name": "Gaston Braegelmann", "age": 19 }, { "name": "Louella Braegelmann", "age": null }, { "name": "Leonie Braegelmann", "age": null } ] } }
+{ "a": { "cid": 367, "name": "Cassondra Fabiani", "age": null, "address": null, "interests": [ "Squash", "Tennis" ], "children": [ { "name": "Evia Fabiani", "age": null }, { "name": "Chaya Fabiani", "age": null }, { "name": "Sherman Fabiani", "age": null }, { "name": "Kathi Fabiani", "age": 54 } ] }, "b": { "cid": 503, "name": "Phyliss Cassani", "age": null, "address": null, "interests": [ "Squash", "Tennis" ], "children": [ { "name": "Rolando Cassani", "age": 44 }, { "name": "Rikki Cassani", "age": 18 }, { "name": "Monty Cassani", "age": 40 } ] } }
+{ "a": { "cid": 369, "name": "Nickole Dory", "age": 10, "address": { "number": 4761, "street": "View St.", "city": "Portland" }, "interests": [ "Walking", "Cooking" ], "children": [ { "name": "Annmarie Dory", "age": null }, { "name": "Michele Dory", "age": null }, { "name": "Annamae Dory", "age": null }, { "name": "Flora Dory", "age": null } ] }, "b": { "cid": 816, "name": "Cheyenne Eddie", "age": null, "address": null, "interests": [ "Walking", "Cooking" ], "children": [ { "name": "Kathe Eddie", "age": null }, { "name": "Charles Eddie", "age": null } ] } }
+{ "a": { "cid": 378, "name": "Melany Matias", "age": 10, "address": { "number": 8838, "street": "Main St.", "city": "Seattle" }, "interests": [ "Coffee", "Tennis", "Bass" ], "children": [ { "name": "Earnestine Matias", "age": null }, { "name": "Lore Matias", "age": null } ] }, "b": { "cid": 545, "name": "Dolores Ferer", "age": null, "address": null, "interests": [ "Coffee", "Bass", "Tennis" ], "children": [ { "name": "Bridgette Ferer", "age": null } ] } }
+{ "a": { "cid": 380, "name": "Silva Purdue", "age": 33, "address": { "number": 1759, "street": "7th St.", "city": "Portland" }, "interests": [ "Music", "Squash" ], "children": [ { "name": "Marshall Purdue", "age": null }, { "name": "Yuki Purdue", "age": null }, { "name": "Val Purdue", "age": 12 }, { "name": "Dominica Purdue", "age": null } ] }, "b": { "cid": 904, "name": "Holley Tofil", "age": 51, "address": { "number": 8946, "street": "Oak St.", "city": "Mountain View" }, "interests": [ "Music", "Squash" ], "children": [ { "name": "Kristal Tofil", "age": null } ] } }
+{ "a": { "cid": 386, "name": "Mao Gradowski", "age": 36, "address": { "number": 5116, "street": "Washington St.", "city": "Mountain View" }, "interests": [ "Computers", "Fishing" ], "children": [ { "name": "Jeneva Gradowski", "age": null }, { "name": "Thu Gradowski", "age": 22 }, { "name": "Daphine Gradowski", "age": null }, { "name": "Providencia Gradowski", "age": null } ] }, "b": { "cid": 646, "name": "Pablo Catterton", "age": null, "address": null, "interests": [ "Fishing", "Computers" ], "children": [ ] } }
+{ "a": { "cid": 386, "name": "Mao Gradowski", "age": 36, "address": { "number": 5116, "street": "Washington St.", "city": "Mountain View" }, "interests": [ "Computers", "Fishing" ], "children": [ { "name": "Jeneva Gradowski", "age": null }, { "name": "Thu Gradowski", "age": 22 }, { "name": "Daphine Gradowski", "age": null }, { "name": "Providencia Gradowski", "age": null } ] }, "b": { "cid": 781, "name": "Christy Darcangelo", "age": 42, "address": { "number": 2178, "street": "Washington St.", "city": "Portland" }, "interests": [ "Computers", "Fishing" ], "children": [ { "name": "Luis Darcangelo", "age": 21 }, { "name": "Omega Darcangelo", "age": 26 }, { "name": "Remedios Darcangelo", "age": 28 }, { "name": "Domenic Darcangelo", "age": 21 } ] } }
+{ "a": { "cid": 389, "name": "Loraine Morfee", "age": 72, "address": { "number": 2945, "street": "Lake St.", "city": "Seattle" }, "interests": [ "Wine", "Walking" ], "children": [ { "name": "Berry Morfee", "age": 30 } ] }, "b": { "cid": 607, "name": "Bert Garigliano", "age": 71, "address": { "number": 3881, "street": "Washington St.", "city": "San Jose" }, "interests": [ "Walking", "Wine" ], "children": [ { "name": "Junior Garigliano", "age": 42 }, { "name": "Willa Garigliano", "age": 21 }, { "name": "Carlo Garigliano", "age": null } ] } }
+{ "a": { "cid": 393, "name": "Rossana Monton", "age": 34, "address": { "number": 4490, "street": "Main St.", "city": "Portland" }, "interests": [ "Skiing", "Base Jumping" ], "children": [ { "name": "Glayds Monton", "age": null }, { "name": "Lily Monton", "age": null }, { "name": "Raina Monton", "age": null }, { "name": "Hilma Monton", "age": null } ] }, "b": { "cid": 493, "name": "Lindsey Trout", "age": 86, "address": { "number": 7619, "street": "Cedar St.", "city": "Portland" }, "interests": [ "Base Jumping", "Skiing" ], "children": [ { "name": "Madlyn Trout", "age": 58 }, { "name": "Amie Trout", "age": 72 } ] } }
+{ "a": { "cid": 394, "name": "Lizette Roux", "age": 57, "address": { "number": 458, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Bass", "Books" ], "children": [ { "name": "Doloris Roux", "age": null } ] }, "b": { "cid": 523, "name": "Johanne Huls", "age": null, "address": null, "interests": [ "Books", "Bass" ], "children": [ { "name": "Melynda Huls", "age": null }, { "name": "Vicky Huls", "age": 16 }, { "name": "Charlott Huls", "age": null } ] } }
+{ "a": { "cid": 403, "name": "Kayleigh Houey", "age": null, "address": null, "interests": [ "Fishing", "Music" ], "children": [ { "name": "Ta Houey", "age": null }, { "name": "Ayana Houey", "age": null }, { "name": "Dominique Houey", "age": null }, { "name": "Denise Houey", "age": 48 } ] }, "b": { "cid": 949, "name": "Elissa Rogue", "age": null, "address": null, "interests": [ "Fishing", "Music" ], "children": [ { "name": "Noriko Rogue", "age": 41 }, { "name": "Lavona Rogue", "age": 39 } ] } }
+{ "a": { "cid": 407, "name": "Bebe Cotney", "age": null, "address": null, "interests": [ "Books", "Tennis" ], "children": [ { "name": "Daren Cotney", "age": null }, { "name": "Lady Cotney", "age": 48 } ] }, "b": { "cid": 420, "name": "Coralie Regueira", "age": null, "address": null, "interests": [ "Books", "Tennis" ], "children": [ { "name": "Latoyia Regueira", "age": 31 }, { "name": "Obdulia Regueira", "age": 12 }, { "name": "Herlinda Regueira", "age": null } ] } }
+{ "a": { "cid": 407, "name": "Bebe Cotney", "age": null, "address": null, "interests": [ "Books", "Tennis" ], "children": [ { "name": "Daren Cotney", "age": null }, { "name": "Lady Cotney", "age": 48 } ] }, "b": { "cid": 549, "name": "Kathrin Cruff", "age": 63, "address": { "number": 9002, "street": "Washington St.", "city": "Sunnyvale" }, "interests": [ "Tennis", "Books" ], "children": [ { "name": "Candi Cruff", "age": 49 }, { "name": "Barry Cruff", "age": 17 }, { "name": "Shane Cruff", "age": 18 }, { "name": "Brendon Cruff", "age": null } ] } }
+{ "a": { "cid": 420, "name": "Coralie Regueira", "age": null, "address": null, "interests": [ "Books", "Tennis" ], "children": [ { "name": "Latoyia Regueira", "age": 31 }, { "name": "Obdulia Regueira", "age": 12 }, { "name": "Herlinda Regueira", "age": null } ] }, "b": { "cid": 549, "name": "Kathrin Cruff", "age": 63, "address": { "number": 9002, "street": "Washington St.", "city": "Sunnyvale" }, "interests": [ "Tennis", "Books" ], "children": [ { "name": "Candi Cruff", "age": 49 }, { "name": "Barry Cruff", "age": 17 }, { "name": "Shane Cruff", "age": 18 }, { "name": "Brendon Cruff", "age": null } ] } }
+{ "a": { "cid": 450, "name": "Althea Mohammed", "age": null, "address": null, "interests": [ "Fishing", "Databases" ], "children": [ { "name": "Jasper Mohammed", "age": null } ] }, "b": { "cid": 478, "name": "Sophia Whitt", "age": 26, "address": { "number": 2787, "street": "Park St.", "city": "Mountain View" }, "interests": [ "Fishing", "Databases" ], "children": [ { "name": "Irving Whitt", "age": 13 }, { "name": "Jeannette Whitt", "age": null } ] } }
+{ "a": { "cid": 452, "name": "Casie Marasigan", "age": null, "address": null, "interests": [ "Walking", "Computers" ], "children": [ { "name": "Connie Marasigan", "age": null }, { "name": "Kimberlie Marasigan", "age": null } ] }, "b": { "cid": 573, "name": "Tyree Ketcher", "age": null, "address": null, "interests": [ "Computers", "Walking" ], "children": [ { "name": "Aleisha Ketcher", "age": null }, { "name": "Vonda Ketcher", "age": null }, { "name": "Cyndy Ketcher", "age": 13 }, { "name": "Chassidy Ketcher", "age": 30 } ] } }
+{ "a": { "cid": 467, "name": "Magali Ingerson", "age": null, "address": null, "interests": [ "Books", "Base Jumping" ], "children": [ { "name": "Monty Ingerson", "age": 11 }, { "name": "Noelia Ingerson", "age": 47 }, { "name": "Tennie Ingerson", "age": null }, { "name": "Merrill Ingerson", "age": null } ] }, "b": { "cid": 632, "name": "Keeley Goga", "age": null, "address": null, "interests": [ "Books", "Base Jumping" ], "children": [ { "name": "Walter Goga", "age": 39 }, { "name": "Chaya Goga", "age": null }, { "name": "Melodie Goga", "age": null }, { "name": "Isidro Goga", "age": 32 } ] } }
+{ "a": { "cid": 472, "name": "Kelley Mischler", "age": 38, "address": { "number": 7988, "street": "Lake St.", "city": "Los Angeles" }, "interests": [ "Movies", "Cooking", "Skiing" ], "children": [ { "name": "Keila Mischler", "age": 19 }, { "name": "Evie Mischler", "age": 15 } ] }, "b": { "cid": 602, "name": "Clyde Salada", "age": 59, "address": { "number": 8316, "street": "7th St.", "city": "Sunnyvale" }, "interests": [ "Movies", "Skiing", "Cooking" ], "children": [ ] } }
+{ "a": { "cid": 480, "name": "Nigel Pitmon", "age": null, "address": null, "interests": [ "Puzzles", "Books" ], "children": [ { "name": "Janene Pitmon", "age": null }, { "name": "Louie Pitmon", "age": 19 }, { "name": "Genny Pitmon", "age": 24 }, { "name": "Robby Pitmon", "age": 55 } ] }, "b": { "cid": 860, "name": "Isabelle Sept", "age": 88, "address": { "number": 4382, "street": "Washington St.", "city": "Portland" }, "interests": [ "Puzzles", "Books" ], "children": [ ] } }
+{ "a": { "cid": 483, "name": "Elsa Vigen", "age": null, "address": null, "interests": [ "Wine", "Databases" ], "children": [ { "name": "Larae Vigen", "age": null }, { "name": "Elwood Vigen", "age": null } ] }, "b": { "cid": 894, "name": "Reginald Julien", "age": 16, "address": { "number": 1107, "street": "Lake St.", "city": "Mountain View" }, "interests": [ "Databases", "Wine" ], "children": [ { "name": "Arthur Julien", "age": null }, { "name": "Evia Julien", "age": null } ] } }
+{ "a": { "cid": 484, "name": "Bennie Dragaj", "age": null, "address": null, "interests": [ "Fishing", "Databases", "Wine" ], "children": [ { "name": "Viva Dragaj", "age": 13 } ] }, "b": { "cid": 741, "name": "Lesia Risatti", "age": 48, "address": { "number": 7378, "street": "Cedar St.", "city": "Portland" }, "interests": [ "Fishing", "Wine", "Databases" ], "children": [ { "name": "Tangela Risatti", "age": null }, { "name": "Leonel Risatti", "age": 33 }, { "name": "Cythia Risatti", "age": 36 } ] } }
+{ "a": { "cid": 484, "name": "Bennie Dragaj", "age": null, "address": null, "interests": [ "Fishing", "Databases", "Wine" ], "children": [ { "name": "Viva Dragaj", "age": 13 } ] }, "b": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Databases", "Fishing", "Wine" ], "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] } }
+{ "a": { "cid": 498, "name": "Arleen Sultzer", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Norine Sultzer", "age": 29 } ] }, "b": { "cid": 875, "name": "Ramon Crepps", "age": null, "address": null, "interests": [ "Coffee", "Movies", "Skiing" ], "children": [ { "name": "Elisha Crepps", "age": null } ] } }
+{ "a": { "cid": 502, "name": "Lawana Mulik", "age": 82, "address": { "number": 3071, "street": "Park St.", "city": "Portland" }, "interests": [ "Cigars", "Cigars" ], "children": [ { "name": "Carrie Mulik", "age": null }, { "name": "Sharlene Mulik", "age": 33 }, { "name": "Leone Mulik", "age": 46 } ] }, "b": { "cid": 774, "name": "Nadene Rigel", "age": null, "address": null, "interests": [ "Cigars", "Cigars" ], "children": [ { "name": "Rebbeca Rigel", "age": 33 } ] } }
+{ "a": { "cid": 508, "name": "Tiffany Kimmey", "age": 64, "address": { "number": 8625, "street": "7th St.", "city": "Mountain View" }, "interests": [ "Bass", "Walking" ], "children": [ ] }, "b": { "cid": 796, "name": "Daniele Brisk", "age": null, "address": null, "interests": [ "Walking", "Bass" ], "children": [ ] } }
+{ "a": { "cid": 510, "name": "Candace Morello", "age": null, "address": null, "interests": [ "Wine", "Base Jumping", "Running" ], "children": [ { "name": "Sandy Morello", "age": 57 }, { "name": "Delois Morello", "age": 15 } ] }, "b": { "cid": 908, "name": "Ferdinand Auila", "age": 82, "address": { "number": 1071, "street": "Lake St.", "city": "Portland" }, "interests": [ "Base Jumping", "Running", "Wine" ], "children": [ { "name": "Ai Auila", "age": 69 }, { "name": "Laurel Auila", "age": null } ] } }
+{ "a": { "cid": 513, "name": "Marianna Gortman", "age": 49, "address": { "number": 927, "street": "Cedar St.", "city": "San Jose" }, "interests": [ "Databases", "Databases" ], "children": [ ] }, "b": { "cid": 520, "name": "Janay Bernbeck", "age": null, "address": null, "interests": [ "Databases", "Databases" ], "children": [ { "name": "Aurea Bernbeck", "age": null }, { "name": "Tiara Bernbeck", "age": null }, { "name": "Alfredia Bernbeck", "age": 26 } ] } }
+{ "a": { "cid": 559, "name": "Carolyne Shiroma", "age": null, "address": null, "interests": [ "Movies", "Running" ], "children": [ { "name": "Ying Shiroma", "age": 57 } ] }, "b": { "cid": 681, "name": "Iliana Nagele", "age": null, "address": null, "interests": [ "Movies", "Running" ], "children": [ { "name": "Sunny Nagele", "age": 55 }, { "name": "Waltraud Nagele", "age": 39 }, { "name": "Darron Nagele", "age": null } ] } }
+{ "a": { "cid": 560, "name": "Karin Dicesare", "age": null, "address": null, "interests": [ "Wine", "Puzzles" ], "children": [ ] }, "b": { "cid": 583, "name": "Bev Yerena", "age": null, "address": null, "interests": [ "Puzzles", "Wine" ], "children": [ { "name": "Larhonda Yerena", "age": 45 }, { "name": "Josefina Yerena", "age": null }, { "name": "Sydney Yerena", "age": 42 } ] } }
+{ "a": { "cid": 570, "name": "Lee Basora", "age": null, "address": null, "interests": [ "Squash", "Cigars" ], "children": [ ] }, "b": { "cid": 819, "name": "Twanna Finnley", "age": null, "address": null, "interests": [ "Squash", "Cigars" ], "children": [ { "name": "Reba Finnley", "age": null }, { "name": "Moises Finnley", "age": null } ] } }
+{ "a": { "cid": 620, "name": "Arielle Mackellar", "age": null, "address": null, "interests": [ "Cooking", "Bass" ], "children": [ { "name": "Evelin Mackellar", "age": 17 }, { "name": "Theresa Mackellar", "age": 53 }, { "name": "Ronnie Mackellar", "age": null }, { "name": "Elwanda Mackellar", "age": 54 } ] }, "b": { "cid": 761, "name": "Adele Henrikson", "age": null, "address": null, "interests": [ "Cooking", "Bass" ], "children": [ { "name": "Paulina Henrikson", "age": null }, { "name": "David Henrikson", "age": null }, { "name": "Jose Henrikson", "age": null }, { "name": "Meg Henrikson", "age": null } ] } }
+{ "a": { "cid": 636, "name": "Babara Shore", "age": 83, "address": { "number": 9452, "street": "Oak St.", "city": "Los Angeles" }, "interests": [ "Databases", "Movies", "Tennis" ], "children": [ { "name": "Candy Shore", "age": 58 }, { "name": "Nanci Shore", "age": null }, { "name": "Asia Shore", "age": null } ] }, "b": { "cid": 992, "name": "Staci Alexandropoul", "age": null, "address": null, "interests": [ "Databases", "Movies", "Tennis" ], "children": [ { "name": "Casimira Alexandropoul", "age": null }, { "name": "Kena Alexandropoul", "age": 54 }, { "name": "Ellie Alexandropoul", "age": null }, { "name": "Ambrose Alexandropoul", "age": null } ] } }
+{ "a": { "cid": 646, "name": "Pablo Catterton", "age": null, "address": null, "interests": [ "Fishing", "Computers" ], "children": [ ] }, "b": { "cid": 781, "name": "Christy Darcangelo", "age": 42, "address": { "number": 2178, "street": "Washington St.", "city": "Portland" }, "interests": [ "Computers", "Fishing" ], "children": [ { "name": "Luis Darcangelo", "age": 21 }, { "name": "Omega Darcangelo", "age": 26 }, { "name": "Remedios Darcangelo", "age": 28 }, { "name": "Domenic Darcangelo", "age": 21 } ] } }
+{ "a": { "cid": 647, "name": "Jodi Dearson", "age": null, "address": null, "interests": [ "Fishing", "Movies" ], "children": [ ] }, "b": { "cid": 884, "name": "Laila Marta", "age": null, "address": null, "interests": [ "Fishing", "Movies" ], "children": [ { "name": "Carlota Marta", "age": 19 } ] } }
+{ "a": { "cid": 704, "name": "Melodee Clemons", "age": null, "address": null, "interests": [ "Base Jumping", "Tennis", "Video Games" ], "children": [ { "name": "Doreatha Clemons", "age": 22 } ] }, "b": { "cid": 812, "name": "Bee Godette", "age": 26, "address": { "number": 1757, "street": "Washington St.", "city": "Portland" }, "interests": [ "Video Games", "Base Jumping", "Tennis" ], "children": [ { "name": "Madaline Godette", "age": 10 }, { "name": "Shasta Godette", "age": 15 }, { "name": "Parthenia Godette", "age": 11 }, { "name": "Priscila Godette", "age": 13 } ] } }
+{ "a": { "cid": 716, "name": "Deirdre Bruderer", "age": null, "address": null, "interests": [ "Computers", "Wine" ], "children": [ { "name": "Coralee Bruderer", "age": null }, { "name": "Mina Bruderer", "age": null }, { "name": "Lindsey Bruderer", "age": 35 }, { "name": "Yi Bruderer", "age": null } ] }, "b": { "cid": 890, "name": "Janise Maccarthy", "age": 66, "address": { "number": 7337, "street": "Main St.", "city": "San Jose" }, "interests": [ "Wine", "Computers" ], "children": [ ] } }
+{ "a": { "cid": 730, "name": "Marti Vandoren", "age": null, "address": null, "interests": [ "Skiing", "Bass" ], "children": [ { "name": "Carroll Vandoren", "age": null }, { "name": "Lorretta Vandoren", "age": 30 }, { "name": "Chloe Vandoren", "age": 42 }, { "name": "Ilona Vandoren", "age": null } ] }, "b": { "cid": 982, "name": "Jude Brandsrud", "age": 41, "address": { "number": 7133, "street": "Washington St.", "city": "Seattle" }, "interests": [ "Bass", "Skiing" ], "children": [ { "name": "Scottie Brandsrud", "age": null }, { "name": "Gennie Brandsrud", "age": 10 }, { "name": "Agnes Brandsrud", "age": null }, { "name": "Clarinda Brandsrud", "age": 17 } ] } }
+{ "a": { "cid": 731, "name": "Yajaira Orto", "age": null, "address": null, "interests": [ "Music", "Databases" ], "children": [ { "name": "Eliz Orto", "age": 17 }, { "name": "Gisela Orto", "age": null } ] }, "b": { "cid": 795, "name": "Sharilyn Branstad", "age": null, "address": null, "interests": [ "Databases", "Music" ], "children": [ { "name": "Ashlee Branstad", "age": 24 }, { "name": "Bobbye Branstad", "age": 26 }, { "name": "Natalya Branstad", "age": null }, { "name": "Edith Branstad", "age": null } ] } }
+{ "a": { "cid": 741, "name": "Lesia Risatti", "age": 48, "address": { "number": 7378, "street": "Cedar St.", "city": "Portland" }, "interests": [ "Fishing", "Wine", "Databases" ], "children": [ { "name": "Tangela Risatti", "age": null }, { "name": "Leonel Risatti", "age": 33 }, { "name": "Cythia Risatti", "age": 36 } ] }, "b": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": [ "Databases", "Fishing", "Wine" ], "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] } }
+{ "a": { "cid": 877, "name": "Nicki Lipkind", "age": null, "address": null, "interests": [ "Books", "Movies" ], "children": [ { "name": "Yahaira Lipkind", "age": 12 } ] }, "b": { "cid": 974, "name": "Alexis Malcomson", "age": null, "address": null, "interests": [ "Movies", "Books" ], "children": [ { "name": "Kerri Malcomson", "age": null } ] } }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ulist-jaccard-inline.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ulist-jaccard-inline.adm
new file mode 100644
index 0000000..22e1770
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ulist-jaccard-inline.adm
@@ -0,0 +1,115 @@
+{ "a": { "cid": 2, "name": "Elin Debell", "age": 82, "address": { "number": 5649, "street": "Hill St.", "city": "Portland" }, "interests": {{ "Bass", "Wine" }}, "children": [ { "name": "Elvina Debell", "age": null }, { "name": "Renaldo Debell", "age": 51 }, { "name": "Divina Debell", "age": 57 } ] }, "b": { "cid": 897, "name": "Gerald Roehrman", "age": null, "address": null, "interests": {{ "Bass", "Wine" }}, "children": [ { "name": "Virgie Roehrman", "age": 28 }, { "name": "Akiko Roehrman", "age": 59 }, { "name": "Robbie Roehrman", "age": 10 }, { "name": "Flavia Roehrman", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 5, "name": "Heide Naifeh", "age": null, "address": null, "interests": {{ "Music", "Databases" }}, "children": [ { "name": "Deirdre Naifeh", "age": null }, { "name": "Jacquelyne Naifeh", "age": 39 } ] }, "b": { "cid": 215, "name": "Ashton Schadegg", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Ciara Schadegg", "age": null }, { "name": "Karisa Schadegg", "age": 11 }, { "name": "Hayden Schadegg", "age": 44 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 5, "name": "Heide Naifeh", "age": null, "address": null, "interests": {{ "Music", "Databases" }}, "children": [ { "name": "Deirdre Naifeh", "age": null }, { "name": "Jacquelyne Naifeh", "age": 39 } ] }, "b": { "cid": 228, "name": "Donnette Brumbley", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Madlyn Brumbley", "age": null }, { "name": "Apolonia Brumbley", "age": 13 }, { "name": "Stephine Brumbley", "age": null }, { "name": "Zelma Brumbley", "age": 51 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 5, "name": "Heide Naifeh", "age": null, "address": null, "interests": {{ "Music", "Databases" }}, "children": [ { "name": "Deirdre Naifeh", "age": null }, { "name": "Jacquelyne Naifeh", "age": 39 } ] }, "b": { "cid": 731, "name": "Yajaira Orto", "age": null, "address": null, "interests": {{ "Music", "Databases" }}, "children": [ { "name": "Eliz Orto", "age": 17 }, { "name": "Gisela Orto", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 5, "name": "Heide Naifeh", "age": null, "address": null, "interests": {{ "Music", "Databases" }}, "children": [ { "name": "Deirdre Naifeh", "age": null }, { "name": "Jacquelyne Naifeh", "age": 39 } ] }, "b": { "cid": 795, "name": "Sharilyn Branstad", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Ashlee Branstad", "age": 24 }, { "name": "Bobbye Branstad", "age": 26 }, { "name": "Natalya Branstad", "age": null }, { "name": "Edith Branstad", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 11, "name": "Meta Simek", "age": 13, "address": { "number": 4384, "street": "7th St.", "city": "San Jose" }, "interests": {{ "Wine", "Walking" }}, "children": [ { "name": "Oretha Simek", "age": null }, { "name": "Terence Simek", "age": null } ] }, "b": { "cid": 389, "name": "Loraine Morfee", "age": 72, "address": { "number": 2945, "street": "Lake St.", "city": "Seattle" }, "interests": {{ "Wine", "Walking" }}, "children": [ { "name": "Berry Morfee", "age": 30 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 11, "name": "Meta Simek", "age": 13, "address": { "number": 4384, "street": "7th St.", "city": "San Jose" }, "interests": {{ "Wine", "Walking" }}, "children": [ { "name": "Oretha Simek", "age": null }, { "name": "Terence Simek", "age": null } ] }, "b": { "cid": 607, "name": "Bert Garigliano", "age": 71, "address": { "number": 3881, "street": "Washington St.", "city": "San Jose" }, "interests": {{ "Walking", "Wine" }}, "children": [ { "name": "Junior Garigliano", "age": 42 }, { "name": "Willa Garigliano", "age": 21 }, { "name": "Carlo Garigliano", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 17, "name": "Ingeborg Monkhouse", "age": null, "address": null, "interests": {{ "Base Jumping", "Cigars", "Movies" }}, "children": [ ] }, "b": { "cid": 156, "name": "Bobbye Kauppi", "age": 79, "address": { "number": 2051, "street": "Hill St.", "city": "Sunnyvale" }, "interests": {{ "Base Jumping", "Cigars", "Movies" }}, "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 27, "name": "Hollie Hyun", "age": null, "address": null, "interests": {{ "Skiing", "Walking" }}, "children": [ { "name": "Morton Hyun", "age": null }, { "name": "Farrah Hyun", "age": 40 }, { "name": "Ali Hyun", "age": null } ] }, "b": { "cid": 542, "name": "Eveline Smedley", "age": 50, "address": { "number": 5513, "street": "Oak St.", "city": "San Jose" }, "interests": {{ "Skiing", "Walking" }}, "children": [ { "name": "Lynsey Smedley", "age": 26 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 32, "name": "Tia Berkley", "age": 30, "address": { "number": 4507, "street": "Park St.", "city": "Sunnyvale" }, "interests": {{ "Base Jumping", "Music" }}, "children": [ { "name": "Carmon Berkley", "age": null }, { "name": "Kristina Berkley", "age": null }, { "name": "Cristi Berkley", "age": 19 } ] }, "b": { "cid": 304, "name": "Francine Reddin", "age": 39, "address": { "number": 9392, "street": "Hill St.", "city": "Seattle" }, "interests": {{ "Music", "Base Jumping" }}, "children": [ { "name": "Millicent Reddin", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 32, "name": "Tia Berkley", "age": 30, "address": { "number": 4507, "street": "Park St.", "city": "Sunnyvale" }, "interests": {{ "Base Jumping", "Music" }}, "children": [ { "name": "Carmon Berkley", "age": null }, { "name": "Kristina Berkley", "age": null }, { "name": "Cristi Berkley", "age": 19 } ] }, "b": { "cid": 501, "name": "Alyce Coant", "age": null, "address": null, "interests": {{ "Music", "Base Jumping" }}, "children": [ { "name": "Elyse Coant", "age": 50 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 33, "name": "Rayford Velmontes", "age": null, "address": null, "interests": {{ "Fishing", "Video Games" }}, "children": [ ] }, "b": { "cid": 519, "name": "Julianna Goodsell", "age": 59, "address": { "number": 5594, "street": "Lake St.", "city": "Seattle" }, "interests": {{ "Video Games", "Fishing" }}, "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 39, "name": "Brock Froncillo", "age": 72, "address": { "number": 4645, "street": "Cedar St.", "city": "San Jose" }, "interests": {{ "Base Jumping", "Skiing" }}, "children": [ { "name": "Cole Froncillo", "age": null }, { "name": "Ivana Froncillo", "age": null }, { "name": "Hugh Froncillo", "age": 23 } ] }, "b": { "cid": 393, "name": "Rossana Monton", "age": 34, "address": { "number": 4490, "street": "Main St.", "city": "Portland" }, "interests": {{ "Skiing", "Base Jumping" }}, "children": [ { "name": "Glayds Monton", "age": null }, { "name": "Lily Monton", "age": null }, { "name": "Raina Monton", "age": null }, { "name": "Hilma Monton", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 39, "name": "Brock Froncillo", "age": 72, "address": { "number": 4645, "street": "Cedar St.", "city": "San Jose" }, "interests": {{ "Base Jumping", "Skiing" }}, "children": [ { "name": "Cole Froncillo", "age": null }, { "name": "Ivana Froncillo", "age": null }, { "name": "Hugh Froncillo", "age": 23 } ] }, "b": { "cid": 493, "name": "Lindsey Trout", "age": 86, "address": { "number": 7619, "street": "Cedar St.", "city": "Portland" }, "interests": {{ "Base Jumping", "Skiing" }}, "children": [ { "name": "Madlyn Trout", "age": 58 }, { "name": "Amie Trout", "age": 72 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 41, "name": "Kevin Giottonini", "age": null, "address": null, "interests": {{ "Skiing", "Bass" }}, "children": [ { "name": "Victor Giottonini", "age": 37 }, { "name": "Alverta Giottonini", "age": null } ] }, "b": { "cid": 182, "name": "Christiana Westlie", "age": null, "address": null, "interests": {{ "Skiing", "Bass" }}, "children": [ { "name": "Ilda Westlie", "age": 18 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 41, "name": "Kevin Giottonini", "age": null, "address": null, "interests": {{ "Skiing", "Bass" }}, "children": [ { "name": "Victor Giottonini", "age": 37 }, { "name": "Alverta Giottonini", "age": null } ] }, "b": { "cid": 730, "name": "Marti Vandoren", "age": null, "address": null, "interests": {{ "Skiing", "Bass" }}, "children": [ { "name": "Carroll Vandoren", "age": null }, { "name": "Lorretta Vandoren", "age": 30 }, { "name": "Chloe Vandoren", "age": 42 }, { "name": "Ilona Vandoren", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 41, "name": "Kevin Giottonini", "age": null, "address": null, "interests": {{ "Skiing", "Bass" }}, "children": [ { "name": "Victor Giottonini", "age": 37 }, { "name": "Alverta Giottonini", "age": null } ] }, "b": { "cid": 982, "name": "Jude Brandsrud", "age": 41, "address": { "number": 7133, "street": "Washington St.", "city": "Seattle" }, "interests": {{ "Bass", "Skiing" }}, "children": [ { "name": "Scottie Brandsrud", "age": null }, { "name": "Gennie Brandsrud", "age": 10 }, { "name": "Agnes Brandsrud", "age": null }, { "name": "Clarinda Brandsrud", "age": 17 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 42, "name": "Asley Simco", "age": 38, "address": { "number": 3322, "street": "Main St.", "city": "Mountain View" }, "interests": {{ "Fishing", "Running", "Cigars" }}, "children": [ { "name": "Micheal Simco", "age": null }, { "name": "Lawerence Simco", "age": null } ] }, "b": { "cid": 753, "name": "Maris Bannett", "age": null, "address": null, "interests": {{ "Fishing", "Cigars", "Running" }}, "children": [ { "name": "Libbie Bannett", "age": 11 }, { "name": "Francina Bannett", "age": 21 }, { "name": "Tuyet Bannett", "age": null }, { "name": "Zona Bannett", "age": 32 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 56, "name": "Andria Killelea", "age": null, "address": null, "interests": {{ "Cigars", "Skiing" }}, "children": [ ] }, "b": { "cid": 857, "name": "Kasie Fujioka", "age": null, "address": null, "interests": {{ "Skiing", "Cigars" }}, "children": [ { "name": "Leontine Fujioka", "age": null }, { "name": "Nga Fujioka", "age": 21 }, { "name": "Nathanael Fujioka", "age": 27 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 71, "name": "Alva Sieger", "age": null, "address": null, "interests": {{ "Movies", "Walking" }}, "children": [ { "name": "Renetta Sieger", "age": null }, { "name": "Shiloh Sieger", "age": 57 }, { "name": "Lavina Sieger", "age": null }, { "name": "Larraine Sieger", "age": null } ] }, "b": { "cid": 758, "name": "Akiko Hoenstine", "age": 56, "address": { "number": 8888, "street": "Lake St.", "city": "Portland" }, "interests": {{ "Movies", "Walking" }}, "children": [ { "name": "Maren Hoenstine", "age": null }, { "name": "Tyler Hoenstine", "age": null }, { "name": "Jesse Hoenstine", "age": 40 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 74, "name": "Lonnie Ercolani", "age": 79, "address": { "number": 2655, "street": "Lake St.", "city": "Los Angeles" }, "interests": {{ "Music", "Coffee" }}, "children": [ { "name": "Cassi Ercolani", "age": null } ] }, "b": { "cid": 325, "name": "Ai Tarleton", "age": null, "address": null, "interests": {{ "Coffee", "Music" }}, "children": [ { "name": "Risa Tarleton", "age": 24 }, { "name": "Leonila Tarleton", "age": null }, { "name": "Thomasina Tarleton", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 76, "name": "Opal Blewett", "age": null, "address": null, "interests": {{ "Running", "Coffee", "Fishing" }}, "children": [ { "name": "Violette Blewett", "age": null } ] }, "b": { "cid": 455, "name": "Manual Altizer", "age": 70, "address": { "number": 6293, "street": "7th St.", "city": "Portland" }, "interests": {{ "Running", "Fishing", "Coffee" }}, "children": [ { "name": "Katherine Altizer", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 77, "name": "Chantal Parriera", "age": 78, "address": { "number": 5967, "street": "Lake St.", "city": "San Jose" }, "interests": {{ "Squash", "Movies", "Coffee" }}, "children": [ ] }, "b": { "cid": 984, "name": "Janett Kitchens", "age": 66, "address": { "number": 7558, "street": "View St.", "city": "Mountain View" }, "interests": {{ "Coffee", "Movies", "Squash" }}, "children": [ { "name": "Grayce Kitchens", "age": 14 }, { "name": "Dwayne Kitchens", "age": null }, { "name": "Wilber Kitchens", "age": 51 }, { "name": "Nancey Kitchens", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 84, "name": "Huong Kachel", "age": null, "address": null, "interests": {{ "Music", "Tennis", "Base Jumping" }}, "children": [ { "name": "Katlyn Kachel", "age": 40 }, { "name": "Sherman Kachel", "age": null }, { "name": "Susana Kachel", "age": 32 } ] }, "b": { "cid": 633, "name": "Shalon Grauberger", "age": 34, "address": { "number": 765, "street": "Washington St.", "city": "Sunnyvale" }, "interests": {{ "Music", "Base Jumping", "Tennis" }}, "children": [ { "name": "Kris Grauberger", "age": 14 }, { "name": "Stuart Grauberger", "age": 12 }, { "name": "Billy Grauberger", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 101, "name": "Meaghan Vandel", "age": null, "address": null, "interests": {{ "Music", "Base Jumping", "Books" }}, "children": [ { "name": "Larissa Vandel", "age": null } ] }, "b": { "cid": 289, "name": "Clarence Milette", "age": 16, "address": { "number": 3778, "street": "Oak St.", "city": "Seattle" }, "interests": {{ "Books", "Base Jumping", "Music" }}, "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 106, "name": "Charles Verna", "age": null, "address": null, "interests": {{ "Bass", "Books" }}, "children": [ { "name": "Betsy Verna", "age": 37 }, { "name": "Chae Verna", "age": 35 }, { "name": "Naoma Verna", "age": 42 } ] }, "b": { "cid": 394, "name": "Lizette Roux", "age": 57, "address": { "number": 458, "street": "Hill St.", "city": "Los Angeles" }, "interests": {{ "Bass", "Books" }}, "children": [ { "name": "Doloris Roux", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 106, "name": "Charles Verna", "age": null, "address": null, "interests": {{ "Bass", "Books" }}, "children": [ { "name": "Betsy Verna", "age": 37 }, { "name": "Chae Verna", "age": 35 }, { "name": "Naoma Verna", "age": 42 } ] }, "b": { "cid": 523, "name": "Johanne Huls", "age": null, "address": null, "interests": {{ "Books", "Bass" }}, "children": [ { "name": "Melynda Huls", "age": null }, { "name": "Vicky Huls", "age": 16 }, { "name": "Charlott Huls", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 119, "name": "Chan Morreau", "age": 22, "address": { "number": 1774, "street": "Lake St.", "city": "Mountain View" }, "interests": {{ "Puzzles", "Squash" }}, "children": [ { "name": "Arlette Morreau", "age": null } ] }, "b": { "cid": 592, "name": "Rachelle Spare", "age": 13, "address": { "number": 8088, "street": "Oak St.", "city": "Portland" }, "interests": {{ "Squash", "Puzzles" }}, "children": [ { "name": "Theo Spare", "age": null }, { "name": "Shizue Spare", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 132, "name": "Cindi Turntine", "age": 64, "address": { "number": 9432, "street": "Park St.", "city": "Portland" }, "interests": {{ "Computers", "Wine" }}, "children": [ { "name": "Howard Turntine", "age": null } ] }, "b": { "cid": 177, "name": "Wilda Hanisch", "age": null, "address": null, "interests": {{ "Wine", "Computers" }}, "children": [ { "name": "Shannan Hanisch", "age": null }, { "name": "Marissa Hanisch", "age": 30 }, { "name": "Keely Hanisch", "age": 54 }, { "name": "Humberto Hanisch", "age": 17 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 132, "name": "Cindi Turntine", "age": 64, "address": { "number": 9432, "street": "Park St.", "city": "Portland" }, "interests": {{ "Computers", "Wine" }}, "children": [ { "name": "Howard Turntine", "age": null } ] }, "b": { "cid": 716, "name": "Deirdre Bruderer", "age": null, "address": null, "interests": {{ "Computers", "Wine" }}, "children": [ { "name": "Coralee Bruderer", "age": null }, { "name": "Mina Bruderer", "age": null }, { "name": "Lindsey Bruderer", "age": 35 }, { "name": "Yi Bruderer", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 132, "name": "Cindi Turntine", "age": 64, "address": { "number": 9432, "street": "Park St.", "city": "Portland" }, "interests": {{ "Computers", "Wine" }}, "children": [ { "name": "Howard Turntine", "age": null } ] }, "b": { "cid": 890, "name": "Janise Maccarthy", "age": 66, "address": { "number": 7337, "street": "Main St.", "city": "San Jose" }, "interests": {{ "Wine", "Computers" }}, "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 138, "name": "Ora Villafane", "age": null, "address": null, "interests": {{ "Walking", "Cooking" }}, "children": [ { "name": "Deeann Villafane", "age": 22 }, { "name": "Cody Villafane", "age": 47 } ] }, "b": { "cid": 369, "name": "Nickole Dory", "age": 10, "address": { "number": 4761, "street": "View St.", "city": "Portland" }, "interests": {{ "Walking", "Cooking" }}, "children": [ { "name": "Annmarie Dory", "age": null }, { "name": "Michele Dory", "age": null }, { "name": "Annamae Dory", "age": null }, { "name": "Flora Dory", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 138, "name": "Ora Villafane", "age": null, "address": null, "interests": {{ "Walking", "Cooking" }}, "children": [ { "name": "Deeann Villafane", "age": 22 }, { "name": "Cody Villafane", "age": 47 } ] }, "b": { "cid": 816, "name": "Cheyenne Eddie", "age": null, "address": null, "interests": {{ "Walking", "Cooking" }}, "children": [ { "name": "Kathe Eddie", "age": null }, { "name": "Charles Eddie", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 144, "name": "Celesta Sosebee", "age": 19, "address": { "number": 2683, "street": "7th St.", "city": "Portland" }, "interests": {{ "Databases", "Databases" }}, "children": [ { "name": "Jesse Sosebee", "age": null }, { "name": "Oralee Sosebee", "age": null }, { "name": "Sunday Sosebee", "age": null } ] }, "b": { "cid": 513, "name": "Marianna Gortman", "age": 49, "address": { "number": 927, "street": "Cedar St.", "city": "San Jose" }, "interests": {{ "Databases", "Databases" }}, "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 144, "name": "Celesta Sosebee", "age": 19, "address": { "number": 2683, "street": "7th St.", "city": "Portland" }, "interests": {{ "Databases", "Databases" }}, "children": [ { "name": "Jesse Sosebee", "age": null }, { "name": "Oralee Sosebee", "age": null }, { "name": "Sunday Sosebee", "age": null } ] }, "b": { "cid": 520, "name": "Janay Bernbeck", "age": null, "address": null, "interests": {{ "Databases", "Databases" }}, "children": [ { "name": "Aurea Bernbeck", "age": null }, { "name": "Tiara Bernbeck", "age": null }, { "name": "Alfredia Bernbeck", "age": 26 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 146, "name": "Glennis Vanruiten", "age": 14, "address": { "number": 8272, "street": "Park St.", "city": "Los Angeles" }, "interests": {{ "Squash", "Databases" }}, "children": [ { "name": "Joanie Vanruiten", "age": null }, { "name": "Long Vanruiten", "age": null }, { "name": "Abdul Vanruiten", "age": null } ] }, "b": { "cid": 532, "name": "Tania Fraklin", "age": 38, "address": { "number": 2857, "street": "Washington St.", "city": "Seattle" }, "interests": {{ "Squash", "Databases" }}, "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 177, "name": "Wilda Hanisch", "age": null, "address": null, "interests": {{ "Wine", "Computers" }}, "children": [ { "name": "Shannan Hanisch", "age": null }, { "name": "Marissa Hanisch", "age": 30 }, { "name": "Keely Hanisch", "age": 54 }, { "name": "Humberto Hanisch", "age": 17 } ] }, "b": { "cid": 716, "name": "Deirdre Bruderer", "age": null, "address": null, "interests": {{ "Computers", "Wine" }}, "children": [ { "name": "Coralee Bruderer", "age": null }, { "name": "Mina Bruderer", "age": null }, { "name": "Lindsey Bruderer", "age": 35 }, { "name": "Yi Bruderer", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 177, "name": "Wilda Hanisch", "age": null, "address": null, "interests": {{ "Wine", "Computers" }}, "children": [ { "name": "Shannan Hanisch", "age": null }, { "name": "Marissa Hanisch", "age": 30 }, { "name": "Keely Hanisch", "age": 54 }, { "name": "Humberto Hanisch", "age": 17 } ] }, "b": { "cid": 890, "name": "Janise Maccarthy", "age": 66, "address": { "number": 7337, "street": "Main St.", "city": "San Jose" }, "interests": {{ "Wine", "Computers" }}, "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 182, "name": "Christiana Westlie", "age": null, "address": null, "interests": {{ "Skiing", "Bass" }}, "children": [ { "name": "Ilda Westlie", "age": 18 } ] }, "b": { "cid": 730, "name": "Marti Vandoren", "age": null, "address": null, "interests": {{ "Skiing", "Bass" }}, "children": [ { "name": "Carroll Vandoren", "age": null }, { "name": "Lorretta Vandoren", "age": 30 }, { "name": "Chloe Vandoren", "age": 42 }, { "name": "Ilona Vandoren", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 182, "name": "Christiana Westlie", "age": null, "address": null, "interests": {{ "Skiing", "Bass" }}, "children": [ { "name": "Ilda Westlie", "age": 18 } ] }, "b": { "cid": 982, "name": "Jude Brandsrud", "age": 41, "address": { "number": 7133, "street": "Washington St.", "city": "Seattle" }, "interests": {{ "Bass", "Skiing" }}, "children": [ { "name": "Scottie Brandsrud", "age": null }, { "name": "Gennie Brandsrud", "age": 10 }, { "name": "Agnes Brandsrud", "age": null }, { "name": "Clarinda Brandsrud", "age": 17 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 190, "name": "Kristel Axelson", "age": null, "address": null, "interests": {{ "Movies", "Books" }}, "children": [ { "name": "Deja Axelson", "age": null } ] }, "b": { "cid": 295, "name": "Guillermina Florek", "age": 61, "address": { "number": 3704, "street": "Washington St.", "city": "Mountain View" }, "interests": {{ "Movies", "Books" }}, "children": [ { "name": "Donnie Florek", "age": null }, { "name": "Jeannetta Florek", "age": 38 }, { "name": "Leigha Florek", "age": null }, { "name": "Zenobia Florek", "age": 10 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 190, "name": "Kristel Axelson", "age": null, "address": null, "interests": {{ "Movies", "Books" }}, "children": [ { "name": "Deja Axelson", "age": null } ] }, "b": { "cid": 877, "name": "Nicki Lipkind", "age": null, "address": null, "interests": {{ "Books", "Movies" }}, "children": [ { "name": "Yahaira Lipkind", "age": 12 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 190, "name": "Kristel Axelson", "age": null, "address": null, "interests": {{ "Movies", "Books" }}, "children": [ { "name": "Deja Axelson", "age": null } ] }, "b": { "cid": 974, "name": "Alexis Malcomson", "age": null, "address": null, "interests": {{ "Movies", "Books" }}, "children": [ { "name": "Kerri Malcomson", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 202, "name": "Evangelina Poloskey", "age": 46, "address": { "number": 8285, "street": "Main St.", "city": "Los Angeles" }, "interests": {{ "Wine", "Squash" }}, "children": [ { "name": "Anthony Poloskey", "age": 27 }, { "name": "Olga Poloskey", "age": 10 }, { "name": "Carmon Poloskey", "age": 13 }, { "name": "Tanja Poloskey", "age": 20 } ] }, "b": { "cid": 599, "name": "Alva Molaison", "age": 87, "address": { "number": 5974, "street": "Washington St.", "city": "Seattle" }, "interests": {{ "Wine", "Squash" }}, "children": [ { "name": "Milo Molaison", "age": 39 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 210, "name": "Jillian Roadruck", "age": null, "address": null, "interests": {{ "Coffee", "Tennis" }}, "children": [ { "name": "Marguerite Roadruck", "age": null }, { "name": "Ilana Roadruck", "age": null }, { "name": "Chantelle Roadruck", "age": 19 }, { "name": "Nikia Roadruck", "age": 43 } ] }, "b": { "cid": 317, "name": "Zona Caffarel", "age": 52, "address": { "number": 9419, "street": "Cedar St.", "city": "Seattle" }, "interests": {{ "Tennis", "Coffee" }}, "children": [ { "name": "Cortez Caffarel", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 210, "name": "Jillian Roadruck", "age": null, "address": null, "interests": {{ "Coffee", "Tennis" }}, "children": [ { "name": "Marguerite Roadruck", "age": null }, { "name": "Ilana Roadruck", "age": null }, { "name": "Chantelle Roadruck", "age": 19 }, { "name": "Nikia Roadruck", "age": 43 } ] }, "b": { "cid": 771, "name": "Marisela Tredo", "age": null, "address": null, "interests": {{ "Tennis", "Coffee" }}, "children": [ { "name": "Ardell Tredo", "age": 21 }, { "name": "Evelynn Tredo", "age": 16 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 214, "name": "Louvenia Zaffalon", "age": null, "address": null, "interests": {{ "Skiing", "Books" }}, "children": [ ] }, "b": { "cid": 270, "name": "Lavon Ascenzo", "age": null, "address": null, "interests": {{ "Books", "Skiing" }}, "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 215, "name": "Ashton Schadegg", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Ciara Schadegg", "age": null }, { "name": "Karisa Schadegg", "age": 11 }, { "name": "Hayden Schadegg", "age": 44 } ] }, "b": { "cid": 228, "name": "Donnette Brumbley", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Madlyn Brumbley", "age": null }, { "name": "Apolonia Brumbley", "age": 13 }, { "name": "Stephine Brumbley", "age": null }, { "name": "Zelma Brumbley", "age": 51 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 215, "name": "Ashton Schadegg", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Ciara Schadegg", "age": null }, { "name": "Karisa Schadegg", "age": 11 }, { "name": "Hayden Schadegg", "age": 44 } ] }, "b": { "cid": 731, "name": "Yajaira Orto", "age": null, "address": null, "interests": {{ "Music", "Databases" }}, "children": [ { "name": "Eliz Orto", "age": 17 }, { "name": "Gisela Orto", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 215, "name": "Ashton Schadegg", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Ciara Schadegg", "age": null }, { "name": "Karisa Schadegg", "age": 11 }, { "name": "Hayden Schadegg", "age": 44 } ] }, "b": { "cid": 795, "name": "Sharilyn Branstad", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Ashlee Branstad", "age": 24 }, { "name": "Bobbye Branstad", "age": 26 }, { "name": "Natalya Branstad", "age": null }, { "name": "Edith Branstad", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 218, "name": "Clarinda Stagliano", "age": 76, "address": { "number": 3258, "street": "Park St.", "city": "San Jose" }, "interests": {{ "Video Games", "Cigars" }}, "children": [ ] }, "b": { "cid": 271, "name": "Carey Ronin", "age": 44, "address": { "number": 8141, "street": "Oak St.", "city": "Mountain View" }, "interests": {{ "Cigars", "Video Games" }}, "children": [ { "name": "Lonny Ronin", "age": null }, { "name": "Armanda Ronin", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 218, "name": "Clarinda Stagliano", "age": 76, "address": { "number": 3258, "street": "Park St.", "city": "San Jose" }, "interests": {{ "Video Games", "Cigars" }}, "children": [ ] }, "b": { "cid": 689, "name": "Camila Cho", "age": 70, "address": { "number": 7731, "street": "Cedar St.", "city": "Mountain View" }, "interests": {{ "Video Games", "Cigars" }}, "children": [ { "name": "Myrtie Cho", "age": 57 }, { "name": "Merideth Cho", "age": 45 }, { "name": "Meta Cho", "age": 20 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 222, "name": "Malcom Bloomgren", "age": 39, "address": { "number": 4674, "street": "Hill St.", "city": "Mountain View" }, "interests": {{ "Databases", "Skiing" }}, "children": [ { "name": "Rosia Bloomgren", "age": null }, { "name": "Bryant Bloomgren", "age": 15 }, { "name": "Donnie Bloomgren", "age": null } ] }, "b": { "cid": 322, "name": "Jaclyn Ettl", "age": 83, "address": { "number": 4500, "street": "Main St.", "city": "Sunnyvale" }, "interests": {{ "Databases", "Skiing" }}, "children": [ { "name": "Noah Ettl", "age": 30 }, { "name": "Kesha Ettl", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 223, "name": "Margurite Embelton", "age": 19, "address": { "number": 554, "street": "Oak St.", "city": "Portland" }, "interests": {{ "Running", "Fishing" }}, "children": [ { "name": "Sherie Embelton", "age": null }, { "name": "Monica Embelton", "age": null }, { "name": "Jeanne Embelton", "age": null }, { "name": "Santiago Embelton", "age": null } ] }, "b": { "cid": 571, "name": "Lenita Tentler", "age": null, "address": null, "interests": {{ "Running", "Fishing" }}, "children": [ { "name": "Damian Tentler", "age": 16 }, { "name": "Camellia Tentler", "age": null }, { "name": "Vern Tentler", "age": 15 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 228, "name": "Donnette Brumbley", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Madlyn Brumbley", "age": null }, { "name": "Apolonia Brumbley", "age": 13 }, { "name": "Stephine Brumbley", "age": null }, { "name": "Zelma Brumbley", "age": 51 } ] }, "b": { "cid": 731, "name": "Yajaira Orto", "age": null, "address": null, "interests": {{ "Music", "Databases" }}, "children": [ { "name": "Eliz Orto", "age": 17 }, { "name": "Gisela Orto", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 228, "name": "Donnette Brumbley", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Madlyn Brumbley", "age": null }, { "name": "Apolonia Brumbley", "age": 13 }, { "name": "Stephine Brumbley", "age": null }, { "name": "Zelma Brumbley", "age": 51 } ] }, "b": { "cid": 795, "name": "Sharilyn Branstad", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Ashlee Branstad", "age": 24 }, { "name": "Bobbye Branstad", "age": 26 }, { "name": "Natalya Branstad", "age": null }, { "name": "Edith Branstad", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 241, "name": "Lesha Ambrosia", "age": 49, "address": { "number": 6133, "street": "Cedar St.", "city": "Portland" }, "interests": {{ "Base Jumping", "Running" }}, "children": [ { "name": "Venice Ambrosia", "age": null } ] }, "b": { "cid": 277, "name": "Malena Smock", "age": null, "address": null, "interests": {{ "Running", "Base Jumping" }}, "children": [ { "name": "Inocencia Smock", "age": 50 }, { "name": "Cleveland Smock", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 241, "name": "Lesha Ambrosia", "age": 49, "address": { "number": 6133, "street": "Cedar St.", "city": "Portland" }, "interests": {{ "Base Jumping", "Running" }}, "children": [ { "name": "Venice Ambrosia", "age": null } ] }, "b": { "cid": 543, "name": "Pearl Nollette", "age": null, "address": null, "interests": {{ "Base Jumping", "Running" }}, "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 254, "name": "Jeanice Longanecker", "age": 74, "address": { "number": 2613, "street": "Oak St.", "city": "San Jose" }, "interests": {{ "Books", "Base Jumping" }}, "children": [ ] }, "b": { "cid": 467, "name": "Magali Ingerson", "age": null, "address": null, "interests": {{ "Books", "Base Jumping" }}, "children": [ { "name": "Monty Ingerson", "age": 11 }, { "name": "Noelia Ingerson", "age": 47 }, { "name": "Tennie Ingerson", "age": null }, { "name": "Merrill Ingerson", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 254, "name": "Jeanice Longanecker", "age": 74, "address": { "number": 2613, "street": "Oak St.", "city": "San Jose" }, "interests": {{ "Books", "Base Jumping" }}, "children": [ ] }, "b": { "cid": 632, "name": "Keeley Goga", "age": null, "address": null, "interests": {{ "Books", "Base Jumping" }}, "children": [ { "name": "Walter Goga", "age": 39 }, { "name": "Chaya Goga", "age": null }, { "name": "Melodie Goga", "age": null }, { "name": "Isidro Goga", "age": 32 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 259, "name": "Aurelio Darrigo", "age": 45, "address": { "number": 1114, "street": "Park St.", "city": "San Jose" }, "interests": {{ "Cooking", "Running" }}, "children": [ { "name": "Leonard Darrigo", "age": 22 }, { "name": "Aron Darrigo", "age": null }, { "name": "Pamelia Darrigo", "age": 14 } ] }, "b": { "cid": 379, "name": "Penney Huslander", "age": 58, "address": { "number": 6919, "street": "7th St.", "city": "Portland" }, "interests": {{ "Cooking", "Running" }}, "children": [ { "name": "Magaret Huslander", "age": null }, { "name": "Dodie Huslander", "age": 14 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 260, "name": "Hedwig Caminero", "age": 81, "address": { "number": 4305, "street": "7th St.", "city": "Portland" }, "interests": {{ "Video Games", "Databases" }}, "children": [ { "name": "Hal Caminero", "age": null }, { "name": "Cierra Caminero", "age": 32 } ] }, "b": { "cid": 298, "name": "Brittny Christin", "age": null, "address": null, "interests": {{ "Databases", "Video Games" }}, "children": [ { "name": "Hilario Christin", "age": null }, { "name": "Clarine Christin", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 260, "name": "Hedwig Caminero", "age": 81, "address": { "number": 4305, "street": "7th St.", "city": "Portland" }, "interests": {{ "Video Games", "Databases" }}, "children": [ { "name": "Hal Caminero", "age": null }, { "name": "Cierra Caminero", "age": 32 } ] }, "b": { "cid": 591, "name": "Matthew Tenhaeff", "age": null, "address": null, "interests": {{ "Databases", "Video Games" }}, "children": [ { "name": "Jan Tenhaeff", "age": 25 }, { "name": "Nana Tenhaeff", "age": null }, { "name": "Laticia Tenhaeff", "age": null }, { "name": "Ara Tenhaeff", "age": 44 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 271, "name": "Carey Ronin", "age": 44, "address": { "number": 8141, "street": "Oak St.", "city": "Mountain View" }, "interests": {{ "Cigars", "Video Games" }}, "children": [ { "name": "Lonny Ronin", "age": null }, { "name": "Armanda Ronin", "age": null } ] }, "b": { "cid": 689, "name": "Camila Cho", "age": 70, "address": { "number": 7731, "street": "Cedar St.", "city": "Mountain View" }, "interests": {{ "Video Games", "Cigars" }}, "children": [ { "name": "Myrtie Cho", "age": 57 }, { "name": "Merideth Cho", "age": 45 }, { "name": "Meta Cho", "age": 20 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 277, "name": "Malena Smock", "age": null, "address": null, "interests": {{ "Running", "Base Jumping" }}, "children": [ { "name": "Inocencia Smock", "age": 50 }, { "name": "Cleveland Smock", "age": null } ] }, "b": { "cid": 543, "name": "Pearl Nollette", "age": null, "address": null, "interests": {{ "Base Jumping", "Running" }}, "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 285, "name": "Edgar Farlin", "age": 75, "address": { "number": 3833, "street": "Lake St.", "city": "Sunnyvale" }, "interests": {{ "Coffee", "Databases" }}, "children": [ { "name": "Stefanie Farlin", "age": 60 }, { "name": "Catina Farlin", "age": null }, { "name": "Lizzie Farlin", "age": null }, { "name": "Beau Farlin", "age": null } ] }, "b": { "cid": 805, "name": "Gaylord Ginder", "age": null, "address": null, "interests": {{ "Databases", "Coffee" }}, "children": [ { "name": "Lucina Ginder", "age": null }, { "name": "Harriett Ginder", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 295, "name": "Guillermina Florek", "age": 61, "address": { "number": 3704, "street": "Washington St.", "city": "Mountain View" }, "interests": {{ "Movies", "Books" }}, "children": [ { "name": "Donnie Florek", "age": null }, { "name": "Jeannetta Florek", "age": 38 }, { "name": "Leigha Florek", "age": null }, { "name": "Zenobia Florek", "age": 10 } ] }, "b": { "cid": 877, "name": "Nicki Lipkind", "age": null, "address": null, "interests": {{ "Books", "Movies" }}, "children": [ { "name": "Yahaira Lipkind", "age": 12 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 295, "name": "Guillermina Florek", "age": 61, "address": { "number": 3704, "street": "Washington St.", "city": "Mountain View" }, "interests": {{ "Movies", "Books" }}, "children": [ { "name": "Donnie Florek", "age": null }, { "name": "Jeannetta Florek", "age": 38 }, { "name": "Leigha Florek", "age": null }, { "name": "Zenobia Florek", "age": 10 } ] }, "b": { "cid": 974, "name": "Alexis Malcomson", "age": null, "address": null, "interests": {{ "Movies", "Books" }}, "children": [ { "name": "Kerri Malcomson", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 298, "name": "Brittny Christin", "age": null, "address": null, "interests": {{ "Databases", "Video Games" }}, "children": [ { "name": "Hilario Christin", "age": null }, { "name": "Clarine Christin", "age": null } ] }, "b": { "cid": 591, "name": "Matthew Tenhaeff", "age": null, "address": null, "interests": {{ "Databases", "Video Games" }}, "children": [ { "name": "Jan Tenhaeff", "age": 25 }, { "name": "Nana Tenhaeff", "age": null }, { "name": "Laticia Tenhaeff", "age": null }, { "name": "Ara Tenhaeff", "age": 44 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 304, "name": "Francine Reddin", "age": 39, "address": { "number": 9392, "street": "Hill St.", "city": "Seattle" }, "interests": {{ "Music", "Base Jumping" }}, "children": [ { "name": "Millicent Reddin", "age": null } ] }, "b": { "cid": 501, "name": "Alyce Coant", "age": null, "address": null, "interests": {{ "Music", "Base Jumping" }}, "children": [ { "name": "Elyse Coant", "age": 50 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 309, "name": "Lise Baiz", "age": 46, "address": { "number": 352, "street": "Oak St.", "city": "San Jose" }, "interests": {{ "Bass", "Squash" }}, "children": [ { "name": "Alisa Baiz", "age": 18 }, { "name": "Elidia Baiz", "age": 28 }, { "name": "Ray Baiz", "age": 19 } ] }, "b": { "cid": 713, "name": "Galina Retterbush", "age": null, "address": null, "interests": {{ "Bass", "Squash" }}, "children": [ { "name": "Janene Retterbush", "age": null }, { "name": "Toby Retterbush", "age": 15 }, { "name": "Renato Retterbush", "age": null }, { "name": "Annice Retterbush", "age": 22 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 315, "name": "Kallie Eiselein", "age": null, "address": null, "interests": {{ "Computers", "Tennis" }}, "children": [ ] }, "b": { "cid": 737, "name": "Jeffrey Chesson", "age": 13, "address": { "number": 6833, "street": "Lake St.", "city": "Portland" }, "interests": {{ "Tennis", "Computers" }}, "children": [ { "name": "Clayton Chesson", "age": null }, { "name": "Yi Chesson", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 317, "name": "Zona Caffarel", "age": 52, "address": { "number": 9419, "street": "Cedar St.", "city": "Seattle" }, "interests": {{ "Tennis", "Coffee" }}, "children": [ { "name": "Cortez Caffarel", "age": null } ] }, "b": { "cid": 771, "name": "Marisela Tredo", "age": null, "address": null, "interests": {{ "Tennis", "Coffee" }}, "children": [ { "name": "Ardell Tredo", "age": 21 }, { "name": "Evelynn Tredo", "age": 16 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 347, "name": "Patrick Feighan", "age": 34, "address": { "number": 7613, "street": "Cedar St.", "city": "Los Angeles" }, "interests": {{ "Puzzles", "Books" }}, "children": [ { "name": "Madaline Feighan", "age": null } ] }, "b": { "cid": 480, "name": "Nigel Pitmon", "age": null, "address": null, "interests": {{ "Puzzles", "Books" }}, "children": [ { "name": "Janene Pitmon", "age": null }, { "name": "Louie Pitmon", "age": 19 }, { "name": "Genny Pitmon", "age": 24 }, { "name": "Robby Pitmon", "age": 55 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 347, "name": "Patrick Feighan", "age": 34, "address": { "number": 7613, "street": "Cedar St.", "city": "Los Angeles" }, "interests": {{ "Puzzles", "Books" }}, "children": [ { "name": "Madaline Feighan", "age": null } ] }, "b": { "cid": 860, "name": "Isabelle Sept", "age": 88, "address": { "number": 4382, "street": "Washington St.", "city": "Portland" }, "interests": {{ "Puzzles", "Books" }}, "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 355, "name": "Elois Leckband", "age": null, "address": null, "interests": {{ "Skiing", "Wine" }}, "children": [ ] }, "b": { "cid": 635, "name": "Angelena Braegelmann", "age": 36, "address": { "number": 4158, "street": "Park St.", "city": "San Jose" }, "interests": {{ "Wine", "Skiing" }}, "children": [ { "name": "Daisey Braegelmann", "age": 18 }, { "name": "Gaston Braegelmann", "age": 19 }, { "name": "Louella Braegelmann", "age": null }, { "name": "Leonie Braegelmann", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 367, "name": "Cassondra Fabiani", "age": null, "address": null, "interests": {{ "Squash", "Tennis" }}, "children": [ { "name": "Evia Fabiani", "age": null }, { "name": "Chaya Fabiani", "age": null }, { "name": "Sherman Fabiani", "age": null }, { "name": "Kathi Fabiani", "age": 54 } ] }, "b": { "cid": 503, "name": "Phyliss Cassani", "age": null, "address": null, "interests": {{ "Squash", "Tennis" }}, "children": [ { "name": "Rolando Cassani", "age": 44 }, { "name": "Rikki Cassani", "age": 18 }, { "name": "Monty Cassani", "age": 40 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 369, "name": "Nickole Dory", "age": 10, "address": { "number": 4761, "street": "View St.", "city": "Portland" }, "interests": {{ "Walking", "Cooking" }}, "children": [ { "name": "Annmarie Dory", "age": null }, { "name": "Michele Dory", "age": null }, { "name": "Annamae Dory", "age": null }, { "name": "Flora Dory", "age": null } ] }, "b": { "cid": 816, "name": "Cheyenne Eddie", "age": null, "address": null, "interests": {{ "Walking", "Cooking" }}, "children": [ { "name": "Kathe Eddie", "age": null }, { "name": "Charles Eddie", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 378, "name": "Melany Matias", "age": 10, "address": { "number": 8838, "street": "Main St.", "city": "Seattle" }, "interests": {{ "Coffee", "Tennis", "Bass" }}, "children": [ { "name": "Earnestine Matias", "age": null }, { "name": "Lore Matias", "age": null } ] }, "b": { "cid": 545, "name": "Dolores Ferer", "age": null, "address": null, "interests": {{ "Coffee", "Bass", "Tennis" }}, "children": [ { "name": "Bridgette Ferer", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 380, "name": "Silva Purdue", "age": 33, "address": { "number": 1759, "street": "7th St.", "city": "Portland" }, "interests": {{ "Music", "Squash" }}, "children": [ { "name": "Marshall Purdue", "age": null }, { "name": "Yuki Purdue", "age": null }, { "name": "Val Purdue", "age": 12 }, { "name": "Dominica Purdue", "age": null } ] }, "b": { "cid": 904, "name": "Holley Tofil", "age": 51, "address": { "number": 8946, "street": "Oak St.", "city": "Mountain View" }, "interests": {{ "Music", "Squash" }}, "children": [ { "name": "Kristal Tofil", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 386, "name": "Mao Gradowski", "age": 36, "address": { "number": 5116, "street": "Washington St.", "city": "Mountain View" }, "interests": {{ "Computers", "Fishing" }}, "children": [ { "name": "Jeneva Gradowski", "age": null }, { "name": "Thu Gradowski", "age": 22 }, { "name": "Daphine Gradowski", "age": null }, { "name": "Providencia Gradowski", "age": null } ] }, "b": { "cid": 646, "name": "Pablo Catterton", "age": null, "address": null, "interests": {{ "Fishing", "Computers" }}, "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 386, "name": "Mao Gradowski", "age": 36, "address": { "number": 5116, "street": "Washington St.", "city": "Mountain View" }, "interests": {{ "Computers", "Fishing" }}, "children": [ { "name": "Jeneva Gradowski", "age": null }, { "name": "Thu Gradowski", "age": 22 }, { "name": "Daphine Gradowski", "age": null }, { "name": "Providencia Gradowski", "age": null } ] }, "b": { "cid": 781, "name": "Christy Darcangelo", "age": 42, "address": { "number": 2178, "street": "Washington St.", "city": "Portland" }, "interests": {{ "Computers", "Fishing" }}, "children": [ { "name": "Luis Darcangelo", "age": 21 }, { "name": "Omega Darcangelo", "age": 26 }, { "name": "Remedios Darcangelo", "age": 28 }, { "name": "Domenic Darcangelo", "age": 21 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 389, "name": "Loraine Morfee", "age": 72, "address": { "number": 2945, "street": "Lake St.", "city": "Seattle" }, "interests": {{ "Wine", "Walking" }}, "children": [ { "name": "Berry Morfee", "age": 30 } ] }, "b": { "cid": 607, "name": "Bert Garigliano", "age": 71, "address": { "number": 3881, "street": "Washington St.", "city": "San Jose" }, "interests": {{ "Walking", "Wine" }}, "children": [ { "name": "Junior Garigliano", "age": 42 }, { "name": "Willa Garigliano", "age": 21 }, { "name": "Carlo Garigliano", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 393, "name": "Rossana Monton", "age": 34, "address": { "number": 4490, "street": "Main St.", "city": "Portland" }, "interests": {{ "Skiing", "Base Jumping" }}, "children": [ { "name": "Glayds Monton", "age": null }, { "name": "Lily Monton", "age": null }, { "name": "Raina Monton", "age": null }, { "name": "Hilma Monton", "age": null } ] }, "b": { "cid": 493, "name": "Lindsey Trout", "age": 86, "address": { "number": 7619, "street": "Cedar St.", "city": "Portland" }, "interests": {{ "Base Jumping", "Skiing" }}, "children": [ { "name": "Madlyn Trout", "age": 58 }, { "name": "Amie Trout", "age": 72 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 394, "name": "Lizette Roux", "age": 57, "address": { "number": 458, "street": "Hill St.", "city": "Los Angeles" }, "interests": {{ "Bass", "Books" }}, "children": [ { "name": "Doloris Roux", "age": null } ] }, "b": { "cid": 523, "name": "Johanne Huls", "age": null, "address": null, "interests": {{ "Books", "Bass" }}, "children": [ { "name": "Melynda Huls", "age": null }, { "name": "Vicky Huls", "age": 16 }, { "name": "Charlott Huls", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 403, "name": "Kayleigh Houey", "age": null, "address": null, "interests": {{ "Fishing", "Music" }}, "children": [ { "name": "Ta Houey", "age": null }, { "name": "Ayana Houey", "age": null }, { "name": "Dominique Houey", "age": null }, { "name": "Denise Houey", "age": 48 } ] }, "b": { "cid": 949, "name": "Elissa Rogue", "age": null, "address": null, "interests": {{ "Fishing", "Music" }}, "children": [ { "name": "Noriko Rogue", "age": 41 }, { "name": "Lavona Rogue", "age": 39 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 407, "name": "Bebe Cotney", "age": null, "address": null, "interests": {{ "Books", "Tennis" }}, "children": [ { "name": "Daren Cotney", "age": null }, { "name": "Lady Cotney", "age": 48 } ] }, "b": { "cid": 420, "name": "Coralie Regueira", "age": null, "address": null, "interests": {{ "Books", "Tennis" }}, "children": [ { "name": "Latoyia Regueira", "age": 31 }, { "name": "Obdulia Regueira", "age": 12 }, { "name": "Herlinda Regueira", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 407, "name": "Bebe Cotney", "age": null, "address": null, "interests": {{ "Books", "Tennis" }}, "children": [ { "name": "Daren Cotney", "age": null }, { "name": "Lady Cotney", "age": 48 } ] }, "b": { "cid": 549, "name": "Kathrin Cruff", "age": 63, "address": { "number": 9002, "street": "Washington St.", "city": "Sunnyvale" }, "interests": {{ "Tennis", "Books" }}, "children": [ { "name": "Candi Cruff", "age": 49 }, { "name": "Barry Cruff", "age": 17 }, { "name": "Shane Cruff", "age": 18 }, { "name": "Brendon Cruff", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 420, "name": "Coralie Regueira", "age": null, "address": null, "interests": {{ "Books", "Tennis" }}, "children": [ { "name": "Latoyia Regueira", "age": 31 }, { "name": "Obdulia Regueira", "age": 12 }, { "name": "Herlinda Regueira", "age": null } ] }, "b": { "cid": 549, "name": "Kathrin Cruff", "age": 63, "address": { "number": 9002, "street": "Washington St.", "city": "Sunnyvale" }, "interests": {{ "Tennis", "Books" }}, "children": [ { "name": "Candi Cruff", "age": 49 }, { "name": "Barry Cruff", "age": 17 }, { "name": "Shane Cruff", "age": 18 }, { "name": "Brendon Cruff", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 450, "name": "Althea Mohammed", "age": null, "address": null, "interests": {{ "Fishing", "Databases" }}, "children": [ { "name": "Jasper Mohammed", "age": null } ] }, "b": { "cid": 478, "name": "Sophia Whitt", "age": 26, "address": { "number": 2787, "street": "Park St.", "city": "Mountain View" }, "interests": {{ "Fishing", "Databases" }}, "children": [ { "name": "Irving Whitt", "age": 13 }, { "name": "Jeannette Whitt", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 452, "name": "Casie Marasigan", "age": null, "address": null, "interests": {{ "Walking", "Computers" }}, "children": [ { "name": "Connie Marasigan", "age": null }, { "name": "Kimberlie Marasigan", "age": null } ] }, "b": { "cid": 573, "name": "Tyree Ketcher", "age": null, "address": null, "interests": {{ "Computers", "Walking" }}, "children": [ { "name": "Aleisha Ketcher", "age": null }, { "name": "Vonda Ketcher", "age": null }, { "name": "Cyndy Ketcher", "age": 13 }, { "name": "Chassidy Ketcher", "age": 30 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 467, "name": "Magali Ingerson", "age": null, "address": null, "interests": {{ "Books", "Base Jumping" }}, "children": [ { "name": "Monty Ingerson", "age": 11 }, { "name": "Noelia Ingerson", "age": 47 }, { "name": "Tennie Ingerson", "age": null }, { "name": "Merrill Ingerson", "age": null } ] }, "b": { "cid": 632, "name": "Keeley Goga", "age": null, "address": null, "interests": {{ "Books", "Base Jumping" }}, "children": [ { "name": "Walter Goga", "age": 39 }, { "name": "Chaya Goga", "age": null }, { "name": "Melodie Goga", "age": null }, { "name": "Isidro Goga", "age": 32 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 472, "name": "Kelley Mischler", "age": 38, "address": { "number": 7988, "street": "Lake St.", "city": "Los Angeles" }, "interests": {{ "Movies", "Cooking", "Skiing" }}, "children": [ { "name": "Keila Mischler", "age": 19 }, { "name": "Evie Mischler", "age": 15 } ] }, "b": { "cid": 602, "name": "Clyde Salada", "age": 59, "address": { "number": 8316, "street": "7th St.", "city": "Sunnyvale" }, "interests": {{ "Movies", "Skiing", "Cooking" }}, "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 480, "name": "Nigel Pitmon", "age": null, "address": null, "interests": {{ "Puzzles", "Books" }}, "children": [ { "name": "Janene Pitmon", "age": null }, { "name": "Louie Pitmon", "age": 19 }, { "name": "Genny Pitmon", "age": 24 }, { "name": "Robby Pitmon", "age": 55 } ] }, "b": { "cid": 860, "name": "Isabelle Sept", "age": 88, "address": { "number": 4382, "street": "Washington St.", "city": "Portland" }, "interests": {{ "Puzzles", "Books" }}, "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 483, "name": "Elsa Vigen", "age": null, "address": null, "interests": {{ "Wine", "Databases" }}, "children": [ { "name": "Larae Vigen", "age": null }, { "name": "Elwood Vigen", "age": null } ] }, "b": { "cid": 894, "name": "Reginald Julien", "age": 16, "address": { "number": 1107, "street": "Lake St.", "city": "Mountain View" }, "interests": {{ "Databases", "Wine" }}, "children": [ { "name": "Arthur Julien", "age": null }, { "name": "Evia Julien", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 484, "name": "Bennie Dragaj", "age": null, "address": null, "interests": {{ "Fishing", "Databases", "Wine" }}, "children": [ { "name": "Viva Dragaj", "age": 13 } ] }, "b": { "cid": 741, "name": "Lesia Risatti", "age": 48, "address": { "number": 7378, "street": "Cedar St.", "city": "Portland" }, "interests": {{ "Fishing", "Wine", "Databases" }}, "children": [ { "name": "Tangela Risatti", "age": null }, { "name": "Leonel Risatti", "age": 33 }, { "name": "Cythia Risatti", "age": 36 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 484, "name": "Bennie Dragaj", "age": null, "address": null, "interests": {{ "Fishing", "Databases", "Wine" }}, "children": [ { "name": "Viva Dragaj", "age": 13 } ] }, "b": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": {{ "Databases", "Fishing", "Wine" }}, "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 498, "name": "Arleen Sultzer", "age": null, "address": null, "interests": {{ "Coffee", "Movies", "Skiing" }}, "children": [ { "name": "Norine Sultzer", "age": 29 } ] }, "b": { "cid": 875, "name": "Ramon Crepps", "age": null, "address": null, "interests": {{ "Coffee", "Movies", "Skiing" }}, "children": [ { "name": "Elisha Crepps", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 502, "name": "Lawana Mulik", "age": 82, "address": { "number": 3071, "street": "Park St.", "city": "Portland" }, "interests": {{ "Cigars", "Cigars" }}, "children": [ { "name": "Carrie Mulik", "age": null }, { "name": "Sharlene Mulik", "age": 33 }, { "name": "Leone Mulik", "age": 46 } ] }, "b": { "cid": 774, "name": "Nadene Rigel", "age": null, "address": null, "interests": {{ "Cigars", "Cigars" }}, "children": [ { "name": "Rebbeca Rigel", "age": 33 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 508, "name": "Tiffany Kimmey", "age": 64, "address": { "number": 8625, "street": "7th St.", "city": "Mountain View" }, "interests": {{ "Bass", "Walking" }}, "children": [ ] }, "b": { "cid": 796, "name": "Daniele Brisk", "age": null, "address": null, "interests": {{ "Walking", "Bass" }}, "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 510, "name": "Candace Morello", "age": null, "address": null, "interests": {{ "Wine", "Base Jumping", "Running" }}, "children": [ { "name": "Sandy Morello", "age": 57 }, { "name": "Delois Morello", "age": 15 } ] }, "b": { "cid": 908, "name": "Ferdinand Auila", "age": 82, "address": { "number": 1071, "street": "Lake St.", "city": "Portland" }, "interests": {{ "Base Jumping", "Running", "Wine" }}, "children": [ { "name": "Ai Auila", "age": 69 }, { "name": "Laurel Auila", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 513, "name": "Marianna Gortman", "age": 49, "address": { "number": 927, "street": "Cedar St.", "city": "San Jose" }, "interests": {{ "Databases", "Databases" }}, "children": [ ] }, "b": { "cid": 520, "name": "Janay Bernbeck", "age": null, "address": null, "interests": {{ "Databases", "Databases" }}, "children": [ { "name": "Aurea Bernbeck", "age": null }, { "name": "Tiara Bernbeck", "age": null }, { "name": "Alfredia Bernbeck", "age": 26 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 559, "name": "Carolyne Shiroma", "age": null, "address": null, "interests": {{ "Movies", "Running" }}, "children": [ { "name": "Ying Shiroma", "age": 57 } ] }, "b": { "cid": 681, "name": "Iliana Nagele", "age": null, "address": null, "interests": {{ "Movies", "Running" }}, "children": [ { "name": "Sunny Nagele", "age": 55 }, { "name": "Waltraud Nagele", "age": 39 }, { "name": "Darron Nagele", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 560, "name": "Karin Dicesare", "age": null, "address": null, "interests": {{ "Wine", "Puzzles" }}, "children": [ ] }, "b": { "cid": 583, "name": "Bev Yerena", "age": null, "address": null, "interests": {{ "Puzzles", "Wine" }}, "children": [ { "name": "Larhonda Yerena", "age": 45 }, { "name": "Josefina Yerena", "age": null }, { "name": "Sydney Yerena", "age": 42 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 570, "name": "Lee Basora", "age": null, "address": null, "interests": {{ "Squash", "Cigars" }}, "children": [ ] }, "b": { "cid": 819, "name": "Twanna Finnley", "age": null, "address": null, "interests": {{ "Squash", "Cigars" }}, "children": [ { "name": "Reba Finnley", "age": null }, { "name": "Moises Finnley", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 620, "name": "Arielle Mackellar", "age": null, "address": null, "interests": {{ "Cooking", "Bass" }}, "children": [ { "name": "Evelin Mackellar", "age": 17 }, { "name": "Theresa Mackellar", "age": 53 }, { "name": "Ronnie Mackellar", "age": null }, { "name": "Elwanda Mackellar", "age": 54 } ] }, "b": { "cid": 761, "name": "Adele Henrikson", "age": null, "address": null, "interests": {{ "Cooking", "Bass" }}, "children": [ { "name": "Paulina Henrikson", "age": null }, { "name": "David Henrikson", "age": null }, { "name": "Jose Henrikson", "age": null }, { "name": "Meg Henrikson", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 636, "name": "Babara Shore", "age": 83, "address": { "number": 9452, "street": "Oak St.", "city": "Los Angeles" }, "interests": {{ "Databases", "Movies", "Tennis" }}, "children": [ { "name": "Candy Shore", "age": 58 }, { "name": "Nanci Shore", "age": null }, { "name": "Asia Shore", "age": null } ] }, "b": { "cid": 992, "name": "Staci Alexandropoul", "age": null, "address": null, "interests": {{ "Databases", "Movies", "Tennis" }}, "children": [ { "name": "Casimira Alexandropoul", "age": null }, { "name": "Kena Alexandropoul", "age": 54 }, { "name": "Ellie Alexandropoul", "age": null }, { "name": "Ambrose Alexandropoul", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 646, "name": "Pablo Catterton", "age": null, "address": null, "interests": {{ "Fishing", "Computers" }}, "children": [ ] }, "b": { "cid": 781, "name": "Christy Darcangelo", "age": 42, "address": { "number": 2178, "street": "Washington St.", "city": "Portland" }, "interests": {{ "Computers", "Fishing" }}, "children": [ { "name": "Luis Darcangelo", "age": 21 }, { "name": "Omega Darcangelo", "age": 26 }, { "name": "Remedios Darcangelo", "age": 28 }, { "name": "Domenic Darcangelo", "age": 21 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 647, "name": "Jodi Dearson", "age": null, "address": null, "interests": {{ "Fishing", "Movies" }}, "children": [ ] }, "b": { "cid": 884, "name": "Laila Marta", "age": null, "address": null, "interests": {{ "Fishing", "Movies" }}, "children": [ { "name": "Carlota Marta", "age": 19 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 704, "name": "Melodee Clemons", "age": null, "address": null, "interests": {{ "Base Jumping", "Tennis", "Video Games" }}, "children": [ { "name": "Doreatha Clemons", "age": 22 } ] }, "b": { "cid": 812, "name": "Bee Godette", "age": 26, "address": { "number": 1757, "street": "Washington St.", "city": "Portland" }, "interests": {{ "Video Games", "Base Jumping", "Tennis" }}, "children": [ { "name": "Madaline Godette", "age": 10 }, { "name": "Shasta Godette", "age": 15 }, { "name": "Parthenia Godette", "age": 11 }, { "name": "Priscila Godette", "age": 13 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 716, "name": "Deirdre Bruderer", "age": null, "address": null, "interests": {{ "Computers", "Wine" }}, "children": [ { "name": "Coralee Bruderer", "age": null }, { "name": "Mina Bruderer", "age": null }, { "name": "Lindsey Bruderer", "age": 35 }, { "name": "Yi Bruderer", "age": null } ] }, "b": { "cid": 890, "name": "Janise Maccarthy", "age": 66, "address": { "number": 7337, "street": "Main St.", "city": "San Jose" }, "interests": {{ "Wine", "Computers" }}, "children": [ ] }, "jacc": 1.0f }
+{ "a": { "cid": 730, "name": "Marti Vandoren", "age": null, "address": null, "interests": {{ "Skiing", "Bass" }}, "children": [ { "name": "Carroll Vandoren", "age": null }, { "name": "Lorretta Vandoren", "age": 30 }, { "name": "Chloe Vandoren", "age": 42 }, { "name": "Ilona Vandoren", "age": null } ] }, "b": { "cid": 982, "name": "Jude Brandsrud", "age": 41, "address": { "number": 7133, "street": "Washington St.", "city": "Seattle" }, "interests": {{ "Bass", "Skiing" }}, "children": [ { "name": "Scottie Brandsrud", "age": null }, { "name": "Gennie Brandsrud", "age": 10 }, { "name": "Agnes Brandsrud", "age": null }, { "name": "Clarinda Brandsrud", "age": 17 } ] }, "jacc": 1.0f }
+{ "a": { "cid": 731, "name": "Yajaira Orto", "age": null, "address": null, "interests": {{ "Music", "Databases" }}, "children": [ { "name": "Eliz Orto", "age": 17 }, { "name": "Gisela Orto", "age": null } ] }, "b": { "cid": 795, "name": "Sharilyn Branstad", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Ashlee Branstad", "age": 24 }, { "name": "Bobbye Branstad", "age": 26 }, { "name": "Natalya Branstad", "age": null }, { "name": "Edith Branstad", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 741, "name": "Lesia Risatti", "age": 48, "address": { "number": 7378, "street": "Cedar St.", "city": "Portland" }, "interests": {{ "Fishing", "Wine", "Databases" }}, "children": [ { "name": "Tangela Risatti", "age": null }, { "name": "Leonel Risatti", "age": 33 }, { "name": "Cythia Risatti", "age": 36 } ] }, "b": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": {{ "Databases", "Fishing", "Wine" }}, "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] }, "jacc": 1.0f }
+{ "a": { "cid": 877, "name": "Nicki Lipkind", "age": null, "address": null, "interests": {{ "Books", "Movies" }}, "children": [ { "name": "Yahaira Lipkind", "age": 12 } ] }, "b": { "cid": 974, "name": "Alexis Malcomson", "age": null, "address": null, "interests": {{ "Movies", "Books" }}, "children": [ { "name": "Kerri Malcomson", "age": null } ] }, "jacc": 1.0f }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ulist-jaccard.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ulist-jaccard.adm
new file mode 100644
index 0000000..582b5db
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ulist-jaccard.adm
@@ -0,0 +1,115 @@
+{ "a": { "cid": 2, "name": "Elin Debell", "age": 82, "address": { "number": 5649, "street": "Hill St.", "city": "Portland" }, "interests": {{ "Bass", "Wine" }}, "children": [ { "name": "Elvina Debell", "age": null }, { "name": "Renaldo Debell", "age": 51 }, { "name": "Divina Debell", "age": 57 } ] }, "b": { "cid": 897, "name": "Gerald Roehrman", "age": null, "address": null, "interests": {{ "Bass", "Wine" }}, "children": [ { "name": "Virgie Roehrman", "age": 28 }, { "name": "Akiko Roehrman", "age": 59 }, { "name": "Robbie Roehrman", "age": 10 }, { "name": "Flavia Roehrman", "age": null } ] } }
+{ "a": { "cid": 5, "name": "Heide Naifeh", "age": null, "address": null, "interests": {{ "Music", "Databases" }}, "children": [ { "name": "Deirdre Naifeh", "age": null }, { "name": "Jacquelyne Naifeh", "age": 39 } ] }, "b": { "cid": 215, "name": "Ashton Schadegg", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Ciara Schadegg", "age": null }, { "name": "Karisa Schadegg", "age": 11 }, { "name": "Hayden Schadegg", "age": 44 } ] } }
+{ "a": { "cid": 5, "name": "Heide Naifeh", "age": null, "address": null, "interests": {{ "Music", "Databases" }}, "children": [ { "name": "Deirdre Naifeh", "age": null }, { "name": "Jacquelyne Naifeh", "age": 39 } ] }, "b": { "cid": 228, "name": "Donnette Brumbley", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Madlyn Brumbley", "age": null }, { "name": "Apolonia Brumbley", "age": 13 }, { "name": "Stephine Brumbley", "age": null }, { "name": "Zelma Brumbley", "age": 51 } ] } }
+{ "a": { "cid": 5, "name": "Heide Naifeh", "age": null, "address": null, "interests": {{ "Music", "Databases" }}, "children": [ { "name": "Deirdre Naifeh", "age": null }, { "name": "Jacquelyne Naifeh", "age": 39 } ] }, "b": { "cid": 731, "name": "Yajaira Orto", "age": null, "address": null, "interests": {{ "Music", "Databases" }}, "children": [ { "name": "Eliz Orto", "age": 17 }, { "name": "Gisela Orto", "age": null } ] } }
+{ "a": { "cid": 5, "name": "Heide Naifeh", "age": null, "address": null, "interests": {{ "Music", "Databases" }}, "children": [ { "name": "Deirdre Naifeh", "age": null }, { "name": "Jacquelyne Naifeh", "age": 39 } ] }, "b": { "cid": 795, "name": "Sharilyn Branstad", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Ashlee Branstad", "age": 24 }, { "name": "Bobbye Branstad", "age": 26 }, { "name": "Natalya Branstad", "age": null }, { "name": "Edith Branstad", "age": null } ] } }
+{ "a": { "cid": 11, "name": "Meta Simek", "age": 13, "address": { "number": 4384, "street": "7th St.", "city": "San Jose" }, "interests": {{ "Wine", "Walking" }}, "children": [ { "name": "Oretha Simek", "age": null }, { "name": "Terence Simek", "age": null } ] }, "b": { "cid": 389, "name": "Loraine Morfee", "age": 72, "address": { "number": 2945, "street": "Lake St.", "city": "Seattle" }, "interests": {{ "Wine", "Walking" }}, "children": [ { "name": "Berry Morfee", "age": 30 } ] } }
+{ "a": { "cid": 11, "name": "Meta Simek", "age": 13, "address": { "number": 4384, "street": "7th St.", "city": "San Jose" }, "interests": {{ "Wine", "Walking" }}, "children": [ { "name": "Oretha Simek", "age": null }, { "name": "Terence Simek", "age": null } ] }, "b": { "cid": 607, "name": "Bert Garigliano", "age": 71, "address": { "number": 3881, "street": "Washington St.", "city": "San Jose" }, "interests": {{ "Walking", "Wine" }}, "children": [ { "name": "Junior Garigliano", "age": 42 }, { "name": "Willa Garigliano", "age": 21 }, { "name": "Carlo Garigliano", "age": null } ] } }
+{ "a": { "cid": 17, "name": "Ingeborg Monkhouse", "age": null, "address": null, "interests": {{ "Base Jumping", "Cigars", "Movies" }}, "children": [ ] }, "b": { "cid": 156, "name": "Bobbye Kauppi", "age": 79, "address": { "number": 2051, "street": "Hill St.", "city": "Sunnyvale" }, "interests": {{ "Base Jumping", "Cigars", "Movies" }}, "children": [ ] } }
+{ "a": { "cid": 27, "name": "Hollie Hyun", "age": null, "address": null, "interests": {{ "Skiing", "Walking" }}, "children": [ { "name": "Morton Hyun", "age": null }, { "name": "Farrah Hyun", "age": 40 }, { "name": "Ali Hyun", "age": null } ] }, "b": { "cid": 542, "name": "Eveline Smedley", "age": 50, "address": { "number": 5513, "street": "Oak St.", "city": "San Jose" }, "interests": {{ "Skiing", "Walking" }}, "children": [ { "name": "Lynsey Smedley", "age": 26 } ] } }
+{ "a": { "cid": 32, "name": "Tia Berkley", "age": 30, "address": { "number": 4507, "street": "Park St.", "city": "Sunnyvale" }, "interests": {{ "Base Jumping", "Music" }}, "children": [ { "name": "Carmon Berkley", "age": null }, { "name": "Kristina Berkley", "age": null }, { "name": "Cristi Berkley", "age": 19 } ] }, "b": { "cid": 304, "name": "Francine Reddin", "age": 39, "address": { "number": 9392, "street": "Hill St.", "city": "Seattle" }, "interests": {{ "Music", "Base Jumping" }}, "children": [ { "name": "Millicent Reddin", "age": null } ] } }
+{ "a": { "cid": 32, "name": "Tia Berkley", "age": 30, "address": { "number": 4507, "street": "Park St.", "city": "Sunnyvale" }, "interests": {{ "Base Jumping", "Music" }}, "children": [ { "name": "Carmon Berkley", "age": null }, { "name": "Kristina Berkley", "age": null }, { "name": "Cristi Berkley", "age": 19 } ] }, "b": { "cid": 501, "name": "Alyce Coant", "age": null, "address": null, "interests": {{ "Music", "Base Jumping" }}, "children": [ { "name": "Elyse Coant", "age": 50 } ] } }
+{ "a": { "cid": 33, "name": "Rayford Velmontes", "age": null, "address": null, "interests": {{ "Fishing", "Video Games" }}, "children": [ ] }, "b": { "cid": 519, "name": "Julianna Goodsell", "age": 59, "address": { "number": 5594, "street": "Lake St.", "city": "Seattle" }, "interests": {{ "Video Games", "Fishing" }}, "children": [ ] } }
+{ "a": { "cid": 39, "name": "Brock Froncillo", "age": 72, "address": { "number": 4645, "street": "Cedar St.", "city": "San Jose" }, "interests": {{ "Base Jumping", "Skiing" }}, "children": [ { "name": "Cole Froncillo", "age": null }, { "name": "Ivana Froncillo", "age": null }, { "name": "Hugh Froncillo", "age": 23 } ] }, "b": { "cid": 393, "name": "Rossana Monton", "age": 34, "address": { "number": 4490, "street": "Main St.", "city": "Portland" }, "interests": {{ "Skiing", "Base Jumping" }}, "children": [ { "name": "Glayds Monton", "age": null }, { "name": "Lily Monton", "age": null }, { "name": "Raina Monton", "age": null }, { "name": "Hilma Monton", "age": null } ] } }
+{ "a": { "cid": 39, "name": "Brock Froncillo", "age": 72, "address": { "number": 4645, "street": "Cedar St.", "city": "San Jose" }, "interests": {{ "Base Jumping", "Skiing" }}, "children": [ { "name": "Cole Froncillo", "age": null }, { "name": "Ivana Froncillo", "age": null }, { "name": "Hugh Froncillo", "age": 23 } ] }, "b": { "cid": 493, "name": "Lindsey Trout", "age": 86, "address": { "number": 7619, "street": "Cedar St.", "city": "Portland" }, "interests": {{ "Base Jumping", "Skiing" }}, "children": [ { "name": "Madlyn Trout", "age": 58 }, { "name": "Amie Trout", "age": 72 } ] } }
+{ "a": { "cid": 41, "name": "Kevin Giottonini", "age": null, "address": null, "interests": {{ "Skiing", "Bass" }}, "children": [ { "name": "Victor Giottonini", "age": 37 }, { "name": "Alverta Giottonini", "age": null } ] }, "b": { "cid": 182, "name": "Christiana Westlie", "age": null, "address": null, "interests": {{ "Skiing", "Bass" }}, "children": [ { "name": "Ilda Westlie", "age": 18 } ] } }
+{ "a": { "cid": 41, "name": "Kevin Giottonini", "age": null, "address": null, "interests": {{ "Skiing", "Bass" }}, "children": [ { "name": "Victor Giottonini", "age": 37 }, { "name": "Alverta Giottonini", "age": null } ] }, "b": { "cid": 730, "name": "Marti Vandoren", "age": null, "address": null, "interests": {{ "Skiing", "Bass" }}, "children": [ { "name": "Carroll Vandoren", "age": null }, { "name": "Lorretta Vandoren", "age": 30 }, { "name": "Chloe Vandoren", "age": 42 }, { "name": "Ilona Vandoren", "age": null } ] } }
+{ "a": { "cid": 41, "name": "Kevin Giottonini", "age": null, "address": null, "interests": {{ "Skiing", "Bass" }}, "children": [ { "name": "Victor Giottonini", "age": 37 }, { "name": "Alverta Giottonini", "age": null } ] }, "b": { "cid": 982, "name": "Jude Brandsrud", "age": 41, "address": { "number": 7133, "street": "Washington St.", "city": "Seattle" }, "interests": {{ "Bass", "Skiing" }}, "children": [ { "name": "Scottie Brandsrud", "age": null }, { "name": "Gennie Brandsrud", "age": 10 }, { "name": "Agnes Brandsrud", "age": null }, { "name": "Clarinda Brandsrud", "age": 17 } ] } }
+{ "a": { "cid": 42, "name": "Asley Simco", "age": 38, "address": { "number": 3322, "street": "Main St.", "city": "Mountain View" }, "interests": {{ "Fishing", "Running", "Cigars" }}, "children": [ { "name": "Micheal Simco", "age": null }, { "name": "Lawerence Simco", "age": null } ] }, "b": { "cid": 753, "name": "Maris Bannett", "age": null, "address": null, "interests": {{ "Fishing", "Cigars", "Running" }}, "children": [ { "name": "Libbie Bannett", "age": 11 }, { "name": "Francina Bannett", "age": 21 }, { "name": "Tuyet Bannett", "age": null }, { "name": "Zona Bannett", "age": 32 } ] } }
+{ "a": { "cid": 56, "name": "Andria Killelea", "age": null, "address": null, "interests": {{ "Cigars", "Skiing" }}, "children": [ ] }, "b": { "cid": 857, "name": "Kasie Fujioka", "age": null, "address": null, "interests": {{ "Skiing", "Cigars" }}, "children": [ { "name": "Leontine Fujioka", "age": null }, { "name": "Nga Fujioka", "age": 21 }, { "name": "Nathanael Fujioka", "age": 27 } ] } }
+{ "a": { "cid": 71, "name": "Alva Sieger", "age": null, "address": null, "interests": {{ "Movies", "Walking" }}, "children": [ { "name": "Renetta Sieger", "age": null }, { "name": "Shiloh Sieger", "age": 57 }, { "name": "Lavina Sieger", "age": null }, { "name": "Larraine Sieger", "age": null } ] }, "b": { "cid": 758, "name": "Akiko Hoenstine", "age": 56, "address": { "number": 8888, "street": "Lake St.", "city": "Portland" }, "interests": {{ "Movies", "Walking" }}, "children": [ { "name": "Maren Hoenstine", "age": null }, { "name": "Tyler Hoenstine", "age": null }, { "name": "Jesse Hoenstine", "age": 40 } ] } }
+{ "a": { "cid": 74, "name": "Lonnie Ercolani", "age": 79, "address": { "number": 2655, "street": "Lake St.", "city": "Los Angeles" }, "interests": {{ "Music", "Coffee" }}, "children": [ { "name": "Cassi Ercolani", "age": null } ] }, "b": { "cid": 325, "name": "Ai Tarleton", "age": null, "address": null, "interests": {{ "Coffee", "Music" }}, "children": [ { "name": "Risa Tarleton", "age": 24 }, { "name": "Leonila Tarleton", "age": null }, { "name": "Thomasina Tarleton", "age": null } ] } }
+{ "a": { "cid": 76, "name": "Opal Blewett", "age": null, "address": null, "interests": {{ "Running", "Coffee", "Fishing" }}, "children": [ { "name": "Violette Blewett", "age": null } ] }, "b": { "cid": 455, "name": "Manual Altizer", "age": 70, "address": { "number": 6293, "street": "7th St.", "city": "Portland" }, "interests": {{ "Running", "Fishing", "Coffee" }}, "children": [ { "name": "Katherine Altizer", "age": null } ] } }
+{ "a": { "cid": 77, "name": "Chantal Parriera", "age": 78, "address": { "number": 5967, "street": "Lake St.", "city": "San Jose" }, "interests": {{ "Squash", "Movies", "Coffee" }}, "children": [ ] }, "b": { "cid": 984, "name": "Janett Kitchens", "age": 66, "address": { "number": 7558, "street": "View St.", "city": "Mountain View" }, "interests": {{ "Coffee", "Movies", "Squash" }}, "children": [ { "name": "Grayce Kitchens", "age": 14 }, { "name": "Dwayne Kitchens", "age": null }, { "name": "Wilber Kitchens", "age": 51 }, { "name": "Nancey Kitchens", "age": null } ] } }
+{ "a": { "cid": 84, "name": "Huong Kachel", "age": null, "address": null, "interests": {{ "Music", "Tennis", "Base Jumping" }}, "children": [ { "name": "Katlyn Kachel", "age": 40 }, { "name": "Sherman Kachel", "age": null }, { "name": "Susana Kachel", "age": 32 } ] }, "b": { "cid": 633, "name": "Shalon Grauberger", "age": 34, "address": { "number": 765, "street": "Washington St.", "city": "Sunnyvale" }, "interests": {{ "Music", "Base Jumping", "Tennis" }}, "children": [ { "name": "Kris Grauberger", "age": 14 }, { "name": "Stuart Grauberger", "age": 12 }, { "name": "Billy Grauberger", "age": null } ] } }
+{ "a": { "cid": 101, "name": "Meaghan Vandel", "age": null, "address": null, "interests": {{ "Music", "Base Jumping", "Books" }}, "children": [ { "name": "Larissa Vandel", "age": null } ] }, "b": { "cid": 289, "name": "Clarence Milette", "age": 16, "address": { "number": 3778, "street": "Oak St.", "city": "Seattle" }, "interests": {{ "Books", "Base Jumping", "Music" }}, "children": [ ] } }
+{ "a": { "cid": 106, "name": "Charles Verna", "age": null, "address": null, "interests": {{ "Bass", "Books" }}, "children": [ { "name": "Betsy Verna", "age": 37 }, { "name": "Chae Verna", "age": 35 }, { "name": "Naoma Verna", "age": 42 } ] }, "b": { "cid": 394, "name": "Lizette Roux", "age": 57, "address": { "number": 458, "street": "Hill St.", "city": "Los Angeles" }, "interests": {{ "Bass", "Books" }}, "children": [ { "name": "Doloris Roux", "age": null } ] } }
+{ "a": { "cid": 106, "name": "Charles Verna", "age": null, "address": null, "interests": {{ "Bass", "Books" }}, "children": [ { "name": "Betsy Verna", "age": 37 }, { "name": "Chae Verna", "age": 35 }, { "name": "Naoma Verna", "age": 42 } ] }, "b": { "cid": 523, "name": "Johanne Huls", "age": null, "address": null, "interests": {{ "Books", "Bass" }}, "children": [ { "name": "Melynda Huls", "age": null }, { "name": "Vicky Huls", "age": 16 }, { "name": "Charlott Huls", "age": null } ] } }
+{ "a": { "cid": 119, "name": "Chan Morreau", "age": 22, "address": { "number": 1774, "street": "Lake St.", "city": "Mountain View" }, "interests": {{ "Puzzles", "Squash" }}, "children": [ { "name": "Arlette Morreau", "age": null } ] }, "b": { "cid": 592, "name": "Rachelle Spare", "age": 13, "address": { "number": 8088, "street": "Oak St.", "city": "Portland" }, "interests": {{ "Squash", "Puzzles" }}, "children": [ { "name": "Theo Spare", "age": null }, { "name": "Shizue Spare", "age": null } ] } }
+{ "a": { "cid": 132, "name": "Cindi Turntine", "age": 64, "address": { "number": 9432, "street": "Park St.", "city": "Portland" }, "interests": {{ "Computers", "Wine" }}, "children": [ { "name": "Howard Turntine", "age": null } ] }, "b": { "cid": 177, "name": "Wilda Hanisch", "age": null, "address": null, "interests": {{ "Wine", "Computers" }}, "children": [ { "name": "Shannan Hanisch", "age": null }, { "name": "Marissa Hanisch", "age": 30 }, { "name": "Keely Hanisch", "age": 54 }, { "name": "Humberto Hanisch", "age": 17 } ] } }
+{ "a": { "cid": 132, "name": "Cindi Turntine", "age": 64, "address": { "number": 9432, "street": "Park St.", "city": "Portland" }, "interests": {{ "Computers", "Wine" }}, "children": [ { "name": "Howard Turntine", "age": null } ] }, "b": { "cid": 716, "name": "Deirdre Bruderer", "age": null, "address": null, "interests": {{ "Computers", "Wine" }}, "children": [ { "name": "Coralee Bruderer", "age": null }, { "name": "Mina Bruderer", "age": null }, { "name": "Lindsey Bruderer", "age": 35 }, { "name": "Yi Bruderer", "age": null } ] } }
+{ "a": { "cid": 132, "name": "Cindi Turntine", "age": 64, "address": { "number": 9432, "street": "Park St.", "city": "Portland" }, "interests": {{ "Computers", "Wine" }}, "children": [ { "name": "Howard Turntine", "age": null } ] }, "b": { "cid": 890, "name": "Janise Maccarthy", "age": 66, "address": { "number": 7337, "street": "Main St.", "city": "San Jose" }, "interests": {{ "Wine", "Computers" }}, "children": [ ] } }
+{ "a": { "cid": 138, "name": "Ora Villafane", "age": null, "address": null, "interests": {{ "Walking", "Cooking" }}, "children": [ { "name": "Deeann Villafane", "age": 22 }, { "name": "Cody Villafane", "age": 47 } ] }, "b": { "cid": 369, "name": "Nickole Dory", "age": 10, "address": { "number": 4761, "street": "View St.", "city": "Portland" }, "interests": {{ "Walking", "Cooking" }}, "children": [ { "name": "Annmarie Dory", "age": null }, { "name": "Michele Dory", "age": null }, { "name": "Annamae Dory", "age": null }, { "name": "Flora Dory", "age": null } ] } }
+{ "a": { "cid": 138, "name": "Ora Villafane", "age": null, "address": null, "interests": {{ "Walking", "Cooking" }}, "children": [ { "name": "Deeann Villafane", "age": 22 }, { "name": "Cody Villafane", "age": 47 } ] }, "b": { "cid": 816, "name": "Cheyenne Eddie", "age": null, "address": null, "interests": {{ "Walking", "Cooking" }}, "children": [ { "name": "Kathe Eddie", "age": null }, { "name": "Charles Eddie", "age": null } ] } }
+{ "a": { "cid": 144, "name": "Celesta Sosebee", "age": 19, "address": { "number": 2683, "street": "7th St.", "city": "Portland" }, "interests": {{ "Databases", "Databases" }}, "children": [ { "name": "Jesse Sosebee", "age": null }, { "name": "Oralee Sosebee", "age": null }, { "name": "Sunday Sosebee", "age": null } ] }, "b": { "cid": 513, "name": "Marianna Gortman", "age": 49, "address": { "number": 927, "street": "Cedar St.", "city": "San Jose" }, "interests": {{ "Databases", "Databases" }}, "children": [ ] } }
+{ "a": { "cid": 144, "name": "Celesta Sosebee", "age": 19, "address": { "number": 2683, "street": "7th St.", "city": "Portland" }, "interests": {{ "Databases", "Databases" }}, "children": [ { "name": "Jesse Sosebee", "age": null }, { "name": "Oralee Sosebee", "age": null }, { "name": "Sunday Sosebee", "age": null } ] }, "b": { "cid": 520, "name": "Janay Bernbeck", "age": null, "address": null, "interests": {{ "Databases", "Databases" }}, "children": [ { "name": "Aurea Bernbeck", "age": null }, { "name": "Tiara Bernbeck", "age": null }, { "name": "Alfredia Bernbeck", "age": 26 } ] } }
+{ "a": { "cid": 146, "name": "Glennis Vanruiten", "age": 14, "address": { "number": 8272, "street": "Park St.", "city": "Los Angeles" }, "interests": {{ "Squash", "Databases" }}, "children": [ { "name": "Joanie Vanruiten", "age": null }, { "name": "Long Vanruiten", "age": null }, { "name": "Abdul Vanruiten", "age": null } ] }, "b": { "cid": 532, "name": "Tania Fraklin", "age": 38, "address": { "number": 2857, "street": "Washington St.", "city": "Seattle" }, "interests": {{ "Squash", "Databases" }}, "children": [ ] } }
+{ "a": { "cid": 177, "name": "Wilda Hanisch", "age": null, "address": null, "interests": {{ "Wine", "Computers" }}, "children": [ { "name": "Shannan Hanisch", "age": null }, { "name": "Marissa Hanisch", "age": 30 }, { "name": "Keely Hanisch", "age": 54 }, { "name": "Humberto Hanisch", "age": 17 } ] }, "b": { "cid": 716, "name": "Deirdre Bruderer", "age": null, "address": null, "interests": {{ "Computers", "Wine" }}, "children": [ { "name": "Coralee Bruderer", "age": null }, { "name": "Mina Bruderer", "age": null }, { "name": "Lindsey Bruderer", "age": 35 }, { "name": "Yi Bruderer", "age": null } ] } }
+{ "a": { "cid": 177, "name": "Wilda Hanisch", "age": null, "address": null, "interests": {{ "Wine", "Computers" }}, "children": [ { "name": "Shannan Hanisch", "age": null }, { "name": "Marissa Hanisch", "age": 30 }, { "name": "Keely Hanisch", "age": 54 }, { "name": "Humberto Hanisch", "age": 17 } ] }, "b": { "cid": 890, "name": "Janise Maccarthy", "age": 66, "address": { "number": 7337, "street": "Main St.", "city": "San Jose" }, "interests": {{ "Wine", "Computers" }}, "children": [ ] } }
+{ "a": { "cid": 182, "name": "Christiana Westlie", "age": null, "address": null, "interests": {{ "Skiing", "Bass" }}, "children": [ { "name": "Ilda Westlie", "age": 18 } ] }, "b": { "cid": 730, "name": "Marti Vandoren", "age": null, "address": null, "interests": {{ "Skiing", "Bass" }}, "children": [ { "name": "Carroll Vandoren", "age": null }, { "name": "Lorretta Vandoren", "age": 30 }, { "name": "Chloe Vandoren", "age": 42 }, { "name": "Ilona Vandoren", "age": null } ] } }
+{ "a": { "cid": 182, "name": "Christiana Westlie", "age": null, "address": null, "interests": {{ "Skiing", "Bass" }}, "children": [ { "name": "Ilda Westlie", "age": 18 } ] }, "b": { "cid": 982, "name": "Jude Brandsrud", "age": 41, "address": { "number": 7133, "street": "Washington St.", "city": "Seattle" }, "interests": {{ "Bass", "Skiing" }}, "children": [ { "name": "Scottie Brandsrud", "age": null }, { "name": "Gennie Brandsrud", "age": 10 }, { "name": "Agnes Brandsrud", "age": null }, { "name": "Clarinda Brandsrud", "age": 17 } ] } }
+{ "a": { "cid": 190, "name": "Kristel Axelson", "age": null, "address": null, "interests": {{ "Movies", "Books" }}, "children": [ { "name": "Deja Axelson", "age": null } ] }, "b": { "cid": 295, "name": "Guillermina Florek", "age": 61, "address": { "number": 3704, "street": "Washington St.", "city": "Mountain View" }, "interests": {{ "Movies", "Books" }}, "children": [ { "name": "Donnie Florek", "age": null }, { "name": "Jeannetta Florek", "age": 38 }, { "name": "Leigha Florek", "age": null }, { "name": "Zenobia Florek", "age": 10 } ] } }
+{ "a": { "cid": 190, "name": "Kristel Axelson", "age": null, "address": null, "interests": {{ "Movies", "Books" }}, "children": [ { "name": "Deja Axelson", "age": null } ] }, "b": { "cid": 877, "name": "Nicki Lipkind", "age": null, "address": null, "interests": {{ "Books", "Movies" }}, "children": [ { "name": "Yahaira Lipkind", "age": 12 } ] } }
+{ "a": { "cid": 190, "name": "Kristel Axelson", "age": null, "address": null, "interests": {{ "Movies", "Books" }}, "children": [ { "name": "Deja Axelson", "age": null } ] }, "b": { "cid": 974, "name": "Alexis Malcomson", "age": null, "address": null, "interests": {{ "Movies", "Books" }}, "children": [ { "name": "Kerri Malcomson", "age": null } ] } }
+{ "a": { "cid": 202, "name": "Evangelina Poloskey", "age": 46, "address": { "number": 8285, "street": "Main St.", "city": "Los Angeles" }, "interests": {{ "Wine", "Squash" }}, "children": [ { "name": "Anthony Poloskey", "age": 27 }, { "name": "Olga Poloskey", "age": 10 }, { "name": "Carmon Poloskey", "age": 13 }, { "name": "Tanja Poloskey", "age": 20 } ] }, "b": { "cid": 599, "name": "Alva Molaison", "age": 87, "address": { "number": 5974, "street": "Washington St.", "city": "Seattle" }, "interests": {{ "Wine", "Squash" }}, "children": [ { "name": "Milo Molaison", "age": 39 } ] } }
+{ "a": { "cid": 210, "name": "Jillian Roadruck", "age": null, "address": null, "interests": {{ "Coffee", "Tennis" }}, "children": [ { "name": "Marguerite Roadruck", "age": null }, { "name": "Ilana Roadruck", "age": null }, { "name": "Chantelle Roadruck", "age": 19 }, { "name": "Nikia Roadruck", "age": 43 } ] }, "b": { "cid": 317, "name": "Zona Caffarel", "age": 52, "address": { "number": 9419, "street": "Cedar St.", "city": "Seattle" }, "interests": {{ "Tennis", "Coffee" }}, "children": [ { "name": "Cortez Caffarel", "age": null } ] } }
+{ "a": { "cid": 210, "name": "Jillian Roadruck", "age": null, "address": null, "interests": {{ "Coffee", "Tennis" }}, "children": [ { "name": "Marguerite Roadruck", "age": null }, { "name": "Ilana Roadruck", "age": null }, { "name": "Chantelle Roadruck", "age": 19 }, { "name": "Nikia Roadruck", "age": 43 } ] }, "b": { "cid": 771, "name": "Marisela Tredo", "age": null, "address": null, "interests": {{ "Tennis", "Coffee" }}, "children": [ { "name": "Ardell Tredo", "age": 21 }, { "name": "Evelynn Tredo", "age": 16 } ] } }
+{ "a": { "cid": 214, "name": "Louvenia Zaffalon", "age": null, "address": null, "interests": {{ "Skiing", "Books" }}, "children": [ ] }, "b": { "cid": 270, "name": "Lavon Ascenzo", "age": null, "address": null, "interests": {{ "Books", "Skiing" }}, "children": [ ] } }
+{ "a": { "cid": 215, "name": "Ashton Schadegg", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Ciara Schadegg", "age": null }, { "name": "Karisa Schadegg", "age": 11 }, { "name": "Hayden Schadegg", "age": 44 } ] }, "b": { "cid": 228, "name": "Donnette Brumbley", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Madlyn Brumbley", "age": null }, { "name": "Apolonia Brumbley", "age": 13 }, { "name": "Stephine Brumbley", "age": null }, { "name": "Zelma Brumbley", "age": 51 } ] } }
+{ "a": { "cid": 215, "name": "Ashton Schadegg", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Ciara Schadegg", "age": null }, { "name": "Karisa Schadegg", "age": 11 }, { "name": "Hayden Schadegg", "age": 44 } ] }, "b": { "cid": 731, "name": "Yajaira Orto", "age": null, "address": null, "interests": {{ "Music", "Databases" }}, "children": [ { "name": "Eliz Orto", "age": 17 }, { "name": "Gisela Orto", "age": null } ] } }
+{ "a": { "cid": 215, "name": "Ashton Schadegg", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Ciara Schadegg", "age": null }, { "name": "Karisa Schadegg", "age": 11 }, { "name": "Hayden Schadegg", "age": 44 } ] }, "b": { "cid": 795, "name": "Sharilyn Branstad", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Ashlee Branstad", "age": 24 }, { "name": "Bobbye Branstad", "age": 26 }, { "name": "Natalya Branstad", "age": null }, { "name": "Edith Branstad", "age": null } ] } }
+{ "a": { "cid": 218, "name": "Clarinda Stagliano", "age": 76, "address": { "number": 3258, "street": "Park St.", "city": "San Jose" }, "interests": {{ "Video Games", "Cigars" }}, "children": [ ] }, "b": { "cid": 271, "name": "Carey Ronin", "age": 44, "address": { "number": 8141, "street": "Oak St.", "city": "Mountain View" }, "interests": {{ "Cigars", "Video Games" }}, "children": [ { "name": "Lonny Ronin", "age": null }, { "name": "Armanda Ronin", "age": null } ] } }
+{ "a": { "cid": 218, "name": "Clarinda Stagliano", "age": 76, "address": { "number": 3258, "street": "Park St.", "city": "San Jose" }, "interests": {{ "Video Games", "Cigars" }}, "children": [ ] }, "b": { "cid": 689, "name": "Camila Cho", "age": 70, "address": { "number": 7731, "street": "Cedar St.", "city": "Mountain View" }, "interests": {{ "Video Games", "Cigars" }}, "children": [ { "name": "Myrtie Cho", "age": 57 }, { "name": "Merideth Cho", "age": 45 }, { "name": "Meta Cho", "age": 20 } ] } }
+{ "a": { "cid": 222, "name": "Malcom Bloomgren", "age": 39, "address": { "number": 4674, "street": "Hill St.", "city": "Mountain View" }, "interests": {{ "Databases", "Skiing" }}, "children": [ { "name": "Rosia Bloomgren", "age": null }, { "name": "Bryant Bloomgren", "age": 15 }, { "name": "Donnie Bloomgren", "age": null } ] }, "b": { "cid": 322, "name": "Jaclyn Ettl", "age": 83, "address": { "number": 4500, "street": "Main St.", "city": "Sunnyvale" }, "interests": {{ "Databases", "Skiing" }}, "children": [ { "name": "Noah Ettl", "age": 30 }, { "name": "Kesha Ettl", "age": null } ] } }
+{ "a": { "cid": 223, "name": "Margurite Embelton", "age": 19, "address": { "number": 554, "street": "Oak St.", "city": "Portland" }, "interests": {{ "Running", "Fishing" }}, "children": [ { "name": "Sherie Embelton", "age": null }, { "name": "Monica Embelton", "age": null }, { "name": "Jeanne Embelton", "age": null }, { "name": "Santiago Embelton", "age": null } ] }, "b": { "cid": 571, "name": "Lenita Tentler", "age": null, "address": null, "interests": {{ "Running", "Fishing" }}, "children": [ { "name": "Damian Tentler", "age": 16 }, { "name": "Camellia Tentler", "age": null }, { "name": "Vern Tentler", "age": 15 } ] } }
+{ "a": { "cid": 228, "name": "Donnette Brumbley", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Madlyn Brumbley", "age": null }, { "name": "Apolonia Brumbley", "age": 13 }, { "name": "Stephine Brumbley", "age": null }, { "name": "Zelma Brumbley", "age": 51 } ] }, "b": { "cid": 731, "name": "Yajaira Orto", "age": null, "address": null, "interests": {{ "Music", "Databases" }}, "children": [ { "name": "Eliz Orto", "age": 17 }, { "name": "Gisela Orto", "age": null } ] } }
+{ "a": { "cid": 228, "name": "Donnette Brumbley", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Madlyn Brumbley", "age": null }, { "name": "Apolonia Brumbley", "age": 13 }, { "name": "Stephine Brumbley", "age": null }, { "name": "Zelma Brumbley", "age": 51 } ] }, "b": { "cid": 795, "name": "Sharilyn Branstad", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Ashlee Branstad", "age": 24 }, { "name": "Bobbye Branstad", "age": 26 }, { "name": "Natalya Branstad", "age": null }, { "name": "Edith Branstad", "age": null } ] } }
+{ "a": { "cid": 241, "name": "Lesha Ambrosia", "age": 49, "address": { "number": 6133, "street": "Cedar St.", "city": "Portland" }, "interests": {{ "Base Jumping", "Running" }}, "children": [ { "name": "Venice Ambrosia", "age": null } ] }, "b": { "cid": 277, "name": "Malena Smock", "age": null, "address": null, "interests": {{ "Running", "Base Jumping" }}, "children": [ { "name": "Inocencia Smock", "age": 50 }, { "name": "Cleveland Smock", "age": null } ] } }
+{ "a": { "cid": 241, "name": "Lesha Ambrosia", "age": 49, "address": { "number": 6133, "street": "Cedar St.", "city": "Portland" }, "interests": {{ "Base Jumping", "Running" }}, "children": [ { "name": "Venice Ambrosia", "age": null } ] }, "b": { "cid": 543, "name": "Pearl Nollette", "age": null, "address": null, "interests": {{ "Base Jumping", "Running" }}, "children": [ ] } }
+{ "a": { "cid": 254, "name": "Jeanice Longanecker", "age": 74, "address": { "number": 2613, "street": "Oak St.", "city": "San Jose" }, "interests": {{ "Books", "Base Jumping" }}, "children": [ ] }, "b": { "cid": 467, "name": "Magali Ingerson", "age": null, "address": null, "interests": {{ "Books", "Base Jumping" }}, "children": [ { "name": "Monty Ingerson", "age": 11 }, { "name": "Noelia Ingerson", "age": 47 }, { "name": "Tennie Ingerson", "age": null }, { "name": "Merrill Ingerson", "age": null } ] } }
+{ "a": { "cid": 254, "name": "Jeanice Longanecker", "age": 74, "address": { "number": 2613, "street": "Oak St.", "city": "San Jose" }, "interests": {{ "Books", "Base Jumping" }}, "children": [ ] }, "b": { "cid": 632, "name": "Keeley Goga", "age": null, "address": null, "interests": {{ "Books", "Base Jumping" }}, "children": [ { "name": "Walter Goga", "age": 39 }, { "name": "Chaya Goga", "age": null }, { "name": "Melodie Goga", "age": null }, { "name": "Isidro Goga", "age": 32 } ] } }
+{ "a": { "cid": 259, "name": "Aurelio Darrigo", "age": 45, "address": { "number": 1114, "street": "Park St.", "city": "San Jose" }, "interests": {{ "Cooking", "Running" }}, "children": [ { "name": "Leonard Darrigo", "age": 22 }, { "name": "Aron Darrigo", "age": null }, { "name": "Pamelia Darrigo", "age": 14 } ] }, "b": { "cid": 379, "name": "Penney Huslander", "age": 58, "address": { "number": 6919, "street": "7th St.", "city": "Portland" }, "interests": {{ "Cooking", "Running" }}, "children": [ { "name": "Magaret Huslander", "age": null }, { "name": "Dodie Huslander", "age": 14 } ] } }
+{ "a": { "cid": 260, "name": "Hedwig Caminero", "age": 81, "address": { "number": 4305, "street": "7th St.", "city": "Portland" }, "interests": {{ "Video Games", "Databases" }}, "children": [ { "name": "Hal Caminero", "age": null }, { "name": "Cierra Caminero", "age": 32 } ] }, "b": { "cid": 298, "name": "Brittny Christin", "age": null, "address": null, "interests": {{ "Databases", "Video Games" }}, "children": [ { "name": "Hilario Christin", "age": null }, { "name": "Clarine Christin", "age": null } ] } }
+{ "a": { "cid": 260, "name": "Hedwig Caminero", "age": 81, "address": { "number": 4305, "street": "7th St.", "city": "Portland" }, "interests": {{ "Video Games", "Databases" }}, "children": [ { "name": "Hal Caminero", "age": null }, { "name": "Cierra Caminero", "age": 32 } ] }, "b": { "cid": 591, "name": "Matthew Tenhaeff", "age": null, "address": null, "interests": {{ "Databases", "Video Games" }}, "children": [ { "name": "Jan Tenhaeff", "age": 25 }, { "name": "Nana Tenhaeff", "age": null }, { "name": "Laticia Tenhaeff", "age": null }, { "name": "Ara Tenhaeff", "age": 44 } ] } }
+{ "a": { "cid": 271, "name": "Carey Ronin", "age": 44, "address": { "number": 8141, "street": "Oak St.", "city": "Mountain View" }, "interests": {{ "Cigars", "Video Games" }}, "children": [ { "name": "Lonny Ronin", "age": null }, { "name": "Armanda Ronin", "age": null } ] }, "b": { "cid": 689, "name": "Camila Cho", "age": 70, "address": { "number": 7731, "street": "Cedar St.", "city": "Mountain View" }, "interests": {{ "Video Games", "Cigars" }}, "children": [ { "name": "Myrtie Cho", "age": 57 }, { "name": "Merideth Cho", "age": 45 }, { "name": "Meta Cho", "age": 20 } ] } }
+{ "a": { "cid": 277, "name": "Malena Smock", "age": null, "address": null, "interests": {{ "Running", "Base Jumping" }}, "children": [ { "name": "Inocencia Smock", "age": 50 }, { "name": "Cleveland Smock", "age": null } ] }, "b": { "cid": 543, "name": "Pearl Nollette", "age": null, "address": null, "interests": {{ "Base Jumping", "Running" }}, "children": [ ] } }
+{ "a": { "cid": 285, "name": "Edgar Farlin", "age": 75, "address": { "number": 3833, "street": "Lake St.", "city": "Sunnyvale" }, "interests": {{ "Coffee", "Databases" }}, "children": [ { "name": "Stefanie Farlin", "age": 60 }, { "name": "Catina Farlin", "age": null }, { "name": "Lizzie Farlin", "age": null }, { "name": "Beau Farlin", "age": null } ] }, "b": { "cid": 805, "name": "Gaylord Ginder", "age": null, "address": null, "interests": {{ "Databases", "Coffee" }}, "children": [ { "name": "Lucina Ginder", "age": null }, { "name": "Harriett Ginder", "age": null } ] } }
+{ "a": { "cid": 295, "name": "Guillermina Florek", "age": 61, "address": { "number": 3704, "street": "Washington St.", "city": "Mountain View" }, "interests": {{ "Movies", "Books" }}, "children": [ { "name": "Donnie Florek", "age": null }, { "name": "Jeannetta Florek", "age": 38 }, { "name": "Leigha Florek", "age": null }, { "name": "Zenobia Florek", "age": 10 } ] }, "b": { "cid": 877, "name": "Nicki Lipkind", "age": null, "address": null, "interests": {{ "Books", "Movies" }}, "children": [ { "name": "Yahaira Lipkind", "age": 12 } ] } }
+{ "a": { "cid": 295, "name": "Guillermina Florek", "age": 61, "address": { "number": 3704, "street": "Washington St.", "city": "Mountain View" }, "interests": {{ "Movies", "Books" }}, "children": [ { "name": "Donnie Florek", "age": null }, { "name": "Jeannetta Florek", "age": 38 }, { "name": "Leigha Florek", "age": null }, { "name": "Zenobia Florek", "age": 10 } ] }, "b": { "cid": 974, "name": "Alexis Malcomson", "age": null, "address": null, "interests": {{ "Movies", "Books" }}, "children": [ { "name": "Kerri Malcomson", "age": null } ] } }
+{ "a": { "cid": 298, "name": "Brittny Christin", "age": null, "address": null, "interests": {{ "Databases", "Video Games" }}, "children": [ { "name": "Hilario Christin", "age": null }, { "name": "Clarine Christin", "age": null } ] }, "b": { "cid": 591, "name": "Matthew Tenhaeff", "age": null, "address": null, "interests": {{ "Databases", "Video Games" }}, "children": [ { "name": "Jan Tenhaeff", "age": 25 }, { "name": "Nana Tenhaeff", "age": null }, { "name": "Laticia Tenhaeff", "age": null }, { "name": "Ara Tenhaeff", "age": 44 } ] } }
+{ "a": { "cid": 304, "name": "Francine Reddin", "age": 39, "address": { "number": 9392, "street": "Hill St.", "city": "Seattle" }, "interests": {{ "Music", "Base Jumping" }}, "children": [ { "name": "Millicent Reddin", "age": null } ] }, "b": { "cid": 501, "name": "Alyce Coant", "age": null, "address": null, "interests": {{ "Music", "Base Jumping" }}, "children": [ { "name": "Elyse Coant", "age": 50 } ] } }
+{ "a": { "cid": 309, "name": "Lise Baiz", "age": 46, "address": { "number": 352, "street": "Oak St.", "city": "San Jose" }, "interests": {{ "Bass", "Squash" }}, "children": [ { "name": "Alisa Baiz", "age": 18 }, { "name": "Elidia Baiz", "age": 28 }, { "name": "Ray Baiz", "age": 19 } ] }, "b": { "cid": 713, "name": "Galina Retterbush", "age": null, "address": null, "interests": {{ "Bass", "Squash" }}, "children": [ { "name": "Janene Retterbush", "age": null }, { "name": "Toby Retterbush", "age": 15 }, { "name": "Renato Retterbush", "age": null }, { "name": "Annice Retterbush", "age": 22 } ] } }
+{ "a": { "cid": 315, "name": "Kallie Eiselein", "age": null, "address": null, "interests": {{ "Computers", "Tennis" }}, "children": [ ] }, "b": { "cid": 737, "name": "Jeffrey Chesson", "age": 13, "address": { "number": 6833, "street": "Lake St.", "city": "Portland" }, "interests": {{ "Tennis", "Computers" }}, "children": [ { "name": "Clayton Chesson", "age": null }, { "name": "Yi Chesson", "age": null } ] } }
+{ "a": { "cid": 317, "name": "Zona Caffarel", "age": 52, "address": { "number": 9419, "street": "Cedar St.", "city": "Seattle" }, "interests": {{ "Tennis", "Coffee" }}, "children": [ { "name": "Cortez Caffarel", "age": null } ] }, "b": { "cid": 771, "name": "Marisela Tredo", "age": null, "address": null, "interests": {{ "Tennis", "Coffee" }}, "children": [ { "name": "Ardell Tredo", "age": 21 }, { "name": "Evelynn Tredo", "age": 16 } ] } }
+{ "a": { "cid": 347, "name": "Patrick Feighan", "age": 34, "address": { "number": 7613, "street": "Cedar St.", "city": "Los Angeles" }, "interests": {{ "Puzzles", "Books" }}, "children": [ { "name": "Madaline Feighan", "age": null } ] }, "b": { "cid": 480, "name": "Nigel Pitmon", "age": null, "address": null, "interests": {{ "Puzzles", "Books" }}, "children": [ { "name": "Janene Pitmon", "age": null }, { "name": "Louie Pitmon", "age": 19 }, { "name": "Genny Pitmon", "age": 24 }, { "name": "Robby Pitmon", "age": 55 } ] } }
+{ "a": { "cid": 347, "name": "Patrick Feighan", "age": 34, "address": { "number": 7613, "street": "Cedar St.", "city": "Los Angeles" }, "interests": {{ "Puzzles", "Books" }}, "children": [ { "name": "Madaline Feighan", "age": null } ] }, "b": { "cid": 860, "name": "Isabelle Sept", "age": 88, "address": { "number": 4382, "street": "Washington St.", "city": "Portland" }, "interests": {{ "Puzzles", "Books" }}, "children": [ ] } }
+{ "a": { "cid": 355, "name": "Elois Leckband", "age": null, "address": null, "interests": {{ "Skiing", "Wine" }}, "children": [ ] }, "b": { "cid": 635, "name": "Angelena Braegelmann", "age": 36, "address": { "number": 4158, "street": "Park St.", "city": "San Jose" }, "interests": {{ "Wine", "Skiing" }}, "children": [ { "name": "Daisey Braegelmann", "age": 18 }, { "name": "Gaston Braegelmann", "age": 19 }, { "name": "Louella Braegelmann", "age": null }, { "name": "Leonie Braegelmann", "age": null } ] } }
+{ "a": { "cid": 367, "name": "Cassondra Fabiani", "age": null, "address": null, "interests": {{ "Squash", "Tennis" }}, "children": [ { "name": "Evia Fabiani", "age": null }, { "name": "Chaya Fabiani", "age": null }, { "name": "Sherman Fabiani", "age": null }, { "name": "Kathi Fabiani", "age": 54 } ] }, "b": { "cid": 503, "name": "Phyliss Cassani", "age": null, "address": null, "interests": {{ "Squash", "Tennis" }}, "children": [ { "name": "Rolando Cassani", "age": 44 }, { "name": "Rikki Cassani", "age": 18 }, { "name": "Monty Cassani", "age": 40 } ] } }
+{ "a": { "cid": 369, "name": "Nickole Dory", "age": 10, "address": { "number": 4761, "street": "View St.", "city": "Portland" }, "interests": {{ "Walking", "Cooking" }}, "children": [ { "name": "Annmarie Dory", "age": null }, { "name": "Michele Dory", "age": null }, { "name": "Annamae Dory", "age": null }, { "name": "Flora Dory", "age": null } ] }, "b": { "cid": 816, "name": "Cheyenne Eddie", "age": null, "address": null, "interests": {{ "Walking", "Cooking" }}, "children": [ { "name": "Kathe Eddie", "age": null }, { "name": "Charles Eddie", "age": null } ] } }
+{ "a": { "cid": 378, "name": "Melany Matias", "age": 10, "address": { "number": 8838, "street": "Main St.", "city": "Seattle" }, "interests": {{ "Coffee", "Tennis", "Bass" }}, "children": [ { "name": "Earnestine Matias", "age": null }, { "name": "Lore Matias", "age": null } ] }, "b": { "cid": 545, "name": "Dolores Ferer", "age": null, "address": null, "interests": {{ "Coffee", "Bass", "Tennis" }}, "children": [ { "name": "Bridgette Ferer", "age": null } ] } }
+{ "a": { "cid": 380, "name": "Silva Purdue", "age": 33, "address": { "number": 1759, "street": "7th St.", "city": "Portland" }, "interests": {{ "Music", "Squash" }}, "children": [ { "name": "Marshall Purdue", "age": null }, { "name": "Yuki Purdue", "age": null }, { "name": "Val Purdue", "age": 12 }, { "name": "Dominica Purdue", "age": null } ] }, "b": { "cid": 904, "name": "Holley Tofil", "age": 51, "address": { "number": 8946, "street": "Oak St.", "city": "Mountain View" }, "interests": {{ "Music", "Squash" }}, "children": [ { "name": "Kristal Tofil", "age": null } ] } }
+{ "a": { "cid": 386, "name": "Mao Gradowski", "age": 36, "address": { "number": 5116, "street": "Washington St.", "city": "Mountain View" }, "interests": {{ "Computers", "Fishing" }}, "children": [ { "name": "Jeneva Gradowski", "age": null }, { "name": "Thu Gradowski", "age": 22 }, { "name": "Daphine Gradowski", "age": null }, { "name": "Providencia Gradowski", "age": null } ] }, "b": { "cid": 646, "name": "Pablo Catterton", "age": null, "address": null, "interests": {{ "Fishing", "Computers" }}, "children": [ ] } }
+{ "a": { "cid": 386, "name": "Mao Gradowski", "age": 36, "address": { "number": 5116, "street": "Washington St.", "city": "Mountain View" }, "interests": {{ "Computers", "Fishing" }}, "children": [ { "name": "Jeneva Gradowski", "age": null }, { "name": "Thu Gradowski", "age": 22 }, { "name": "Daphine Gradowski", "age": null }, { "name": "Providencia Gradowski", "age": null } ] }, "b": { "cid": 781, "name": "Christy Darcangelo", "age": 42, "address": { "number": 2178, "street": "Washington St.", "city": "Portland" }, "interests": {{ "Computers", "Fishing" }}, "children": [ { "name": "Luis Darcangelo", "age": 21 }, { "name": "Omega Darcangelo", "age": 26 }, { "name": "Remedios Darcangelo", "age": 28 }, { "name": "Domenic Darcangelo", "age": 21 } ] } }
+{ "a": { "cid": 389, "name": "Loraine Morfee", "age": 72, "address": { "number": 2945, "street": "Lake St.", "city": "Seattle" }, "interests": {{ "Wine", "Walking" }}, "children": [ { "name": "Berry Morfee", "age": 30 } ] }, "b": { "cid": 607, "name": "Bert Garigliano", "age": 71, "address": { "number": 3881, "street": "Washington St.", "city": "San Jose" }, "interests": {{ "Walking", "Wine" }}, "children": [ { "name": "Junior Garigliano", "age": 42 }, { "name": "Willa Garigliano", "age": 21 }, { "name": "Carlo Garigliano", "age": null } ] } }
+{ "a": { "cid": 393, "name": "Rossana Monton", "age": 34, "address": { "number": 4490, "street": "Main St.", "city": "Portland" }, "interests": {{ "Skiing", "Base Jumping" }}, "children": [ { "name": "Glayds Monton", "age": null }, { "name": "Lily Monton", "age": null }, { "name": "Raina Monton", "age": null }, { "name": "Hilma Monton", "age": null } ] }, "b": { "cid": 493, "name": "Lindsey Trout", "age": 86, "address": { "number": 7619, "street": "Cedar St.", "city": "Portland" }, "interests": {{ "Base Jumping", "Skiing" }}, "children": [ { "name": "Madlyn Trout", "age": 58 }, { "name": "Amie Trout", "age": 72 } ] } }
+{ "a": { "cid": 394, "name": "Lizette Roux", "age": 57, "address": { "number": 458, "street": "Hill St.", "city": "Los Angeles" }, "interests": {{ "Bass", "Books" }}, "children": [ { "name": "Doloris Roux", "age": null } ] }, "b": { "cid": 523, "name": "Johanne Huls", "age": null, "address": null, "interests": {{ "Books", "Bass" }}, "children": [ { "name": "Melynda Huls", "age": null }, { "name": "Vicky Huls", "age": 16 }, { "name": "Charlott Huls", "age": null } ] } }
+{ "a": { "cid": 403, "name": "Kayleigh Houey", "age": null, "address": null, "interests": {{ "Fishing", "Music" }}, "children": [ { "name": "Ta Houey", "age": null }, { "name": "Ayana Houey", "age": null }, { "name": "Dominique Houey", "age": null }, { "name": "Denise Houey", "age": 48 } ] }, "b": { "cid": 949, "name": "Elissa Rogue", "age": null, "address": null, "interests": {{ "Fishing", "Music" }}, "children": [ { "name": "Noriko Rogue", "age": 41 }, { "name": "Lavona Rogue", "age": 39 } ] } }
+{ "a": { "cid": 407, "name": "Bebe Cotney", "age": null, "address": null, "interests": {{ "Books", "Tennis" }}, "children": [ { "name": "Daren Cotney", "age": null }, { "name": "Lady Cotney", "age": 48 } ] }, "b": { "cid": 420, "name": "Coralie Regueira", "age": null, "address": null, "interests": {{ "Books", "Tennis" }}, "children": [ { "name": "Latoyia Regueira", "age": 31 }, { "name": "Obdulia Regueira", "age": 12 }, { "name": "Herlinda Regueira", "age": null } ] } }
+{ "a": { "cid": 407, "name": "Bebe Cotney", "age": null, "address": null, "interests": {{ "Books", "Tennis" }}, "children": [ { "name": "Daren Cotney", "age": null }, { "name": "Lady Cotney", "age": 48 } ] }, "b": { "cid": 549, "name": "Kathrin Cruff", "age": 63, "address": { "number": 9002, "street": "Washington St.", "city": "Sunnyvale" }, "interests": {{ "Tennis", "Books" }}, "children": [ { "name": "Candi Cruff", "age": 49 }, { "name": "Barry Cruff", "age": 17 }, { "name": "Shane Cruff", "age": 18 }, { "name": "Brendon Cruff", "age": null } ] } }
+{ "a": { "cid": 420, "name": "Coralie Regueira", "age": null, "address": null, "interests": {{ "Books", "Tennis" }}, "children": [ { "name": "Latoyia Regueira", "age": 31 }, { "name": "Obdulia Regueira", "age": 12 }, { "name": "Herlinda Regueira", "age": null } ] }, "b": { "cid": 549, "name": "Kathrin Cruff", "age": 63, "address": { "number": 9002, "street": "Washington St.", "city": "Sunnyvale" }, "interests": {{ "Tennis", "Books" }}, "children": [ { "name": "Candi Cruff", "age": 49 }, { "name": "Barry Cruff", "age": 17 }, { "name": "Shane Cruff", "age": 18 }, { "name": "Brendon Cruff", "age": null } ] } }
+{ "a": { "cid": 450, "name": "Althea Mohammed", "age": null, "address": null, "interests": {{ "Fishing", "Databases" }}, "children": [ { "name": "Jasper Mohammed", "age": null } ] }, "b": { "cid": 478, "name": "Sophia Whitt", "age": 26, "address": { "number": 2787, "street": "Park St.", "city": "Mountain View" }, "interests": {{ "Fishing", "Databases" }}, "children": [ { "name": "Irving Whitt", "age": 13 }, { "name": "Jeannette Whitt", "age": null } ] } }
+{ "a": { "cid": 452, "name": "Casie Marasigan", "age": null, "address": null, "interests": {{ "Walking", "Computers" }}, "children": [ { "name": "Connie Marasigan", "age": null }, { "name": "Kimberlie Marasigan", "age": null } ] }, "b": { "cid": 573, "name": "Tyree Ketcher", "age": null, "address": null, "interests": {{ "Computers", "Walking" }}, "children": [ { "name": "Aleisha Ketcher", "age": null }, { "name": "Vonda Ketcher", "age": null }, { "name": "Cyndy Ketcher", "age": 13 }, { "name": "Chassidy Ketcher", "age": 30 } ] } }
+{ "a": { "cid": 467, "name": "Magali Ingerson", "age": null, "address": null, "interests": {{ "Books", "Base Jumping" }}, "children": [ { "name": "Monty Ingerson", "age": 11 }, { "name": "Noelia Ingerson", "age": 47 }, { "name": "Tennie Ingerson", "age": null }, { "name": "Merrill Ingerson", "age": null } ] }, "b": { "cid": 632, "name": "Keeley Goga", "age": null, "address": null, "interests": {{ "Books", "Base Jumping" }}, "children": [ { "name": "Walter Goga", "age": 39 }, { "name": "Chaya Goga", "age": null }, { "name": "Melodie Goga", "age": null }, { "name": "Isidro Goga", "age": 32 } ] } }
+{ "a": { "cid": 472, "name": "Kelley Mischler", "age": 38, "address": { "number": 7988, "street": "Lake St.", "city": "Los Angeles" }, "interests": {{ "Movies", "Cooking", "Skiing" }}, "children": [ { "name": "Keila Mischler", "age": 19 }, { "name": "Evie Mischler", "age": 15 } ] }, "b": { "cid": 602, "name": "Clyde Salada", "age": 59, "address": { "number": 8316, "street": "7th St.", "city": "Sunnyvale" }, "interests": {{ "Movies", "Skiing", "Cooking" }}, "children": [ ] } }
+{ "a": { "cid": 480, "name": "Nigel Pitmon", "age": null, "address": null, "interests": {{ "Puzzles", "Books" }}, "children": [ { "name": "Janene Pitmon", "age": null }, { "name": "Louie Pitmon", "age": 19 }, { "name": "Genny Pitmon", "age": 24 }, { "name": "Robby Pitmon", "age": 55 } ] }, "b": { "cid": 860, "name": "Isabelle Sept", "age": 88, "address": { "number": 4382, "street": "Washington St.", "city": "Portland" }, "interests": {{ "Puzzles", "Books" }}, "children": [ ] } }
+{ "a": { "cid": 483, "name": "Elsa Vigen", "age": null, "address": null, "interests": {{ "Wine", "Databases" }}, "children": [ { "name": "Larae Vigen", "age": null }, { "name": "Elwood Vigen", "age": null } ] }, "b": { "cid": 894, "name": "Reginald Julien", "age": 16, "address": { "number": 1107, "street": "Lake St.", "city": "Mountain View" }, "interests": {{ "Databases", "Wine" }}, "children": [ { "name": "Arthur Julien", "age": null }, { "name": "Evia Julien", "age": null } ] } }
+{ "a": { "cid": 484, "name": "Bennie Dragaj", "age": null, "address": null, "interests": {{ "Fishing", "Databases", "Wine" }}, "children": [ { "name": "Viva Dragaj", "age": 13 } ] }, "b": { "cid": 741, "name": "Lesia Risatti", "age": 48, "address": { "number": 7378, "street": "Cedar St.", "city": "Portland" }, "interests": {{ "Fishing", "Wine", "Databases" }}, "children": [ { "name": "Tangela Risatti", "age": null }, { "name": "Leonel Risatti", "age": 33 }, { "name": "Cythia Risatti", "age": 36 } ] } }
+{ "a": { "cid": 484, "name": "Bennie Dragaj", "age": null, "address": null, "interests": {{ "Fishing", "Databases", "Wine" }}, "children": [ { "name": "Viva Dragaj", "age": 13 } ] }, "b": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": {{ "Databases", "Fishing", "Wine" }}, "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] } }
+{ "a": { "cid": 498, "name": "Arleen Sultzer", "age": null, "address": null, "interests": {{ "Coffee", "Movies", "Skiing" }}, "children": [ { "name": "Norine Sultzer", "age": 29 } ] }, "b": { "cid": 875, "name": "Ramon Crepps", "age": null, "address": null, "interests": {{ "Coffee", "Movies", "Skiing" }}, "children": [ { "name": "Elisha Crepps", "age": null } ] } }
+{ "a": { "cid": 502, "name": "Lawana Mulik", "age": 82, "address": { "number": 3071, "street": "Park St.", "city": "Portland" }, "interests": {{ "Cigars", "Cigars" }}, "children": [ { "name": "Carrie Mulik", "age": null }, { "name": "Sharlene Mulik", "age": 33 }, { "name": "Leone Mulik", "age": 46 } ] }, "b": { "cid": 774, "name": "Nadene Rigel", "age": null, "address": null, "interests": {{ "Cigars", "Cigars" }}, "children": [ { "name": "Rebbeca Rigel", "age": 33 } ] } }
+{ "a": { "cid": 508, "name": "Tiffany Kimmey", "age": 64, "address": { "number": 8625, "street": "7th St.", "city": "Mountain View" }, "interests": {{ "Bass", "Walking" }}, "children": [ ] }, "b": { "cid": 796, "name": "Daniele Brisk", "age": null, "address": null, "interests": {{ "Walking", "Bass" }}, "children": [ ] } }
+{ "a": { "cid": 510, "name": "Candace Morello", "age": null, "address": null, "interests": {{ "Wine", "Base Jumping", "Running" }}, "children": [ { "name": "Sandy Morello", "age": 57 }, { "name": "Delois Morello", "age": 15 } ] }, "b": { "cid": 908, "name": "Ferdinand Auila", "age": 82, "address": { "number": 1071, "street": "Lake St.", "city": "Portland" }, "interests": {{ "Base Jumping", "Running", "Wine" }}, "children": [ { "name": "Ai Auila", "age": 69 }, { "name": "Laurel Auila", "age": null } ] } }
+{ "a": { "cid": 513, "name": "Marianna Gortman", "age": 49, "address": { "number": 927, "street": "Cedar St.", "city": "San Jose" }, "interests": {{ "Databases", "Databases" }}, "children": [ ] }, "b": { "cid": 520, "name": "Janay Bernbeck", "age": null, "address": null, "interests": {{ "Databases", "Databases" }}, "children": [ { "name": "Aurea Bernbeck", "age": null }, { "name": "Tiara Bernbeck", "age": null }, { "name": "Alfredia Bernbeck", "age": 26 } ] } }
+{ "a": { "cid": 559, "name": "Carolyne Shiroma", "age": null, "address": null, "interests": {{ "Movies", "Running" }}, "children": [ { "name": "Ying Shiroma", "age": 57 } ] }, "b": { "cid": 681, "name": "Iliana Nagele", "age": null, "address": null, "interests": {{ "Movies", "Running" }}, "children": [ { "name": "Sunny Nagele", "age": 55 }, { "name": "Waltraud Nagele", "age": 39 }, { "name": "Darron Nagele", "age": null } ] } }
+{ "a": { "cid": 560, "name": "Karin Dicesare", "age": null, "address": null, "interests": {{ "Wine", "Puzzles" }}, "children": [ ] }, "b": { "cid": 583, "name": "Bev Yerena", "age": null, "address": null, "interests": {{ "Puzzles", "Wine" }}, "children": [ { "name": "Larhonda Yerena", "age": 45 }, { "name": "Josefina Yerena", "age": null }, { "name": "Sydney Yerena", "age": 42 } ] } }
+{ "a": { "cid": 570, "name": "Lee Basora", "age": null, "address": null, "interests": {{ "Squash", "Cigars" }}, "children": [ ] }, "b": { "cid": 819, "name": "Twanna Finnley", "age": null, "address": null, "interests": {{ "Squash", "Cigars" }}, "children": [ { "name": "Reba Finnley", "age": null }, { "name": "Moises Finnley", "age": null } ] } }
+{ "a": { "cid": 620, "name": "Arielle Mackellar", "age": null, "address": null, "interests": {{ "Cooking", "Bass" }}, "children": [ { "name": "Evelin Mackellar", "age": 17 }, { "name": "Theresa Mackellar", "age": 53 }, { "name": "Ronnie Mackellar", "age": null }, { "name": "Elwanda Mackellar", "age": 54 } ] }, "b": { "cid": 761, "name": "Adele Henrikson", "age": null, "address": null, "interests": {{ "Cooking", "Bass" }}, "children": [ { "name": "Paulina Henrikson", "age": null }, { "name": "David Henrikson", "age": null }, { "name": "Jose Henrikson", "age": null }, { "name": "Meg Henrikson", "age": null } ] } }
+{ "a": { "cid": 636, "name": "Babara Shore", "age": 83, "address": { "number": 9452, "street": "Oak St.", "city": "Los Angeles" }, "interests": {{ "Databases", "Movies", "Tennis" }}, "children": [ { "name": "Candy Shore", "age": 58 }, { "name": "Nanci Shore", "age": null }, { "name": "Asia Shore", "age": null } ] }, "b": { "cid": 992, "name": "Staci Alexandropoul", "age": null, "address": null, "interests": {{ "Databases", "Movies", "Tennis" }}, "children": [ { "name": "Casimira Alexandropoul", "age": null }, { "name": "Kena Alexandropoul", "age": 54 }, { "name": "Ellie Alexandropoul", "age": null }, { "name": "Ambrose Alexandropoul", "age": null } ] } }
+{ "a": { "cid": 646, "name": "Pablo Catterton", "age": null, "address": null, "interests": {{ "Fishing", "Computers" }}, "children": [ ] }, "b": { "cid": 781, "name": "Christy Darcangelo", "age": 42, "address": { "number": 2178, "street": "Washington St.", "city": "Portland" }, "interests": {{ "Computers", "Fishing" }}, "children": [ { "name": "Luis Darcangelo", "age": 21 }, { "name": "Omega Darcangelo", "age": 26 }, { "name": "Remedios Darcangelo", "age": 28 }, { "name": "Domenic Darcangelo", "age": 21 } ] } }
+{ "a": { "cid": 647, "name": "Jodi Dearson", "age": null, "address": null, "interests": {{ "Fishing", "Movies" }}, "children": [ ] }, "b": { "cid": 884, "name": "Laila Marta", "age": null, "address": null, "interests": {{ "Fishing", "Movies" }}, "children": [ { "name": "Carlota Marta", "age": 19 } ] } }
+{ "a": { "cid": 704, "name": "Melodee Clemons", "age": null, "address": null, "interests": {{ "Base Jumping", "Tennis", "Video Games" }}, "children": [ { "name": "Doreatha Clemons", "age": 22 } ] }, "b": { "cid": 812, "name": "Bee Godette", "age": 26, "address": { "number": 1757, "street": "Washington St.", "city": "Portland" }, "interests": {{ "Video Games", "Base Jumping", "Tennis" }}, "children": [ { "name": "Madaline Godette", "age": 10 }, { "name": "Shasta Godette", "age": 15 }, { "name": "Parthenia Godette", "age": 11 }, { "name": "Priscila Godette", "age": 13 } ] } }
+{ "a": { "cid": 716, "name": "Deirdre Bruderer", "age": null, "address": null, "interests": {{ "Computers", "Wine" }}, "children": [ { "name": "Coralee Bruderer", "age": null }, { "name": "Mina Bruderer", "age": null }, { "name": "Lindsey Bruderer", "age": 35 }, { "name": "Yi Bruderer", "age": null } ] }, "b": { "cid": 890, "name": "Janise Maccarthy", "age": 66, "address": { "number": 7337, "street": "Main St.", "city": "San Jose" }, "interests": {{ "Wine", "Computers" }}, "children": [ ] } }
+{ "a": { "cid": 730, "name": "Marti Vandoren", "age": null, "address": null, "interests": {{ "Skiing", "Bass" }}, "children": [ { "name": "Carroll Vandoren", "age": null }, { "name": "Lorretta Vandoren", "age": 30 }, { "name": "Chloe Vandoren", "age": 42 }, { "name": "Ilona Vandoren", "age": null } ] }, "b": { "cid": 982, "name": "Jude Brandsrud", "age": 41, "address": { "number": 7133, "street": "Washington St.", "city": "Seattle" }, "interests": {{ "Bass", "Skiing" }}, "children": [ { "name": "Scottie Brandsrud", "age": null }, { "name": "Gennie Brandsrud", "age": 10 }, { "name": "Agnes Brandsrud", "age": null }, { "name": "Clarinda Brandsrud", "age": 17 } ] } }
+{ "a": { "cid": 731, "name": "Yajaira Orto", "age": null, "address": null, "interests": {{ "Music", "Databases" }}, "children": [ { "name": "Eliz Orto", "age": 17 }, { "name": "Gisela Orto", "age": null } ] }, "b": { "cid": 795, "name": "Sharilyn Branstad", "age": null, "address": null, "interests": {{ "Databases", "Music" }}, "children": [ { "name": "Ashlee Branstad", "age": 24 }, { "name": "Bobbye Branstad", "age": 26 }, { "name": "Natalya Branstad", "age": null }, { "name": "Edith Branstad", "age": null } ] } }
+{ "a": { "cid": 741, "name": "Lesia Risatti", "age": 48, "address": { "number": 7378, "street": "Cedar St.", "city": "Portland" }, "interests": {{ "Fishing", "Wine", "Databases" }}, "children": [ { "name": "Tangela Risatti", "age": null }, { "name": "Leonel Risatti", "age": 33 }, { "name": "Cythia Risatti", "age": 36 } ] }, "b": { "cid": 968, "name": "Alix Levier", "age": 44, "address": { "number": 7241, "street": "Hill St.", "city": "Los Angeles" }, "interests": {{ "Databases", "Fishing", "Wine" }}, "children": [ { "name": "Florentina Levier", "age": null }, { "name": "Hyon Levier", "age": null }, { "name": "Dannielle Levier", "age": null } ] } }
+{ "a": { "cid": 877, "name": "Nicki Lipkind", "age": null, "address": null, "interests": {{ "Books", "Movies" }}, "children": [ { "name": "Yahaira Lipkind", "age": 12 } ] }, "b": { "cid": 974, "name": "Alexis Malcomson", "age": null, "address": null, "interests": {{ "Movies", "Books" }}, "children": [ { "name": "Kerri Malcomson", "age": null } ] } }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join/word-jaccard-inline.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/word-jaccard-inline.adm
new file mode 100644
index 0000000..7e80ba2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/word-jaccard-inline.adm
@@ -0,0 +1,5 @@
+{ "arec": { "id": 5, "dblpid": "books/acm/kim95/DayalHW95", "title": "Active Database Systems.", "authors": "Umeshwar Dayal Eric N. Hanson Jennifer Widom", "misc": "2002-01-03 434-456 1995 Modern Database Systems db/books/collections/kim95.html#DayalHW95" }, "brec": { "id": 98, "csxid": "oai CiteSeerXPSU 10.1.1.49.2910", "title": "Active Database Systems", "authors": "Umeshwar Dayal Eric N. Hanson Jennifer Widom", "misc": "2009-04-12 In Won Kim editor Modern Database Systems The Object Model Integrating a production rules facility into a database system provides a uniform mechanism for a number of advanced database features including integrity constraint enforcement, derived data maintenance, triggers, alerters, protection, version control, and others. In addition, a database system with rule processing capabilities provides a useful platform for large and efficient knowledge-base and expert systems. Database systems with production rules are referred to as active database systems, and the field of active database systems has indeed been active. This chapter summarizes current work in active database systems topics covered include active database rule models and languages, rule execution semantics, and implementation issues. 1 Introduction Conventional database systems are passive they only execute queries or transactions explicitly submitted by a user or an application program. For many applications, however, it is important to monitor situations of interest, and to ... CiteSeerX ACM Press 2009-04-12 2007-11-22 1994 application/postscript text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.49.2910 http //www-db.stanford.edu/pub/papers/book-chapter.ps en 10.1.1.17.1323 10.1.1.143.7196 10.1.1.50.3821 10.1.1.51.9946 10.1.1.41.2030 10.1.1.46.2504 10.1.1.52.4421 10.1.1.38.2083 10.1.1.34.661 10.1.1.103.7630 10.1.1.100.9015 10.1.1.97.1699 10.1.1.107.4220 10.1.1.47.9217 10.1.1.133.7157 10.1.1.101.5051 10.1.1.30.9989 10.1.1.53.6941 10.1.1.50.8529 10.1.1.133.4287 10.1.1.50.7278 10.1.1.10.1688 10.1.1.19.8669 10.1.1.44.7600 10.1.1.144.376 10.1.1.44.1348 10.1.1.47.9998 10.1.1.90.4428 10.1.1.108.344 10.1.1.48.9470 10.1.1.53.5472 10.1.1.52.4872 10.1.1.144.4965 10.1.1.31.7578 10.1.1.32.6426 10.1.1.58.6335 10.1.1.85.8052 10.1.1.93.1931 10.1.1.55.4610 10.1.1.21.3821 10.1.1.26.9208 10.1.1.31.4869 10.1.1.48.1833 10.1.1.83.8628 10.1.1.87.9318 10.1.1.90.2195 10.1.1.36.5184 10.1.1.21.1704 10.1.1.53.1733 10.1.1.90.3181 10.1.1.53.6783 10.1.1.52.6151 10.1.1.104.6911 10.1.1.105.1691 10.1.1.21.1984 10.1.1.23.2775 10.1.1.62.5556 10.1.1.68.9063 10.1.1.74.4746 10.1.1.78.5097 10.1.1.84.743 10.1.1.84.904 10.1.1.87.6019 10.1.1.88.3907 10.1.1.89.9631 10.1.1.90.4147 10.1.1.92.365 10.1.1.100.2747 10.1.1.98.5083 10.1.1.98.6663 10.1.1.99.1894 10.1.1.99.8174 10.1.1.133.8073 10.1.1.52.7823 10.1.1.39.5341 10.1.1.35.3458 10.1.1.26.4620 10.1.1.18.8936 10.1.1.19.3694 10.1.1.12.631 10.1.1.48.6394 Metadata may be used without restrictions as long as the oai identifier remains attached to it." }, "jacc": 1.0f }
+{ "arec": { "id": 25, "dblpid": "books/acm/kim95/RusinkiewiczS95", "title": "Specification and Execution of Transactional Workflows.", "authors": "Marek Rusinkiewicz Amit P. Sheth", "misc": "2004-03-08 592-620 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#RusinkiewiczS95 1995" }, "brec": { "id": 88, "csxid": "oai CiteSeerXPSU 10.1.1.43.3839", "title": "Specification and Execution of Transactional Workflows", "authors": "Marek Rusinkiewicz Amit Sheth", "misc": "2009-04-13 The basic transaction model has evolved over time to incorporate more complex transaction structures and to selectively modify the atomicity and isolation properties. In this chapter we discuss the application of transaction concepts to activities that involve coordinated execution of multiple tasks (possibly of different types) over different processing entities. Such applications are referred to as transactional workflows. In this chapter we discuss the specification of such workflows and the issues involved in their execution. 1 What is a Workflow? Workflows are activities involving the coordinated execution of multiple tasks performed by different processing entities. A task defines some work to be done and can be specified in a number of ways, including a textual description in a file or an email, a form, a message, or a computer program. A processing entity that performs the tasks may be a person or a software system (e.g., a mailer, an application program, a database mana... CiteSeerX ACM Press 2009-04-13 2007-11-22 1995 application/postscript text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.43.3839 http //lsdis.cs.uga.edu/lib/././download/RS93.ps en 10.1.1.17.1323 10.1.1.59.5051 10.1.1.38.6210 10.1.1.68.7445 10.1.1.109.5175 10.1.1.17.7962 10.1.1.44.7778 10.1.1.112.244 10.1.1.13.7602 10.1.1.102.7874 10.1.1.41.4043 10.1.1.49.5143 10.1.1.41.7252 10.1.1.17.3225 10.1.1.54.7761 10.1.1.55.5255 10.1.1.108.958 10.1.1.35.7733 10.1.1.52.3682 10.1.1.36.1618 10.1.1.45.6317 10.1.1.43.3180 10.1.1.35.8718 10.1.1.44.6365 10.1.1.51.2883 10.1.1.50.9206 10.1.1.6.9085 10.1.1.30.1707 10.1.1.80.6634 10.1.1.49.355 10.1.1.127.3550 10.1.1.35.3562 10.1.1.137.8832 10.1.1.49.4085 10.1.1.41.5506 10.1.1.40.4657 10.1.1.43.2369 10.1.1.40.832 10.1.1.74.5411 10.1.1.90.4428 10.1.1.110.6967 10.1.1.27.2122 10.1.1.15.5605 10.1.1.54.727 10.1.1.49.7512 10.1.1.45.8796 10.1.1.50.5984 10.1.1.53.137 10.1.1.30.3262 10.1.1.28.1680 10.1.1.21.7110 10.1.1.29.3148 10.1.1.57.687 10.1.1.59.5924 10.1.1.46.2812 10.1.1.51.5552 10.1.1.17.7375 10.1.1.40.1598 10.1.1.52.9787 10.1.1.1.3496 10.1.1.50.6791 10.1.1.55.3358 10.1.1.137.7582 10.1.1.118.4127 10.1.1.49.3580 10.1.1.35.5825 10.1.1.46.9382 10.1.1.31.7411 10.1.1.48.5504 10.1.1.55.5163 10.1.1.18.1603 10.1.1.52.8129 10.1.1.1.9723 10.1.1.21.9113 10.1.1.49.7644 10.1.1.52.6646 10.1.1.75.3106 10.1.1.80.2072 10.1.1.55.8770 10.1.1.54.8188 10.1.1.101.7919 10.1.1.104.8176 10.1.1.24.5741 10.1.1.29.4667 10.1.1.4.1055 10.1.1.48.9175 10.1.1.56.792 10.1.1.65.3172 10.1.1.66.5947 10.1.1.73.8532 10.1.1.83.8299 10.1.1.86.8521 10.1.1.87.2402 10.1.1.87.4648 10.1.1.90.5638 10.1.1.91.1709 10.1.1.94.4248 10.1.1.114.511 10.1.1.119.5037 10.1.1.124.7957 10.1.1.49.215 10.1.1.53.7777 10.1.1.53.9711 10.1.1.45.9409 10.1.1.40.8789 10.1.1.43.4845 10.1.1.34.8273 10.1.1.35.4783 10.1.1.28.3176 10.1.1.16.8151 10.1.1.8.9117 10.1.1.58.3449 10.1.1.142.7041 Metadata may be used without restrictions as long as the oai identifier remains attached to it." }, "jacc": 1.0f }
+{ "arec": { "id": 51, "dblpid": "books/aw/kimL89/NierstraszT89", "title": "Integrated Office Systems.", "authors": "Oscar Nierstrasz Dennis Tsichritzis", "misc": "2002-01-03 199-215 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#NierstraszT89" }, "brec": { "id": 92, "csxid": "oai CiteSeerXPSU 10.1.1.13.2374", "title": "Integrated Office Systems", "authors": "O. M. Nierstrasz D. C. Tsichritzis", "misc": "2009-04-17 Introduction New techniques are sorely needed to aid in the development and maintenance of large application systems. The problem with traditional approaches to software engineering is well in evidence in the field of o#ce information systems it is costly and di#cult to extend existing applications, and to get unrelated applications to \"talk\" to each other. The objectoriented approach is already being tentatively applied in the modeling of \"o#ce objects\" and in the presentation of these entities to users as such in \"desktop\" interfaces to o#ce software. In order to fully exploit the approach to achieve integrated o#ce systems, we need to use object-oriented programming languages, object-oriented run-time support, and object-oriented software engineering environments. We can view the fundamental idea behind the object-oriented approach as that of encapsulation object-oriented languages and systems exploit encapsulation in various ways in an attempt to enhance productivity through, f CiteSeerX 2009-04-17 2007-11-21 1988 application/pdf text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.13.2374 http //www.iam.unibe.ch/~scg/Archive/OSG/Nier89bIntegOfficeSystems.pdf en 10.1.1.26.9545 10.1.1.65.5865 10.1.1.34.624 10.1.1.12.8544 10.1.1.144.6983 10.1.1.26.6746 10.1.1.49.3064 10.1.1.30.4607 10.1.1.38.4894 10.1.1.20.8197 10.1.1.26.4381 10.1.1.29.1890 Metadata may be used without restrictions as long as the oai identifier remains attached to it." }, "jacc": 1.0f }
+{ "arec": { "id": 51, "dblpid": "books/aw/kimL89/NierstraszT89", "title": "Integrated Office Systems.", "authors": "Oscar Nierstrasz Dennis Tsichritzis", "misc": "2002-01-03 199-215 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#NierstraszT89" }, "brec": { "id": 93, "csxid": "oai CiteSeerXPSU 10.1.1.42.9253", "title": "Integrated Office Systems", "authors": "O. M. Nierstrasz D. C. Tsichritzis", "misc": "2009-04-11 Introduction New techniques are sorely needed to aid in the development and maintenance of large application systems. The problem with traditional approaches to software engineering is well in evidence in the field of office information systems it is costly and difficult to extend existing applications, and to get unrelated applications to \"talk\" to each other. The objectoriented approach is already being tentatively applied in the modeling of \"office objects\" and in the presentation of these entities to users as such in \"desktop\" interfaces to office software. In order to fully exploit the approach to achieve integrated office systems, we need to use object-oriented programming languages, object-oriented run-time support, and object-oriented software engineering environments. We can view the fundamental idea behind the object-oriented approach as that of encapsulation object-oriented languages and systems exploit encapsulation in various ways in an attempt t CiteSeerX ACM Press and Addison-Wesley 2009-04-11 2007-11-22 1988 application/postscript text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.42.9253 ftp //ftp.iam.unibe.ch/pub/scg/Papers/integratedOfficeSystems.ps.gz en 10.1.1.26.9545 10.1.1.65.5865 10.1.1.34.624 10.1.1.12.8544 10.1.1.144.6983 10.1.1.26.6746 10.1.1.49.3064 10.1.1.30.4607 10.1.1.38.4894 10.1.1.20.8197 10.1.1.26.4381 10.1.1.29.1890 Metadata may be used without restrictions as long as the oai identifier remains attached to it." }, "jacc": 1.0f }
+{ "arec": { "id": 54, "dblpid": "books/aw/kimL89/SteinLU89", "title": "A Shared View of Sharing The Treaty of Orlando.", "authors": "Lynn Andrea Stein Henry Lieberman David Ungar", "misc": "2002-01-03 31-48 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#SteinLU89" }, "brec": { "id": 91, "csxid": "oai CiteSeerXPSU 10.1.1.55.482", "title": "A Shared View of Sharing The Treaty of Orlando", "authors": "Lynn Andrea Stein Henry Lieberman David Ungar", "misc": "2009-04-12 Introduction For the past few years, researchers have been debating the relative merits of object-oriented languages with classes and inheritance as opposed to those with prototypes and delegation. It has become clear that the object-oriented programming language design space is not a dichotomy. Instead, we have identified two fundamental mechanisms---templates and empathy---and several different independent degrees of freedom for each. Templates create new objects in their own image, providing guarantees about the similarity of group members. Empathy allows an object to act as if it were some other object, thus providing sharing of state and behavior. The Smalltalk-80 TM language, 1 Actors, Lieberman's Delegation system, Self, and Hybrid each take differing stands on the forms of templates 1 Smalltalk-80 TM is a trademark of Par CiteSeerX ACM Press 2009-04-12 2007-11-22 1989 application/postscript text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.55.482 http //lcs.www.media.mit.edu/people/lieber/Lieberary/OOP/Treaty/Treaty.ps en 10.1.1.26.9545 10.1.1.118.6579 10.1.1.48.69 10.1.1.57.5195 10.1.1.9.570 10.1.1.47.511 10.1.1.127.5320 10.1.1.100.4334 10.1.1.5.3348 10.1.1.39.3374 10.1.1.56.4713 10.1.1.61.2065 10.1.1.27.3015 10.1.1.1.5960 10.1.1.67.5433 10.1.1.31.8109 10.1.1.68.4062 10.1.1.49.3986 10.1.1.122.9331 10.1.1.46.8283 10.1.1.54.5230 10.1.1.16.2055 10.1.1.137.5180 10.1.1.43.5722 10.1.1.68.2105 10.1.1.35.1247 10.1.1.30.1415 10.1.1.7.5014 10.1.1.102.3946 10.1.1.105.6469 10.1.1.26.223 10.1.1.26.8645 10.1.1.35.4104 10.1.1.39.6986 10.1.1.41.7822 10.1.1.42.9056 10.1.1.53.9325 10.1.1.71.1802 10.1.1.76.6993 10.1.1.89.9613 10.1.1.121.5599 10.1.1.122.3737 10.1.1.127.1894 10.1.1.55.5674 10.1.1.37.8260 10.1.1.2.2077 10.1.1.24.5782 10.1.1.19.780 10.1.1.2.4148 10.1.1.2.4173 10.1.1.131.902 10.1.1.30.2927 Metadata may be used without restrictions as long as the oai identifier remains attached to it." }, "jacc": 1.0f }
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join/word-jaccard.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/word-jaccard.adm
new file mode 100644
index 0000000..3550136
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/word-jaccard.adm
@@ -0,0 +1,5 @@
+{ "arec": { "id": 5, "dblpid": "books/acm/kim95/DayalHW95", "title": "Active Database Systems.", "authors": "Umeshwar Dayal Eric N. Hanson Jennifer Widom", "misc": "2002-01-03 434-456 1995 Modern Database Systems db/books/collections/kim95.html#DayalHW95" }, "brec": { "id": 98, "csxid": "oai CiteSeerXPSU 10.1.1.49.2910", "title": "Active Database Systems", "authors": "Umeshwar Dayal Eric N. Hanson Jennifer Widom", "misc": "2009-04-12 In Won Kim editor Modern Database Systems The Object Model Integrating a production rules facility into a database system provides a uniform mechanism for a number of advanced database features including integrity constraint enforcement, derived data maintenance, triggers, alerters, protection, version control, and others. In addition, a database system with rule processing capabilities provides a useful platform for large and efficient knowledge-base and expert systems. Database systems with production rules are referred to as active database systems, and the field of active database systems has indeed been active. This chapter summarizes current work in active database systems topics covered include active database rule models and languages, rule execution semantics, and implementation issues. 1 Introduction Conventional database systems are passive they only execute queries or transactions explicitly submitted by a user or an application program. For many applications, however, it is important to monitor situations of interest, and to ... CiteSeerX ACM Press 2009-04-12 2007-11-22 1994 application/postscript text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.49.2910 http //www-db.stanford.edu/pub/papers/book-chapter.ps en 10.1.1.17.1323 10.1.1.143.7196 10.1.1.50.3821 10.1.1.51.9946 10.1.1.41.2030 10.1.1.46.2504 10.1.1.52.4421 10.1.1.38.2083 10.1.1.34.661 10.1.1.103.7630 10.1.1.100.9015 10.1.1.97.1699 10.1.1.107.4220 10.1.1.47.9217 10.1.1.133.7157 10.1.1.101.5051 10.1.1.30.9989 10.1.1.53.6941 10.1.1.50.8529 10.1.1.133.4287 10.1.1.50.7278 10.1.1.10.1688 10.1.1.19.8669 10.1.1.44.7600 10.1.1.144.376 10.1.1.44.1348 10.1.1.47.9998 10.1.1.90.4428 10.1.1.108.344 10.1.1.48.9470 10.1.1.53.5472 10.1.1.52.4872 10.1.1.144.4965 10.1.1.31.7578 10.1.1.32.6426 10.1.1.58.6335 10.1.1.85.8052 10.1.1.93.1931 10.1.1.55.4610 10.1.1.21.3821 10.1.1.26.9208 10.1.1.31.4869 10.1.1.48.1833 10.1.1.83.8628 10.1.1.87.9318 10.1.1.90.2195 10.1.1.36.5184 10.1.1.21.1704 10.1.1.53.1733 10.1.1.90.3181 10.1.1.53.6783 10.1.1.52.6151 10.1.1.104.6911 10.1.1.105.1691 10.1.1.21.1984 10.1.1.23.2775 10.1.1.62.5556 10.1.1.68.9063 10.1.1.74.4746 10.1.1.78.5097 10.1.1.84.743 10.1.1.84.904 10.1.1.87.6019 10.1.1.88.3907 10.1.1.89.9631 10.1.1.90.4147 10.1.1.92.365 10.1.1.100.2747 10.1.1.98.5083 10.1.1.98.6663 10.1.1.99.1894 10.1.1.99.8174 10.1.1.133.8073 10.1.1.52.7823 10.1.1.39.5341 10.1.1.35.3458 10.1.1.26.4620 10.1.1.18.8936 10.1.1.19.3694 10.1.1.12.631 10.1.1.48.6394 Metadata may be used without restrictions as long as the oai identifier remains attached to it." } }
+{ "arec": { "id": 25, "dblpid": "books/acm/kim95/RusinkiewiczS95", "title": "Specification and Execution of Transactional Workflows.", "authors": "Marek Rusinkiewicz Amit P. Sheth", "misc": "2004-03-08 592-620 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#RusinkiewiczS95 1995" }, "brec": { "id": 88, "csxid": "oai CiteSeerXPSU 10.1.1.43.3839", "title": "Specification and Execution of Transactional Workflows", "authors": "Marek Rusinkiewicz Amit Sheth", "misc": "2009-04-13 The basic transaction model has evolved over time to incorporate more complex transaction structures and to selectively modify the atomicity and isolation properties. In this chapter we discuss the application of transaction concepts to activities that involve coordinated execution of multiple tasks (possibly of different types) over different processing entities. Such applications are referred to as transactional workflows. In this chapter we discuss the specification of such workflows and the issues involved in their execution. 1 What is a Workflow? Workflows are activities involving the coordinated execution of multiple tasks performed by different processing entities. A task defines some work to be done and can be specified in a number of ways, including a textual description in a file or an email, a form, a message, or a computer program. A processing entity that performs the tasks may be a person or a software system (e.g., a mailer, an application program, a database mana... CiteSeerX ACM Press 2009-04-13 2007-11-22 1995 application/postscript text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.43.3839 http //lsdis.cs.uga.edu/lib/././download/RS93.ps en 10.1.1.17.1323 10.1.1.59.5051 10.1.1.38.6210 10.1.1.68.7445 10.1.1.109.5175 10.1.1.17.7962 10.1.1.44.7778 10.1.1.112.244 10.1.1.13.7602 10.1.1.102.7874 10.1.1.41.4043 10.1.1.49.5143 10.1.1.41.7252 10.1.1.17.3225 10.1.1.54.7761 10.1.1.55.5255 10.1.1.108.958 10.1.1.35.7733 10.1.1.52.3682 10.1.1.36.1618 10.1.1.45.6317 10.1.1.43.3180 10.1.1.35.8718 10.1.1.44.6365 10.1.1.51.2883 10.1.1.50.9206 10.1.1.6.9085 10.1.1.30.1707 10.1.1.80.6634 10.1.1.49.355 10.1.1.127.3550 10.1.1.35.3562 10.1.1.137.8832 10.1.1.49.4085 10.1.1.41.5506 10.1.1.40.4657 10.1.1.43.2369 10.1.1.40.832 10.1.1.74.5411 10.1.1.90.4428 10.1.1.110.6967 10.1.1.27.2122 10.1.1.15.5605 10.1.1.54.727 10.1.1.49.7512 10.1.1.45.8796 10.1.1.50.5984 10.1.1.53.137 10.1.1.30.3262 10.1.1.28.1680 10.1.1.21.7110 10.1.1.29.3148 10.1.1.57.687 10.1.1.59.5924 10.1.1.46.2812 10.1.1.51.5552 10.1.1.17.7375 10.1.1.40.1598 10.1.1.52.9787 10.1.1.1.3496 10.1.1.50.6791 10.1.1.55.3358 10.1.1.137.7582 10.1.1.118.4127 10.1.1.49.3580 10.1.1.35.5825 10.1.1.46.9382 10.1.1.31.7411 10.1.1.48.5504 10.1.1.55.5163 10.1.1.18.1603 10.1.1.52.8129 10.1.1.1.9723 10.1.1.21.9113 10.1.1.49.7644 10.1.1.52.6646 10.1.1.75.3106 10.1.1.80.2072 10.1.1.55.8770 10.1.1.54.8188 10.1.1.101.7919 10.1.1.104.8176 10.1.1.24.5741 10.1.1.29.4667 10.1.1.4.1055 10.1.1.48.9175 10.1.1.56.792 10.1.1.65.3172 10.1.1.66.5947 10.1.1.73.8532 10.1.1.83.8299 10.1.1.86.8521 10.1.1.87.2402 10.1.1.87.4648 10.1.1.90.5638 10.1.1.91.1709 10.1.1.94.4248 10.1.1.114.511 10.1.1.119.5037 10.1.1.124.7957 10.1.1.49.215 10.1.1.53.7777 10.1.1.53.9711 10.1.1.45.9409 10.1.1.40.8789 10.1.1.43.4845 10.1.1.34.8273 10.1.1.35.4783 10.1.1.28.3176 10.1.1.16.8151 10.1.1.8.9117 10.1.1.58.3449 10.1.1.142.7041 Metadata may be used without restrictions as long as the oai identifier remains attached to it." } }
+{ "arec": { "id": 51, "dblpid": "books/aw/kimL89/NierstraszT89", "title": "Integrated Office Systems.", "authors": "Oscar Nierstrasz Dennis Tsichritzis", "misc": "2002-01-03 199-215 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#NierstraszT89" }, "brec": { "id": 92, "csxid": "oai CiteSeerXPSU 10.1.1.13.2374", "title": "Integrated Office Systems", "authors": "O. M. Nierstrasz D. C. Tsichritzis", "misc": "2009-04-17 Introduction New techniques are sorely needed to aid in the development and maintenance of large application systems. The problem with traditional approaches to software engineering is well in evidence in the field of o#ce information systems it is costly and di#cult to extend existing applications, and to get unrelated applications to \"talk\" to each other. The objectoriented approach is already being tentatively applied in the modeling of \"o#ce objects\" and in the presentation of these entities to users as such in \"desktop\" interfaces to o#ce software. In order to fully exploit the approach to achieve integrated o#ce systems, we need to use object-oriented programming languages, object-oriented run-time support, and object-oriented software engineering environments. We can view the fundamental idea behind the object-oriented approach as that of encapsulation object-oriented languages and systems exploit encapsulation in various ways in an attempt to enhance productivity through, f CiteSeerX 2009-04-17 2007-11-21 1988 application/pdf text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.13.2374 http //www.iam.unibe.ch/~scg/Archive/OSG/Nier89bIntegOfficeSystems.pdf en 10.1.1.26.9545 10.1.1.65.5865 10.1.1.34.624 10.1.1.12.8544 10.1.1.144.6983 10.1.1.26.6746 10.1.1.49.3064 10.1.1.30.4607 10.1.1.38.4894 10.1.1.20.8197 10.1.1.26.4381 10.1.1.29.1890 Metadata may be used without restrictions as long as the oai identifier remains attached to it." } }
+{ "arec": { "id": 51, "dblpid": "books/aw/kimL89/NierstraszT89", "title": "Integrated Office Systems.", "authors": "Oscar Nierstrasz Dennis Tsichritzis", "misc": "2002-01-03 199-215 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#NierstraszT89" }, "brec": { "id": 93, "csxid": "oai CiteSeerXPSU 10.1.1.42.9253", "title": "Integrated Office Systems", "authors": "O. M. Nierstrasz D. C. Tsichritzis", "misc": "2009-04-11 Introduction New techniques are sorely needed to aid in the development and maintenance of large application systems. The problem with traditional approaches to software engineering is well in evidence in the field of office information systems it is costly and difficult to extend existing applications, and to get unrelated applications to \"talk\" to each other. The objectoriented approach is already being tentatively applied in the modeling of \"office objects\" and in the presentation of these entities to users as such in \"desktop\" interfaces to office software. In order to fully exploit the approach to achieve integrated office systems, we need to use object-oriented programming languages, object-oriented run-time support, and object-oriented software engineering environments. We can view the fundamental idea behind the object-oriented approach as that of encapsulation object-oriented languages and systems exploit encapsulation in various ways in an attempt t CiteSeerX ACM Press and Addison-Wesley 2009-04-11 2007-11-22 1988 application/postscript text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.42.9253 ftp //ftp.iam.unibe.ch/pub/scg/Papers/integratedOfficeSystems.ps.gz en 10.1.1.26.9545 10.1.1.65.5865 10.1.1.34.624 10.1.1.12.8544 10.1.1.144.6983 10.1.1.26.6746 10.1.1.49.3064 10.1.1.30.4607 10.1.1.38.4894 10.1.1.20.8197 10.1.1.26.4381 10.1.1.29.1890 Metadata may be used without restrictions as long as the oai identifier remains attached to it." } }
+{ "arec": { "id": 54, "dblpid": "books/aw/kimL89/SteinLU89", "title": "A Shared View of Sharing The Treaty of Orlando.", "authors": "Lynn Andrea Stein Henry Lieberman David Ungar", "misc": "2002-01-03 31-48 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#SteinLU89" }, "brec": { "id": 91, "csxid": "oai CiteSeerXPSU 10.1.1.55.482", "title": "A Shared View of Sharing The Treaty of Orlando", "authors": "Lynn Andrea Stein Henry Lieberman David Ungar", "misc": "2009-04-12 Introduction For the past few years, researchers have been debating the relative merits of object-oriented languages with classes and inheritance as opposed to those with prototypes and delegation. It has become clear that the object-oriented programming language design space is not a dichotomy. Instead, we have identified two fundamental mechanisms---templates and empathy---and several different independent degrees of freedom for each. Templates create new objects in their own image, providing guarantees about the similarity of group members. Empathy allows an object to act as if it were some other object, thus providing sharing of state and behavior. The Smalltalk-80 TM language, 1 Actors, Lieberman's Delegation system, Self, and Hybrid each take differing stands on the forms of templates 1 Smalltalk-80 TM is a trademark of Par CiteSeerX ACM Press 2009-04-12 2007-11-22 1989 application/postscript text http //citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.55.482 http //lcs.www.media.mit.edu/people/lieber/Lieberary/OOP/Treaty/Treaty.ps en 10.1.1.26.9545 10.1.1.118.6579 10.1.1.48.69 10.1.1.57.5195 10.1.1.9.570 10.1.1.47.511 10.1.1.127.5320 10.1.1.100.4334 10.1.1.5.3348 10.1.1.39.3374 10.1.1.56.4713 10.1.1.61.2065 10.1.1.27.3015 10.1.1.1.5960 10.1.1.67.5433 10.1.1.31.8109 10.1.1.68.4062 10.1.1.49.3986 10.1.1.122.9331 10.1.1.46.8283 10.1.1.54.5230 10.1.1.16.2055 10.1.1.137.5180 10.1.1.43.5722 10.1.1.68.2105 10.1.1.35.1247 10.1.1.30.1415 10.1.1.7.5014 10.1.1.102.3946 10.1.1.105.6469 10.1.1.26.223 10.1.1.26.8645 10.1.1.35.4104 10.1.1.39.6986 10.1.1.41.7822 10.1.1.42.9056 10.1.1.53.9325 10.1.1.71.1802 10.1.1.76.6993 10.1.1.89.9613 10.1.1.121.5599 10.1.1.122.3737 10.1.1.127.1894 10.1.1.55.5674 10.1.1.37.8260 10.1.1.2.2077 10.1.1.24.5782 10.1.1.19.780 10.1.1.2.4148 10.1.1.2.4173 10.1.1.131.902 10.1.1.30.2927 Metadata may be used without restrictions as long as the oai identifier remains attached to it." } }
diff --git a/asterix-app/src/test/resources/runtimets/results/list/listify_03.adm b/asterix-app/src/test/resources/runtimets/results/list/listify_03.adm
new file mode 100644
index 0000000..978069e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/list/listify_03.adm
@@ -0,0 +1,2 @@
+-5
+-5
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/list/ordered-list-constructor_03.adm b/asterix-app/src/test/resources/runtimets/results/list/ordered-list-constructor_03.adm
new file mode 100644
index 0000000..5c06d0b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/list/ordered-list-constructor_03.adm
@@ -0,0 +1 @@
+[ null, null, null ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/list/unordered-list-constructor_03.adm b/asterix-app/src/test/resources/runtimets/results/list/unordered-list-constructor_03.adm
new file mode 100644
index 0000000..8ffe6e4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/list/unordered-list-constructor_03.adm
@@ -0,0 +1 @@
+{{ null, null, null }}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/float_01.adm b/asterix-app/src/test/resources/runtimets/results/misc/float_01.adm
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/results/float_01.adm
rename to asterix-app/src/test/resources/runtimets/results/misc/float_01.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/groupby-orderby-count.adm b/asterix-app/src/test/resources/runtimets/results/misc/groupby-orderby-count.adm
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/results/groupby-orderby-count.adm
rename to asterix-app/src/test/resources/runtimets/results/misc/groupby-orderby-count.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/ifthenelse_01.adm b/asterix-app/src/test/resources/runtimets/results/misc/ifthenelse_01.adm
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/results/ifthenelse_01.adm
rename to asterix-app/src/test/resources/runtimets/results/misc/ifthenelse_01.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/is-null_01.adm b/asterix-app/src/test/resources/runtimets/results/misc/is-null_01.adm
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/results/is-null_01.adm
rename to asterix-app/src/test/resources/runtimets/results/misc/is-null_01.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/nested-loop-join_01.adm b/asterix-app/src/test/resources/runtimets/results/misc/nested-loop-join_01.adm
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/results/nested-loop-join_01.adm
rename to asterix-app/src/test/resources/runtimets/results/misc/nested-loop-join_01.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/range_01.adm b/asterix-app/src/test/resources/runtimets/results/misc/range_01.adm
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/results/range_01.adm
rename to asterix-app/src/test/resources/runtimets/results/misc/range_01.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/tid_01.adm b/asterix-app/src/test/resources/runtimets/results/misc/tid_01.adm
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/results/tid_01.adm
rename to asterix-app/src/test/resources/runtimets/results/misc/tid_01.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/year_01.adm b/asterix-app/src/test/resources/runtimets/results/misc/year_01.adm
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/results/year_01.adm
rename to asterix-app/src/test/resources/runtimets/results/misc/year_01.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue134.adm b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue134.adm
new file mode 100644
index 0000000..0d06066
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue134.adm
@@ -0,0 +1 @@
+{{ [ 1, 2, 3, 4, 5 ], [ 6, 5, 3, 8, 9 ], [ 44, 22, 66, -1, 0, 99.9d ] }}
diff --git a/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue166.adm b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue166.adm
new file mode 100644
index 0000000..b5897af
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue166.adm
@@ -0,0 +1 @@
+[ 4, 5, 6, 7 ]
diff --git a/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue208.adm b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue208.adm
new file mode 100644
index 0000000..14c1c18
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue208.adm
@@ -0,0 +1,6 @@
+{ "count": 1, "user": "RollandEckhard#500" }
+{ "count": 2, "user": "RollandEckhardstein#211" }
+{ "count": 1, "user": "RollandEckhardstein#221" }
+{ "count": 1, "user": "RollandEcstein#211" }
+{ "count": 1, "user": "Rolldstein#211" }
+{ "count": 1, "user": "Rolltein#211" }
diff --git a/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue29.adm b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue29.adm
new file mode 100644
index 0000000..3d2819e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue29.adm
@@ -0,0 +1 @@
+{{ { "tweetid": "1023", "user": { "screen-name": "dflynn24", "lang": "en", "friends_count": 46, "statuses_count": 987, "name": "danielle flynn", "followers_count": 47 }, "sender-location": "40.904177,-72.958996", "send-time": "2010-02-21T11:56:02-05:00", "referred-topics": {{ "verizon" }}, "message-text": "i need a #verizon phone like nowwwww! :(" }, { "tweetid": "1024", "user": { "screen-name": "miriamorous", "lang": "en", "friends_count": 69, "statuses_count": 1068, "name": "Miriam Songco", "followers_count": 78 }, "send-time": "2010-02-21T11:11:43-08:00", "referred-topics": {{ "commercials", "verizon", "att" }}, "message-text": "#verizon & #att #commercials, so competitive" }, { "tweetid": "1025", "user": { "screen-name": "dj33", "lang": "en", "friends_count": 96, "statuses_count": 1696, "name": "Don Jango", "followers_count": 22 }, "send-time": "2010-02-21T12:38:44-05:00", "referred-topics": {{ "charlotte" }}, "message-text": "Chillin at dca waiting for 900am flight to #charlotte and from there to providenciales" }, { "tweetid": "1026", "user": { "screen-name": "reallyleila", "lang": "en", "friends_count": 106, "statuses_count": 107, "name": "Leila Samii", "followers_count": 52 }, "send-time": "2010-02-21T21:31:57-06:00", "referred-topics": {{ "verizon", "at&t", "iphone" }}, "message-text": "I think a switch from #verizon to #at&t may be in my near future... my smartphone is like a land line compared to the #iphone!" } }}
diff --git a/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue55-1.adm b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue55-1.adm
new file mode 100644
index 0000000..adf0f33
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue55-1.adm
@@ -0,0 +1,49 @@
+[ 1.1f, 1.1f, "=", true, "<", false, "<=", true, ">", false, ">=", true ]
+[ 1.1f, 1.0f, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.1f, 1.2f, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1.1f, 0.9d, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.1f, 1.3d, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1.1f, 1, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.1f, 2, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1.0f, 1.1f, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1.0f, 1.0f, "=", true, "<", false, "<=", true, ">", false, ">=", true ]
+[ 1.0f, 1.2f, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1.0f, 0.9d, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.0f, 1.3d, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1.0f, 1, "=", true, "<", false, "<=", true, ">", false, ">=", true ]
+[ 1.0f, 2, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1.2f, 1.1f, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.2f, 1.0f, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.2f, 1.2f, "=", true, "<", false, "<=", true, ">", false, ">=", true ]
+[ 1.2f, 0.9d, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.2f, 1.3d, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1.2f, 1, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.2f, 2, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 0.9d, 1.1f, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 0.9d, 1.0f, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 0.9d, 1.2f, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 0.9d, 0.9d, "=", true, "<", false, "<=", true, ">", false, ">=", true ]
+[ 0.9d, 1.3d, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 0.9d, 1, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 0.9d, 2, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1.3d, 1.1f, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.3d, 1.0f, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.3d, 1.2f, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.3d, 0.9d, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.3d, 1.3d, "=", true, "<", false, "<=", true, ">", false, ">=", true ]
+[ 1.3d, 1, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.3d, 2, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1, 1.1f, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1, 1.0f, "=", true, "<", false, "<=", true, ">", false, ">=", true ]
+[ 1, 1.2f, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1, 0.9d, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1, 1.3d, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1, 1, "=", true, "<", false, "<=", true, ">", false, ">=", true ]
+[ 1, 2, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 2, 1.1f, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 2, 1.0f, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 2, 1.2f, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 2, 0.9d, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 2, 1.3d, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 2, 1, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 2, 2, "=", true, "<", false, "<=", true, ">", false, ">=", true ]
diff --git a/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue55.adm b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue55.adm
new file mode 100644
index 0000000..d384bce
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue55.adm
@@ -0,0 +1,4 @@
+[ 1, 3 ]
+[ 4, 5, 2 ]
+[ -1, -3, 0 ]
+[ "a" ]
diff --git a/asterix-app/src/test/resources/runtimets/results/open-closed/query-proposal.adm b/asterix-app/src/test/resources/runtimets/results/open-closed/query-proposal.adm
new file mode 100644
index 0000000..23ab1f6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/open-closed/query-proposal.adm
@@ -0,0 +1,5 @@
+{ "topic": "at&t", "count": 1 }
+{ "topic": "att", "count": 1 }
+{ "topic": "commercials", "count": 1 }
+{ "topic": "iphone", "count": 1 }
+{ "topic": "verizon", "count": 3 }
diff --git a/asterix-app/src/test/resources/runtimets/results/open-closed/query-proposal02.adm b/asterix-app/src/test/resources/runtimets/results/open-closed/query-proposal02.adm
new file mode 100644
index 0000000..23ab1f6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/open-closed/query-proposal02.adm
@@ -0,0 +1,5 @@
+{ "topic": "at&t", "count": 1 }
+{ "topic": "att", "count": 1 }
+{ "topic": "commercials", "count": 1 }
+{ "topic": "iphone", "count": 1 }
+{ "topic": "verizon", "count": 3 }
diff --git a/asterix-app/src/test/resources/runtimets/results/quantifiers/everysat_01.adm b/asterix-app/src/test/resources/runtimets/results/quantifiers/everysat_01.adm
new file mode 100644
index 0000000..d6cf966
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/quantifiers/everysat_01.adm
@@ -0,0 +1 @@
+-30
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/quantifiers/everysat_02.adm b/asterix-app/src/test/resources/runtimets/results/quantifiers/everysat_02.adm
new file mode 100644
index 0000000..fd6a9d9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/quantifiers/everysat_02.adm
@@ -0,0 +1,12 @@
+false
+true
+false
+true
+false
+false
+true
+false
+false
+false
+false
+false
diff --git a/asterix-app/src/test/resources/runtimets/results/quantifiers/everysat_04.adm b/asterix-app/src/test/resources/runtimets/results/quantifiers/everysat_04.adm
new file mode 100644
index 0000000..98ce28d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/quantifiers/everysat_04.adm
@@ -0,0 +1,8 @@
+false
+false
+false
+true
+true
+false
+false
+false
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/quantifiers/somesat_06.adm b/asterix-app/src/test/resources/runtimets/results/quantifiers/somesat_06.adm
new file mode 100644
index 0000000..2cc1766
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/quantifiers/somesat_06.adm
@@ -0,0 +1,8 @@
+false
+true
+true
+true
+true
+true
+true
+false
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/field-access-on-open-field.adm b/asterix-app/src/test/resources/runtimets/results/records/field-access-on-open-field.adm
new file mode 100644
index 0000000..d4edf93
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/field-access-on-open-field.adm
@@ -0,0 +1 @@
+92617
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/scan/issue238_query_1.adm b/asterix-app/src/test/resources/runtimets/results/scan/issue238_query_1.adm
new file mode 100644
index 0000000..a7ec8f6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/scan/issue238_query_1.adm
@@ -0,0 +1,100 @@
+{ "id": 1, "dblpid": "books/acm/kim95/AnnevelinkACFHK95", "title": "Object SQL - A Language for the Design and Implementation of Object Databases.", "authors": "Jurgen Annevelink Rafiul Ahad Amelia Carlson Daniel H. Fishman Michael L. Heytens William Kent", "misc": "2002-01-03 42-68 1995 Modern Database Systems db/books/collections/kim95.html#AnnevelinkACFHK95" }
+{ "id": 2, "dblpid": "books/acm/kim95/Blakeley95", "title": "OQL[C++] Extending C++ with an Object Query Capability.", "authors": "José A. Blakeley", "misc": "2002-01-03 69-88 Modern Database Systems db/books/collections/kim95.html#Blakeley95 1995" }
+{ "id": 3, "dblpid": "books/acm/kim95/BreitbartGS95", "title": "Transaction Management in Multidatabase Systems.", "authors": "Yuri Breitbart Hector Garcia-Molina Abraham Silberschatz", "misc": "2004-03-08 573-591 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#BreitbartGS95 1995" }
+{ "id": 4, "dblpid": "books/acm/kim95/ChristodoulakisK95", "title": "Multimedia Information Systems Issues and Approaches.", "authors": "Stavros Christodoulakis Leonidas Koveos", "misc": "2002-01-03 318-337 1995 Modern Database Systems db/books/collections/kim95.html#ChristodoulakisK95" }
+{ "id": 5, "dblpid": "books/acm/kim95/DayalHW95", "title": "Active Database Systems.", "authors": "Umeshwar Dayal Eric N. Hanson Jennifer Widom", "misc": "2002-01-03 434-456 1995 Modern Database Systems db/books/collections/kim95.html#DayalHW95" }
+{ "id": 6, "dblpid": "books/acm/kim95/DittrichD95", "title": "Where Object-Oriented DBMSs Should Do Better A Critique Based on Early Experiences.", "authors": "Angelika Kotz Dittrich Klaus R. Dittrich", "misc": "2002-01-03 238-254 1995 Modern Database Systems db/books/collections/kim95.html#DittrichD95" }
+{ "id": 7, "dblpid": "books/acm/kim95/Garcia-MolinaH95", "title": "Distributed Databases.", "authors": "Hector Garcia-Molina Meichun Hsu", "misc": "2002-01-03 477-493 1995 Modern Database Systems db/books/collections/kim95.html#Garcia-MolinaH95" }
+{ "id": 8, "dblpid": "books/acm/kim95/Goodman95", "title": "An Object-Oriented DBMS War Story Developing a Genome Mapping Database in C++.", "authors": "Nathan Goodman", "misc": "2002-01-03 216-237 1995 Modern Database Systems db/books/collections/kim95.html#Goodman95" }
+{ "id": 9, "dblpid": "books/acm/kim95/Kaiser95", "title": "Cooperative Transactions for Multiuser Environments.", "authors": "Gail E. Kaiser", "misc": "2002-01-03 409-433 1995 Modern Database Systems db/books/collections/kim95.html#Kaiser95" }
+{ "id": 10, "dblpid": "books/acm/kim95/KelleyGKRG95", "title": "Schema Architecture of the UniSQL/M Multidatabase System", "authors": "William Kelley Sunit K. Gala Won Kim Tom C. Reyes Bruce Graham", "misc": "2004-03-08 Modern Database Systems books/acm/Kim95 621-648 1995 db/books/collections/kim95.html#KelleyGKRG95" }
+{ "id": 11, "dblpid": "books/acm/kim95/KemperM95", "title": "Physical Object Management.", "authors": "Alfons Kemper Guido Moerkotte", "misc": "2002-01-03 175-202 1995 Modern Database Systems db/books/collections/kim95.html#KemperM95" }
+{ "id": 12, "dblpid": "books/acm/kim95/Kim95", "title": "Introduction to Part 1 Next-Generation Database Technology.", "authors": "Won Kim", "misc": "2002-01-03 5-17 1995 Modern Database Systems db/books/collections/kim95.html#Kim95" }
+{ "id": 13, "dblpid": "books/acm/kim95/Kim95a", "title": "Object-Oriented Database Systems Promises, Reality, and Future.", "authors": "Won Kim", "misc": "2002-01-03 255-280 1995 Modern Database Systems db/books/collections/kim95.html#Kim95a" }
+{ "id": 14, "dblpid": "books/acm/kim95/Kim95b", "title": "Introduction to Part 2 Technology for Interoperating Legacy Databases.", "authors": "Won Kim", "misc": "2002-01-03 515-520 1995 Modern Database Systems db/books/collections/kim95.html#Kim95b" }
+{ "id": 15, "dblpid": "books/acm/kim95/KimCGS95", "title": "On Resolving Schematic Heterogeneity in Multidatabase Systems.", "authors": "Won Kim Injun Choi Sunit K. Gala Mark Scheevel", "misc": "2002-01-03 521-550 1995 Modern Database Systems db/books/collections/kim95.html#KimCGS95" }
+{ "id": 16, "dblpid": "books/acm/kim95/KimG95", "title": "Requirements for a Performance Benchmark for Object-Oriented Database Systems.", "authors": "Won Kim Jorge F. Garza", "misc": "2002-01-03 203-215 1995 Modern Database Systems db/books/collections/kim95.html#KimG95" }
+{ "id": 17, "dblpid": "books/acm/kim95/KimK95", "title": "On View Support in Object-Oriented Databases Systems.", "authors": "Won Kim William Kelley", "misc": "2002-01-03 108-129 1995 Modern Database Systems db/books/collections/kim95.html#KimK95" }
+{ "id": 18, "dblpid": "books/acm/kim95/Kowalski95", "title": "The POSC Solution to Managing E&P Data.", "authors": "Vincent J. Kowalski", "misc": "2002-01-03 281-301 1995 Modern Database Systems db/books/collections/kim95.html#Kowalski95" }
+{ "id": 19, "dblpid": "books/acm/kim95/KriegerA95", "title": "C++ Bindings to an Object Database.", "authors": "David Krieger Tim Andrews", "misc": "2002-01-03 89-107 1995 Modern Database Systems db/books/collections/kim95.html#KriegerA95" }
+{ "id": 20, "dblpid": "books/acm/kim95/Lunt95", "title": "Authorization in Object-Oriented Databases.", "authors": "Teresa F. Lunt", "misc": "2002-01-03 130-145 1995 Modern Database Systems db/books/collections/kim95.html#Lunt95" }
+{ "id": 21, "dblpid": "books/acm/kim95/MengY95", "title": "Query Processing in Multidatabase Systems.", "authors": "Weiyi Meng Clement T. Yu", "misc": "2002-01-03 551-572 1995 Modern Database Systems db/books/collections/kim95.html#MengY95" }
+{ "id": 22, "dblpid": "books/acm/kim95/Motro95", "title": "Management of Uncerainty in database Systems.", "authors": "Amihai Motro", "misc": "2002-01-03 457-476 1995 Modern Database Systems db/books/collections/kim95.html#Motro95" }
+{ "id": 23, "dblpid": "books/acm/kim95/Omiecinski95", "title": "Parallel Relational Database Systems.", "authors": "Edward Omiecinski", "misc": "2002-01-03 494-512 1995 Modern Database Systems db/books/collections/kim95.html#Omiecinski95" }
+{ "id": 24, "dblpid": "books/acm/kim95/OzsuB95", "title": "Query Processing in Object-Oriented Database Systems.", "authors": "M. Tamer Özsu José A. Blakeley", "misc": "2002-01-03 146-174 1995 Modern Database Systems db/books/collections/kim95.html#OzsuB95" }
+{ "id": 25, "dblpid": "books/acm/kim95/RusinkiewiczS95", "title": "Specification and Execution of Transactional Workflows.", "authors": "Marek Rusinkiewicz Amit P. Sheth", "misc": "2004-03-08 592-620 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#RusinkiewiczS95 1995" }
+{ "id": 26, "dblpid": "books/acm/kim95/Samet95", "title": "Spatial Data Structures.", "authors": "Hanan Samet", "misc": "2004-03-08 361-385 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#Samet95 1995" }
+{ "id": 27, "dblpid": "books/acm/kim95/SametA95", "title": "Spatial Data Models and Query Processing.", "authors": "Hanan Samet Walid G. Aref", "misc": "2002-01-03 338-360 1995 Modern Database Systems db/books/collections/kim95.html#SametA95" }
+{ "id": 28, "dblpid": "books/acm/kim95/ShanADDK95", "title": "Pegasus A Heterogeneous Information Management System.", "authors": "Ming-Chien Shan Rafi Ahmed Jim Davis Weimin Du William Kent", "misc": "2004-03-08 664-682 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#ShanADDK95 1995" }
+{ "id": 29, "dblpid": "books/acm/kim95/Snodgrass95", "title": "Temporal Object-Oriented Databases A Critical Comparison.", "authors": "Richard T. Snodgrass", "misc": "2002-01-03 386-408 1995 Modern Database Systems db/books/collections/kim95.html#Snodgrass95" }
+{ "id": 30, "dblpid": "books/acm/kim95/SoleyK95", "title": "The OMG Object Model.", "authors": "Richard Mark Soley William Kent", "misc": "2002-01-03 18-41 1995 Modern Database Systems db/books/collections/kim95.html#SoleyK95" }
+{ "id": 31, "dblpid": "books/acm/kim95/Stout95", "title": "EDA/SQL.", "authors": "Ralph L. Stout", "misc": "2004-03-08 649-663 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#Stout95 1995" }
+{ "id": 32, "dblpid": "books/acm/kim95/Thompson95", "title": "The Changing Database Standards Landscape.", "authors": "Craig W. Thompson", "misc": "2002-01-03 302-317 1995 Modern Database Systems db/books/collections/kim95.html#Thompson95" }
+{ "id": 33, "dblpid": "books/acm/kim95/BreitbartR95", "title": "Overview of the ADDS System.", "authors": "Yuri Breitbart Tom C. Reyes", "misc": "2009-06-12 683-701 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#BreitbartR95 1995" }
+{ "id": 34, "dblpid": "books/acm/Kim95", "title": "Modern Database Systems The Object Model, Interoperability, and Beyond.", "authors": "", "misc": "2004-03-08 Won Kim Modern Database Systems ACM Press and Addison-Wesley 1995 0-201-59098-0 db/books/collections/kim95.html" }
+{ "id": 35, "dblpid": "books/ap/MarshallO79", "title": "Inequalities Theory of Majorization and Its Application.", "authors": "Albert W. Marshall Ingram Olkin", "misc": "2002-01-03 Academic Press 1979 0-12-473750-1" }
+{ "id": 36, "dblpid": "books/aw/kimL89/BjornerstedtH89", "title": "Version Control in an Object-Oriented Architecture.", "authors": "Anders Björnerstedt Christer Hulten", "misc": "2006-02-24 451-485 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#BjornerstedtH89" }
+{ "id": 37, "dblpid": "books/aw/kimL89/BretlMOPSSWW89", "title": "The GemStone Data Management System.", "authors": "Robert Bretl David Maier Allen Otis D. Jason Penney Bruce Schuchardt Jacob Stein E. Harold Williams Monty Williams", "misc": "2002-01-03 283-308 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#BretlMOPSSWW89" }
+{ "id": 38, "dblpid": "books/aw/kimL89/CareyDRS89", "title": "Storage Management in EXODUS.", "authors": "Michael J. Carey David J. DeWitt Joel E. Richardson Eugene J. Shekita", "misc": "2002-01-03 341-369 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#CareyDRS89" }
+{ "id": 39, "dblpid": "books/aw/kimL89/Decouchant89", "title": "A Distributed Object Manager for the Smalltalk-80 System.", "authors": "Dominique Decouchant", "misc": "2002-01-03 487-520 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#Decouchant89" }
+{ "id": 40, "dblpid": "books/aw/kimL89/DiederichM89", "title": "Objects, Messages, and Rules in Database Design.", "authors": "Jim Diederich Jack Milton", "misc": "2002-01-03 177-197 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#DiederichM89" }
+{ "id": 41, "dblpid": "books/aw/kimL89/EllisG89", "title": "Active Objects Ealities and Possibilities.", "authors": "Clarence A. Ellis Simon J. Gibbs", "misc": "2002-01-03 561-572 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#EllisG89" }
+{ "id": 42, "dblpid": "books/aw/kimL89/FishmanABCCDHHKLLMNRSW89", "title": "Overview of the Iris DBMS.", "authors": "Daniel H. Fishman Jurgen Annevelink David Beech E. C. Chow Tim Connors J. W. Davis Waqar Hasan C. G. Hoch William Kent S. Leichner Peter Lyngbæk Brom Mahbod Marie-Anne Neimat Tore Risch Ming-Chien Shan W. Kevin Wilkinson", "misc": "2002-01-03 219-250 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#FishmanABCCDHHKLLMNRSW89" }
+{ "id": 43, "dblpid": "books/aw/kimL89/KimBCGW89", "title": "Features of the ORION Object-Oriented Database System.", "authors": "Won Kim Nat Ballou Hong-Tai Chou Jorge F. Garza Darrell Woelk", "misc": "2002-01-03 251-282 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#KimBCGW89" }
+{ "id": 44, "dblpid": "books/aw/kimL89/KimKD89", "title": "Indexing Techniques for Object-Oriented Databases.", "authors": "Won Kim Kyung-Chang Kim Alfred G. Dale", "misc": "2002-01-03 371-394 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#KimKD89" }
+{ "id": 45, "dblpid": "books/aw/kimL89/King89", "title": "My Cat Is Object-Oriented.", "authors": "Roger King", "misc": "2002-01-03 23-30 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#King89" }
+{ "id": 46, "dblpid": "books/aw/kimL89/Maier89", "title": "Making Database Systems Fast Enough for CAD Applications.", "authors": "David Maier", "misc": "2002-01-03 573-582 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#Maier89" }
+{ "id": 47, "dblpid": "books/aw/kimL89/MellenderRS89", "title": "Optimizing Smalltalk Message Performance.", "authors": "Fred Mellender Steve Riegel Andrew Straw", "misc": "2002-01-03 423-450 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#MellenderRS89" }
+{ "id": 48, "dblpid": "books/aw/kimL89/Moon89", "title": "The Common List Object-Oriented Programming Language Standard.", "authors": "David A. Moon", "misc": "2002-01-03 49-78 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#Moon89" }
+{ "id": 49, "dblpid": "books/aw/kimL89/Moss89", "title": "Object Orientation as Catalyst for Language-Database Inegration.", "authors": "J. Eliot B. Moss", "misc": "2002-01-03 583-592 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#Moss89" }
+{ "id": 50, "dblpid": "books/aw/kimL89/Nierstrasz89", "title": "A Survey of Object-Oriented Concepts.", "authors": "Oscar Nierstrasz", "misc": "2002-01-03 3-21 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#Nierstrasz89" }
+{ "id": 51, "dblpid": "books/aw/kimL89/NierstraszT89", "title": "Integrated Office Systems.", "authors": "Oscar Nierstrasz Dennis Tsichritzis", "misc": "2002-01-03 199-215 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#NierstraszT89" }
+{ "id": 52, "dblpid": "books/aw/kimL89/Russinoff89", "title": "Proteus A Frame-Based Nonmonotonic Inference System.", "authors": "David M. Russinoff", "misc": "2002-01-03 127-150 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#Russinoff89" }
+{ "id": 53, "dblpid": "books/aw/kimL89/SkarraZ89", "title": "Concurrency Control and Object-Oriented Databases.", "authors": "Andrea H. Skarra Stanley B. Zdonik", "misc": "2002-01-03 395-421 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#SkarraZ89" }
+{ "id": 54, "dblpid": "books/aw/kimL89/SteinLU89", "title": "A Shared View of Sharing The Treaty of Orlando.", "authors": "Lynn Andrea Stein Henry Lieberman David Ungar", "misc": "2002-01-03 31-48 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#SteinLU89" }
+{ "id": 55, "dblpid": "books/aw/kimL89/TarltonT89", "title": "Pogo A Declarative Representation System for Graphics.", "authors": "Mark A. Tarlton P. Nong Tarlton", "misc": "2002-01-03 151-176 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#TarltonT89" }
+{ "id": 56, "dblpid": "books/aw/kimL89/TomlinsonS89", "title": "Concurrent Object-Oriented Programming Languages.", "authors": "Chris Tomlinson Mark Scheevel", "misc": "2002-01-03 79-124 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#TomlinsonS89" }
+{ "id": 57, "dblpid": "books/aw/kimL89/TsichritzisN89", "title": "Directions in Object-Oriented Research.", "authors": "Dennis Tsichritzis Oscar Nierstrasz", "misc": "2002-01-03 523-536 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#TsichritzisN89" }
+{ "id": 58, "dblpid": "books/aw/kimL89/Wand89", "title": "A Proposal for a Formal Model of Objects.", "authors": "Yair Wand", "misc": "2002-01-03 537-559 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#Wand89" }
+{ "id": 59, "dblpid": "books/aw/kimL89/WeiserL89", "title": "OZ+ An Object-Oriented Database System.", "authors": "Stephen P. Weiser Frederick H. Lochovsky", "misc": "2002-01-03 309-337 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#WeiserL89" }
+{ "id": 60, "dblpid": "books/aw/stonebraker86/RoweS86", "title": "The Commercial INGRES Epilogue.", "authors": "Lawrence A. Rowe Michael Stonebraker", "misc": "2002-01-03 63-82 1986 The INGRES Papers db/books/collections/Stonebraker86.html#RoweS86 db/books/collections/Stonebraker86/RoweS86.html ingres/P063.pdf" }
+{ "id": 61, "dblpid": "books/aw/stonebraker86/Stonebraker86", "title": "Design of Relational Systems (Introduction to Section 1).", "authors": "Michael Stonebraker", "misc": "2002-01-03 1-3 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86 db/books/collections/Stonebraker86/Stonebraker86.html ingres/P001.pdf" }
+{ "id": 62, "dblpid": "books/aw/stonebraker86/Stonebraker86a", "title": "Supporting Studies on Relational Systems (Introduction to Section 2).", "authors": "Michael Stonebraker", "misc": "2002-01-03 83-85 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86a db/books/collections/Stonebraker86/Stonebraker86a.html ingres/P083.pdf" }
+{ "id": 63, "dblpid": "books/aw/stonebraker86/Stonebraker86b", "title": "Distributed Database Systems (Introduction to Section 3).", "authors": "Michael Stonebraker", "misc": "2002-01-03 183-186 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86b db/books/collections/Stonebraker86/Stonebraker86b.html ingres/P183.pdf" }
+{ "id": 64, "dblpid": "books/aw/stonebraker86/Stonebraker86c", "title": "The Design and Implementation of Distributed INGRES.", "authors": "Michael Stonebraker", "misc": "2002-01-03 187-196 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86c db/books/collections/Stonebraker86/Stonebraker86c.html ingres/P187.pdf" }
+{ "id": 65, "dblpid": "books/aw/stonebraker86/Stonebraker86d", "title": "User Interfaces for Database Systems (Introduction to Section 4).", "authors": "Michael Stonebraker", "misc": "2002-01-03 243-245 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86d db/books/collections/Stonebraker86/Stonebraker86d.html ingres/P243.pdf" }
+{ "id": 66, "dblpid": "books/aw/stonebraker86/Stonebraker86e", "title": "Extended Semantics for the Relational Model (Introduction to Section 5).", "authors": "Michael Stonebraker", "misc": "2002-01-03 313-316 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86e db/books/collections/Stonebraker86/Stonebraker86e.html ingres/P313.pdf" }
+{ "id": 67, "dblpid": "books/aw/stonebraker86/Stonebraker86f", "title": "Database Design (Introduction to Section 6).", "authors": "Michael Stonebraker", "misc": "2002-01-03 393-394 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86f db/books/collections/Stonebraker86/Stonebraker86f.html ingres/P393.pdf" }
+{ "id": 68, "dblpid": "books/aw/stonebraker86/X86", "title": "Title, Preface, Contents.", "authors": "", "misc": "2002-01-03 1986 The INGRES Papers db/books/collections/Stonebraker86.html#X86 db/books/collections/Stonebraker86/X86.html ingres/frontmatter.pdf" }
+{ "id": 69, "dblpid": "books/aw/stonebraker86/X86a", "title": "References.", "authors": "", "misc": "2002-01-03 429-444 1986 The INGRES Papers db/books/collections/Stonebraker86.html#X86a db/books/collections/Stonebraker86/X86a.html ingres/P429.pdf" }
+{ "id": 70, "dblpid": "books/aw/Knuth86a", "title": "TeX The Program", "authors": "Donald E. Knuth", "misc": "2002-01-03 Addison-Wesley 1986 0-201-13437-3" }
+{ "id": 71, "dblpid": "books/aw/AbiteboulHV95", "title": "Foundations of Databases.", "authors": "Serge Abiteboul Richard Hull Victor Vianu", "misc": "2002-01-03 Addison-Wesley 1995 0-201-53771-0 AHV/Toc.pdf ... ... journals/tods/AstrahanBCEGGKLMMPTWW76 books/bc/AtzeniA93 journals/tcs/AtzeniABM82 journals/jcss/AbiteboulB86 journals/csur/AtkinsonB87 conf/pods/AtzeniB87 journals/vldb/AbiteboulB95 conf/sigmod/AbiteboulB91 conf/dood/AtkinsonBDDMZ89 conf/vldb/AlbanoBGO93 ... conf/icdt/Abiteboul88 journals/ipl/Abiteboul89 conf/ds/Abrial74 journals/tods/AhoBU79 books/mk/minker88/AptBW88 conf/vldb/AroraC78 conf/stoc/AfratiC89 journals/tods/AlbanoCO85 conf/pods/AfratiCY91 conf/pods/AusielloDM85 conf/vldb/AbiteboulG85 journals/jacm/AjtaiG87 conf/focs/AjtaiG89 journals/tods/AbiteboulG91 ... ... journals/tods/AbiteboulH87 conf/sigmod/AbiteboulH88 ... conf/sigmod/AbiteboulK89 journals/tcs/AbiteboulKG91 journals/jcss/AbiteboulKRW95 conf/sigmod/AbiteboulLUW93 conf/pods/AtzeniP82 conf/pods/AfratiP87 conf/pods/AptP87 conf/wg/AndriesP91 conf/pods/AfratiPPRSU86 books/el/leeuwen90/Apt90 conf/ifip/Armstrong74 journals/siamcomp/AhoSSU81 journals/tods/AhoSU79 journals/siamcomp/AhoSU79 conf/pods/AbiteboulSV90 journals/is/AtzeniT93 conf/popl/AhoU79 conf/pods/AbiteboulV87 conf/jcdkb/AbiteboulV88 journals/jacm/AbiteboulV88 conf/pods/AbiteboulV88 journals/jacm/AbiteboulV89 journals/jcss/AbiteboulV90 journals/jcss/AbiteboulV91 conf/stoc/AbiteboulV91 journals/amai/AbiteboulV91 journals/jcss/AbiteboulV95 journals/jacm/AptE82 conf/coco/AbiteboulVV92 conf/iclp/AptB88 conf/oopsla/BobrowKKMSZ86 journals/tse/BatoryBGSTTW88 conf/mfcs/Bancilhon78 ... conf/db-workshops/Bancilhon85 books/el/leeuwen90/Barendregt90 ... journals/tods/BeeriB79 books/el/leeuwen90/BerstelB90 conf/icdt/BeneventanoB92 conf/vldb/BernsteinBC80 conf/vldb/BeeriBG78 conf/sigmod/BorgidaBMR89 journals/tods/BunemanC79 journals/jacm/BernsteinC81 conf/dbpl/BancilhonCD89 books/bc/tanselCGSS93/BaudinetCW93 conf/sigmod/BiskupDB79 journals/jacm/BeeriDFS84 books/mk/BancilhonDK92 conf/edbt/BryDM88 conf/pods/BunemanDW88 journals/jcss/BunemanDW91 journals/tods/Beeri80 journals/dke/Beeri90 ... journals/tods/Bernstein76 conf/lics/BidoitF87 journals/iandc/BidoitF91 conf/sigmod/BeeriFH77 conf/stoc/BeeriFMMUY81 journals/jacm/BeeriFMY83 journals/tods/BunemanFN82 journals/siamcomp/BernsteinG81 journals/iandc/BlassGK85 conf/ijcai/BrachmanGL85 journals/tods/BernsteinGWRR81 books/aw/BernsteinHG87 ... journals/tcs/Bidoit91 journals/tcs/Biskup80 conf/adbt/Biskup79 journals/tods/Biskup83 journals/tcs/BunemanJO91 journals/tods/BeeriK86 conf/pods/BeeriKBR87 conf/icdt/BidoitL90 journals/csur/BatiniL86 conf/sigmod/BlakeleyLT86 conf/vldb/BeeriM91 conf/sigmod/BlakeleyMG93 journals/siamcomp/BeeriMSU81 conf/pods/BancilhonMSU86 conf/pods/BeeriNRST87 journals/software/Borgida85 conf/icalp/BraP83 conf/fgcs/BalbinMR88 ... conf/pods/BeeriR87 journals/jlp/BalbinR87 conf/sigmod/BancilhonR86 books/mk/minker88/BancilhonR88 journals/jlp/BeeriR91 conf/vldb/BancilhonRS82 conf/pods/BeeriRSS92 conf/dood/Bry89 journals/tods/BancilhonS81 journals/cogsci/BrachmanS85 journals/tods/BergamaschiS92 conf/sigmod/BernsteinST75 conf/dbpl/TannenBN91 conf/icdt/TannenBW92 ... journals/jacm/BeeriV84 conf/icalp/BeeriV81 conf/adbt/BeeriV79 journals/siamcomp/BeeriV84 journals/iandc/BeeriV84 journals/jacm/BeeriV84 journals/tcs/BeeriV85 journals/ibmrd/ChamberlinAEGLMRW76 ... journals/iandc/Cardelli88 books/mk/Cattell94 conf/sigmod/CacaceCCTZ90 conf/vldb/CastilhoCF82 conf/adbt/CasanovaF82 conf/focs/CaiFI89 journals/jcss/CasanovaFP84 conf/stoc/CosmadakisGKV88 conf/dood/CorciuloGP93 books/sp/CeriGT90 conf/focs/ChandraH80 journals/jcss/ChandraH80 journals/jcss/ChandraH82 journals/jlp/ChandraH85 conf/popl/Chandra81 conf/adbt/Chang79 conf/pods/Chandra88 ... journals/tods/Chen76 conf/ride/ChenHM94 conf/icde/Chomicki92 conf/pods/Chomicki92 ... ... ... conf/stoc/CosmadakisK85 journals/acr/CosmadakisK86 ... journals/jcss/CosmadakisKS86 journals/jacm/CosmadakisKV90 ... conf/pods/CalvaneseL94 conf/adbt/Clark77 conf/stoc/ChandraLM81 conf/stoc/ChandraM77 conf/pods/ConsensM90 conf/sigmod/ConsensM93 conf/icdt/ConsensM90 journals/cacm/Codd70 conf/sigmod/Codd71a persons/Codd71a persons/Codd72 conf/ifip/Codd74 ... conf/sigmod/Codd79 journals/cacm/Codd82 ... conf/sigmod/Cohen89 journals/cacm/Cohen90 ... journals/jcss/Cook74 conf/pods/Cosmadakis83 conf/focs/Cosmadakis87 books/el/leeuwen90/Courcelle90a journals/jacm/CosmadakisP84 conf/edbt/CeriCGLLTZ88 ... conf/vldb/CeriT87 conf/vldb/CasanovaTF88 ... conf/pods/CasanovaV83 journals/siamcomp/ChandraV85 conf/pods/ChaudhuriV92 conf/pods/ChaudhuriV93 conf/pods/ChaudhuriV94 journals/csur/CardelliW85 conf/pods/ChenW89 conf/pods/CohenW89 conf/vldb/CeriW90 conf/vldb/CeriW91 conf/iclp/ChenW92 conf/vldb/CeriW93 ... conf/birthday/Dahlhaus87 conf/vldb/Date81 books/aw/Date86 ... conf/dbpl/Dayal89 journals/tods/DayalB82 journals/ibmrd/DelobelC73 conf/icde/DelcambreD89 ... journals/tods/Delobel78 journals/jacm/Demolombe92 journals/tods/DateF92 ... conf/vldb/DayalHL91 journals/jacm/Paola69a conf/caap/DahlhausM86 journals/acr/DAtriM86 journals/iandc/DahlhausM92 conf/sigmod/DerrMP93 conf/vldb/MaindrevilleS88 conf/pods/Dong92 conf/adbt/BraP82 ... conf/dbpl/DongS91 journals/iandc/DongS95 conf/dbpl/DongS93 conf/dbpl/DongS93 conf/icdt/DongT92 conf/vldb/DenninghoffV91 conf/pods/DenninghoffV93 ... ... books/acm/kim95/DayalHW95 ... conf/pods/EiterGM94 conf/pods/Escobar-MolanoHJ93 ... books/el/leeuwen90/Emerson90 books/bc/ElmasriN89 ... conf/icse/Eswaran76 conf/sigmod/EpsteinSW78 ... ... conf/vldb/Fagin77 journals/tods/Fagin77 conf/sigmod/Fagin79 journals/tods/Fagin81 journals/ipl/FaginV83 journals/jacm/Fagin82 journals/jacm/Fagin83 journals/tcs/Fagin93 books/sp/kimrb85/FurtadoC85 ... journals/jlp/Fitting85a journals/tcs/FischerJT83 journals/acr/FaginKUV86 conf/icdt/FernandezM92 journals/tods/FaginMU82 conf/vldb/FaloutsosNS91 ... journals/ai/Forgy82 ... conf/sigmod/Freytag87 ... journals/siamcomp/FischerT83 journals/siamcomp/FaginMUY83 conf/pods/FaginUV83 conf/icalp/FaginV84 ... ... ... ... conf/sigmod/GraefeD87 conf/ride/GatziuD94 conf/sigmod/GardarinM86 conf/sigmod/GyssensG88 journals/tcs/GinsburgH83a journals/jacm/GinsburgH86 ... books/bc/tanselCGSS93/Ginsburg93 books/fm/GareyJ79 journals/jacm/GrantJ82 conf/vldb/GehaniJ91 conf/vldb/GhandeharizadehHJCELLTZ93 journals/tods/GhandeharizadehHJ96 conf/vldb/GehaniJS92 ... conf/sigmod/GehaniJS92 ... conf/deductive/GuptaKM92 conf/pods/GurevichL82 conf/iclp/GelfondL88 conf/adbt/77 journals/csur/GallaireMN84 conf/pods/GrahneMR92 conf/sigmod/GuptaMS93 conf/lics/GaifmanMSV87 journals/jacm/GaifmanMSV93 journals/jacm/GrahamMV86 conf/csl/GradelO92 ... conf/pods/Gottlob87 conf/pods/GyssensPG90 conf/dood/GiannottiPSZ91 books/aw/GoldbergR83 journals/acr/GrahneR86 journals/ipl/Grant77 ... journals/iandc/Grandjean83 conf/vldb/Grahne84 ... journals/csur/Graefe93 books/sp/Greibach75 journals/tods/GoodmanS82 journals/jcss/GoodmanS84 conf/focs/GurevichS85 ... conf/pods/GrumbachS94 conf/sigmod/GangulyST90 ... journals/tcs/Gunter92 ... ... ... ... conf/pods/GrahamV84 conf/pods/GrumbachV91 conf/icde/GardarinV92 conf/sigmod/GraefeW89 ... journals/jacm/GinsburgZ82 conf/vldb/GottlobZ88 ... ... journals/sigmod/Hanson89 ... journals/cacm/Harel80 journals/tkde/HaasCLMWLLPCS90 conf/lics/Hella92 journals/iandc/Herrmann95 conf/pods/HirstH93 conf/vldb/HullJ91 conf/ewdw/HullJ90 journals/csur/HullK87 journals/tods/HudsonK89 conf/lics/HillebrandKM93 conf/nato/HillebrandKR93 conf/jcdkb/HsuLM88 journals/ipl/HoneymanLY80 journals/tods/HammerM81 conf/adbt/HenschenMN82 ... journals/jacm/HenschenN84 journals/jacm/Honeyman82 conf/sigmod/HullS89 conf/pods/HullS89 journals/acta/HullS94 journals/jcss/HullS93 conf/fodo/HullTY89 journals/jcss/Hull83 journals/jacm/Hull84 journals/tcs/Hull85 journals/siamcomp/Hull86 ... conf/vldb/Hulin89 ... journals/jacm/HullY84 conf/vldb/HullY90 conf/pods/HullY91 conf/sigmod/IoannidisK90 journals/jcss/ImielinskiL84 conf/adbt/Imielinski82 journals/jcss/Immerman82 journals/iandc/Immerman86 ... journals/siamcomp/Immerman87 conf/pods/ImielinskiN88 conf/vldb/IoannidisNSS92 conf/sigmod/ImielinskiNV91 conf/dood/ImielinskiNV91 conf/vldb/Ioannidis85 journals/jacm/Jacobs82 conf/dbpl/JacobsH91 journals/csur/JarkeK84 journals/jcss/JohnsonK84 conf/popl/JaffarL87 books/el/leeuwen90/Johnson90 journals/jacm/Joyner76 conf/pods/JaeschkeS82 ... books/mk/minker88/Kanellakis88 books/el/leeuwen90/Kanellakis90 conf/oopsla/KhoshafianC86 conf/edbt/KotzDM88 conf/jcdkb/Keller82 conf/pods/Keller85 journals/computer/Keller86 ... journals/tods/Kent79 ... journals/ngc/RohmerLK86 conf/tacs/KanellakisG94 conf/jcdkb/Kifer88 conf/pods/KanellakisKR90 conf/sigmod/KiferKS92 ... conf/icdt/KiferL86 books/aw/KimL89 ... journals/tods/Klug80 journals/jacm/Klug82 journals/jacm/Klug88 journals/jacm/KiferLW95 conf/kr/KatsunoM91 journals/ai/KatsunoM92 conf/jcdkb/KrishnamurthyN88 journals/csur/Knight89 ... journals/iandc/Kolaitis91 journals/ai/Konolige88 conf/ifip/Kowalski74 journals/jacm/Kowalski75 conf/bncod/Kowalski84 conf/vldb/KoenigP81 journals/tods/KlugP82 ... conf/pods/KolaitisP88 conf/pods/KiferRS88 conf/sigmod/KrishnamurthyRS88 books/mg/SilberschatzK91 conf/iclp/KempT88 conf/sigmod/KellerU84 conf/dood/Kuchenhoff91 ... journals/jlp/Kunen87 conf/iclp/Kunen88 conf/pods/Kuper87 conf/pods/Kuper88 conf/ppcp/Kuper93 conf/pods/KuperV84 conf/stoc/KolaitisV87 journals/tcs/KarabegV90 journals/iandc/KolaitisV90 conf/pods/KolaitisV90 journals/tods/KarabegV91 journals/iandc/KolaitisV92 journals/tcs/KuperV93 journals/tods/KuperV93 journals/tse/KellerW85 conf/pods/KiferW89 conf/jcdkb/Lang88 books/el/Leeuwen90 ... journals/jcss/Leivant89 ... journals/iandc/Leivant90 ... conf/db-workshops/Levesque82 journals/ai/Levesque84 conf/mfdbs/Libkin91 conf/er/Lien79 journals/jacm/Lien82 books/mk/minker88/Lifschitz88 ... journals/tcs/Lindell91 journals/tods/Lipski79 journals/jacm/Lipski81 journals/tcs/LeratL86 journals/cj/LeveneL90 books/sp/Lloyd87 conf/pods/LakshmananM89 conf/tlca/LeivantM93 conf/sigmod/LaverMG83 conf/pods/LiptonN90 journals/jcss/LucchesiO78 conf/sigmod/Lohman88 ... conf/ijcai/Lozinskii85 books/ph/LewisP81 ... conf/sigmod/LecluseRV88 journals/is/LipeckS87 journals/jlp/LloydST87 journals/tods/LingTK81 conf/sigmod/LyngbaekV87 conf/dood/LefebvreV89 conf/pods/LibkinW93 conf/dbpl/LibkinW93 journals/jacm/Maier80 books/cs/Maier83 ... conf/vldb/Makinouchi77 conf/icalp/Makowsky81 ... conf/icdt/Malvestuto86 conf/aaai/MacGregorB92 journals/tods/MylopoulosBW80 conf/sigmod/McCarthyD89 journals/csur/MishraE92 conf/sigmod/MumickFPR90 books/mk/Minker88 journals/jlp/Minker88 conf/vldb/MillerIR93 journals/is/MillerIR94 journals/iandc/Mitchell83 conf/pods/Mitchell83 conf/vldb/MendelzonM79 journals/tods/MaierMS79 journals/jcss/MaierMSU80 conf/pods/MendelzonMW94 journals/debu/MorrisNSUG87 journals/ai/Moore85 conf/vldb/Morgenstern83 conf/pods/Morris88 ... conf/pods/MannilaR85 ... journals/jlp/MinkerR90 books/aw/MannilaR92 journals/acr/MaierRW86 ... journals/tods/MarkowitzS92 conf/pods/Marchetti-SpaccamelaPS87 journals/jacm/MaierSY81 conf/iclp/MorrisUG86 journals/tods/MaierUV84 conf/iclp/MorrisUG86 journals/acta/MakowskyV86 books/bc/MaierW88 books/mk/minker88/ManchandraW88 conf/pods/Naughton86 conf/sigmod/NgFS91 ... conf/vldb/Nejdl87 conf/adbt/NicolasM77 conf/sigmod/Nicolas78 journals/acta/Nicolas82 conf/ds/76 conf/pods/NaqviK88 journals/tods/NegriPS91 conf/vldb/NaughtonRSU89 conf/pods/NaughtonS87 ... ... conf/vldb/Osborn79 ... journals/tods/OzsoyogluY87 conf/adbt/Paige82 ... books/cs/Papadimitriou86 ... journals/ipl/Paredaens78 ... books/sp/ParedaensBGG89 journals/ai/Andersen91 books/el/leeuwen90/Perrin90 journals/ins/Petrov89 conf/pods/ParedaensG88 conf/pods/PatnaikI94 conf/adbt/ParedaensJ79 journals/csur/PeckhamM88 ... ... conf/sigmod/ParkerP80 ... conf/iclp/Przymusinski88 conf/pods/Przymusinski89 ... conf/vldb/ParkerSV92 conf/aaai/PearlV87 journals/ai/PereiraW80a conf/pods/PapadimitriouY92 journals/tkde/QianW91 ... journals/jlp/Ramakrishnan91 conf/pods/RamakrishnanBS87 ... conf/adbt/Reiter77 journals/ai/Reiter80 conf/db-workshops/Reiter82 journals/jacm/Reiter86 journals/tods/Rissanen77 conf/mfcs/Rissanen78 conf/pods/Rissanen82 ... journals/ngc/RohmerLK86 journals/jacm/Robinson65 ... conf/pods/Ross89 ... ... conf/sigmod/RoweS79 conf/sigmod/RichardsonS91 journals/debu/RamamohanaraoSBPNTZD87 conf/vldb/RamakrishnanSS92 conf/sigmod/RamakrishnanSSS93 conf/pods/RamakrishnanSUV89 journals/jcss/RamakrishnanSUV93 journals/jlp/RamakrishnanU95 conf/sigmod/SelingerACLP79 conf/sigmod/Sagiv81 journals/tods/Sagiv83 books/mk/minker88/Sagiv88 conf/slp/Sagiv90 conf/sigmod/Sciore81 journals/jacm/Sciore82 conf/pods/Sciore83 journals/acr/Sciore86 journals/jacm/SagivDPF81 conf/pods/X89 ... journals/ai/SmithG85 books/mk/minker88/Shepherdson88 journals/tods/Shipman81 conf/pods/Shmueli87 conf/iclp/SekiI88 conf/sigmod/ShmueliI84 journals/tc/Sickel76 journals/jsc/Siekmann89 conf/sigmod/StonebrakerJGP90 conf/vldb/SimonKM92 journals/csur/ShethL90 conf/pods/SeibL91 conf/sigmod/SuLRD93 conf/adbt/SilvaM79 journals/sigmod/Snodgrass90 journals/sigmod/Soo91 conf/pods/SuciuP94 conf/sigmod/StonebrakerR86 conf/slp/SudarshanR93 conf/pods/SagivS86 journals/cacm/Stonebraker81 books/mk/Stonebraker88 journals/tkde/Stonebraker92 books/aw/Stroustrup91 journals/jacm/SadriU82 conf/vldb/Su91 conf/pods/SagivV89 journals/jacm/SagivW82 journals/tods/StonebrakerWKH76 journals/jacm/SagivY80 conf/pods/SaccaZ86 journals/tcs/SaccaZ88 ... conf/pods/SaccaZ90 ... ... books/bc/TanselCGJSS93 ... journals/acr/ThomasF86 ... ... ... ... journals/tcs/Topor87 ... books/mk/minker88/ToporS88 ... journals/siamcomp/TarjanY84 journals/csur/TeoreyYF86 journals/algorithmica/UllmanG88 conf/pods/Ullman82 books/cs/Ullman82 journals/tods/Ullman85 books/cs/Ullman88 conf/pods/Ullman89 books/cs/Ullman89 conf/sigmod/Gelder86 ... conf/pods/BusscheG92 conf/focs/BusscheGAG92 conf/pods/BusscheP91 conf/slp/Gelder86 conf/pods/Gelder89 conf/pods/GelderRS88 journals/jacm/GelderRS91 journals/tods/GelderT91 journals/ipl/Vardi81 conf/stoc/Vardi82 conf/focs/Vardi82 journals/acta/Vardi83 journals/jcss/Vardi84 conf/pods/Vardi85 conf/pods/Vardi86 journals/jcss/Vardi86 ... conf/pods/Vardi88 conf/sigmod/Vassiliou79 ... ... journals/jacm/EmdenK76 conf/nf2/SchollABBGPRV87 journals/jacm/Vianu87 journals/acta/Vianu87 conf/eds/Vieille86 conf/iclp/Vieille87 ... conf/eds/Vieille88 journals/tcs/Vieille89 ... journals/tcs/VianuV92 conf/sigmod/WidomF90 conf/icde/WangH92 conf/pos/WidjojoHW90 journals/computer/Wiederhold92 conf/pods/Wilkins86 conf/pods/Winslett88 conf/sigmod/WolfsonO90 conf/pods/Wong93 conf/sigmod/WolfsonS88 journals/ibmrd/WangW75 journals/tods/WongY76 conf/vldb/Yannakakis81 journals/csur/YuC84 ... journals/jcss/YannakakisP82 ... journals/tods/Zaniolo82 journals/jcss/Zaniolo84 ... conf/edbt/ZhouH90 journals/ibmsj/Zloof77 books/mk/ZdonikM90 db/books/dbtext/abiteboul95.html" }
+{ "id": 72, "dblpid": "books/aw/Lamport86", "title": "LaTeX User's Guide & Reference Manual", "authors": "Leslie Lamport", "misc": "2002-01-03 Addison-Wesley 1986 0-201-15790-X" }
+{ "id": 73, "dblpid": "books/aw/AhoHU74", "title": "The Design and Analysis of Computer Algorithms.", "authors": "Alfred V. Aho John E. Hopcroft Jeffrey D. Ullman", "misc": "2002-01-03 Addison-Wesley 1974 0-201-00029-6" }
+{ "id": 74, "dblpid": "books/aw/Lamport2002", "title": "Specifying Systems, The TLA+ Language and Tools for Hardware and Software Engineers", "authors": "Leslie Lamport", "misc": "2005-07-28 Addison-Wesley 2002 0-3211-4306-X http //research.microsoft.com/users/lamport/tla/book.html" }
+{ "id": 75, "dblpid": "books/aw/AhoHU83", "title": "Data Structures and Algorithms.", "authors": "Alfred V. Aho John E. Hopcroft Jeffrey D. Ullman", "misc": "2002-01-03 Addison-Wesley 1983 0-201-00023-7" }
+{ "id": 76, "dblpid": "books/aw/LewisBK01", "title": "Databases and Transaction Processing An Application-Oriented Approach", "authors": "Philip M. Lewis Arthur J. Bernstein Michael Kifer", "misc": "2002-01-03 Addison-Wesley 2001 0-201-70872-8" }
+{ "id": 77, "dblpid": "books/aw/AhoKW88", "title": "The AWK Programming Language", "authors": "Alfred V. Aho Brian W. Kernighan Peter J. Weinberger", "misc": "2002-01-03 Addison-Wesley 1988" }
+{ "id": 78, "dblpid": "books/aw/LindholmY97", "title": "The Java Virtual Machine Specification", "authors": "Tim Lindholm Frank Yellin", "misc": "2002-01-28 Addison-Wesley 1997 0-201-63452-X" }
+{ "id": 79, "dblpid": "books/aw/AhoSU86", "title": "Compilers Princiles, Techniques, and Tools.", "authors": "Alfred V. Aho Ravi Sethi Jeffrey D. Ullman", "misc": "2002-01-03 Addison-Wesley 1986 0-201-10088-6" }
+{ "id": 80, "dblpid": "books/aw/Sedgewick83", "title": "Algorithms", "authors": "Robert Sedgewick", "misc": "2002-01-03 Addison-Wesley 1983 0-201-06672-6" }
+{ "id": 81, "dblpid": "journals/siamcomp/AspnesW96", "title": "Randomized Consensus in Expected O(n log² n) Operations Per Processor.", "authors": "James Aspnes Orli Waarts", "misc": "2002-01-03 1024-1044 1996 25 SIAM J. Comput. 5 db/journals/siamcomp/siamcomp25.html#AspnesW96" }
+{ "id": 82, "dblpid": "conf/focs/AspnesW92", "title": "Randomized Consensus in Expected O(n log ^2 n) Operations Per Processor", "authors": "James Aspnes Orli Waarts", "misc": "2006-04-25 137-146 conf/focs/FOCS33 1992 FOCS db/conf/focs/focs92.html#AspnesW92" }
+{ "id": 83, "dblpid": "journals/siamcomp/Bloniarz83", "title": "A Shortest-Path Algorithm with Expected Time O(n² log n log* n).", "authors": "Peter A. Bloniarz", "misc": "2002-01-03 588-600 1983 12 SIAM J. Comput. 3 db/journals/siamcomp/siamcomp12.html#Bloniarz83" }
+{ "id": 84, "dblpid": "conf/stoc/Bloniarz80", "title": "A Shortest-Path Algorithm with Expected Time O(n^2 log n log ^* n)", "authors": "Peter A. Bloniarz", "misc": "2006-04-25 378-384 conf/stoc/STOC12 1980 STOC db/conf/stoc/stoc80.html#Bloniarz80" }
+{ "id": 85, "dblpid": "journals/siamcomp/Megiddo83a", "title": "Linear-Time Algorithms for Linear Programming in R³ and Related Problems.", "authors": "Nimrod Megiddo", "misc": "2002-01-03 759-776 1983 12 SIAM J. Comput. 4 db/journals/siamcomp/siamcomp12.html#Megiddo83a" }
+{ "id": 86, "dblpid": "conf/focs/Megiddo82", "title": "Linear-Time Algorithms for Linear Programming in R^3 and Related Problems", "authors": "Nimrod Megiddo", "misc": "2006-04-25 329-338 conf/focs/FOCS23 1982 FOCS db/conf/focs/focs82.html#Megiddo82" }
+{ "id": 87, "dblpid": "journals/siamcomp/MoffatT87", "title": "An All Pairs Shortest Path Algorithm with Expected Time O(n² log n).", "authors": "Alistair Moffat Tadao Takaoka", "misc": "2002-01-03 1023-1031 1987 16 SIAM J. Comput. 6 db/journals/siamcomp/siamcomp16.html#MoffatT87" }
+{ "id": 88, "dblpid": "conf/focs/MoffatT85", "title": "An All Pairs Shortest Path Algorithm with Expected Running Time O(n^2 log n)", "authors": "Alistair Moffat Tadao Takaoka", "misc": "2006-04-25 101-105 conf/focs/FOCS26 1985 FOCS db/conf/focs/focs85.html#MoffatT85" }
+{ "id": 89, "dblpid": "conf/icip/SchonfeldL98", "title": "VORTEX Video Retrieval and Tracking from Compressed Multimedia Databases.", "authors": "Dan Schonfeld Dan Lelescu", "misc": "2002-11-05 123-127 1998 ICIP (3) db/conf/icip/icip1998-3.html#SchonfeldL98" }
+{ "id": 90, "dblpid": "conf/hicss/SchonfeldL99", "title": "VORTEX Video Retrieval and Tracking from Compressed Multimedia Databases ¾ Visual Search Engine.", "authors": "Dan Schonfeld Dan Lelescu", "misc": "2002-01-03 1999 HICSS http //computer.org/proceedings/hicss/0001/00013/00013006abs.htm db/conf/hicss/hicss1999-3.html#SchonfeldL99" }
+{ "id": 91, "dblpid": "journals/corr/abs-0802-2861", "title": "Geometric Set Cover and Hitting Sets for Polytopes in $R^3$", "authors": "Sören Laue", "misc": "2008-03-03 http //arxiv.org/abs/0802.2861 2008 CoRR abs/0802.2861 db/journals/corr/corr0802.html#abs-0802-2861 informal publication" }
+{ "id": 92, "dblpid": "conf/stacs/Laue08", "title": "Geometric Set Cover and Hitting Sets for Polytopes in R³.", "authors": "Sören Laue", "misc": "2008-03-04 2008 STACS 479-490 http //drops.dagstuhl.de/opus/volltexte/2008/1367 conf/stacs/2008 db/conf/stacs/stacs2008.html#Laue08" }
+{ "id": 93, "dblpid": "journals/iandc/IbarraJCR91", "title": "Some Classes of Languages in NC¹", "authors": "Oscar H. Ibarra Tao Jiang Jik H. Chang Bala Ravikumar", "misc": "2006-04-25 86-106 Inf. Comput. January 1991 90 1 db/journals/iandc/iandc90.html#IbarraJCR91" }
+{ "id": 94, "dblpid": "conf/awoc/IbarraJRC88", "title": "On Some Languages in NC.", "authors": "Oscar H. Ibarra Tao Jiang Bala Ravikumar Jik H. Chang", "misc": "2002-08-06 64-73 1988 conf/awoc/1988 AWOC db/conf/awoc/awoc88.html#IbarraJRC88" }
+{ "id": 95, "dblpid": "journals/jacm/GalilHLSW87", "title": "An O(n³log n) deterministic and an O(n³) Las Vegs isomorphism test for trivalent graphs.", "authors": "Zvi Galil Christoph M. Hoffmann Eugene M. Luks Claus-Peter Schnorr Andreas Weber", "misc": "2003-11-20 513-531 1987 34 J. ACM 3 http //doi.acm.org/10.1145/28869.28870 db/journals/jacm/jacm34.html#GalilHLSW87" }
+{ "id": 96, "dblpid": "conf/focs/GalilHLSW82", "title": "An O(n^3 log n) Deterministic and an O(n^3) Probabilistic Isomorphism Test for Trivalent Graphs", "authors": "Zvi Galil Christoph M. Hoffmann Eugene M. Luks Claus-Peter Schnorr Andreas Weber", "misc": "2006-04-25 118-125 conf/focs/FOCS23 1982 FOCS db/conf/focs/focs82.html#GalilHLSW82" }
+{ "id": 97, "dblpid": "journals/jacm/GalilT88", "title": "An O(n²(m + n log n)log n) min-cost flow algorithm.", "authors": "Zvi Galil Éva Tardos", "misc": "2003-11-20 374-386 1988 35 J. ACM 2 http //doi.acm.org/10.1145/42282.214090 db/journals/jacm/jacm35.html#GalilT88" }
+{ "id": 98, "dblpid": "conf/focs/GalilT86", "title": "An O(n^2 (m + n log n) log n) Min-Cost Flow Algorithm", "authors": "Zvi Galil Éva Tardos", "misc": "2006-04-25 1-9 conf/focs/FOCS27 1986 FOCS db/conf/focs/focs86.html#GalilT86" }
+{ "id": 99, "dblpid": "series/synthesis/2009Weintraub", "title": "Jordan Canonical Form Theory and Practice", "authors": "Steven H. Weintraub", "misc": "2009-09-06 Jordan Canonical Form Theory and Practice http //dx.doi.org/10.2200/S00218ED1V01Y200908MAS006 http //dx.doi.org/10.2200/S00218ED1V01Y200908MAS006 2009 Synthesis Lectures on Mathematics & Statistics Morgan & Claypool Publishers" }
+{ "id": 100, "dblpid": "series/synthesis/2009Brozos", "title": "The Geometry of Walker Manifolds", "authors": "Miguel Brozos-Vázquez Eduardo García-Río Peter Gilkey Stana Nikcevic Rámon Vázquez-Lorenzo", "misc": "2009-09-06 The Geometry of Walker Manifolds http //dx.doi.org/10.2200/S00197ED1V01Y200906MAS005 http //dx.doi.org/10.2200/S00197ED1V01Y200906MAS005 2009 Synthesis Lectures on Mathematics & Statistics Morgan & Claypool Publishers" }
diff --git a/asterix-app/src/test/resources/runtimets/results/scan/issue238_query_2.adm b/asterix-app/src/test/resources/runtimets/results/scan/issue238_query_2.adm
new file mode 100644
index 0000000..a7ec8f6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/scan/issue238_query_2.adm
@@ -0,0 +1,100 @@
+{ "id": 1, "dblpid": "books/acm/kim95/AnnevelinkACFHK95", "title": "Object SQL - A Language for the Design and Implementation of Object Databases.", "authors": "Jurgen Annevelink Rafiul Ahad Amelia Carlson Daniel H. Fishman Michael L. Heytens William Kent", "misc": "2002-01-03 42-68 1995 Modern Database Systems db/books/collections/kim95.html#AnnevelinkACFHK95" }
+{ "id": 2, "dblpid": "books/acm/kim95/Blakeley95", "title": "OQL[C++] Extending C++ with an Object Query Capability.", "authors": "José A. Blakeley", "misc": "2002-01-03 69-88 Modern Database Systems db/books/collections/kim95.html#Blakeley95 1995" }
+{ "id": 3, "dblpid": "books/acm/kim95/BreitbartGS95", "title": "Transaction Management in Multidatabase Systems.", "authors": "Yuri Breitbart Hector Garcia-Molina Abraham Silberschatz", "misc": "2004-03-08 573-591 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#BreitbartGS95 1995" }
+{ "id": 4, "dblpid": "books/acm/kim95/ChristodoulakisK95", "title": "Multimedia Information Systems Issues and Approaches.", "authors": "Stavros Christodoulakis Leonidas Koveos", "misc": "2002-01-03 318-337 1995 Modern Database Systems db/books/collections/kim95.html#ChristodoulakisK95" }
+{ "id": 5, "dblpid": "books/acm/kim95/DayalHW95", "title": "Active Database Systems.", "authors": "Umeshwar Dayal Eric N. Hanson Jennifer Widom", "misc": "2002-01-03 434-456 1995 Modern Database Systems db/books/collections/kim95.html#DayalHW95" }
+{ "id": 6, "dblpid": "books/acm/kim95/DittrichD95", "title": "Where Object-Oriented DBMSs Should Do Better A Critique Based on Early Experiences.", "authors": "Angelika Kotz Dittrich Klaus R. Dittrich", "misc": "2002-01-03 238-254 1995 Modern Database Systems db/books/collections/kim95.html#DittrichD95" }
+{ "id": 7, "dblpid": "books/acm/kim95/Garcia-MolinaH95", "title": "Distributed Databases.", "authors": "Hector Garcia-Molina Meichun Hsu", "misc": "2002-01-03 477-493 1995 Modern Database Systems db/books/collections/kim95.html#Garcia-MolinaH95" }
+{ "id": 8, "dblpid": "books/acm/kim95/Goodman95", "title": "An Object-Oriented DBMS War Story Developing a Genome Mapping Database in C++.", "authors": "Nathan Goodman", "misc": "2002-01-03 216-237 1995 Modern Database Systems db/books/collections/kim95.html#Goodman95" }
+{ "id": 9, "dblpid": "books/acm/kim95/Kaiser95", "title": "Cooperative Transactions for Multiuser Environments.", "authors": "Gail E. Kaiser", "misc": "2002-01-03 409-433 1995 Modern Database Systems db/books/collections/kim95.html#Kaiser95" }
+{ "id": 10, "dblpid": "books/acm/kim95/KelleyGKRG95", "title": "Schema Architecture of the UniSQL/M Multidatabase System", "authors": "William Kelley Sunit K. Gala Won Kim Tom C. Reyes Bruce Graham", "misc": "2004-03-08 Modern Database Systems books/acm/Kim95 621-648 1995 db/books/collections/kim95.html#KelleyGKRG95" }
+{ "id": 11, "dblpid": "books/acm/kim95/KemperM95", "title": "Physical Object Management.", "authors": "Alfons Kemper Guido Moerkotte", "misc": "2002-01-03 175-202 1995 Modern Database Systems db/books/collections/kim95.html#KemperM95" }
+{ "id": 12, "dblpid": "books/acm/kim95/Kim95", "title": "Introduction to Part 1 Next-Generation Database Technology.", "authors": "Won Kim", "misc": "2002-01-03 5-17 1995 Modern Database Systems db/books/collections/kim95.html#Kim95" }
+{ "id": 13, "dblpid": "books/acm/kim95/Kim95a", "title": "Object-Oriented Database Systems Promises, Reality, and Future.", "authors": "Won Kim", "misc": "2002-01-03 255-280 1995 Modern Database Systems db/books/collections/kim95.html#Kim95a" }
+{ "id": 14, "dblpid": "books/acm/kim95/Kim95b", "title": "Introduction to Part 2 Technology for Interoperating Legacy Databases.", "authors": "Won Kim", "misc": "2002-01-03 515-520 1995 Modern Database Systems db/books/collections/kim95.html#Kim95b" }
+{ "id": 15, "dblpid": "books/acm/kim95/KimCGS95", "title": "On Resolving Schematic Heterogeneity in Multidatabase Systems.", "authors": "Won Kim Injun Choi Sunit K. Gala Mark Scheevel", "misc": "2002-01-03 521-550 1995 Modern Database Systems db/books/collections/kim95.html#KimCGS95" }
+{ "id": 16, "dblpid": "books/acm/kim95/KimG95", "title": "Requirements for a Performance Benchmark for Object-Oriented Database Systems.", "authors": "Won Kim Jorge F. Garza", "misc": "2002-01-03 203-215 1995 Modern Database Systems db/books/collections/kim95.html#KimG95" }
+{ "id": 17, "dblpid": "books/acm/kim95/KimK95", "title": "On View Support in Object-Oriented Databases Systems.", "authors": "Won Kim William Kelley", "misc": "2002-01-03 108-129 1995 Modern Database Systems db/books/collections/kim95.html#KimK95" }
+{ "id": 18, "dblpid": "books/acm/kim95/Kowalski95", "title": "The POSC Solution to Managing E&P Data.", "authors": "Vincent J. Kowalski", "misc": "2002-01-03 281-301 1995 Modern Database Systems db/books/collections/kim95.html#Kowalski95" }
+{ "id": 19, "dblpid": "books/acm/kim95/KriegerA95", "title": "C++ Bindings to an Object Database.", "authors": "David Krieger Tim Andrews", "misc": "2002-01-03 89-107 1995 Modern Database Systems db/books/collections/kim95.html#KriegerA95" }
+{ "id": 20, "dblpid": "books/acm/kim95/Lunt95", "title": "Authorization in Object-Oriented Databases.", "authors": "Teresa F. Lunt", "misc": "2002-01-03 130-145 1995 Modern Database Systems db/books/collections/kim95.html#Lunt95" }
+{ "id": 21, "dblpid": "books/acm/kim95/MengY95", "title": "Query Processing in Multidatabase Systems.", "authors": "Weiyi Meng Clement T. Yu", "misc": "2002-01-03 551-572 1995 Modern Database Systems db/books/collections/kim95.html#MengY95" }
+{ "id": 22, "dblpid": "books/acm/kim95/Motro95", "title": "Management of Uncerainty in database Systems.", "authors": "Amihai Motro", "misc": "2002-01-03 457-476 1995 Modern Database Systems db/books/collections/kim95.html#Motro95" }
+{ "id": 23, "dblpid": "books/acm/kim95/Omiecinski95", "title": "Parallel Relational Database Systems.", "authors": "Edward Omiecinski", "misc": "2002-01-03 494-512 1995 Modern Database Systems db/books/collections/kim95.html#Omiecinski95" }
+{ "id": 24, "dblpid": "books/acm/kim95/OzsuB95", "title": "Query Processing in Object-Oriented Database Systems.", "authors": "M. Tamer Özsu José A. Blakeley", "misc": "2002-01-03 146-174 1995 Modern Database Systems db/books/collections/kim95.html#OzsuB95" }
+{ "id": 25, "dblpid": "books/acm/kim95/RusinkiewiczS95", "title": "Specification and Execution of Transactional Workflows.", "authors": "Marek Rusinkiewicz Amit P. Sheth", "misc": "2004-03-08 592-620 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#RusinkiewiczS95 1995" }
+{ "id": 26, "dblpid": "books/acm/kim95/Samet95", "title": "Spatial Data Structures.", "authors": "Hanan Samet", "misc": "2004-03-08 361-385 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#Samet95 1995" }
+{ "id": 27, "dblpid": "books/acm/kim95/SametA95", "title": "Spatial Data Models and Query Processing.", "authors": "Hanan Samet Walid G. Aref", "misc": "2002-01-03 338-360 1995 Modern Database Systems db/books/collections/kim95.html#SametA95" }
+{ "id": 28, "dblpid": "books/acm/kim95/ShanADDK95", "title": "Pegasus A Heterogeneous Information Management System.", "authors": "Ming-Chien Shan Rafi Ahmed Jim Davis Weimin Du William Kent", "misc": "2004-03-08 664-682 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#ShanADDK95 1995" }
+{ "id": 29, "dblpid": "books/acm/kim95/Snodgrass95", "title": "Temporal Object-Oriented Databases A Critical Comparison.", "authors": "Richard T. Snodgrass", "misc": "2002-01-03 386-408 1995 Modern Database Systems db/books/collections/kim95.html#Snodgrass95" }
+{ "id": 30, "dblpid": "books/acm/kim95/SoleyK95", "title": "The OMG Object Model.", "authors": "Richard Mark Soley William Kent", "misc": "2002-01-03 18-41 1995 Modern Database Systems db/books/collections/kim95.html#SoleyK95" }
+{ "id": 31, "dblpid": "books/acm/kim95/Stout95", "title": "EDA/SQL.", "authors": "Ralph L. Stout", "misc": "2004-03-08 649-663 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#Stout95 1995" }
+{ "id": 32, "dblpid": "books/acm/kim95/Thompson95", "title": "The Changing Database Standards Landscape.", "authors": "Craig W. Thompson", "misc": "2002-01-03 302-317 1995 Modern Database Systems db/books/collections/kim95.html#Thompson95" }
+{ "id": 33, "dblpid": "books/acm/kim95/BreitbartR95", "title": "Overview of the ADDS System.", "authors": "Yuri Breitbart Tom C. Reyes", "misc": "2009-06-12 683-701 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#BreitbartR95 1995" }
+{ "id": 34, "dblpid": "books/acm/Kim95", "title": "Modern Database Systems The Object Model, Interoperability, and Beyond.", "authors": "", "misc": "2004-03-08 Won Kim Modern Database Systems ACM Press and Addison-Wesley 1995 0-201-59098-0 db/books/collections/kim95.html" }
+{ "id": 35, "dblpid": "books/ap/MarshallO79", "title": "Inequalities Theory of Majorization and Its Application.", "authors": "Albert W. Marshall Ingram Olkin", "misc": "2002-01-03 Academic Press 1979 0-12-473750-1" }
+{ "id": 36, "dblpid": "books/aw/kimL89/BjornerstedtH89", "title": "Version Control in an Object-Oriented Architecture.", "authors": "Anders Björnerstedt Christer Hulten", "misc": "2006-02-24 451-485 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#BjornerstedtH89" }
+{ "id": 37, "dblpid": "books/aw/kimL89/BretlMOPSSWW89", "title": "The GemStone Data Management System.", "authors": "Robert Bretl David Maier Allen Otis D. Jason Penney Bruce Schuchardt Jacob Stein E. Harold Williams Monty Williams", "misc": "2002-01-03 283-308 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#BretlMOPSSWW89" }
+{ "id": 38, "dblpid": "books/aw/kimL89/CareyDRS89", "title": "Storage Management in EXODUS.", "authors": "Michael J. Carey David J. DeWitt Joel E. Richardson Eugene J. Shekita", "misc": "2002-01-03 341-369 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#CareyDRS89" }
+{ "id": 39, "dblpid": "books/aw/kimL89/Decouchant89", "title": "A Distributed Object Manager for the Smalltalk-80 System.", "authors": "Dominique Decouchant", "misc": "2002-01-03 487-520 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#Decouchant89" }
+{ "id": 40, "dblpid": "books/aw/kimL89/DiederichM89", "title": "Objects, Messages, and Rules in Database Design.", "authors": "Jim Diederich Jack Milton", "misc": "2002-01-03 177-197 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#DiederichM89" }
+{ "id": 41, "dblpid": "books/aw/kimL89/EllisG89", "title": "Active Objects Ealities and Possibilities.", "authors": "Clarence A. Ellis Simon J. Gibbs", "misc": "2002-01-03 561-572 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#EllisG89" }
+{ "id": 42, "dblpid": "books/aw/kimL89/FishmanABCCDHHKLLMNRSW89", "title": "Overview of the Iris DBMS.", "authors": "Daniel H. Fishman Jurgen Annevelink David Beech E. C. Chow Tim Connors J. W. Davis Waqar Hasan C. G. Hoch William Kent S. Leichner Peter Lyngbæk Brom Mahbod Marie-Anne Neimat Tore Risch Ming-Chien Shan W. Kevin Wilkinson", "misc": "2002-01-03 219-250 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#FishmanABCCDHHKLLMNRSW89" }
+{ "id": 43, "dblpid": "books/aw/kimL89/KimBCGW89", "title": "Features of the ORION Object-Oriented Database System.", "authors": "Won Kim Nat Ballou Hong-Tai Chou Jorge F. Garza Darrell Woelk", "misc": "2002-01-03 251-282 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#KimBCGW89" }
+{ "id": 44, "dblpid": "books/aw/kimL89/KimKD89", "title": "Indexing Techniques for Object-Oriented Databases.", "authors": "Won Kim Kyung-Chang Kim Alfred G. Dale", "misc": "2002-01-03 371-394 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#KimKD89" }
+{ "id": 45, "dblpid": "books/aw/kimL89/King89", "title": "My Cat Is Object-Oriented.", "authors": "Roger King", "misc": "2002-01-03 23-30 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#King89" }
+{ "id": 46, "dblpid": "books/aw/kimL89/Maier89", "title": "Making Database Systems Fast Enough for CAD Applications.", "authors": "David Maier", "misc": "2002-01-03 573-582 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#Maier89" }
+{ "id": 47, "dblpid": "books/aw/kimL89/MellenderRS89", "title": "Optimizing Smalltalk Message Performance.", "authors": "Fred Mellender Steve Riegel Andrew Straw", "misc": "2002-01-03 423-450 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#MellenderRS89" }
+{ "id": 48, "dblpid": "books/aw/kimL89/Moon89", "title": "The Common List Object-Oriented Programming Language Standard.", "authors": "David A. Moon", "misc": "2002-01-03 49-78 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#Moon89" }
+{ "id": 49, "dblpid": "books/aw/kimL89/Moss89", "title": "Object Orientation as Catalyst for Language-Database Inegration.", "authors": "J. Eliot B. Moss", "misc": "2002-01-03 583-592 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#Moss89" }
+{ "id": 50, "dblpid": "books/aw/kimL89/Nierstrasz89", "title": "A Survey of Object-Oriented Concepts.", "authors": "Oscar Nierstrasz", "misc": "2002-01-03 3-21 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#Nierstrasz89" }
+{ "id": 51, "dblpid": "books/aw/kimL89/NierstraszT89", "title": "Integrated Office Systems.", "authors": "Oscar Nierstrasz Dennis Tsichritzis", "misc": "2002-01-03 199-215 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#NierstraszT89" }
+{ "id": 52, "dblpid": "books/aw/kimL89/Russinoff89", "title": "Proteus A Frame-Based Nonmonotonic Inference System.", "authors": "David M. Russinoff", "misc": "2002-01-03 127-150 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#Russinoff89" }
+{ "id": 53, "dblpid": "books/aw/kimL89/SkarraZ89", "title": "Concurrency Control and Object-Oriented Databases.", "authors": "Andrea H. Skarra Stanley B. Zdonik", "misc": "2002-01-03 395-421 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#SkarraZ89" }
+{ "id": 54, "dblpid": "books/aw/kimL89/SteinLU89", "title": "A Shared View of Sharing The Treaty of Orlando.", "authors": "Lynn Andrea Stein Henry Lieberman David Ungar", "misc": "2002-01-03 31-48 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#SteinLU89" }
+{ "id": 55, "dblpid": "books/aw/kimL89/TarltonT89", "title": "Pogo A Declarative Representation System for Graphics.", "authors": "Mark A. Tarlton P. Nong Tarlton", "misc": "2002-01-03 151-176 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#TarltonT89" }
+{ "id": 56, "dblpid": "books/aw/kimL89/TomlinsonS89", "title": "Concurrent Object-Oriented Programming Languages.", "authors": "Chris Tomlinson Mark Scheevel", "misc": "2002-01-03 79-124 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#TomlinsonS89" }
+{ "id": 57, "dblpid": "books/aw/kimL89/TsichritzisN89", "title": "Directions in Object-Oriented Research.", "authors": "Dennis Tsichritzis Oscar Nierstrasz", "misc": "2002-01-03 523-536 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#TsichritzisN89" }
+{ "id": 58, "dblpid": "books/aw/kimL89/Wand89", "title": "A Proposal for a Formal Model of Objects.", "authors": "Yair Wand", "misc": "2002-01-03 537-559 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#Wand89" }
+{ "id": 59, "dblpid": "books/aw/kimL89/WeiserL89", "title": "OZ+ An Object-Oriented Database System.", "authors": "Stephen P. Weiser Frederick H. Lochovsky", "misc": "2002-01-03 309-337 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#WeiserL89" }
+{ "id": 60, "dblpid": "books/aw/stonebraker86/RoweS86", "title": "The Commercial INGRES Epilogue.", "authors": "Lawrence A. Rowe Michael Stonebraker", "misc": "2002-01-03 63-82 1986 The INGRES Papers db/books/collections/Stonebraker86.html#RoweS86 db/books/collections/Stonebraker86/RoweS86.html ingres/P063.pdf" }
+{ "id": 61, "dblpid": "books/aw/stonebraker86/Stonebraker86", "title": "Design of Relational Systems (Introduction to Section 1).", "authors": "Michael Stonebraker", "misc": "2002-01-03 1-3 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86 db/books/collections/Stonebraker86/Stonebraker86.html ingres/P001.pdf" }
+{ "id": 62, "dblpid": "books/aw/stonebraker86/Stonebraker86a", "title": "Supporting Studies on Relational Systems (Introduction to Section 2).", "authors": "Michael Stonebraker", "misc": "2002-01-03 83-85 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86a db/books/collections/Stonebraker86/Stonebraker86a.html ingres/P083.pdf" }
+{ "id": 63, "dblpid": "books/aw/stonebraker86/Stonebraker86b", "title": "Distributed Database Systems (Introduction to Section 3).", "authors": "Michael Stonebraker", "misc": "2002-01-03 183-186 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86b db/books/collections/Stonebraker86/Stonebraker86b.html ingres/P183.pdf" }
+{ "id": 64, "dblpid": "books/aw/stonebraker86/Stonebraker86c", "title": "The Design and Implementation of Distributed INGRES.", "authors": "Michael Stonebraker", "misc": "2002-01-03 187-196 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86c db/books/collections/Stonebraker86/Stonebraker86c.html ingres/P187.pdf" }
+{ "id": 65, "dblpid": "books/aw/stonebraker86/Stonebraker86d", "title": "User Interfaces for Database Systems (Introduction to Section 4).", "authors": "Michael Stonebraker", "misc": "2002-01-03 243-245 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86d db/books/collections/Stonebraker86/Stonebraker86d.html ingres/P243.pdf" }
+{ "id": 66, "dblpid": "books/aw/stonebraker86/Stonebraker86e", "title": "Extended Semantics for the Relational Model (Introduction to Section 5).", "authors": "Michael Stonebraker", "misc": "2002-01-03 313-316 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86e db/books/collections/Stonebraker86/Stonebraker86e.html ingres/P313.pdf" }
+{ "id": 67, "dblpid": "books/aw/stonebraker86/Stonebraker86f", "title": "Database Design (Introduction to Section 6).", "authors": "Michael Stonebraker", "misc": "2002-01-03 393-394 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86f db/books/collections/Stonebraker86/Stonebraker86f.html ingres/P393.pdf" }
+{ "id": 68, "dblpid": "books/aw/stonebraker86/X86", "title": "Title, Preface, Contents.", "authors": "", "misc": "2002-01-03 1986 The INGRES Papers db/books/collections/Stonebraker86.html#X86 db/books/collections/Stonebraker86/X86.html ingres/frontmatter.pdf" }
+{ "id": 69, "dblpid": "books/aw/stonebraker86/X86a", "title": "References.", "authors": "", "misc": "2002-01-03 429-444 1986 The INGRES Papers db/books/collections/Stonebraker86.html#X86a db/books/collections/Stonebraker86/X86a.html ingres/P429.pdf" }
+{ "id": 70, "dblpid": "books/aw/Knuth86a", "title": "TeX The Program", "authors": "Donald E. Knuth", "misc": "2002-01-03 Addison-Wesley 1986 0-201-13437-3" }
+{ "id": 71, "dblpid": "books/aw/AbiteboulHV95", "title": "Foundations of Databases.", "authors": "Serge Abiteboul Richard Hull Victor Vianu", "misc": "2002-01-03 Addison-Wesley 1995 0-201-53771-0 AHV/Toc.pdf ... ... journals/tods/AstrahanBCEGGKLMMPTWW76 books/bc/AtzeniA93 journals/tcs/AtzeniABM82 journals/jcss/AbiteboulB86 journals/csur/AtkinsonB87 conf/pods/AtzeniB87 journals/vldb/AbiteboulB95 conf/sigmod/AbiteboulB91 conf/dood/AtkinsonBDDMZ89 conf/vldb/AlbanoBGO93 ... conf/icdt/Abiteboul88 journals/ipl/Abiteboul89 conf/ds/Abrial74 journals/tods/AhoBU79 books/mk/minker88/AptBW88 conf/vldb/AroraC78 conf/stoc/AfratiC89 journals/tods/AlbanoCO85 conf/pods/AfratiCY91 conf/pods/AusielloDM85 conf/vldb/AbiteboulG85 journals/jacm/AjtaiG87 conf/focs/AjtaiG89 journals/tods/AbiteboulG91 ... ... journals/tods/AbiteboulH87 conf/sigmod/AbiteboulH88 ... conf/sigmod/AbiteboulK89 journals/tcs/AbiteboulKG91 journals/jcss/AbiteboulKRW95 conf/sigmod/AbiteboulLUW93 conf/pods/AtzeniP82 conf/pods/AfratiP87 conf/pods/AptP87 conf/wg/AndriesP91 conf/pods/AfratiPPRSU86 books/el/leeuwen90/Apt90 conf/ifip/Armstrong74 journals/siamcomp/AhoSSU81 journals/tods/AhoSU79 journals/siamcomp/AhoSU79 conf/pods/AbiteboulSV90 journals/is/AtzeniT93 conf/popl/AhoU79 conf/pods/AbiteboulV87 conf/jcdkb/AbiteboulV88 journals/jacm/AbiteboulV88 conf/pods/AbiteboulV88 journals/jacm/AbiteboulV89 journals/jcss/AbiteboulV90 journals/jcss/AbiteboulV91 conf/stoc/AbiteboulV91 journals/amai/AbiteboulV91 journals/jcss/AbiteboulV95 journals/jacm/AptE82 conf/coco/AbiteboulVV92 conf/iclp/AptB88 conf/oopsla/BobrowKKMSZ86 journals/tse/BatoryBGSTTW88 conf/mfcs/Bancilhon78 ... conf/db-workshops/Bancilhon85 books/el/leeuwen90/Barendregt90 ... journals/tods/BeeriB79 books/el/leeuwen90/BerstelB90 conf/icdt/BeneventanoB92 conf/vldb/BernsteinBC80 conf/vldb/BeeriBG78 conf/sigmod/BorgidaBMR89 journals/tods/BunemanC79 journals/jacm/BernsteinC81 conf/dbpl/BancilhonCD89 books/bc/tanselCGSS93/BaudinetCW93 conf/sigmod/BiskupDB79 journals/jacm/BeeriDFS84 books/mk/BancilhonDK92 conf/edbt/BryDM88 conf/pods/BunemanDW88 journals/jcss/BunemanDW91 journals/tods/Beeri80 journals/dke/Beeri90 ... journals/tods/Bernstein76 conf/lics/BidoitF87 journals/iandc/BidoitF91 conf/sigmod/BeeriFH77 conf/stoc/BeeriFMMUY81 journals/jacm/BeeriFMY83 journals/tods/BunemanFN82 journals/siamcomp/BernsteinG81 journals/iandc/BlassGK85 conf/ijcai/BrachmanGL85 journals/tods/BernsteinGWRR81 books/aw/BernsteinHG87 ... journals/tcs/Bidoit91 journals/tcs/Biskup80 conf/adbt/Biskup79 journals/tods/Biskup83 journals/tcs/BunemanJO91 journals/tods/BeeriK86 conf/pods/BeeriKBR87 conf/icdt/BidoitL90 journals/csur/BatiniL86 conf/sigmod/BlakeleyLT86 conf/vldb/BeeriM91 conf/sigmod/BlakeleyMG93 journals/siamcomp/BeeriMSU81 conf/pods/BancilhonMSU86 conf/pods/BeeriNRST87 journals/software/Borgida85 conf/icalp/BraP83 conf/fgcs/BalbinMR88 ... conf/pods/BeeriR87 journals/jlp/BalbinR87 conf/sigmod/BancilhonR86 books/mk/minker88/BancilhonR88 journals/jlp/BeeriR91 conf/vldb/BancilhonRS82 conf/pods/BeeriRSS92 conf/dood/Bry89 journals/tods/BancilhonS81 journals/cogsci/BrachmanS85 journals/tods/BergamaschiS92 conf/sigmod/BernsteinST75 conf/dbpl/TannenBN91 conf/icdt/TannenBW92 ... journals/jacm/BeeriV84 conf/icalp/BeeriV81 conf/adbt/BeeriV79 journals/siamcomp/BeeriV84 journals/iandc/BeeriV84 journals/jacm/BeeriV84 journals/tcs/BeeriV85 journals/ibmrd/ChamberlinAEGLMRW76 ... journals/iandc/Cardelli88 books/mk/Cattell94 conf/sigmod/CacaceCCTZ90 conf/vldb/CastilhoCF82 conf/adbt/CasanovaF82 conf/focs/CaiFI89 journals/jcss/CasanovaFP84 conf/stoc/CosmadakisGKV88 conf/dood/CorciuloGP93 books/sp/CeriGT90 conf/focs/ChandraH80 journals/jcss/ChandraH80 journals/jcss/ChandraH82 journals/jlp/ChandraH85 conf/popl/Chandra81 conf/adbt/Chang79 conf/pods/Chandra88 ... journals/tods/Chen76 conf/ride/ChenHM94 conf/icde/Chomicki92 conf/pods/Chomicki92 ... ... ... conf/stoc/CosmadakisK85 journals/acr/CosmadakisK86 ... journals/jcss/CosmadakisKS86 journals/jacm/CosmadakisKV90 ... conf/pods/CalvaneseL94 conf/adbt/Clark77 conf/stoc/ChandraLM81 conf/stoc/ChandraM77 conf/pods/ConsensM90 conf/sigmod/ConsensM93 conf/icdt/ConsensM90 journals/cacm/Codd70 conf/sigmod/Codd71a persons/Codd71a persons/Codd72 conf/ifip/Codd74 ... conf/sigmod/Codd79 journals/cacm/Codd82 ... conf/sigmod/Cohen89 journals/cacm/Cohen90 ... journals/jcss/Cook74 conf/pods/Cosmadakis83 conf/focs/Cosmadakis87 books/el/leeuwen90/Courcelle90a journals/jacm/CosmadakisP84 conf/edbt/CeriCGLLTZ88 ... conf/vldb/CeriT87 conf/vldb/CasanovaTF88 ... conf/pods/CasanovaV83 journals/siamcomp/ChandraV85 conf/pods/ChaudhuriV92 conf/pods/ChaudhuriV93 conf/pods/ChaudhuriV94 journals/csur/CardelliW85 conf/pods/ChenW89 conf/pods/CohenW89 conf/vldb/CeriW90 conf/vldb/CeriW91 conf/iclp/ChenW92 conf/vldb/CeriW93 ... conf/birthday/Dahlhaus87 conf/vldb/Date81 books/aw/Date86 ... conf/dbpl/Dayal89 journals/tods/DayalB82 journals/ibmrd/DelobelC73 conf/icde/DelcambreD89 ... journals/tods/Delobel78 journals/jacm/Demolombe92 journals/tods/DateF92 ... conf/vldb/DayalHL91 journals/jacm/Paola69a conf/caap/DahlhausM86 journals/acr/DAtriM86 journals/iandc/DahlhausM92 conf/sigmod/DerrMP93 conf/vldb/MaindrevilleS88 conf/pods/Dong92 conf/adbt/BraP82 ... conf/dbpl/DongS91 journals/iandc/DongS95 conf/dbpl/DongS93 conf/dbpl/DongS93 conf/icdt/DongT92 conf/vldb/DenninghoffV91 conf/pods/DenninghoffV93 ... ... books/acm/kim95/DayalHW95 ... conf/pods/EiterGM94 conf/pods/Escobar-MolanoHJ93 ... books/el/leeuwen90/Emerson90 books/bc/ElmasriN89 ... conf/icse/Eswaran76 conf/sigmod/EpsteinSW78 ... ... conf/vldb/Fagin77 journals/tods/Fagin77 conf/sigmod/Fagin79 journals/tods/Fagin81 journals/ipl/FaginV83 journals/jacm/Fagin82 journals/jacm/Fagin83 journals/tcs/Fagin93 books/sp/kimrb85/FurtadoC85 ... journals/jlp/Fitting85a journals/tcs/FischerJT83 journals/acr/FaginKUV86 conf/icdt/FernandezM92 journals/tods/FaginMU82 conf/vldb/FaloutsosNS91 ... journals/ai/Forgy82 ... conf/sigmod/Freytag87 ... journals/siamcomp/FischerT83 journals/siamcomp/FaginMUY83 conf/pods/FaginUV83 conf/icalp/FaginV84 ... ... ... ... conf/sigmod/GraefeD87 conf/ride/GatziuD94 conf/sigmod/GardarinM86 conf/sigmod/GyssensG88 journals/tcs/GinsburgH83a journals/jacm/GinsburgH86 ... books/bc/tanselCGSS93/Ginsburg93 books/fm/GareyJ79 journals/jacm/GrantJ82 conf/vldb/GehaniJ91 conf/vldb/GhandeharizadehHJCELLTZ93 journals/tods/GhandeharizadehHJ96 conf/vldb/GehaniJS92 ... conf/sigmod/GehaniJS92 ... conf/deductive/GuptaKM92 conf/pods/GurevichL82 conf/iclp/GelfondL88 conf/adbt/77 journals/csur/GallaireMN84 conf/pods/GrahneMR92 conf/sigmod/GuptaMS93 conf/lics/GaifmanMSV87 journals/jacm/GaifmanMSV93 journals/jacm/GrahamMV86 conf/csl/GradelO92 ... conf/pods/Gottlob87 conf/pods/GyssensPG90 conf/dood/GiannottiPSZ91 books/aw/GoldbergR83 journals/acr/GrahneR86 journals/ipl/Grant77 ... journals/iandc/Grandjean83 conf/vldb/Grahne84 ... journals/csur/Graefe93 books/sp/Greibach75 journals/tods/GoodmanS82 journals/jcss/GoodmanS84 conf/focs/GurevichS85 ... conf/pods/GrumbachS94 conf/sigmod/GangulyST90 ... journals/tcs/Gunter92 ... ... ... ... conf/pods/GrahamV84 conf/pods/GrumbachV91 conf/icde/GardarinV92 conf/sigmod/GraefeW89 ... journals/jacm/GinsburgZ82 conf/vldb/GottlobZ88 ... ... journals/sigmod/Hanson89 ... journals/cacm/Harel80 journals/tkde/HaasCLMWLLPCS90 conf/lics/Hella92 journals/iandc/Herrmann95 conf/pods/HirstH93 conf/vldb/HullJ91 conf/ewdw/HullJ90 journals/csur/HullK87 journals/tods/HudsonK89 conf/lics/HillebrandKM93 conf/nato/HillebrandKR93 conf/jcdkb/HsuLM88 journals/ipl/HoneymanLY80 journals/tods/HammerM81 conf/adbt/HenschenMN82 ... journals/jacm/HenschenN84 journals/jacm/Honeyman82 conf/sigmod/HullS89 conf/pods/HullS89 journals/acta/HullS94 journals/jcss/HullS93 conf/fodo/HullTY89 journals/jcss/Hull83 journals/jacm/Hull84 journals/tcs/Hull85 journals/siamcomp/Hull86 ... conf/vldb/Hulin89 ... journals/jacm/HullY84 conf/vldb/HullY90 conf/pods/HullY91 conf/sigmod/IoannidisK90 journals/jcss/ImielinskiL84 conf/adbt/Imielinski82 journals/jcss/Immerman82 journals/iandc/Immerman86 ... journals/siamcomp/Immerman87 conf/pods/ImielinskiN88 conf/vldb/IoannidisNSS92 conf/sigmod/ImielinskiNV91 conf/dood/ImielinskiNV91 conf/vldb/Ioannidis85 journals/jacm/Jacobs82 conf/dbpl/JacobsH91 journals/csur/JarkeK84 journals/jcss/JohnsonK84 conf/popl/JaffarL87 books/el/leeuwen90/Johnson90 journals/jacm/Joyner76 conf/pods/JaeschkeS82 ... books/mk/minker88/Kanellakis88 books/el/leeuwen90/Kanellakis90 conf/oopsla/KhoshafianC86 conf/edbt/KotzDM88 conf/jcdkb/Keller82 conf/pods/Keller85 journals/computer/Keller86 ... journals/tods/Kent79 ... journals/ngc/RohmerLK86 conf/tacs/KanellakisG94 conf/jcdkb/Kifer88 conf/pods/KanellakisKR90 conf/sigmod/KiferKS92 ... conf/icdt/KiferL86 books/aw/KimL89 ... journals/tods/Klug80 journals/jacm/Klug82 journals/jacm/Klug88 journals/jacm/KiferLW95 conf/kr/KatsunoM91 journals/ai/KatsunoM92 conf/jcdkb/KrishnamurthyN88 journals/csur/Knight89 ... journals/iandc/Kolaitis91 journals/ai/Konolige88 conf/ifip/Kowalski74 journals/jacm/Kowalski75 conf/bncod/Kowalski84 conf/vldb/KoenigP81 journals/tods/KlugP82 ... conf/pods/KolaitisP88 conf/pods/KiferRS88 conf/sigmod/KrishnamurthyRS88 books/mg/SilberschatzK91 conf/iclp/KempT88 conf/sigmod/KellerU84 conf/dood/Kuchenhoff91 ... journals/jlp/Kunen87 conf/iclp/Kunen88 conf/pods/Kuper87 conf/pods/Kuper88 conf/ppcp/Kuper93 conf/pods/KuperV84 conf/stoc/KolaitisV87 journals/tcs/KarabegV90 journals/iandc/KolaitisV90 conf/pods/KolaitisV90 journals/tods/KarabegV91 journals/iandc/KolaitisV92 journals/tcs/KuperV93 journals/tods/KuperV93 journals/tse/KellerW85 conf/pods/KiferW89 conf/jcdkb/Lang88 books/el/Leeuwen90 ... journals/jcss/Leivant89 ... journals/iandc/Leivant90 ... conf/db-workshops/Levesque82 journals/ai/Levesque84 conf/mfdbs/Libkin91 conf/er/Lien79 journals/jacm/Lien82 books/mk/minker88/Lifschitz88 ... journals/tcs/Lindell91 journals/tods/Lipski79 journals/jacm/Lipski81 journals/tcs/LeratL86 journals/cj/LeveneL90 books/sp/Lloyd87 conf/pods/LakshmananM89 conf/tlca/LeivantM93 conf/sigmod/LaverMG83 conf/pods/LiptonN90 journals/jcss/LucchesiO78 conf/sigmod/Lohman88 ... conf/ijcai/Lozinskii85 books/ph/LewisP81 ... conf/sigmod/LecluseRV88 journals/is/LipeckS87 journals/jlp/LloydST87 journals/tods/LingTK81 conf/sigmod/LyngbaekV87 conf/dood/LefebvreV89 conf/pods/LibkinW93 conf/dbpl/LibkinW93 journals/jacm/Maier80 books/cs/Maier83 ... conf/vldb/Makinouchi77 conf/icalp/Makowsky81 ... conf/icdt/Malvestuto86 conf/aaai/MacGregorB92 journals/tods/MylopoulosBW80 conf/sigmod/McCarthyD89 journals/csur/MishraE92 conf/sigmod/MumickFPR90 books/mk/Minker88 journals/jlp/Minker88 conf/vldb/MillerIR93 journals/is/MillerIR94 journals/iandc/Mitchell83 conf/pods/Mitchell83 conf/vldb/MendelzonM79 journals/tods/MaierMS79 journals/jcss/MaierMSU80 conf/pods/MendelzonMW94 journals/debu/MorrisNSUG87 journals/ai/Moore85 conf/vldb/Morgenstern83 conf/pods/Morris88 ... conf/pods/MannilaR85 ... journals/jlp/MinkerR90 books/aw/MannilaR92 journals/acr/MaierRW86 ... journals/tods/MarkowitzS92 conf/pods/Marchetti-SpaccamelaPS87 journals/jacm/MaierSY81 conf/iclp/MorrisUG86 journals/tods/MaierUV84 conf/iclp/MorrisUG86 journals/acta/MakowskyV86 books/bc/MaierW88 books/mk/minker88/ManchandraW88 conf/pods/Naughton86 conf/sigmod/NgFS91 ... conf/vldb/Nejdl87 conf/adbt/NicolasM77 conf/sigmod/Nicolas78 journals/acta/Nicolas82 conf/ds/76 conf/pods/NaqviK88 journals/tods/NegriPS91 conf/vldb/NaughtonRSU89 conf/pods/NaughtonS87 ... ... conf/vldb/Osborn79 ... journals/tods/OzsoyogluY87 conf/adbt/Paige82 ... books/cs/Papadimitriou86 ... journals/ipl/Paredaens78 ... books/sp/ParedaensBGG89 journals/ai/Andersen91 books/el/leeuwen90/Perrin90 journals/ins/Petrov89 conf/pods/ParedaensG88 conf/pods/PatnaikI94 conf/adbt/ParedaensJ79 journals/csur/PeckhamM88 ... ... conf/sigmod/ParkerP80 ... conf/iclp/Przymusinski88 conf/pods/Przymusinski89 ... conf/vldb/ParkerSV92 conf/aaai/PearlV87 journals/ai/PereiraW80a conf/pods/PapadimitriouY92 journals/tkde/QianW91 ... journals/jlp/Ramakrishnan91 conf/pods/RamakrishnanBS87 ... conf/adbt/Reiter77 journals/ai/Reiter80 conf/db-workshops/Reiter82 journals/jacm/Reiter86 journals/tods/Rissanen77 conf/mfcs/Rissanen78 conf/pods/Rissanen82 ... journals/ngc/RohmerLK86 journals/jacm/Robinson65 ... conf/pods/Ross89 ... ... conf/sigmod/RoweS79 conf/sigmod/RichardsonS91 journals/debu/RamamohanaraoSBPNTZD87 conf/vldb/RamakrishnanSS92 conf/sigmod/RamakrishnanSSS93 conf/pods/RamakrishnanSUV89 journals/jcss/RamakrishnanSUV93 journals/jlp/RamakrishnanU95 conf/sigmod/SelingerACLP79 conf/sigmod/Sagiv81 journals/tods/Sagiv83 books/mk/minker88/Sagiv88 conf/slp/Sagiv90 conf/sigmod/Sciore81 journals/jacm/Sciore82 conf/pods/Sciore83 journals/acr/Sciore86 journals/jacm/SagivDPF81 conf/pods/X89 ... journals/ai/SmithG85 books/mk/minker88/Shepherdson88 journals/tods/Shipman81 conf/pods/Shmueli87 conf/iclp/SekiI88 conf/sigmod/ShmueliI84 journals/tc/Sickel76 journals/jsc/Siekmann89 conf/sigmod/StonebrakerJGP90 conf/vldb/SimonKM92 journals/csur/ShethL90 conf/pods/SeibL91 conf/sigmod/SuLRD93 conf/adbt/SilvaM79 journals/sigmod/Snodgrass90 journals/sigmod/Soo91 conf/pods/SuciuP94 conf/sigmod/StonebrakerR86 conf/slp/SudarshanR93 conf/pods/SagivS86 journals/cacm/Stonebraker81 books/mk/Stonebraker88 journals/tkde/Stonebraker92 books/aw/Stroustrup91 journals/jacm/SadriU82 conf/vldb/Su91 conf/pods/SagivV89 journals/jacm/SagivW82 journals/tods/StonebrakerWKH76 journals/jacm/SagivY80 conf/pods/SaccaZ86 journals/tcs/SaccaZ88 ... conf/pods/SaccaZ90 ... ... books/bc/TanselCGJSS93 ... journals/acr/ThomasF86 ... ... ... ... journals/tcs/Topor87 ... books/mk/minker88/ToporS88 ... journals/siamcomp/TarjanY84 journals/csur/TeoreyYF86 journals/algorithmica/UllmanG88 conf/pods/Ullman82 books/cs/Ullman82 journals/tods/Ullman85 books/cs/Ullman88 conf/pods/Ullman89 books/cs/Ullman89 conf/sigmod/Gelder86 ... conf/pods/BusscheG92 conf/focs/BusscheGAG92 conf/pods/BusscheP91 conf/slp/Gelder86 conf/pods/Gelder89 conf/pods/GelderRS88 journals/jacm/GelderRS91 journals/tods/GelderT91 journals/ipl/Vardi81 conf/stoc/Vardi82 conf/focs/Vardi82 journals/acta/Vardi83 journals/jcss/Vardi84 conf/pods/Vardi85 conf/pods/Vardi86 journals/jcss/Vardi86 ... conf/pods/Vardi88 conf/sigmod/Vassiliou79 ... ... journals/jacm/EmdenK76 conf/nf2/SchollABBGPRV87 journals/jacm/Vianu87 journals/acta/Vianu87 conf/eds/Vieille86 conf/iclp/Vieille87 ... conf/eds/Vieille88 journals/tcs/Vieille89 ... journals/tcs/VianuV92 conf/sigmod/WidomF90 conf/icde/WangH92 conf/pos/WidjojoHW90 journals/computer/Wiederhold92 conf/pods/Wilkins86 conf/pods/Winslett88 conf/sigmod/WolfsonO90 conf/pods/Wong93 conf/sigmod/WolfsonS88 journals/ibmrd/WangW75 journals/tods/WongY76 conf/vldb/Yannakakis81 journals/csur/YuC84 ... journals/jcss/YannakakisP82 ... journals/tods/Zaniolo82 journals/jcss/Zaniolo84 ... conf/edbt/ZhouH90 journals/ibmsj/Zloof77 books/mk/ZdonikM90 db/books/dbtext/abiteboul95.html" }
+{ "id": 72, "dblpid": "books/aw/Lamport86", "title": "LaTeX User's Guide & Reference Manual", "authors": "Leslie Lamport", "misc": "2002-01-03 Addison-Wesley 1986 0-201-15790-X" }
+{ "id": 73, "dblpid": "books/aw/AhoHU74", "title": "The Design and Analysis of Computer Algorithms.", "authors": "Alfred V. Aho John E. Hopcroft Jeffrey D. Ullman", "misc": "2002-01-03 Addison-Wesley 1974 0-201-00029-6" }
+{ "id": 74, "dblpid": "books/aw/Lamport2002", "title": "Specifying Systems, The TLA+ Language and Tools for Hardware and Software Engineers", "authors": "Leslie Lamport", "misc": "2005-07-28 Addison-Wesley 2002 0-3211-4306-X http //research.microsoft.com/users/lamport/tla/book.html" }
+{ "id": 75, "dblpid": "books/aw/AhoHU83", "title": "Data Structures and Algorithms.", "authors": "Alfred V. Aho John E. Hopcroft Jeffrey D. Ullman", "misc": "2002-01-03 Addison-Wesley 1983 0-201-00023-7" }
+{ "id": 76, "dblpid": "books/aw/LewisBK01", "title": "Databases and Transaction Processing An Application-Oriented Approach", "authors": "Philip M. Lewis Arthur J. Bernstein Michael Kifer", "misc": "2002-01-03 Addison-Wesley 2001 0-201-70872-8" }
+{ "id": 77, "dblpid": "books/aw/AhoKW88", "title": "The AWK Programming Language", "authors": "Alfred V. Aho Brian W. Kernighan Peter J. Weinberger", "misc": "2002-01-03 Addison-Wesley 1988" }
+{ "id": 78, "dblpid": "books/aw/LindholmY97", "title": "The Java Virtual Machine Specification", "authors": "Tim Lindholm Frank Yellin", "misc": "2002-01-28 Addison-Wesley 1997 0-201-63452-X" }
+{ "id": 79, "dblpid": "books/aw/AhoSU86", "title": "Compilers Princiles, Techniques, and Tools.", "authors": "Alfred V. Aho Ravi Sethi Jeffrey D. Ullman", "misc": "2002-01-03 Addison-Wesley 1986 0-201-10088-6" }
+{ "id": 80, "dblpid": "books/aw/Sedgewick83", "title": "Algorithms", "authors": "Robert Sedgewick", "misc": "2002-01-03 Addison-Wesley 1983 0-201-06672-6" }
+{ "id": 81, "dblpid": "journals/siamcomp/AspnesW96", "title": "Randomized Consensus in Expected O(n log² n) Operations Per Processor.", "authors": "James Aspnes Orli Waarts", "misc": "2002-01-03 1024-1044 1996 25 SIAM J. Comput. 5 db/journals/siamcomp/siamcomp25.html#AspnesW96" }
+{ "id": 82, "dblpid": "conf/focs/AspnesW92", "title": "Randomized Consensus in Expected O(n log ^2 n) Operations Per Processor", "authors": "James Aspnes Orli Waarts", "misc": "2006-04-25 137-146 conf/focs/FOCS33 1992 FOCS db/conf/focs/focs92.html#AspnesW92" }
+{ "id": 83, "dblpid": "journals/siamcomp/Bloniarz83", "title": "A Shortest-Path Algorithm with Expected Time O(n² log n log* n).", "authors": "Peter A. Bloniarz", "misc": "2002-01-03 588-600 1983 12 SIAM J. Comput. 3 db/journals/siamcomp/siamcomp12.html#Bloniarz83" }
+{ "id": 84, "dblpid": "conf/stoc/Bloniarz80", "title": "A Shortest-Path Algorithm with Expected Time O(n^2 log n log ^* n)", "authors": "Peter A. Bloniarz", "misc": "2006-04-25 378-384 conf/stoc/STOC12 1980 STOC db/conf/stoc/stoc80.html#Bloniarz80" }
+{ "id": 85, "dblpid": "journals/siamcomp/Megiddo83a", "title": "Linear-Time Algorithms for Linear Programming in R³ and Related Problems.", "authors": "Nimrod Megiddo", "misc": "2002-01-03 759-776 1983 12 SIAM J. Comput. 4 db/journals/siamcomp/siamcomp12.html#Megiddo83a" }
+{ "id": 86, "dblpid": "conf/focs/Megiddo82", "title": "Linear-Time Algorithms for Linear Programming in R^3 and Related Problems", "authors": "Nimrod Megiddo", "misc": "2006-04-25 329-338 conf/focs/FOCS23 1982 FOCS db/conf/focs/focs82.html#Megiddo82" }
+{ "id": 87, "dblpid": "journals/siamcomp/MoffatT87", "title": "An All Pairs Shortest Path Algorithm with Expected Time O(n² log n).", "authors": "Alistair Moffat Tadao Takaoka", "misc": "2002-01-03 1023-1031 1987 16 SIAM J. Comput. 6 db/journals/siamcomp/siamcomp16.html#MoffatT87" }
+{ "id": 88, "dblpid": "conf/focs/MoffatT85", "title": "An All Pairs Shortest Path Algorithm with Expected Running Time O(n^2 log n)", "authors": "Alistair Moffat Tadao Takaoka", "misc": "2006-04-25 101-105 conf/focs/FOCS26 1985 FOCS db/conf/focs/focs85.html#MoffatT85" }
+{ "id": 89, "dblpid": "conf/icip/SchonfeldL98", "title": "VORTEX Video Retrieval and Tracking from Compressed Multimedia Databases.", "authors": "Dan Schonfeld Dan Lelescu", "misc": "2002-11-05 123-127 1998 ICIP (3) db/conf/icip/icip1998-3.html#SchonfeldL98" }
+{ "id": 90, "dblpid": "conf/hicss/SchonfeldL99", "title": "VORTEX Video Retrieval and Tracking from Compressed Multimedia Databases ¾ Visual Search Engine.", "authors": "Dan Schonfeld Dan Lelescu", "misc": "2002-01-03 1999 HICSS http //computer.org/proceedings/hicss/0001/00013/00013006abs.htm db/conf/hicss/hicss1999-3.html#SchonfeldL99" }
+{ "id": 91, "dblpid": "journals/corr/abs-0802-2861", "title": "Geometric Set Cover and Hitting Sets for Polytopes in $R^3$", "authors": "Sören Laue", "misc": "2008-03-03 http //arxiv.org/abs/0802.2861 2008 CoRR abs/0802.2861 db/journals/corr/corr0802.html#abs-0802-2861 informal publication" }
+{ "id": 92, "dblpid": "conf/stacs/Laue08", "title": "Geometric Set Cover and Hitting Sets for Polytopes in R³.", "authors": "Sören Laue", "misc": "2008-03-04 2008 STACS 479-490 http //drops.dagstuhl.de/opus/volltexte/2008/1367 conf/stacs/2008 db/conf/stacs/stacs2008.html#Laue08" }
+{ "id": 93, "dblpid": "journals/iandc/IbarraJCR91", "title": "Some Classes of Languages in NC¹", "authors": "Oscar H. Ibarra Tao Jiang Jik H. Chang Bala Ravikumar", "misc": "2006-04-25 86-106 Inf. Comput. January 1991 90 1 db/journals/iandc/iandc90.html#IbarraJCR91" }
+{ "id": 94, "dblpid": "conf/awoc/IbarraJRC88", "title": "On Some Languages in NC.", "authors": "Oscar H. Ibarra Tao Jiang Bala Ravikumar Jik H. Chang", "misc": "2002-08-06 64-73 1988 conf/awoc/1988 AWOC db/conf/awoc/awoc88.html#IbarraJRC88" }
+{ "id": 95, "dblpid": "journals/jacm/GalilHLSW87", "title": "An O(n³log n) deterministic and an O(n³) Las Vegs isomorphism test for trivalent graphs.", "authors": "Zvi Galil Christoph M. Hoffmann Eugene M. Luks Claus-Peter Schnorr Andreas Weber", "misc": "2003-11-20 513-531 1987 34 J. ACM 3 http //doi.acm.org/10.1145/28869.28870 db/journals/jacm/jacm34.html#GalilHLSW87" }
+{ "id": 96, "dblpid": "conf/focs/GalilHLSW82", "title": "An O(n^3 log n) Deterministic and an O(n^3) Probabilistic Isomorphism Test for Trivalent Graphs", "authors": "Zvi Galil Christoph M. Hoffmann Eugene M. Luks Claus-Peter Schnorr Andreas Weber", "misc": "2006-04-25 118-125 conf/focs/FOCS23 1982 FOCS db/conf/focs/focs82.html#GalilHLSW82" }
+{ "id": 97, "dblpid": "journals/jacm/GalilT88", "title": "An O(n²(m + n log n)log n) min-cost flow algorithm.", "authors": "Zvi Galil Éva Tardos", "misc": "2003-11-20 374-386 1988 35 J. ACM 2 http //doi.acm.org/10.1145/42282.214090 db/journals/jacm/jacm35.html#GalilT88" }
+{ "id": 98, "dblpid": "conf/focs/GalilT86", "title": "An O(n^2 (m + n log n) log n) Min-Cost Flow Algorithm", "authors": "Zvi Galil Éva Tardos", "misc": "2006-04-25 1-9 conf/focs/FOCS27 1986 FOCS db/conf/focs/focs86.html#GalilT86" }
+{ "id": 99, "dblpid": "series/synthesis/2009Weintraub", "title": "Jordan Canonical Form Theory and Practice", "authors": "Steven H. Weintraub", "misc": "2009-09-06 Jordan Canonical Form Theory and Practice http //dx.doi.org/10.2200/S00218ED1V01Y200908MAS006 http //dx.doi.org/10.2200/S00218ED1V01Y200908MAS006 2009 Synthesis Lectures on Mathematics & Statistics Morgan & Claypool Publishers" }
+{ "id": 100, "dblpid": "series/synthesis/2009Brozos", "title": "The Geometry of Walker Manifolds", "authors": "Miguel Brozos-Vázquez Eduardo García-Río Peter Gilkey Stana Nikcevic Rámon Vázquez-Lorenzo", "misc": "2009-09-06 The Geometry of Walker Manifolds http //dx.doi.org/10.2200/S00197ED1V01Y200906MAS005 http //dx.doi.org/10.2200/S00197ED1V01Y200906MAS005 2009 Synthesis Lectures on Mathematics & Statistics Morgan & Claypool Publishers" }
diff --git a/asterix-app/src/test/resources/runtimets/results/spatial/circle_accessor.adm b/asterix-app/src/test/resources/runtimets/results/spatial/circle_accessor.adm
new file mode 100644
index 0000000..8848521
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/spatial/circle_accessor.adm
@@ -0,0 +1 @@
+{ "circle-radius": 1.0d, "circle-center": point("6.0,3.0") }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/spatial/create-rtree-index.adm b/asterix-app/src/test/resources/runtimets/results/spatial/create-rtree-index.adm
new file mode 100644
index 0000000..1778736
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/spatial/create-rtree-index.adm
@@ -0,0 +1,19 @@
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/spatial/line_accessor.adm b/asterix-app/src/test/resources/runtimets/results/spatial/line_accessor.adm
new file mode 100644
index 0000000..c6d1c06
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/spatial/line_accessor.adm
@@ -0,0 +1,2 @@
+point("100.6,999.4")
+point("-872.0,-876.9")
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/spatial/point_accessor.adm b/asterix-app/src/test/resources/runtimets/results/spatial/point_accessor.adm
new file mode 100644
index 0000000..0fa3fe4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/spatial/point_accessor.adm
@@ -0,0 +1 @@
+{ "x-coordinate": 2.3d, "y-coordinate": 5.0d }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/spatial/polygon_accessor.adm b/asterix-app/src/test/resources/runtimets/results/spatial/polygon_accessor.adm
new file mode 100644
index 0000000..12685ce
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/spatial/polygon_accessor.adm
@@ -0,0 +1,4 @@
+point("1.0,1.0")
+point("2.0,2.0")
+point("3.0,3.0")
+point("4.0,4.0")
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/spatial/rectangle_accessor.adm b/asterix-app/src/test/resources/runtimets/results/spatial/rectangle_accessor.adm
new file mode 100644
index 0000000..f198dff
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/spatial/rectangle_accessor.adm
@@ -0,0 +1,2 @@
+point("9.2,49.0")
+point("77.8,111.1")
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/string/concat1.adm b/asterix-app/src/test/resources/runtimets/results/string/concat_01.adm
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/results/string/concat1.adm
rename to asterix-app/src/test/resources/runtimets/results/string/concat_01.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/string/concat_02.adm b/asterix-app/src/test/resources/runtimets/results/string/concat_02.adm
new file mode 100644
index 0000000..ba4be9f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/concat_02.adm
@@ -0,0 +1 @@
+{ "a": null, "b": null, "c": null }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/string/cpttostr01.adm b/asterix-app/src/test/resources/runtimets/results/string/cpttostr01.adm
new file mode 100644
index 0000000..041e3f6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/cpttostr01.adm
@@ -0,0 +1 @@
+"0-9,A-Z"
diff --git a/asterix-app/src/test/resources/runtimets/results/string/cpttostr02.adm b/asterix-app/src/test/resources/runtimets/results/string/cpttostr02.adm
new file mode 100644
index 0000000..98b52bd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/cpttostr02.adm
@@ -0,0 +1 @@
+{ "c1": "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "c2": "abcdefghijklmnopqrstuvwxyz", "c3": "!\"#$%&'()*+,-./01234567?@" }
diff --git a/asterix-app/src/test/resources/runtimets/results/string/cpttostr04.adm b/asterix-app/src/test/resources/runtimets/results/string/cpttostr04.adm
new file mode 100644
index 0000000..8dbc300
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/cpttostr04.adm
@@ -0,0 +1 @@
+{ "c1": "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" }
diff --git a/asterix-app/src/test/resources/runtimets/results/string/endwith02.adm b/asterix-app/src/test/resources/runtimets/results/string/endwith02.adm
new file mode 100644
index 0000000..913c84a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/endwith02.adm
@@ -0,0 +1,6 @@
+false
+false
+true
+true
+true
+true
diff --git a/asterix-app/src/test/resources/runtimets/results/string/endwith03.adm b/asterix-app/src/test/resources/runtimets/results/string/endwith03.adm
new file mode 100644
index 0000000..c90ce70
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/endwith03.adm
@@ -0,0 +1,4 @@
+{ "name": "I am Jones" }
+{ "name": "Jim Jones" }
+{ "name": "Marian Jones" }
+{ "name": "Phil Jones" }
diff --git a/asterix-app/src/test/resources/runtimets/results/string/length.adm b/asterix-app/src/test/resources/runtimets/results/string/length_01.adm
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/results/string/length.adm
rename to asterix-app/src/test/resources/runtimets/results/string/length_01.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/string/length_02.adm b/asterix-app/src/test/resources/runtimets/results/string/length_02.adm
new file mode 100644
index 0000000..930236d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/length_02.adm
@@ -0,0 +1,8 @@
+3
+6
+6
+5
+5
+5
+7
+6
diff --git a/asterix-app/src/test/resources/runtimets/results/string/matches02.adm b/asterix-app/src/test/resources/runtimets/results/string/matches02.adm
new file mode 100644
index 0000000..b02ee08
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/matches02.adm
@@ -0,0 +1 @@
+{ "c3": true, "c4": true, "c5": true, "c6": true, "c7": true, "c8": true, "c9": false, "c10": true, "c11": true, "c12": false }
diff --git a/asterix-app/src/test/resources/runtimets/results/string/matches03.adm b/asterix-app/src/test/resources/runtimets/results/string/matches03.adm
new file mode 100644
index 0000000..aa3f9c8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/matches03.adm
@@ -0,0 +1,13 @@
+true
+true
+false
+false
+true
+true
+true
+false
+true
+true
+false
+false
+true
diff --git a/asterix-app/src/test/resources/runtimets/results/string/matches04.adm b/asterix-app/src/test/resources/runtimets/results/string/matches04.adm
new file mode 100644
index 0000000..814ccfe
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/matches04.adm
@@ -0,0 +1,7 @@
+true
+true
+true
+true
+true
+true
+true
diff --git a/asterix-app/src/test/resources/runtimets/results/string/matches05.adm b/asterix-app/src/test/resources/runtimets/results/string/matches05.adm
new file mode 100644
index 0000000..f2c3846
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/matches05.adm
@@ -0,0 +1,4 @@
+{ "fname": "Test", "lname": "Test", "id": 123 }
+{ "fname": "Testa", "lname": "Test", "id": 124 }
+{ "fname": "Test1", "lname": "Test1", "id": 125 }
+{ "fname": "Test2", "lname": "Test2", "id": 127 }
diff --git a/asterix-app/src/test/resources/runtimets/results/string/matches06.adm b/asterix-app/src/test/resources/runtimets/results/string/matches06.adm
new file mode 100644
index 0000000..3252af9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/matches06.adm
@@ -0,0 +1,15 @@
+true
+false
+true
+true
+true
+false
+true
+false
+false
+true
+true
+true
+true
+false
+true
diff --git a/asterix-app/src/test/resources/runtimets/results/string/matches11.adm b/asterix-app/src/test/resources/runtimets/results/string/matches11.adm
new file mode 100644
index 0000000..440a996
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/matches11.adm
@@ -0,0 +1,5 @@
+false
+false
+false
+false
+false
diff --git a/asterix-app/src/test/resources/runtimets/results/string/startwith02.adm b/asterix-app/src/test/resources/runtimets/results/string/startwith02.adm
new file mode 100644
index 0000000..39acf48
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/startwith02.adm
@@ -0,0 +1,14 @@
+true
+false
+true
+false
+false
+true
+true
+false
+true
+false
+true
+true
+false
+false
diff --git a/asterix-app/src/test/resources/runtimets/results/string/startwith03.adm b/asterix-app/src/test/resources/runtimets/results/string/startwith03.adm
new file mode 100644
index 0000000..ccb9311
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/startwith03.adm
@@ -0,0 +1,5 @@
+{ "name": "John Doe" }
+{ "name": "John Smith" }
+{ "name": "John Wayne" }
+{ "name": "Johnny Walker" }
+{ "name": "Johnson Ben" }
diff --git a/asterix-app/src/test/resources/runtimets/results/string/strconcat01.adm b/asterix-app/src/test/resources/runtimets/results/string/strconcat01.adm
new file mode 100644
index 0000000..b597701
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/strconcat01.adm
@@ -0,0 +1,9 @@
+{ "Full Name": "Young SeokKim" }
+{ "Full Name": "AlexBehm" }
+{ "Full Name": "JohnSmith" }
+{ "Full Name": "BobJones" }
+{ "Full Name": "MikeCarey" }
+{ "Full Name": "ChenLi" }
+{ "Full Name": "RamanGrover" }
+{ "Full Name": "YingyiBu" }
+{ "Full Name": "VinayakBorkar" }
diff --git a/asterix-app/src/test/resources/runtimets/results/string/strconcat02.adm b/asterix-app/src/test/resources/runtimets/results/string/strconcat02.adm
new file mode 100644
index 0000000..38f2315
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/strconcat02.adm
@@ -0,0 +1,3 @@
+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
+" ab cdefgpoqrst "
+"This is a testand all tests must passand life is good..."
diff --git a/asterix-app/src/test/resources/runtimets/results/string/strlen02.adm b/asterix-app/src/test/resources/runtimets/results/string/strlen02.adm
new file mode 100644
index 0000000..46e26f6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/strlen02.adm
@@ -0,0 +1,6 @@
+21
+21
+21
+25
+29
+28
diff --git a/asterix-app/src/test/resources/runtimets/results/string/strlen03.adm b/asterix-app/src/test/resources/runtimets/results/string/strlen03.adm
new file mode 100644
index 0000000..368bdb9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/strlen03.adm
@@ -0,0 +1,12 @@
+13
+17
+5
+8
+5
+4
+14
+10
+7
+6
+5
+15
diff --git a/asterix-app/src/test/resources/runtimets/results/string/strtocpt01.adm b/asterix-app/src/test/resources/runtimets/results/string/strtocpt01.adm
new file mode 100644
index 0000000..3308db7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/strtocpt01.adm
@@ -0,0 +1 @@
+[ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48 ]
diff --git a/asterix-app/src/test/resources/runtimets/results/string/strtocpt02.adm b/asterix-app/src/test/resources/runtimets/results/string/strtocpt02.adm
new file mode 100644
index 0000000..30602ee
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/strtocpt02.adm
@@ -0,0 +1 @@
+[ 34, 39, 45, 61, 95, 43, 124, 92, 44, 46, 47, 60, 62, 63, 58, 59, 126, 96 ]
diff --git a/asterix-app/src/test/resources/runtimets/results/string/strtocpt03.adm b/asterix-app/src/test/resources/runtimets/results/string/strtocpt03.adm
new file mode 100644
index 0000000..9f30023
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/strtocpt03.adm
@@ -0,0 +1 @@
+[ 33, 64, 35, 36, 37, 94, 38, 42, 40, 41 ]
diff --git a/asterix-app/src/test/resources/runtimets/results/string/substr01.adm b/asterix-app/src/test/resources/runtimets/results/string/substr01.adm
new file mode 100644
index 0000000..ac9dedd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/substr01.adm
@@ -0,0 +1 @@
+{ "str2": "ld", "str4": "g", "str6": "", "str8": "This is a test string", "str10": "This is a test string", "str13": "gThis is a another test string", "str14": "Irvine" }
diff --git a/asterix-app/src/test/resources/runtimets/results/string/substr04.adm b/asterix-app/src/test/resources/runtimets/results/string/substr04.adm
new file mode 100644
index 0000000..fcd3396
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/substr04.adm
@@ -0,0 +1,10 @@
+"world"
+"hello world"
+"llo world"
+"CD"
+"ABCD"
+"Irvine"
+"UC Irvine"
+"UC Irvine"
+"Irvine"
+"Irvine"
diff --git a/asterix-app/src/test/resources/runtimets/results/string/substr05.adm b/asterix-app/src/test/resources/runtimets/results/string/substr05.adm
new file mode 100644
index 0000000..52a2718
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/substr05.adm
@@ -0,0 +1,8 @@
+"Berkeley"
+"Irvine"
+"LA"
+"Riverside"
+"San Diego"
+"Santa Barbara"
+"Austin "
+"Dallas"
diff --git a/asterix-app/src/test/resources/runtimets/results/string/substr06.adm b/asterix-app/src/test/resources/runtimets/results/string/substr06.adm
new file mode 100644
index 0000000..52a2718
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/substr06.adm
@@ -0,0 +1,8 @@
+"Berkeley"
+"Irvine"
+"LA"
+"Riverside"
+"San Diego"
+"Santa Barbara"
+"Austin "
+"Dallas"
diff --git a/asterix-app/src/test/resources/runtimets/results/string/toLowerCase02.adm b/asterix-app/src/test/resources/runtimets/results/string/toLowerCase02.adm
new file mode 100644
index 0000000..65dfed7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/toLowerCase02.adm
@@ -0,0 +1,12 @@
+"a b c d e f g"
+"a b c d e f g h i j k l m n o p q r s t u v w x y z"
+"abcdefghij klmnop qrstu vwxyz"
+"abcdefghijklmnopqrstuvwxyz"
+"this is a test string"
+"smaller string"
+"abcd"
+"abcdefghijklmnopqrstuvwxyz"
+"abcdefghijkabcdefghijk"
+"hijklmnopqrhijklmnopqr"
+"abcdefghijklmnopqrstuvwxyz01234"
+"a33b2cd1ef78ghijk123lmnopqrstuvw3x2y01035z"
diff --git a/asterix-app/src/test/resources/runtimets/results/string/toLowerCase03.adm b/asterix-app/src/test/resources/runtimets/results/string/toLowerCase03.adm
new file mode 100644
index 0000000..b6d7e8a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/toLowerCase03.adm
@@ -0,0 +1,12 @@
+"beckham david"
+"cristiano ronaldo"
+"henry"
+"maradona"
+"messi"
+"pele"
+"roberto baggio"
+"ronaldinho"
+"ronaldo"
+"rooney"
+"tevez"
+"zinadine zidane"
diff --git a/asterix-app/src/test/resources/runtimets/results/string/toLowerCase04.adm b/asterix-app/src/test/resources/runtimets/results/string/toLowerCase04.adm
new file mode 100644
index 0000000..2b33ad2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/string/toLowerCase04.adm
@@ -0,0 +1,2 @@
+"abcdefghijklmnopqrstuvwxyz"
+"abcdefghijklmnopqrstuvwxyz"
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/query-issue201.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/query-issue201.adm
new file mode 100644
index 0000000..190423f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/query-issue201.adm
@@ -0,0 +1,100 @@
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf01.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf01.adm
new file mode 100644
index 0000000..f00c965
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf01.adm
@@ -0,0 +1,10 @@
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf02.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf02.adm
new file mode 100644
index 0000000..2b2f2e1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf02.adm
@@ -0,0 +1,2 @@
+1
+3
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf03.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf03.adm
new file mode 100644
index 0000000..5885d0f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf03.adm
@@ -0,0 +1 @@
+1234.1d
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf04.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf04.adm
new file mode 100644
index 0000000..46c8aa5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf04.adm
@@ -0,0 +1,3 @@
+{ "name": "John", "age": 45, "id": 123 }
+{ "name": "Jim", "age": 55, "id": 103 }
+{ "name": "Bill", "age": 35, "id": 125 }
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf05.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf05.adm
new file mode 100644
index 0000000..81c545e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf05.adm
@@ -0,0 +1 @@
+1234
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf06.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf06.adm
new file mode 100644
index 0000000..5885d0f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf06.adm
@@ -0,0 +1 @@
+1234.1d
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf07.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf07.adm
new file mode 100644
index 0000000..74dde56
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf07.adm
@@ -0,0 +1 @@
+1234.1f
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf08.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf08.adm
new file mode 100644
index 0000000..c3ce7a2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf08.adm
@@ -0,0 +1 @@
+"This is a test string"
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf09.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf09.adm
new file mode 100644
index 0000000..410a64a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf09.adm
@@ -0,0 +1 @@
+[ { "id": 241 }, { "id": 245 }, { "id": 315 }, { "id": 345 }, { "id": 349 }, { "id": 385 }, { "id": 745 }, { "id": 845 } ]
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf10.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf10.adm
new file mode 100644
index 0000000..b07e4f4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf10.adm
@@ -0,0 +1 @@
+{{ "this is optional data", "this is extra data", "open types are good" }}
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf11.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf11.adm
new file mode 100644
index 0000000..f00c965
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf11.adm
@@ -0,0 +1,10 @@
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf12.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf12.adm
new file mode 100644
index 0000000..697cb3a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf12.adm
@@ -0,0 +1 @@
+300
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf13.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf13.adm
new file mode 100644
index 0000000..08839f6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf13.adm
@@ -0,0 +1 @@
+200
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf14.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf14.adm
new file mode 100644
index 0000000..146cf04
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf14.adm
@@ -0,0 +1 @@
+80000
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf16.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf16.adm
new file mode 100644
index 0000000..e85087a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf16.adm
@@ -0,0 +1 @@
+31
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf17.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf17.adm
new file mode 100644
index 0000000..13481ba
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf17.adm
@@ -0,0 +1 @@
+"This data is from the child function"
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf18.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf18.adm
new file mode 100644
index 0000000..27ba77d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf18.adm
@@ -0,0 +1 @@
+true
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf19.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf19.adm
new file mode 100644
index 0000000..948a660
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf19.adm
@@ -0,0 +1,4 @@
+113.03999999999999d
+200.96d
+314.0d
+452.15999999999997d
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf20.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf20.adm
new file mode 100644
index 0000000..0d27e01
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf20.adm
@@ -0,0 +1,4 @@
+{ "radius": 6, "area": 113.03999999999999d }
+{ "radius": 8, "area": 200.96d }
+{ "radius": 10, "area": 314.0d }
+{ "radius": 12, "area": 452.15999999999997d }
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf21.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf21.adm
new file mode 100644
index 0000000..426c833
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf21.adm
@@ -0,0 +1,12 @@
+3
+5
+7
+9
+1
+13
+17
+19
+25
+45
+65
+75
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf22.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf22.adm
new file mode 100644
index 0000000..8be5ca6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf22.adm
@@ -0,0 +1 @@
+"BobHarbus"
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf23.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf23.adm
new file mode 100644
index 0000000..7fc9d1f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf23.adm
@@ -0,0 +1,6 @@
+{ "DataverseName": "Metadata", "DatasetName": "Dataset", "DataTypeName": "DatasetRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName" ], "PrimaryKey": [ "DataverseName", "DatasetName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:59:27 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "DatasourceAdapter", "DataTypeName": "DatasourceAdapterRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "Name" ], "PrimaryKey": [ "DataverseName", "Name" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:59:27 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Datatype", "DataTypeName": "DatatypeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatatypeName" ], "PrimaryKey": [ "DataverseName", "DatatypeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:59:27 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataverse", "DataTypeName": "DataverseRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName" ], "PrimaryKey": [ "DataverseName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:59:27 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Function", "DataTypeName": "FunctionRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "Name", "Arity" ], "PrimaryKey": [ "DataverseName", "Name", "Arity" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:59:27 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Index", "DataTypeName": "IndexRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName", "IndexName" ], "PrimaryKey": [ "DataverseName", "DatasetName", "IndexName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Nov 05 10:59:27 PST 2012" }
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf27.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf27.adm
new file mode 100644
index 0000000..c508d53
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/udf27.adm
@@ -0,0 +1 @@
+false
diff --git a/asterix-app/src/test/resources/runtimets/results/writers/serialized_01.adm b/asterix-app/src/test/resources/runtimets/results/writers/serialized_01.adm
index f2aee15..c503a33 100644
--- a/asterix-app/src/test/resources/runtimets/results/writers/serialized_01.adm
+++ b/asterix-app/src/test/resources/runtimets/results/writers/serialized_01.adm
Binary files differ
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
new file mode 100644
index 0000000..a423945
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -0,0 +1,3882 @@
+<test-suite xmlns="urn:xml.testframework.asterix.ics.uci.edu" ResultOffsetPath="results" QueryOffsetPath="queries" QueryFileExtension=".aql">
+ <test-group name="aggregate">
+ <test-case FilePath="aggregate">
+ <compilation-unit name="avg_double">
+ <output-file compare="Text">avg_double.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="avg_double_null">
+ <output-file compare="Text">avg_double_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="avg_empty_01">
+ <output-file compare="Text">avg_empty_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="avg_empty_02">
+ <output-file compare="Text">avg_empty_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="avg_float">
+ <output-file compare="Text">avg_float.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="avg_float_null">
+ <output-file compare="Text">avg_float_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="avg_int16">
+ <output-file compare="Text">avg_int16.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="avg_int16_null">
+ <output-file compare="Text">avg_int16_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="avg_int32">
+ <output-file compare="Text">avg_int32.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="avg_int32_null">
+ <output-file compare="Text">avg_int32_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="avg_int64">
+ <output-file compare="Text">avg_int64.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="avg_int64_null">
+ <output-file compare="Text">avg_int64_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="avg_int8">
+ <output-file compare="Text">avg_int8.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="avg_int8_null">
+ <output-file compare="Text">avg_int8_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="count_01">
+ <output-file compare="Text">count_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="count_empty_01">
+ <output-file compare="Text">count_empty_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="count_empty_02">
+ <output-file compare="Text">count_empty_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="count_null">
+ <output-file compare="Text">count_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="aggregate">
+ <compilation-unit name="droptype">
+ <output-file compare="Text">droptype.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="aggregate">
+ <compilation-unit name="global-avg_01">
+ <output-file compare="Text">global-avg_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="global-avg_null">
+ <output-file compare="Text">global-avg_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="local-avg_double">
+ <output-file compare="Text">local-avg_double.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="local-avg_double_null">
+ <output-file compare="Text">local-avg_double_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="local-avg_float">
+ <output-file compare="Text">local-avg_float.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="local-avg_float_null">
+ <output-file compare="Text">local-avg_float_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="local-avg_int16">
+ <output-file compare="Text">local-avg_int16.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="local-avg_int16_null">
+ <output-file compare="Text">local-avg_int16_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="local-avg_int32">
+ <output-file compare="Text">local-avg_int32.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="local-avg_int32_null">
+ <output-file compare="Text">local-avg_int32_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="local-avg_int64">
+ <output-file compare="Text">local-avg_int64.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="local-avg_int64_null">
+ <output-file compare="Text">local-avg_int64_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="local-avg_int8">
+ <output-file compare="Text">local-avg_int8.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="local-avg_int8_null">
+ <output-file compare="Text">local-avg_int8_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="max_empty_01">
+ <output-file compare="Text">max_empty_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="max_empty_02">
+ <output-file compare="Text">max_empty_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="min_empty_01">
+ <output-file compare="Text">min_empty_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="min_empty_02">
+ <output-file compare="Text">min_empty_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="scalar_avg">
+ <output-file compare="Text">scalar_avg.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="scalar_avg_empty">
+ <output-file compare="Text">scalar_avg_empty.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="scalar_avg_null">
+ <output-file compare="Text">scalar_avg_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="scalar_count">
+ <output-file compare="Text">scalar_count.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="scalar_count_empty">
+ <output-file compare="Text">scalar_count_empty.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="scalar_count_null">
+ <output-file compare="Text">scalar_count_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="scalar_max">
+ <output-file compare="Text">scalar_max.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="scalar_max_empty">
+ <output-file compare="Text">scalar_max_empty.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="scalar_max_null">
+ <output-file compare="Text">scalar_max_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="scalar_min">
+ <output-file compare="Text">scalar_min.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="scalar_min_empty">
+ <output-file compare="Text">scalar_min_empty.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="scalar_min_null">
+ <output-file compare="Text">scalar_min_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="scalar_sum">
+ <output-file compare="Text">scalar_sum.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="scalar_sum_empty">
+ <output-file compare="Text">scalar_sum_empty.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="scalar_sum_null">
+ <output-file compare="Text">scalar_sum_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="sum_double">
+ <output-file compare="Text">sum_double.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="sum_double_null">
+ <output-file compare="Text">sum_double_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="sum_empty_01">
+ <output-file compare="Text">sum_empty_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="sum_empty_02">
+ <output-file compare="Text">sum_empty_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="sum_float">
+ <output-file compare="Text">sum_float.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="sum_float_null">
+ <output-file compare="Text">sum_float_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="sum_int16">
+ <output-file compare="Text">sum_int16.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="sum_int16_null">
+ <output-file compare="Text">sum_int16_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="sum_int32">
+ <output-file compare="Text">sum_int32.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="sum_int32_null">
+ <output-file compare="Text">sum_int32_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="sum_int64">
+ <output-file compare="Text">sum_int64.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="sum_int64_null">
+ <output-file compare="Text">sum_int64_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="sum_int8">
+ <output-file compare="Text">sum_int8.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="sum_int8_null">
+ <output-file compare="Text">sum_int8_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="sum_null-with-pred">
+ <output-file compare="Text">sum_null-with-pred.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate">
+ <compilation-unit name="sum_numeric_null">
+ <output-file compare="Text">sum_numeric_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="boolean">
+ <test-case FilePath="boolean">
+ <compilation-unit name="and_01">
+ <output-file compare="Text">and_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="boolean">
+ <compilation-unit name="and_null">
+ <output-file compare="Text">and_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="boolean">
+ <compilation-unit name="and_null_false">
+ <output-file compare="Text">and_null_false.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="boolean">
+ <compilation-unit name="not_01">
+ <output-file compare="Text">not_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="comparison">
+ <test-case FilePath="comparison">
+ <compilation-unit name="datetime_order">
+ <output-file compare="Text">datetime_order.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="datetime_range">
+ <output-file compare="Text">datetime_range.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="datetime_tzeq">
+ <output-file compare="Text">datetime_tzeq.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="double">
+ <output-file compare="Text">double.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="double_gte_01">
+ <output-file compare="Text">double_gte_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="double_null">
+ <output-file compare="Text">double_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="eq_01">
+ <output-file compare="Text">eq_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="float">
+ <output-file compare="Text">float.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="float_null">
+ <output-file compare="Text">float_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="gt_01">
+ <output-file compare="Text">gt_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="gte_01">
+ <output-file compare="Text">gte_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int16">
+ <output-file compare="Text">int16.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int16_null">
+ <output-file compare="Text">int16_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int32">
+ <output-file compare="Text">int32.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int32_null">
+ <output-file compare="Text">int32_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int64">
+ <output-file compare="Text">int64.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int64_null">
+ <output-file compare="Text">int64_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int8">
+ <output-file compare="Text">int8.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int8_null">
+ <output-file compare="Text">int8_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="lt_01">
+ <output-file compare="Text">lt_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="lte_01">
+ <output-file compare="Text">lte_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="neq_01">
+ <output-file compare="Text">neq_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="comparison">
+ <compilation-unit name="numeric-comparison_01">
+ <output-file compare="Text">numeric-comparison_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="comparison">
+ <compilation-unit name="string">
+ <output-file compare="Text">string.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="string_null">
+ <output-file compare="Text">string_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="constructor">
+ <test-case FilePath="constructor">
+ <compilation-unit name="add-null">
+ <output-file compare="Text">add-null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="constructor">
+ <compilation-unit name="boolean_01">
+ <output-file compare="Text">boolean_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="constructor">
+ <compilation-unit name="circle_01">
+ <output-file compare="Text">circle_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="constructor">
+ <compilation-unit name="date_01">
+ <output-file compare="Text">date_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="constructor">
+ <compilation-unit name="datetime_01">
+ <output-file compare="Text">datetime_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="constructor">
+ <compilation-unit name="double_01">
+ <output-file compare="Text">double_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="constructor">
+ <compilation-unit name="duration_01">
+ <output-file compare="Text">duration_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="constructor">
+ <compilation-unit name="float_01">
+ <output-file compare="Text">float_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="constructor">
+ <compilation-unit name="int_01">
+ <output-file compare="Text">int_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="constructor">
+ <compilation-unit name="line_01">
+ <output-file compare="Text">line_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="constructor">
+ <compilation-unit name="point_01">
+ <output-file compare="Text">point_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="constructor">
+ <compilation-unit name="polygon_01">
+ <output-file compare="Text">polygon_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="constructor">
+ <compilation-unit name="primitive-01">
+ <output-file compare="Text">primitive-01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="constructor">
+ <compilation-unit name="primitive-02">
+ <output-file compare="Text">primitive-02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="constructor">
+ <compilation-unit name="primitive-03">
+ <output-file compare="Text">primitive-03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="constructor">
+ <compilation-unit name="primitive-04">
+ <output-file compare="Text">primitive-04.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="constructor">
+ <compilation-unit name="string_01">
+ <output-file compare="Text">string_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="constructor">
+ <compilation-unit name="time_01">
+ <output-file compare="Text">time_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="custord">
+ <!--
+ <test-case FilePath="custord">
+ <compilation-unit name="co">
+ <output-file compare="Text">co.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="custord">
+ <compilation-unit name="customer_q_01">
+ <output-file compare="Text">customer_q_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="custord">
+ <compilation-unit name="customer_q_02">
+ <output-file compare="Text">customer_q_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="custord">
+ <compilation-unit name="customer_q_03">
+ <output-file compare="Text">customer_q_03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="custord">
+ <compilation-unit name="customer_q_04">
+ <output-file compare="Text">customer_q_04.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="custord">
+ <compilation-unit name="customer_q_05">
+ <output-file compare="Text">customer_q_05.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="custord">
+ <compilation-unit name="customer_q_06">
+ <output-file compare="Text">customer_q_06.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="custord">
+ <compilation-unit name="customer_q_07">
+ <output-file compare="Text">customer_q_07.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="custord">
+ <compilation-unit name="customer_q_08">
+ <output-file compare="Text">customer_q_08.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="custord">
+ <compilation-unit name="denorm-cust-order_01">
+ <output-file compare="Text">denorm-cust-order_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="custord">
+ <compilation-unit name="denorm-cust-order_02">
+ <output-file compare="Text">denorm-cust-order_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="custord">
+ <compilation-unit name="denorm-cust-order_03">
+ <output-file compare="Text">denorm-cust-order_03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <!--
+ <test-case FilePath="custord">
+ <compilation-unit name="freq-clerk">
+ <output-file compare="Text">freq-clerk.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="custord">
+ <compilation-unit name="join_q_01">
+ <output-file compare="Text">join_q_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="custord">
+ <compilation-unit name="join_q_02">
+ <output-file compare="Text">join_q_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="custord">
+ <compilation-unit name="join_q_03">
+ <output-file compare="Text">join_q_03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="custord">
+ <compilation-unit name="join_q_04">
+ <output-file compare="Text">join_q_04.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="custord">
+ <compilation-unit name="load-test">
+ <output-file compare="Text">load-test.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="custord">
+ <compilation-unit name="order_q_01">
+ <output-file compare="Text">order_q_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="custord">
+ <compilation-unit name="order_q_02">
+ <output-file compare="Text">order_q_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="custord">
+ <compilation-unit name="order_q_03">
+ <output-file compare="Text">order_q_03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="custord">
+ <compilation-unit name="order_q_04">
+ <output-file compare="Text">order_q_04.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="custord">
+ <compilation-unit name="order_q_05">
+ <output-file compare="Text">order_q_05.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="custord">
+ <compilation-unit name="order_q_06">
+ <output-file compare="Text">order_q_06.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="dapd">
+ <test-case FilePath="dapd">
+ <compilation-unit name="q1">
+ <output-file compare="Text">q1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dapd">
+ <compilation-unit name="q2">
+ <output-file compare="Text">q2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="dapd">
+ <compilation-unit name="q3">
+ <output-file compare="Text">q3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ </test-group>
+ <test-group name="dml">
+ <test-case FilePath="dml">
+ <compilation-unit name="query-issue205">
+ <output-file compare="Text">query-issue205.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="delete-from-loaded-dataset-with-index">
+ <output-file compare="Text">delete-from-loaded-dataset-with-index.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="delete-from-loaded-dataset">
+ <output-file compare="Text">delete-from-loaded-dataset.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="drop-index">
+ <output-file compare="Text">drop-index.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="empty-load-with-index">
+ <output-file compare="Text">empty-load-with-index.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="empty-load">
+ <output-file compare="Text">empty-load.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="insert-into-empty-dataset-with-index">
+ <output-file compare="Text">insert-into-empty-dataset-with-index.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="insert-into-empty-dataset">
+ <output-file compare="Text">insert-into-empty-dataset.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="insert-into-loaded-dataset-with-index_01">
+ <output-file compare="Text">insert-into-loaded-dataset-with-index_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="insert-into-loaded-dataset-with-index_02">
+ <output-file compare="Text">insert-into-loaded-dataset-with-index_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="insert-into-loaded-dataset_01">
+ <output-file compare="Text">insert-into-loaded-dataset_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="insert-into-loaded-dataset_02">
+ <output-file compare="Text">insert-into-loaded-dataset_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="insert-src-dst-01">
+ <output-file compare="Text">insert-src-dst-01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="insert">
+ <output-file compare="Text">insert.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="insert_less_nc">
+ <output-file compare="Text">insert_less_nc.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="dml">
+ <compilation-unit name="load-from-hdfs">
+ <output-file compare="Text">load-from-hdfs.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="dml">
+ <compilation-unit name="load-with-index">
+ <output-file compare="Text">load-with-index.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="opentype-c2o-recursive">
+ <output-file compare="Text">opentype-c2o-recursive.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="opentype-c2o">
+ <output-file compare="Text">opentype-c2o.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="opentype-closed-optional">
+ <output-file compare="Text">opentype-closed-optional.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="opentype-insert">
+ <output-file compare="Text">opentype-insert.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="opentype-insert2">
+ <output-file compare="Text">opentype-insert2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="opentype-noexpand">
+ <output-file compare="Text">opentype-noexpand.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="opentype-o2c-recursive">
+ <output-file compare="Text">opentype-o2c-recursive.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="opentype-o2c">
+ <output-file compare="Text">opentype-o2c.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="opentype-o2o">
+ <output-file compare="Text">opentype-o2o.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="scan-delete-btree-secondary-index-nullable">
+ <output-file compare="Text">scan-delete-btree-secondary-index-nullable.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="scan-delete-rtree-secondary-index-nullable">
+ <output-file compare="Text">scan-delete-rtree-secondary-index-nullable.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="scan-delete-rtree-secondary-index">
+ <output-file compare="Text">scan-delete-rtree-secondary-index.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="scan-insert-btree-secondary-index-nullable">
+ <output-file compare="Text">scan-insert-btree-secondary-index-nullable.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="scan-insert-rtree-secondary-index-nullable">
+ <output-file compare="Text">scan-insert-rtree-secondary-index-nullable.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="scan-insert-rtree-secondary-index">
+ <output-file compare="Text">scan-insert-rtree-secondary-index.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="employee">
+ <test-case FilePath="employee">
+ <compilation-unit name="q_01">
+ <output-file compare="Text">q_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="employee">
+ <compilation-unit name="q_02">
+ <output-file compare="Text">q_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="failure">
+ <test-case FilePath="failure">
+ <compilation-unit name="delete-rtree">
+ <output-file compare="Text">delete-rtree.adm</output-file>
+ <expected-error>edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException</expected-error>
+ </compilation-unit>
+ <compilation-unit name="verify_delete-rtree">
+ <output-file compare="Text">delete-rtree.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="failure">
+ <compilation-unit name="delete">
+ <output-file compare="Text">delete.adm</output-file>
+ <expected-error>edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException</expected-error>
+ </compilation-unit>
+ <compilation-unit name="verify_delete">
+ <output-file compare="Text">delete.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="failure">
+ <compilation-unit name="insert-rtree">
+ <output-file compare="Text">insert-rtree.adm</output-file>
+ <expected-error>edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException</expected-error>
+ </compilation-unit>
+ <compilation-unit name="verify_insert-rtree">
+ <output-file compare="Text">insert-rtree.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="failure">
+ <compilation-unit name="insert">
+ <output-file compare="Text">insert.adm</output-file>
+ <expected-error>edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException</expected-error>
+ </compilation-unit>
+ <compilation-unit name="verify_insert">
+ <output-file compare="Text">insert.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="failure">
+ <compilation-unit name="q1_pricing_summary_report_failure">
+ <output-file compare="Text">q1_pricing_summary_report_failure.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ </test-group>
+ <!--
+ <test-group name="flwor">
+ <test-case FilePath="flwor">
+ <compilation-unit name="for01">
+ <output-file compare="Text">for01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="for02">
+ <output-file compare="Text">for02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="for03">
+ <output-file compare="Text">for03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="for04">
+ <output-file compare="Text">for04.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="for05">
+ <output-file compare="Text">for05.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="for06">
+ <output-file compare="Text">for06.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="for07">
+ <output-file compare="Text">for07.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="for08">
+ <output-file compare="Text">for08.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="for09">
+ <output-file compare="Text">for09.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="for10">
+ <output-file compare="Text">for10.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="for11">
+ <output-file compare="Text">for11.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="for12">
+ <output-file compare="Text">for12.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="for13">
+ <output-file compare="Text">for13.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="for14">
+ <output-file compare="Text">for14.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="for15">
+ <output-file compare="Text">for15.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="for16">
+ <output-file compare="Text">for16.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="for17">
+ <output-file compare="Text">for17.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="for18">
+ <output-file compare="Text">for18.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="for19">
+ <output-file compare="Text">for19.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="grpby01">
+ <output-file compare="Text">grpby01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="grpby02">
+ <output-file compare="Text">grpby02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let01">
+ <output-file compare="Text">let01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let02">
+ <output-file compare="Text">let02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let03">
+ <output-file compare="Text">let03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let04">
+ <output-file compare="Text">let04.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let05">
+ <output-file compare="Text">let05.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let06">
+ <output-file compare="Text">let06.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let07">
+ <output-file compare="Text">let07.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let08">
+ <output-file compare="Text">let08.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let09">
+ <output-file compare="Text">let09.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let10">
+ <output-file compare="Text">let10.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let11">
+ <output-file compare="Text">let11.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let12">
+ <output-file compare="Text">let12.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let13">
+ <output-file compare="Text">let13.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let14">
+ <output-file compare="Text">let14.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let15">
+ <output-file compare="Text">let15.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let16">
+ <output-file compare="Text">let16.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let17">
+ <output-file compare="Text">let17.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let18">
+ <output-file compare="Text">let18.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let19">
+ <output-file compare="Text">let19.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let20">
+ <output-file compare="Text">let20.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let21">
+ <output-file compare="Text">let21.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let22">
+ <output-file compare="Text">let22.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let23">
+ <output-file compare="Text">let23.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let24">
+ <output-file compare="Text">let24.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let25">
+ <output-file compare="Text">let25.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let26">
+ <output-file compare="Text">let26.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let27">
+ <output-file compare="Text">let27.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let28">
+ <output-file compare="Text">let28.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let29">
+ <output-file compare="Text">let29.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let30">
+ <output-file compare="Text">let30.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let31">
+ <output-file compare="Text">let31.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="let32">
+ <output-file compare="Text">let32.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="order-by-01">
+ <output-file compare="Text">order-by-01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="order-by-02">
+ <output-file compare="Text">order-by-02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="order-by-03">
+ <output-file compare="Text">order-by-03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="order-by-04">
+ <output-file compare="Text">order-by-04.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="order-by-05">
+ <output-file compare="Text">order-by-05.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="order-by-06">
+ <output-file compare="Text">order-by-06.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="order-by-07">
+ <output-file compare="Text">order-by-07.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="order-by-08">
+ <output-file compare="Text">order-by-08.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="order-by-09">
+ <output-file compare="Text">order-by-09.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="order-by-10">
+ <output-file compare="Text">order-by-10.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="order-by-11">
+ <output-file compare="Text">order-by-11.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="order-by-12">
+ <output-file compare="Text">order-by-12.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="ret-01">
+ <output-file compare="Text">ret-01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="ret-02">
+ <output-file compare="Text">ret-02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="ret-03">
+ <output-file compare="Text">ret-03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="ret-04">
+ <output-file compare="Text">ret-04.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="ret-05">
+ <output-file compare="Text">ret-05.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="ret-06">
+ <output-file compare="Text">ret-06.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="ret-07">
+ <output-file compare="Text">ret-07.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="ret-08">
+ <output-file compare="Text">ret-08.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="ret-09">
+ <output-file compare="Text">ret-09.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="ret-10">
+ <output-file compare="Text">ret-10.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="ret-11">
+ <output-file compare="Text">ret-11.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="ret-12">
+ <output-file compare="Text">ret-12.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="ret-13">
+ <output-file compare="Text">ret-13.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="ret-14">
+ <output-file compare="Text">ret-14.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="ret-15">
+ <output-file compare="Text">ret-15.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="ret-16">
+ <output-file compare="Text">ret-16.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="ret-17">
+ <output-file compare="Text">ret-17.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="ret-18">
+ <output-file compare="Text">ret-18.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
+ <compilation-unit name="ret-19">
+ <output-file compare="Text">ret-19.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ -->
+ <test-group name="fuzzyjoin">
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-1_1">
+ <output-file compare="Text">dblp-1_1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-1_2.1.1">
+ <output-file compare="Text">dblp-1_2.1.1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-1_2.1">
+ <output-file compare="Text">dblp-1_2.1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-1_2">
+ <output-file compare="Text">dblp-1_2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-2.1_5.3.1">
+ <output-file compare="Text">dblp-2.1_5.3.1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-2_1">
+ <output-file compare="Text">dblp-2_1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-2_2">
+ <output-file compare="Text">dblp-2_2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-2.2">
+ <output-file compare="Text">dblp-2.2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-2_3">
+ <output-file compare="Text">dblp-2_3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-2_4">
+ <output-file compare="Text">dblp-2_4.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-2_5.1">
+ <output-file compare="Text">dblp-2_5.1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-2_5.2">
+ <output-file compare="Text">dblp-2_5.2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-2_5.3.1">
+ <output-file compare="Text">dblp-2_5.3.1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-2_5.3">
+ <output-file compare="Text">dblp-2_5.3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-2_5">
+ <output-file compare="Text">dblp-2_5.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-3_1.1">
+ <output-file compare="Text">dblp-3_1.1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-3_1.2">
+ <output-file compare="Text">dblp-3_1.2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-3_1">
+ <output-file compare="Text">dblp-3_1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-aqlplus_1">
+ <output-file compare="Text">dblp-aqlplus_1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-aqlplus_2">
+ <output-file compare="Text">dblp-aqlplus_2.adm</output-file>
+ <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-2_1">
+ <output-file compare="Text">dblp-csx-2_1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-2_2">
+ <output-file compare="Text">dblp-csx-2_2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-2_3">
+ <output-file compare="Text">dblp-csx-2_3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-2_4">
+ <output-file compare="Text">dblp-csx-2_4.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-2_5.1">
+ <output-file compare="Text">dblp-csx-2_5.1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-2_5.2">
+ <output-file compare="Text">dblp-csx-2_5.2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-2_5.3.1">
+ <output-file compare="Text">dblp-csx-2_5.3.1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-2_5.3">
+ <output-file compare="Text">dblp-csx-2_5.3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-2_5">
+ <output-file compare="Text">dblp-csx-2_5.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-3_1">
+ <output-file compare="Text">dblp-csx-3_1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-3_2">
+ <output-file compare="Text">dblp-csx-3_2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-3_3">
+ <output-file compare="Text">dblp-csx-3_3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-3_4">
+ <output-file compare="Text">dblp-csx-3_4.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-3_5.1">
+ <output-file compare="Text">dblp-csx-3_5.1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-3_5.2">
+ <output-file compare="Text">dblp-csx-3_5.2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-3_5.3.1">
+ <output-file compare="Text">dblp-csx-3_5.3.1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-3_5.3">
+ <output-file compare="Text">dblp-csx-3_5.3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-3_5.4.1">
+ <output-file compare="Text">dblp-csx-3_5.4.1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-3_5.4">
+ <output-file compare="Text">dblp-csx-3_5.4.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-3_5">
+ <output-file compare="Text">dblp-csx-3_5.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-aqlplus_1">
+ <output-file compare="Text">dblp-csx-aqlplus_1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-aqlplus_2">
+ <output-file compare="Text">dblp-csx-aqlplus_2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-aqlplus_3">
+ <output-file compare="Text">dblp-csx-aqlplus_3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-csx-dblp-aqlplus_1">
+ <output-file compare="Text">dblp-csx-dblp-aqlplus_1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-lookup_1">
+ <output-file compare="Text">dblp-lookup_1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="fuzzyjoin">
+ <compilation-unit name="dblp-splits-3_1">
+ <output-file compare="Text">dblp-splits-3_1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ </test-group>
+ <test-group name="index-join">
+ <test-case FilePath="index-join">
+ <compilation-unit name="btree-primary-equi-join">
+ <output-file compare="Text">btree-primary-equi-join.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-join">
+ <compilation-unit name="btree-secondary-equi-join">
+ <output-file compare="Text">btree-secondary-equi-join.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-join">
+ <compilation-unit name="rtree-spatial-intersect-point">
+ <output-file compare="Text">rtree-spatial-intersect-point.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="index-selection">
+ <test-case FilePath="index-selection">
+ <compilation-unit name="btree-index-composite-key">
+ <output-file compare="Text">btree-index-composite-key.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="btree-index-rewrite-multiple">
+ <output-file compare="Text">btree-index-rewrite-multiple.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="cust-index-age-nullable">
+ <output-file compare="Text">cust-index-age-nullable.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="inverted-index-ngram-contains">
+ <output-file compare="Text">inverted-index-ngram-contains.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="inverted-index-ngram-edit-distance-panic">
+ <output-file compare="Text">inverted-index-ngram-edit-distance-panic.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="inverted-index-ngram-edit-distance">
+ <output-file compare="Text">inverted-index-ngram-edit-distance.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="inverted-index-ngram-jaccard">
+ <output-file compare="Text">inverted-index-ngram-jaccard.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="inverted-index-olist-edit-distance-panic">
+ <output-file compare="Text">inverted-index-olist-edit-distance-panic.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="inverted-index-olist-edit-distance">
+ <output-file compare="Text">inverted-index-olist-edit-distance.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="inverted-index-olist-jaccard">
+ <output-file compare="Text">inverted-index-olist-jaccard.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="inverted-index-ulist-jaccard">
+ <output-file compare="Text">inverted-index-ulist-jaccard.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="inverted-index-word-contains">
+ <output-file compare="Text">inverted-index-word-contains.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="inverted-index-word-jaccard">
+ <output-file compare="Text">inverted-index-word-jaccard.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="orders-index-custkey-conjunctive-open">
+ <output-file compare="Text">orders-index-custkey-conjunctive-open.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="orders-index-custkey-conjunctive">
+ <output-file compare="Text">orders-index-custkey-conjunctive.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="orders-index-custkey-open">
+ <output-file compare="Text">orders-index-custkey-open.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="orders-index-custkey">
+ <output-file compare="Text">orders-index-custkey.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="range-search-open">
+ <output-file compare="Text">range-search-open.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="range-search">
+ <output-file compare="Text">range-search.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="rtree-secondary-index-nullable">
+ <output-file compare="Text">rtree-secondary-index-nullable.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="rtree-secondary-index-open">
+ <output-file compare="Text">rtree-secondary-index-open.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="index-selection">
+ <compilation-unit name="rtree-secondary-index">
+ <output-file compare="Text">rtree-secondary-index.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="inverted-index-join">
+ <test-case FilePath="inverted-index-join">
+ <compilation-unit name="ngram-edit-distance">
+ <output-file compare="Text">ngram-edit-distance.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join">
+ <compilation-unit name="ngram-edit-distance-inline">
+ <output-file compare="Text">ngram-edit-distance-inline.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join">
+ <compilation-unit name="ngram-jaccard">
+ <output-file compare="Text">ngram-jaccard.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join">
+ <compilation-unit name="ngram-jaccard-inline">
+ <output-file compare="Text">ngram-jaccard-inline.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join">
+ <compilation-unit name="olist-edit-distance">
+ <output-file compare="Text">olist-edit-distance.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join">
+ <compilation-unit name="olist-edit-distance-inline">
+ <output-file compare="Text">olist-edit-distance-inline.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join">
+ <compilation-unit name="olist-jaccard">
+ <output-file compare="Text">olist-jaccard.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join">
+ <compilation-unit name="olist-jaccard-inline">
+ <output-file compare="Text">olist-jaccard-inline.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join">
+ <compilation-unit name="ulist-jaccard">
+ <output-file compare="Text">ulist-jaccard.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join">
+ <compilation-unit name="ulist-jaccard-inline">
+ <output-file compare="Text">ulist-jaccard-inline.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join">
+ <compilation-unit name="word-jaccard">
+ <output-file compare="Text">word-jaccard.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join">
+ <compilation-unit name="word-jaccard-inline">
+ <output-file compare="Text">word-jaccard-inline.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="inverted-index-join-noeqjoin">
+ <test-case FilePath="inverted-index-join-noeqjoin">
+ <compilation-unit name="ngram-edit-distance">
+ <output-file compare="Text">ngram-edit-distance.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join-noeqjoin">
+ <compilation-unit name="ngram-edit-distance-inline">
+ <output-file compare="Text">ngram-edit-distance-inline.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join-noeqjoin">
+ <compilation-unit name="ngram-jaccard">
+ <output-file compare="Text">ngram-jaccard.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join-noeqjoin">
+ <compilation-unit name="ngram-jaccard-inline">
+ <output-file compare="Text">ngram-jaccard-inline.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join-noeqjoin">
+ <compilation-unit name="olist-edit-distance">
+ <output-file compare="Text">olist-edit-distance.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join-noeqjoin">
+ <compilation-unit name="olist-edit-distance-inline">
+ <output-file compare="Text">olist-edit-distance-inline.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join-noeqjoin">
+ <compilation-unit name="olist-jaccard">
+ <output-file compare="Text">olist-jaccard.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join-noeqjoin">
+ <compilation-unit name="olist-jaccard-inline">
+ <output-file compare="Text">olist-jaccard-inline.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join-noeqjoin">
+ <compilation-unit name="ulist-jaccard">
+ <output-file compare="Text">ulist-jaccard.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join-noeqjoin">
+ <compilation-unit name="ulist-jaccard-inline">
+ <output-file compare="Text">ulist-jaccard-inline.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join-noeqjoin">
+ <compilation-unit name="word-jaccard">
+ <output-file compare="Text">word-jaccard.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="inverted-index-join-noeqjoin">
+ <compilation-unit name="word-jaccard-inline">
+ <output-file compare="Text">word-jaccard-inline.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="list">
+ <test-case FilePath="list">
+ <compilation-unit name="any-collection-member_01">
+ <output-file compare="Text">any-collection-member_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="list">
+ <compilation-unit name="get-item_01">
+ <output-file compare="Text">get-item_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="list">
+ <compilation-unit name="len_01">
+ <output-file compare="Text">len_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="list">
+ <compilation-unit name="len_null_01">
+ <output-file compare="Text">len_null_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="list">
+ <compilation-unit name="listify_01">
+ <output-file compare="Text">listify_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="list">
+ <compilation-unit name="listify_02">
+ <output-file compare="Text">listify_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="list">
+ <compilation-unit name="listify_03">
+ <output-file compare="Text">listify_03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="list">
+ <compilation-unit name="ordered-list-constructor_01">
+ <output-file compare="Text">ordered-list-constructor_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="list">
+ <compilation-unit name="ordered-list-constructor_02">
+ <output-file compare="Text">ordered-list-constructor_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="list">
+ <compilation-unit name="ordered-list-constructor_03">
+ <output-file compare="Text">ordered-list-constructor_03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="list">
+ <compilation-unit name="scan-collection_01">
+ <output-file compare="Text">scan-collection_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="list">
+ <compilation-unit name="union_01">
+ <output-file compare="Text">union_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="list">
+ <compilation-unit name="union_02">
+ <output-file compare="Text">union_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="list">
+ <compilation-unit name="unordered-list-constructor_01">
+ <output-file compare="Text">unordered-list-constructor_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="list">
+ <compilation-unit name="unordered-list-constructor_02">
+ <output-file compare="Text">unordered-list-constructor_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="list">
+ <compilation-unit name="unordered-list-constructor_03">
+ <output-file compare="Text">unordered-list-constructor_03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="misc">
+ <test-case FilePath="misc">
+ <compilation-unit name="float_01">
+ <output-file compare="Text">float_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="misc">
+ <compilation-unit name="groupby-orderby-count">
+ <output-file compare="Text">groupby-orderby-count.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="misc">
+ <compilation-unit name="ifthenelse_01">
+ <output-file compare="Text">ifthenelse_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="misc">
+ <compilation-unit name="is-null_01">
+ <output-file compare="Text">is-null_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="misc">
+ <compilation-unit name="nested-loop-join_01">
+ <output-file compare="Text">nested-loop-join_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="misc">
+ <compilation-unit name="range_01">
+ <output-file compare="Text">range_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="misc">
+ <compilation-unit name="tid_01">
+ <output-file compare="Text">tid_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="misc">
+ <compilation-unit name="year_01">
+ <output-file compare="Text">year_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="nestrecords">
+ <test-case FilePath="nestrecords">
+ <compilation-unit name="nestrecord">
+ <output-file compare="Text">nestrecord.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="numeric">
+ <test-case FilePath="numeric">
+ <compilation-unit name="abs0">
+ <output-file compare="Text">abs0.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="abs1">
+ <output-file compare="Text">abs1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="abs2">
+ <output-file compare="Text">abs2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="abs3">
+ <output-file compare="Text">abs3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="abs4">
+ <output-file compare="Text">abs4.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="add_double">
+ <output-file compare="Text">add_double.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="add_float">
+ <output-file compare="Text">add_float.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="add_int16">
+ <output-file compare="Text">add_int16.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="add_int32">
+ <output-file compare="Text">add_int32.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="add_int64">
+ <output-file compare="Text">add_int64.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="add_int8">
+ <output-file compare="Text">add_int8.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="ceiling0">
+ <output-file compare="Text">ceiling0.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="ceiling1">
+ <output-file compare="Text">ceiling1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="ceiling2">
+ <output-file compare="Text">ceiling2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="ceiling3">
+ <output-file compare="Text">ceiling3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="ceiling4">
+ <output-file compare="Text">ceiling4.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="divide_double">
+ <output-file compare="Text">divide_double.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="divide_float">
+ <output-file compare="Text">divide_float.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="divide_int16">
+ <output-file compare="Text">divide_int16.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="divide_int32">
+ <output-file compare="Text">divide_int32.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="divide_int64">
+ <output-file compare="Text">divide_int64.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="divide_int8">
+ <output-file compare="Text">divide_int8.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="floor0">
+ <output-file compare="Text">floor0.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="floor1">
+ <output-file compare="Text">floor1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="floor2">
+ <output-file compare="Text">floor2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="floor3">
+ <output-file compare="Text">floor3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="floor4">
+ <output-file compare="Text">floor4.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="multiply_double">
+ <output-file compare="Text">multiply_double.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="multiply_float">
+ <output-file compare="Text">multiply_float.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="multiply_int16">
+ <output-file compare="Text">multiply_int16.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="multiply_int32">
+ <output-file compare="Text">multiply_int32.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="multiply_int64">
+ <output-file compare="Text">multiply_int64.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="multiply_int8">
+ <output-file compare="Text">multiply_int8.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="round-half-to-even0">
+ <output-file compare="Text">round-half-to-even0.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="round-half-to-even1">
+ <output-file compare="Text">round-half-to-even1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="round-half-to-even2">
+ <output-file compare="Text">round-half-to-even2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="round-half-to-even20">
+ <output-file compare="Text">round-half-to-even20.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="round-half-to-even21">
+ <output-file compare="Text">round-half-to-even21.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="round-half-to-even22">
+ <output-file compare="Text">round-half-to-even22.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="round-half-to-even23">
+ <output-file compare="Text">round-half-to-even23.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="round-half-to-even24">
+ <output-file compare="Text">round-half-to-even24.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="round-half-to-even3">
+ <output-file compare="Text">round-half-to-even3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="round-half-to-even4">
+ <output-file compare="Text">round-half-to-even4.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="round-half-to-even5">
+ <output-file compare="Text">round-half-to-even5.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="round0">
+ <output-file compare="Text">round0.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="round1">
+ <output-file compare="Text">round1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="round2">
+ <output-file compare="Text">round2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="round3">
+ <output-file compare="Text">round3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="round4">
+ <output-file compare="Text">round4.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="subtract_double">
+ <output-file compare="Text">subtract_double.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="subtract_float">
+ <output-file compare="Text">subtract_float.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="subtract_int16">
+ <output-file compare="Text">subtract_int16.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="subtract_int32">
+ <output-file compare="Text">subtract_int32.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="subtract_int64">
+ <output-file compare="Text">subtract_int64.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="subtract_int8">
+ <output-file compare="Text">subtract_int8.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="unary-minus_double_01">
+ <output-file compare="Text">unary-minus_double_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="unary-minus_double_02">
+ <output-file compare="Text">unary-minus_double_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="unary-minus_float_01">
+ <output-file compare="Text">unary-minus_float_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="unary-minus_float_02">
+ <output-file compare="Text">unary-minus_float_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="unary-minus_int_01">
+ <output-file compare="Text">unary-minus_int_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="unary-minus_int_02">
+ <output-file compare="Text">unary-minus_int_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="numeric">
+ <compilation-unit name="unary-minus_null">
+ <output-file compare="Text">unary-minus_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="open-closed">
+ <!--
+ <test-case FilePath="open-closed">
+ <compilation-unit name="c2c-w-optional">
+ <output-file compare="Text">c2c-w-optional.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <!--
+ <test-case FilePath="open-closed">
+ <compilation-unit name="c2c-wo-optional">
+ <output-file compare="Text">c2c-wo-optional.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <!--
+ <test-case FilePath="open-closed">
+ <compilation-unit name="c2c">
+ <output-file compare="Text">c2c.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="open-closed">
+ <compilation-unit name="heterog-list-ordered01">
+ <output-file compare="Text">heterog-list-ordered01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="heterog-list01">
+ <output-file compare="Text">heterog-list01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="open-closed">
+ <compilation-unit name="heterog-list02">
+ <output-file compare="Text">heterog-list02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <!--
+ <test-case FilePath="open-closed">
+ <compilation-unit name="heterog-list03">
+ <output-file compare="Text">heterog-list03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="open-closed">
+ <compilation-unit name="open-closed-01">
+ <output-file compare="Text">open-closed-01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="open-closed-12">
+ <output-file compare="Text">open-closed-12.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="open-closed-14">
+ <output-file compare="Text">open-closed-14.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="query-issue134">
+ <output-file compare="Text">query-issue134.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="query-issue55">
+ <output-file compare="Text">query-issue55.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="query-issue55-1">
+ <output-file compare="Text">query-issue55-1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="query-issue166">
+ <output-file compare="Text">query-issue166.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="query-issue208">
+ <output-file compare="Text">query-issue208.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="open-closed">
+ <compilation-unit name="open-closed-15">
+ <output-file compare="Text">open-closed-15.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <!--
+ <test-case FilePath="open-closed">
+ <compilation-unit name="open-closed-16">
+ <output-file compare="Text">open-closed-16.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <!--
+ <test-case FilePath="open-closed">
+ <compilation-unit name="open-closed-17">
+ <output-file compare="Text">open-closed-17.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <!--
+ <test-case FilePath="open-closed">
+ <compilation-unit name="open-closed-19">
+ <output-file compare="Text">open-closed-19.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <!--
+ <test-case FilePath="open-closed">
+ <compilation-unit name="open-closed-20">
+ <output-file compare="Text">open-closed-20.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <!--
+ <test-case FilePath="open-closed">
+ <compilation-unit name="open-closed-21">
+ <output-file compare="Text">open-closed-21.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <!--
+ <test-case FilePath="open-closed">
+ <compilation-unit name="open-closed-22">
+ <output-file compare="Text">open-closed-22.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="open-closed">
+ <compilation-unit name="open-closed-24">
+ <output-file compare="Text">open-closed-24.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="open-closed-25">
+ <output-file compare="Text">open-closed-25.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="open-closed-26">
+ <output-file compare="Text">open-closed-26.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="open-closed">
+ <compilation-unit name="open-closed-28">
+ <output-file compare="Text">open-closed-28.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="open-closed">
+ <compilation-unit name="open-closed-29">
+ <output-file compare="Text">open-closed-29.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="open-closed">
+ <compilation-unit name="open-closed-30">
+ <output-file compare="Text">open-closed-30.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="open-closed">
+ <compilation-unit name="open-closed-31">
+ <output-file compare="Text">open-closed-31.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="open-closed-32">
+ <output-file compare="Text">open-closed-32.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="open-closed-33">
+ <output-file compare="Text">open-closed-33.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="query-proposal02">
+ <output-file compare="Text">query-proposal02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="query-proposal">
+ <output-file compare="Text">query-proposal.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="quantifiers">
+ <test-case FilePath="quantifiers">
+ <compilation-unit name="everysat_01">
+ <output-file compare="Text">everysat_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="quantifiers">
+ <compilation-unit name="everysat_02">
+ <output-file compare="Text">everysat_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <!--
+ <test-case FilePath="quantifiers">
+ <compilation-unit name="everysat_03">
+ <output-file compare="Text">everysat_03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="quantifiers">
+ <compilation-unit name="everysat_04">
+ <output-file compare="Text">everysat_04.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="quantifiers">
+ <compilation-unit name="somesat_01">
+ <output-file compare="Text">somesat_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="quantifiers">
+ <compilation-unit name="somesat_02">
+ <output-file compare="Text">somesat_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="quantifiers">
+ <compilation-unit name="somesat_03">
+ <output-file compare="Text">somesat_03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <!--
+ <test-case FilePath="quantifiers">
+ <compilation-unit name="somesat_04">
+ <output-file compare="Text">somesat_04.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <!--
+ <test-case FilePath="quantifiers">
+ <compilation-unit name="somesat_05">
+ <output-file compare="Text">somesat_05.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="quantifiers">
+ <compilation-unit name="somesat_06">
+ <output-file compare="Text">somesat_06.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="records">
+ <test-case FilePath="records">
+ <compilation-unit name="closed-record-constructor_01">
+ <output-file compare="Text">closed-record-constructor_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records">
+ <compilation-unit name="closed-record-constructor_02">
+ <output-file compare="Text">closed-record-constructor_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records">
+ <compilation-unit name="closed-record-constructor_03">
+ <output-file compare="Text">closed-record-constructor_03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records">
+ <compilation-unit name="expFieldName">
+ <output-file compare="Text">expFieldName.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records">
+ <compilation-unit name="field-access-by-index_01">
+ <output-file compare="Text">field-access-by-index_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records">
+ <compilation-unit name="field-access-on-open-field">
+ <output-file compare="Text">field-access-on-open-field.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records">
+ <compilation-unit name="open-record-constructor_01">
+ <output-file compare="Text">open-record-constructor_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records">
+ <compilation-unit name="open-record-constructor_02">
+ <output-file compare="Text">open-record-constructor_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="scan">
+ <test-case FilePath="scan">
+ <compilation-unit name="10">
+ <output-file compare="Text">10.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="scan">
+ <compilation-unit name="20">
+ <output-file compare="Text">20.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="scan">
+ <compilation-unit name="issue238_query_1">
+ <output-file compare="Text">issue238_query_1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="scan">
+ <compilation-unit name="issue238_query_2">
+ <output-file compare="Text">issue238_query_2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="scan">
+ <compilation-unit name="30">
+ <output-file compare="Text">30.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="scan">
+ <compilation-unit name="alltypes_01">
+ <output-file compare="Text">alltypes_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="scan">
+ <compilation-unit name="numeric_types_01">
+ <output-file compare="Text">numeric_types_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="scan">
+ <compilation-unit name="spatial_types_01">
+ <output-file compare="Text">spatial_types_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="scan">
+ <compilation-unit name="spatial_types_02">
+ <output-file compare="Text">spatial_types_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="scan">
+ <compilation-unit name="temp_types_01">
+ <output-file compare="Text">temp_types_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="scan">
+ <compilation-unit name="temp_types_02">
+ <output-file compare="Text">temp_types_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ </test-group>
+ <test-group name="semistructured">
+ <test-case FilePath="semistructured">
+ <compilation-unit name="count-nullable">
+ <output-file compare="Text">count-nullable.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="semistructured">
+ <compilation-unit name="cust-filter">
+ <output-file compare="Text">cust-filter.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="semistructured">
+ <compilation-unit name="has-param1">
+ <output-file compare="Text">has-param1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="similarity">
+ <test-case FilePath="similarity">
+ <compilation-unit name="edit-distance-check_ints">
+ <output-file compare="Text">edit-distance-check_ints.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="edit-distance-check_strings">
+ <output-file compare="Text">edit-distance-check_strings.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="edit-distance-list-is-filterable">
+ <output-file compare="Text">edit-distance-list-is-filterable.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="edit-distance-string-is-filterable">
+ <output-file compare="Text">edit-distance-string-is-filterable.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="edit-distance_ints">
+ <output-file compare="Text">edit-distance_ints.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="edit-distance_strings">
+ <output-file compare="Text">edit-distance_strings.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="fuzzyeq-edit-distance">
+ <output-file compare="Text">fuzzyeq-edit-distance.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="fuzzyeq-similarity-jaccard">
+ <output-file compare="Text">fuzzyeq-similarity-jaccard.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="prefix-len-jaccard">
+ <output-file compare="Text">prefix-len-jaccard.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="similarity-jaccard-check_ints">
+ <output-file compare="Text">similarity-jaccard-check_ints.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="similarity-jaccard-check_query">
+ <output-file compare="Text">similarity-jaccard-check_query.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="similarity-jaccard-check_strings">
+ <output-file compare="Text">similarity-jaccard-check_strings.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="similarity-jaccard-prefix-check">
+ <output-file compare="Text">similarity-jaccard-prefix-check.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="similarity-jaccard-prefix">
+ <output-file compare="Text">similarity-jaccard-prefix.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="similarity-jaccard-sorted-check_ints">
+ <output-file compare="Text">similarity-jaccard-sorted-check_ints.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="similarity-jaccard-sorted-check_query">
+ <output-file compare="Text">similarity-jaccard-sorted-check_query.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="similarity-jaccard-sorted-check_strings">
+ <output-file compare="Text">similarity-jaccard-sorted-check_strings.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="similarity-jaccard-sorted_ints">
+ <output-file compare="Text">similarity-jaccard-sorted_ints.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="similarity-jaccard-sorted_query">
+ <output-file compare="Text">similarity-jaccard-sorted_query.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="similarity-jaccard-sorted_strings">
+ <output-file compare="Text">similarity-jaccard-sorted_strings.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="similarity-jaccard_ints">
+ <output-file compare="Text">similarity-jaccard_ints.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="similarity-jaccard_query">
+ <output-file compare="Text">similarity-jaccard_query.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="similarity">
+ <compilation-unit name="similarity-jaccard_strings">
+ <output-file compare="Text">similarity-jaccard_strings.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="spatial">
+ <test-case FilePath="spatial">
+ <compilation-unit name="cell-aggregation-with-filtering">
+ <output-file compare="Text">cell-aggregation-with-filtering.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="cell-aggregation">
+ <output-file compare="Text">cell-aggregation.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="circle_accessor">
+ <output-file compare="Text">circle_accessor.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="circle-intersect-circle">
+ <output-file compare="Text">circle-intersect-circle.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="create-rtree-index">
+ <output-file compare="Text">create-rtree-index.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="distance-between-points">
+ <output-file compare="Text">distance-between-points.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="line_accessor">
+ <output-file compare="Text">line_accessor.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="line-intersect-circle">
+ <output-file compare="Text">line-intersect-circle.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="line-intersect-line">
+ <output-file compare="Text">line-intersect-line.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="line-intersect-polygon">
+ <output-file compare="Text">line-intersect-polygon.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="line-intersect-rectangle">
+ <output-file compare="Text">line-intersect-rectangle.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="point_accessor">
+ <output-file compare="Text">point_accessor.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="point-equals-point">
+ <output-file compare="Text">point-equals-point.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="point-in-circle">
+ <output-file compare="Text">point-in-circle.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="point-in-polygon">
+ <output-file compare="Text">point-in-polygon.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="point-in-rectangle">
+ <output-file compare="Text">point-in-rectangle.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="point-on-line">
+ <output-file compare="Text">point-on-line.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="polygon_accessor">
+ <output-file compare="Text">polygon_accessor.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="polygon-intersect-circle">
+ <output-file compare="Text">polygon-intersect-circle.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="polygon-intersect-polygon">
+ <output-file compare="Text">polygon-intersect-polygon.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="polygon-intersect-rectangle">
+ <output-file compare="Text">polygon-intersect-rectangle.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="rectangle_accessor">
+ <output-file compare="Text">rectangle_accessor.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="rectangle-intersect-circle">
+ <output-file compare="Text">rectangle-intersect-circle.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="rectangle-intersect-rectangle">
+ <output-file compare="Text">rectangle-intersect-rectangle.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
+ <compilation-unit name="spatial-area">
+ <output-file compare="Text">spatial-area.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="string">
+ <test-case FilePath="string">
+ <compilation-unit name="codepoint-to-string1">
+ <output-file compare="Text">codepoint-to-string1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="codepoint-to-string2">
+ <output-file compare="Text">codepoint-to-string2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="concat_01">
+ <output-file compare="Text">concat_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="concat_02">
+ <output-file compare="Text">concat_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="contains_01">
+ <output-file compare="Text">contains_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="cpttostr01">
+ <output-file compare="Text">cpttostr01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="cpttostr02">
+ <output-file compare="Text">cpttostr02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="cpttostr04">
+ <output-file compare="Text">cpttostr04.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="end-with1">
+ <output-file compare="Text">end-with1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="end-with2">
+ <output-file compare="Text">end-with2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="end-with3">
+ <output-file compare="Text">end-with3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="end-with4">
+ <output-file compare="Text">end-with4.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="end-with5">
+ <output-file compare="Text">end-with5.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="ends-with_01">
+ <output-file compare="Text">ends-with_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="endwith02">
+ <output-file compare="Text">endwith02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="endwith03">
+ <output-file compare="Text">endwith03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="length_01">
+ <output-file compare="Text">length_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="length_02">
+ <output-file compare="Text">length_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="like_01">
+ <output-file compare="Text">like_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="like_null">
+ <output-file compare="Text">like_null.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="lowercase">
+ <output-file compare="Text">lowercase.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="matches02">
+ <output-file compare="Text">matches02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="matches03">
+ <output-file compare="Text">matches03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="matches04">
+ <output-file compare="Text">matches04.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="matches05">
+ <output-file compare="Text">matches05.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="matches06">
+ <output-file compare="Text">matches06.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="matches1">
+ <output-file compare="Text">matches1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="matches11">
+ <output-file compare="Text">matches11.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="matches2">
+ <output-file compare="Text">matches2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="matches21">
+ <output-file compare="Text">matches21.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="matches22">
+ <output-file compare="Text">matches22.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="matches23">
+ <output-file compare="Text">matches23.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="matches3">
+ <output-file compare="Text">matches3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="matchesnull">
+ <output-file compare="Text">matchesnull.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="replace1">
+ <output-file compare="Text">replace1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="replace2">
+ <output-file compare="Text">replace2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="replace21">
+ <output-file compare="Text">replace21.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="replace22">
+ <output-file compare="Text">replace22.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="replace3">
+ <output-file compare="Text">replace3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="start-with1">
+ <output-file compare="Text">start-with1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="start-with2">
+ <output-file compare="Text">start-with2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="start-with3">
+ <output-file compare="Text">start-with3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="start-with4">
+ <output-file compare="Text">start-with4.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="start-with5">
+ <output-file compare="Text">start-with5.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="starts-with_01">
+ <output-file compare="Text">starts-with_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="startwith02">
+ <output-file compare="Text">startwith02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="string">
+ <compilation-unit name="startwith03">
+ <output-file compare="Text">startwith03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="string">
+ <compilation-unit name="strconcat01">
+ <output-file compare="Text">strconcat01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="strconcat02">
+ <output-file compare="Text">strconcat02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="string-concat1">
+ <output-file compare="Text">string-concat1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="string-equal1">
+ <output-file compare="Text">string-equal1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="string-equal2">
+ <output-file compare="Text">string-equal2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="string-equal3">
+ <output-file compare="Text">string-equal3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="string-equal4">
+ <output-file compare="Text">string-equal4.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="string-join1">
+ <output-file compare="Text">string-join1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="string-to-codepoint">
+ <output-file compare="Text">string-to-codepoint.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="string-to-codepoint1">
+ <output-file compare="Text">string-to-codepoint1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="strlen02">
+ <output-file compare="Text">strlen02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="strlen03">
+ <output-file compare="Text">strlen03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="strtocpt01">
+ <output-file compare="Text">strtocpt01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="strtocpt02">
+ <output-file compare="Text">strtocpt02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="strtocpt03">
+ <output-file compare="Text">strtocpt03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substr01">
+ <output-file compare="Text">substr01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!-- Issue no 219
+ <test-case FilePath="string">
+ <compilation-unit name="substr04">
+ <output-file compare="Text">substr04.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substr05">
+ <output-file compare="Text">substr05.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="string">
+ <compilation-unit name="substr06">
+ <output-file compare="Text">substr06.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substring-after-1">
+ <output-file compare="Text">substring-after-1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substring-after-2">
+ <output-file compare="Text">substring-after-2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substring-after-3">
+ <output-file compare="Text">substring-after-3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substring-after-4">
+ <output-file compare="Text">substring-after-4.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substring-before-1">
+ <output-file compare="Text">substring-before-1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substring-before-2">
+ <output-file compare="Text">substring-before-2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substring-before-3">
+ <output-file compare="Text">substring-before-3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substring2-1">
+ <output-file compare="Text">substring2-1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substring2-2">
+ <output-file compare="Text">substring2-2.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substring2-3">
+ <output-file compare="Text">substring2-3.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substring2-4">
+ <output-file compare="Text">substring2-4.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substring_01">
+ <output-file compare="Text">substring_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="toLowerCase02">
+ <output-file compare="Text">toLowerCase02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="toLowerCase03">
+ <output-file compare="Text">toLowerCase03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="toLowerCase04">
+ <output-file compare="Text">toLowerCase04.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="subset-collection">
+ <test-case FilePath="subset-collection">
+ <compilation-unit name="01">
+ <output-file compare="Text">01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="subset-collection">
+ <compilation-unit name="02">
+ <output-file compare="Text">02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="subset-collection">
+ <compilation-unit name="03">
+ <output-file compare="Text">03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="subset-collection">
+ <compilation-unit name="04">
+ <output-file compare="Text">04.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="subset-collection">
+ <compilation-unit name="05">
+ <output-file compare="Text">05.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="subset-collection">
+ <compilation-unit name="06">
+ <output-file compare="Text">06.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="subset-collection">
+ <compilation-unit name="07">
+ <output-file compare="Text">07.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="tokenizers">
+ <test-case FilePath="tokenizers">
+ <compilation-unit name="counthashed-gram-tokens_01">
+ <output-file compare="Text">counthashed-gram-tokens_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tokenizers">
+ <compilation-unit name="counthashed-gram-tokens_02">
+ <output-file compare="Text">counthashed-gram-tokens_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tokenizers">
+ <compilation-unit name="counthashed-word-tokens_01">
+ <output-file compare="Text">counthashed-word-tokens_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tokenizers">
+ <compilation-unit name="gram-tokens_01">
+ <output-file compare="Text">gram-tokens_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tokenizers">
+ <compilation-unit name="gram-tokens_02">
+ <output-file compare="Text">gram-tokens_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tokenizers">
+ <compilation-unit name="hashed-gram-tokens_01">
+ <output-file compare="Text">hashed-gram-tokens_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tokenizers">
+ <compilation-unit name="hashed-gram-tokens_02">
+ <output-file compare="Text">hashed-gram-tokens_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tokenizers">
+ <compilation-unit name="hashed-word-tokens_01">
+ <output-file compare="Text">hashed-word-tokens_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tokenizers">
+ <compilation-unit name="word-tokens_01">
+ <output-file compare="Text">word-tokens_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tokenizers">
+ <compilation-unit name="word-tokens_02">
+ <output-file compare="Text">word-tokens_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="tpch">
+ <test-case FilePath="tpch">
+ <compilation-unit name="distinct_by">
+ <output-file compare="Text">distinct_by.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="group_no_agg">
+ <output-file compare="Text">group_no_agg.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q10_returned_item">
+ <output-file compare="Text">q10_returned_item.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q11_important_stock">
+ <output-file compare="Text">q11_important_stock.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q12_shipping">
+ <output-file compare="Text">q12_shipping.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q13_customer_distribution">
+ <output-file compare="Text">q13_customer_distribution.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q14_promotion_effect">
+ <output-file compare="Text">q14_promotion_effect.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q15_top_supplier">
+ <output-file compare="Text">q15_top_supplier.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q16_parts_supplier_relationship">
+ <output-file compare="Text">q16_parts_supplier_relationship.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q17_small_quantity_order_revenue">
+ <output-file compare="Text">q17_small_quantity_order_revenue.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q18_large_volume_customer">
+ <output-file compare="Text">q18_large_volume_customer.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q19_discounted_revenue">
+ <output-file compare="Text">q19_discounted_revenue.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q1_pricing_summary_report_nt">
+ <output-file compare="Text">q1_pricing_summary_report_nt.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q20_potential_part_promotion">
+ <output-file compare="Text">q20_potential_part_promotion.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q21_suppliers_who_kept_orders_waiting">
+ <output-file compare="Text">q21_suppliers_who_kept_orders_waiting.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q22_global_sales_opportunity">
+ <output-file compare="Text">q22_global_sales_opportunity.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q2_minimum_cost_supplier">
+ <output-file compare="Text">q2_minimum_cost_supplier.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q3_shipping_priority_nt">
+ <output-file compare="Text">q3_shipping_priority_nt.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q4_order_priority">
+ <output-file compare="Text">q4_order_priority.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q5_local_supplier_volume">
+ <output-file compare="Text">q5_local_supplier_volume.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q6_forecast_revenue_change">
+ <output-file compare="Text">q6_forecast_revenue_change.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q7_volume_shipping">
+ <output-file compare="Text">q7_volume_shipping.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q8_national_market_share">
+ <output-file compare="Text">q8_national_market_share.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="tpch">
+ <compilation-unit name="q9_product_type_profit_nt">
+ <output-file compare="Text">q9_product_type_profit_nt.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="writers">
+ <test-case FilePath="writers">
+ <compilation-unit name="print_01">
+ <output-file compare="Text">print_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="writers">
+ <compilation-unit name="serialized_01">
+ <output-file compare="Text">serialized_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="cross-dataverse">
+ <test-case FilePath="cross-dataverse">
+ <compilation-unit name="cross-dv01">
+ <output-file compare="Text">cross-dv01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="cross-dataverse">
+ <compilation-unit name="cross-dv02">
+ <output-file compare="Text">cross-dv02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="cross-dataverse">
+ <compilation-unit name="cross-dv03">
+ <output-file compare="Text">cross-dv03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="cross-dataverse">
+ <compilation-unit name="cross-dv04">
+ <output-file compare="Text">cross-dv04.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="cross-dataverse">
+ <compilation-unit name="cross-dv07">
+ <output-file compare="Text">cross-dv07.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!--NotImplementedException: No binary comparator factory implemented for type RECORD.
+ <test-case FilePath="cross-dataverse">
+ <compilation-unit name="cross-dv08">
+ <output-file compare="Text">cross-dv08.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="cross-dataverse">
+ <compilation-unit name="cross-dv09">
+ <output-file compare="Text">cross-dv09.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="cross-dataverse">
+ <compilation-unit name="cross-dv11">
+ <output-file compare="Text">cross-dv11.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="cross-dataverse">
+ <compilation-unit name="cross-dv12">
+ <output-file compare="Text">cross-dv12.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="cross-dataverse">
+ <compilation-unit name="cross-dv13">
+ <output-file compare="Text">cross-dv13.adm</output-file>
+ <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="cross-dataverse">
+ <compilation-unit name="cross-dv14">
+ <output-file compare="Text">cross-dv14.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="cross-dataverse">
+ <compilation-unit name="cross-dv15">
+ <output-file compare="Text">cross-dv15.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="cross-dataverse">
+ <compilation-unit name="cross-dv16">
+ <output-file compare="Text">cross-dv16.adm</output-file>
+ <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+ </compilation-unit>
+ </test-case>
+ <!--NotImplementedException: No binary comparator factory implemented for type RECORD.
+ <test-case FilePath="cross-dataverse">
+ <compilation-unit name="cross-dv17">
+ <output-file compare="Text">cross-dv17.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <!--NotImplementedException: No binary comparator factory implemented for type RECORD.
+ <test-case FilePath="cross-dataverse">
+ <compilation-unit name="cross-dv18">
+ <output-file compare="Text">cross-dv18.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="cross-dataverse">
+ <compilation-unit name="cross-dv19">
+ <output-file compare="Text">cross-dv19.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="cross-dataverse">
+ <compilation-unit name="insert_across_dataverses">
+ <output-file compare="Text">insert_across_dataverses.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="cross-dataverse">
+ <compilation-unit name="join_across_dataverses">
+ <output-file compare="Text">join_across_dataverses.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="user-defined-functions">
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="query-issue201">
+ <output-file compare="Text">query-issue201.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf01">
+ <output-file compare="Text">udf01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf02">
+ <output-file compare="Text">udf02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!-- causes NPE: Issue 200
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf03">
+ <output-file compare="Text">udf03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf04">
+ <output-file compare="Text">udf04.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf05">
+ <output-file compare="Text">udf05.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf06">
+ <output-file compare="Text">udf06.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf07">
+ <output-file compare="Text">udf07.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf08">
+ <output-file compare="Text">udf08.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf09">
+ <output-file compare="Text">udf09.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf10">
+ <output-file compare="Text">udf10.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf11">
+ <output-file compare="Text">udf11.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf12">
+ <output-file compare="Text">udf12.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf13">
+ <output-file compare="Text">udf13.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf14">
+ <output-file compare="Text">udf14.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!-- Issue 166
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf15">
+ <output-file compare="Text">udf15.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf16">
+ <output-file compare="Text">udf16.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf17">
+ <output-file compare="Text">udf17.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf18">
+ <output-file compare="Text">udf18.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf19">
+ <output-file compare="Text">udf19.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf20">
+ <output-file compare="Text">udf20.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf21">
+ <output-file compare="Text">udf21.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf22">
+ <output-file compare="Text">udf22.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf23">
+ <output-file compare="Text">udf23.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <!-- Issue 195
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf24">
+ <output-file compare="Text">udf24.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <!-- Issue 218
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf25">
+ <output-file compare="Text">udf25.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf26">
+ <output-file compare="Text">udf26.adm</output-file>
+ <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="udf27">
+ <output-file compare="Text">udf27.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
+ <compilation-unit name="f01">
+ <output-file compare="Text">f01.adm</output-file>
+ <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="load">
+ <test-case FilePath="load">
+ <compilation-unit name="issue14_query">
+ <output-file compare="Text">none.adm</output-file>
+ <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="feeds">
+ <test-case FilePath="feeds">
+ <compilation-unit name="feeds_01">
+ <output-file compare="Text">feeds_01.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="feeds">
+ <compilation-unit name="feeds_02">
+ <output-file compare="Text">feeds_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="feeds">
+ <compilation-unit name="feeds_03">
+ <output-file compare="Text">feeds_03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="feeds">
+ <compilation-unit name="feeds_04">
+ <output-file compare="Text">feeds_04.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="feeds">
+ <compilation-unit name="issue_230_feeds">
+ <output-file compare="Text">issue_230_feeds.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="hdfs">
+ <test-case FilePath="hdfs">
+ <compilation-unit name="issue_245_hdfs">
+ <output-file compare="Text">issue_245_hdfs.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="hdfs">
+ <compilation-unit name="hdfs_02">
+ <output-file compare="Text">hdfs_02.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="hdfs">
+ <compilation-unit name="hdfs_03">
+ <output-file compare="Text">hdfs_03.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+</test-suite>
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/base/AbstractExpression.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/base/AbstractExpression.java
new file mode 100644
index 0000000..e83a1ed
--- /dev/null
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/base/AbstractExpression.java
@@ -0,0 +1,25 @@
+package edu.uci.ics.asterix.aql.base;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IExpressionAnnotation;
+
+public abstract class AbstractExpression implements Expression {
+ protected List<IExpressionAnnotation> hints;
+
+ public void addHint(IExpressionAnnotation hint) {
+ if (hints == null) {
+ hints = new ArrayList<IExpressionAnnotation>();
+ }
+ hints.add(hint);
+ }
+
+ public boolean hasHints() {
+ return hints != null;
+ }
+
+ public List<IExpressionAnnotation> getHints() {
+ return hints;
+ }
+}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/context/FunctionExpressionMap.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/context/FunctionExpressionMap.java
index f30ae09..f013f18 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/context/FunctionExpressionMap.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/context/FunctionExpressionMap.java
@@ -2,9 +2,9 @@
import java.util.HashMap;
-import edu.uci.ics.asterix.om.functions.AsterixFunction;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
-public class FunctionExpressionMap extends HashMap<Integer, AsterixFunction> {
+public class FunctionExpressionMap extends HashMap<Integer, FunctionSignature> {
/**
*
*/
@@ -24,7 +24,7 @@
this.varargs = varargs;
}
- public AsterixFunction get(int arity) {
+ public FunctionSignature get(int arity) {
if (varargs) {
return super.get(-1);
} else {
@@ -32,7 +32,7 @@
}
}
- public AsterixFunction put(int arity, AsterixFunction fd) {
+ public FunctionSignature put(int arity, FunctionSignature fd) {
if (varargs) {
return super.put(-1, fd);
} else {
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/context/FunctionSignatures.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/context/FunctionSignatures.java
index 1027c42..88fff83 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/context/FunctionSignatures.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/context/FunctionSignatures.java
@@ -3,17 +3,18 @@
import java.util.HashMap;
import java.util.Map;
-import edu.uci.ics.asterix.om.functions.AsterixFunction;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
public class FunctionSignatures {
- private final Map<String, FunctionExpressionMap> functionMap;
+ private final Map<FunctionSignature, FunctionExpressionMap> functionMap;
public FunctionSignatures() {
- functionMap = new HashMap<String, FunctionExpressionMap>();
+ functionMap = new HashMap<FunctionSignature, FunctionExpressionMap>();
}
- public AsterixFunction get(String name, int arity) {
- FunctionExpressionMap possibleFD = functionMap.get(name);
+ public FunctionSignature get(String dataverse, String name, int arity) {
+ FunctionSignature fid = new FunctionSignature(dataverse, name, arity);
+ FunctionExpressionMap possibleFD = functionMap.get(fid);
if (possibleFD == null) {
return null;
} else {
@@ -21,12 +22,11 @@
}
}
- public void put(AsterixFunction fd, boolean varargs) {
- String name = fd.getFunctionName();
- FunctionExpressionMap func = functionMap.get(name);
+ public void put(FunctionSignature fd, boolean varargs) {
+ FunctionExpressionMap func = functionMap.get(fd);
if (func == null) {
func = new FunctionExpressionMap(varargs);
- functionMap.put(name, func);
+ functionMap.put(fd, func);
}
func.put(fd.getArity(), fd);
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/context/Scope.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/context/Scope.java
index ef338d4..4c1339a 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/context/Scope.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/context/Scope.java
@@ -5,7 +5,7 @@
import edu.uci.ics.asterix.aql.expression.Identifier;
import edu.uci.ics.asterix.aql.expression.VarIdentifier;
import edu.uci.ics.asterix.aql.parser.ScopeChecker;
-import edu.uci.ics.asterix.om.functions.AsterixFunction;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
public final class Scope {
private Scope parent;
@@ -78,11 +78,11 @@
* @param varargs
* whether this function has varargs
*/
- public void addFunctionDescriptor(AsterixFunction fd, boolean varargs) {
+ public void addFunctionDescriptor(FunctionSignature signature, boolean varargs) {
if (functionSignatures == null) {
functionSignatures = new FunctionSignatures();
}
- functionSignatures.put(fd, varargs);
+ functionSignatures.put(signature, varargs);
}
/**
@@ -94,13 +94,13 @@
* # of arguments
* @return FunctionDescriptor of the function found; otherwise null
*/
- public AsterixFunction findFunctionSignature(String name, int arity) {
- AsterixFunction fd = null;
+ public FunctionSignature findFunctionSignature(String dataverse, String name, int arity) {
+ FunctionSignature fd = null;
if (functionSignatures != null) {
- fd = functionSignatures.get(name, arity);
+ fd = functionSignatures.get(dataverse, name, arity);
}
if (fd == null && parent != null) {
- fd = parent.findFunctionSignature(name, arity);
+ fd = parent.findFunctionSignature(dataverse, name, arity);
}
return fd;
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/BeginFeedStatement.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/BeginFeedStatement.java
index a142534..422ca79 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/BeginFeedStatement.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/BeginFeedStatement.java
@@ -1,6 +1,7 @@
package edu.uci.ics.asterix.aql.expression;
import java.io.StringReader;
+import java.util.List;
import edu.uci.ics.asterix.aql.base.Statement;
import edu.uci.ics.asterix.aql.expression.visitor.IAqlExpressionVisitor;
@@ -8,38 +9,71 @@
import edu.uci.ics.asterix.aql.parser.AQLParser;
import edu.uci.ics.asterix.aql.parser.ParseException;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
+import edu.uci.ics.asterix.metadata.MetadataException;
+import edu.uci.ics.asterix.metadata.MetadataManager;
+import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
+import edu.uci.ics.asterix.metadata.entities.Dataset;
import edu.uci.ics.asterix.metadata.entities.FeedDatasetDetails;
+import edu.uci.ics.asterix.metadata.entities.Function;
public class BeginFeedStatement implements Statement {
- private Identifier datasetName;
+ private final Identifier dataverseName;
+ private final Identifier datasetName;
private Query query;
private int varCounter;
- public BeginFeedStatement(Identifier datasetName, int varCounter) {
+ public BeginFeedStatement(Identifier dataverseName, Identifier datasetName, int varCounter) {
+ this.dataverseName = dataverseName;
this.datasetName = datasetName;
this.varCounter = varCounter;
}
-
- public void initialize(FeedDatasetDetails feedDetails){
+
+ public void initialize(MetadataTransactionContext mdTxnCtx, Dataset dataset) throws MetadataException {
query = new Query();
- String functionName = feedDetails.getFunctionIdentifier();
- String stmt;
- if(functionName == null){
- stmt = "insert into dataset " + datasetName + " (" + " for $x in feed-ingest ('" + datasetName + "')"
- + " return $x" + " );";
+ FeedDatasetDetails feedDetails = (FeedDatasetDetails) dataset.getDatasetDetails();
+ String functionName = feedDetails.getFunction() == null ? null : feedDetails.getFunction().getName();
+ StringBuilder builder = new StringBuilder();
+ builder.append("insert into dataset " + datasetName + " ");
+
+ if (functionName == null) {
+ builder.append(" (" + " for $x in feed-ingest ('" + datasetName + "') ");
+ builder.append(" return $x");
} else {
- stmt = "insert into dataset " + datasetName + " (" + " for $x in feed-ingest ('" + datasetName + "')"
- + " return " + functionName + "(" + "$x" + ")" + ");";
+ int arity = feedDetails.getFunction().getArity();
+ FunctionSignature signature = new FunctionSignature(dataset.getDataverseName(), functionName, arity);
+ Function function = MetadataManager.INSTANCE.getFunction(mdTxnCtx, signature);
+ if (function == null) {
+ throw new MetadataException(" Unknown function " + feedDetails.getFunction());
+ }
+ if (function.getLanguage().equalsIgnoreCase(Function.LANGUAGE_AQL)) {
+ String param = function.getParams().get(0);
+ builder.append(" (" + " for" + " " + param + " in feed-ingest ('" + datasetName + "') ");
+ builder.append(" let $y:=(" + function.getFunctionBody() + ")" + " return $y");
+ } else {
+ builder.append(" (" + " for $x in feed-ingest ('" + datasetName + "') ");
+ builder.append(" let $y:=" + function.getName() + "(" + "$x" + ")");
+ builder.append(" return $y");
+ }
+
}
- AQLParser parser = new AQLParser(new StringReader(stmt));
+ builder.append(")");
+ builder.append(";");
+ AQLParser parser = new AQLParser(new StringReader(builder.toString()));
+
+ List<Statement> statements;
try {
- query = (Query) parser.Statement();
+ statements = parser.Statement();
+ query = ((InsertStatement) statements.get(0)).getQuery();
} catch (ParseException pe) {
- throw new RuntimeException(pe);
+ throw new MetadataException(pe);
}
- query = ((InsertStatement) query.getPrologDeclList().get(0)).getQuery();
+ }
+
+ public Identifier getDataverseName() {
+ return dataverseName;
}
public Identifier getDatasetName() {
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/CallExpr.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/CallExpr.java
index cda7e69..9bd59d4 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/CallExpr.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/CallExpr.java
@@ -2,54 +2,44 @@
import java.util.List;
+import edu.uci.ics.asterix.aql.base.AbstractExpression;
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;
-import edu.uci.ics.asterix.om.functions.AsterixFunction;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
-public class CallExpr implements Expression {
- private AsterixFunction ident;
+public class CallExpr extends AbstractExpression {
+ private final FunctionSignature functionSignature;
private List<Expression> exprList;
private boolean isBuiltin;
- public CallExpr() {
- }
-
- public CallExpr(AsterixFunction ident, List<Expression> exprList) {
- this.ident = ident;
+ public CallExpr(FunctionSignature functionSignature, List<Expression> exprList) {
+ this.functionSignature = functionSignature;
this.exprList = exprList;
}
- public AsterixFunction getIdent() {
- return ident;
- }
-
- public void setIdent(AsterixFunction ident) {
- this.ident = ident;
+ public FunctionSignature getFunctionSignature() {
+ return functionSignature;
}
public List<Expression> getExprList() {
return exprList;
}
- public void setExprList(List<Expression> exprList) {
- this.exprList = exprList;
- }
-
public boolean isBuiltin() {
return isBuiltin;
}
- public void setIsBuiltin(boolean builtin) {
- this.isBuiltin = builtin;
- }
-
@Override
public Kind getKind() {
return Kind.CALL_EXPRESSION;
}
+ public void setExprList(List<Expression> exprList) {
+ this.exprList = exprList;
+ }
+
@Override
public <T> void accept(IAqlVisitorWithVoidReturn<T> visitor, T arg) throws AsterixException {
visitor.visit(this, arg);
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/ControlFeedStatement.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/ControlFeedStatement.java
index 844fec6..4ceb0e3 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/ControlFeedStatement.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/ControlFeedStatement.java
@@ -9,7 +9,8 @@
public class ControlFeedStatement implements Statement {
- private Identifier datasetName;
+ private final Identifier dataverseName;
+ private final Identifier datasetName;
public enum OperationType {
BEGIN,
@@ -22,18 +23,24 @@
private OperationType operationType;
private Map<String, String> alterAdapterConfParams;
- public ControlFeedStatement(OperationType operation, Identifier datasetName) {
+ public ControlFeedStatement(OperationType operation, Identifier dataverseName, Identifier datasetName) {
this.operationType = operation;
this.datasetName = datasetName;
+ this.dataverseName = dataverseName;
}
- public ControlFeedStatement(OperationType operation, Identifier datasetName,
+ public ControlFeedStatement(OperationType operation, Identifier dataverseName, Identifier datasetName,
Map<String, String> alterAdapterConfParams) {
this.operationType = operation;
this.datasetName = datasetName;
+ this.dataverseName = dataverseName;
this.alterAdapterConfParams = alterAdapterConfParams;
}
-
+
+ public Identifier getDataverseName() {
+ return dataverseName;
+ }
+
public Identifier getDatasetName() {
return datasetName;
}
@@ -54,7 +61,7 @@
public Map<String, String> getAlterAdapterConfParams() {
return alterAdapterConfParams;
}
-
+
@Override
public <R, T> R accept(IAqlExpressionVisitor<R, T> visitor, T arg) throws AsterixException {
return visitor.visitControlFeedStatement(this, arg);
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/CreateFunctionStatement.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/CreateFunctionStatement.java
index 6ffd39d..6a8fec6 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/CreateFunctionStatement.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/CreateFunctionStatement.java
@@ -7,39 +7,26 @@
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;
-import edu.uci.ics.asterix.om.functions.AsterixFunction;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
public class CreateFunctionStatement implements Statement {
- private AsterixFunction asterixFunction;
- private String functionBody;
- private boolean ifNotExists;
- private List<String> paramList;
+ private final FunctionSignature signature;
+ private final String functionBody;
+ private final boolean ifNotExists;
+ private final List<String> paramList;
- public AsterixFunction getFunctionIdentifier() {
- return asterixFunction;
- }
-
- public void setFunctionIdentifier(AsterixFunction AsterixFunction) {
- this.asterixFunction = AsterixFunction;
+ public FunctionSignature getaAterixFunction() {
+ return signature;
}
public String getFunctionBody() {
return functionBody;
}
- public void setFunctionBody(String functionBody) {
- this.functionBody = functionBody;
- }
-
- public void setIfNotExists(boolean ifNotExists) {
- this.ifNotExists = ifNotExists;
- }
-
- public CreateFunctionStatement(AsterixFunction AsterixFunction, List<VarIdentifier> parameterList, String functionBody,
+ public CreateFunctionStatement(FunctionSignature signature, List<VarIdentifier> parameterList, String functionBody,
boolean ifNotExists) {
-
- this.asterixFunction = AsterixFunction;
+ this.signature = signature;
this.functionBody = functionBody;
this.ifNotExists = ifNotExists;
this.paramList = new ArrayList<String>();
@@ -61,8 +48,8 @@
return paramList;
}
- public void setParamList(List<String> paramList) {
- this.paramList = paramList;
+ public FunctionSignature getSignature() {
+ return signature;
}
@Override
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/CreateIndexStatement.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/CreateIndexStatement.java
index ab75af5..ffd0534 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/CreateIndexStatement.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/CreateIndexStatement.java
@@ -13,6 +13,7 @@
private Identifier indexName;
private boolean needToCreate = true;
+ private Identifier dataverseName;
private Identifier datasetName;
private List<String> fieldExprs = new ArrayList<String>();
private IndexType indexType = IndexType.BTREE;
@@ -48,6 +49,14 @@
this.indexName = indexName;
}
+ public Identifier getDataverseName() {
+ return dataverseName;
+ }
+
+ public void setDataverseName(Identifier dataverseName) {
+ this.dataverseName = dataverseName;
+ }
+
public Identifier getDatasetName() {
return datasetName;
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/DatasetDecl.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/DatasetDecl.java
index 7996062..463a256 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/DatasetDecl.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/DatasetDecl.java
@@ -21,17 +21,21 @@
import edu.uci.ics.asterix.common.exceptions.AsterixException;
public class DatasetDecl implements Statement {
- protected Identifier name;
- protected Identifier itemTypeName;
- protected DatasetType datasetType;
- protected IDatasetDetailsDecl datasetDetailsDecl;
+ protected final Identifier name;
+ protected final Identifier dataverse;
+ protected final Identifier itemTypeName;
+ protected final DatasetType datasetType;
+ protected final IDatasetDetailsDecl datasetDetailsDecl;
public boolean ifNotExists;
- public DatasetDecl(Identifier name, Identifier itemTypeName, IDatasetDetailsDecl idd, boolean ifNotExists) {
+ public DatasetDecl(Identifier dataverse, Identifier name, Identifier itemTypeName, DatasetType datasetType,
+ IDatasetDetailsDecl idd, boolean ifNotExists) {
+ this.dataverse = dataverse;
this.name = name;
this.itemTypeName = itemTypeName;
this.ifNotExists = ifNotExists;
+ this.datasetType = datasetType;
datasetDetailsDecl = idd;
}
@@ -39,10 +43,6 @@
return this.ifNotExists;
}
- public void setDatasetType(DatasetType datasetType) {
- this.datasetType = datasetType;
- }
-
public DatasetType getDatasetType() {
return datasetType;
}
@@ -51,18 +51,10 @@
return name;
}
- public void setName(Identifier name) {
- this.name = name;
- }
-
public Identifier getItemTypeName() {
return itemTypeName;
}
- public void setItemTypeName(Identifier itemTypeName) {
- this.itemTypeName = itemTypeName;
- }
-
@Override
public <R, T> R accept(IAqlExpressionVisitor<R, T> visitor, T arg) throws AsterixException {
return visitor.visitDatasetDecl(this, arg);
@@ -82,7 +74,8 @@
return datasetDetailsDecl;
}
- public void setDatasetDetailsDecl(IDatasetDetailsDecl datasetDetailsDecl) {
- this.datasetDetailsDecl = datasetDetailsDecl;
+ public Identifier getDataverse() {
+ return dataverse;
}
+
}
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 9d957cf..48b7909 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
@@ -10,14 +10,16 @@
public class DeleteStatement implements Statement {
private VariableExpr vars;
+ private Identifier dataverseName;
private Identifier datasetName;
private Expression condition;
private Clause dieClause;
private int varCounter;
- public DeleteStatement(VariableExpr vars, Identifier datasetName, Expression condition, Clause dieClause,
- int varCounter) {
+ public DeleteStatement(VariableExpr vars, Identifier dataverseName, Identifier datasetName, Expression condition,
+ Clause dieClause, int varCounter) {
this.vars = vars;
+ this.dataverseName = dataverseName;
this.datasetName = datasetName;
this.condition = condition;
this.dieClause = dieClause;
@@ -33,6 +35,10 @@
return vars;
}
+ public Identifier getDataverseName() {
+ return dataverseName;
+ }
+
public Identifier getDatasetName() {
return datasetName;
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/DropStatement.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/DropStatement.java
index 9ddec0e..76d952b 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/DropStatement.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/DropStatement.java
@@ -7,10 +7,12 @@
public class DropStatement implements Statement {
- private Identifier datasetName;
+ private final Identifier dataverseName;
+ private final Identifier datasetName;
private boolean ifExists;
- public DropStatement(Identifier datasetName, boolean ifExists) {
+ public DropStatement(Identifier dataverseName, Identifier datasetName, boolean ifExists) {
+ this.dataverseName = dataverseName;
this.datasetName = datasetName;
this.ifExists = ifExists;
}
@@ -20,6 +22,10 @@
return Kind.DATASET_DROP;
}
+ public Identifier getDataverseName() {
+ return dataverseName;
+ }
+
public Identifier getDatasetName() {
return datasetName;
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/FeedDetailsDecl.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/FeedDetailsDecl.java
index cb32ac6..2c99a3d 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/FeedDetailsDecl.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/FeedDetailsDecl.java
@@ -14,34 +14,37 @@
*/
package edu.uci.ics.asterix.aql.expression;
+import java.util.List;
import java.util.Map;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
+
public class FeedDetailsDecl extends InternalDetailsDecl {
- private Map<String, String> properties;
- private String adapterClassname;
- private String functionIdentifier;
+ private final Map<String, String> configuration;
+ private final String adapterFactoryClassname;
+ private final FunctionSignature functionSignature;
- public void setFunctionIdentifier(String functionIdentifier) {
- this.functionIdentifier = functionIdentifier;
+ public FeedDetailsDecl(String adapterFactoryClassname, Map<String, String> configuration,
+ FunctionSignature signature, Identifier nodeGroupName, List<String> partitioningExpr) {
+ super(nodeGroupName, partitioningExpr);
+ this.adapterFactoryClassname = adapterFactoryClassname;
+ this.configuration = configuration;
+ this.functionSignature = signature;
}
- public void setAdapterClassname(String adapter) {
- this.adapterClassname = adapter;
+ public Map<String, String> getConfiguration() {
+ return configuration;
}
- public void setProperties(Map<String, String> properties) {
- this.properties = properties;
+ public String getAdapterFactoryClassname() {
+ return adapterFactoryClassname;
}
- public String getAdapterClassname() {
- return adapterClassname;
+ public FunctionSignature getSignature() {
+ return functionSignature;
}
- public Map<String, String> getProperties() {
- return properties;
- }
-
- public String getFunctionIdentifier() {
- return functionIdentifier;
+ public FunctionSignature getFunctionSignature() {
+ return functionSignature;
}
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/FunctionDecl.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/FunctionDecl.java
index e69035a..8871c79 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/FunctionDecl.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/FunctionDecl.java
@@ -7,38 +7,27 @@
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;
-import edu.uci.ics.asterix.om.functions.AsterixFunction;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
public class FunctionDecl implements Statement {
- private AsterixFunction ident;
+ private FunctionSignature signature;
private List<VarIdentifier> paramList;
private Expression funcBody;
- public FunctionDecl() {
- }
-
- public FunctionDecl(AsterixFunction ident, List<VarIdentifier> paramList, Expression funcBody) {
- this.ident = ident;
+ public FunctionDecl(FunctionSignature signature, List<VarIdentifier> paramList, Expression funcBody) {
+ this.signature = signature;
this.paramList = paramList;
this.funcBody = funcBody;
}
- public AsterixFunction getIdent() {
- return ident;
- }
-
- public void setIdent(AsterixFunction ident) {
- this.ident = ident;
+ public FunctionSignature getSignature() {
+ return signature;
}
public List<VarIdentifier> getParamList() {
return paramList;
}
- public void setParamList(List<VarIdentifier> paramList) {
- this.paramList = paramList;
- }
-
public Expression getFuncBody() {
return funcBody;
}
@@ -47,6 +36,24 @@
this.funcBody = funcBody;
}
+ public void setSignature(FunctionSignature signature) {
+ this.signature = signature;
+ }
+
+ public void setParamList(List<VarIdentifier> paramList) {
+ this.paramList = paramList;
+ }
+
+ @Override
+ public int hashCode() {
+ return signature.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ return (o instanceof FunctionDecl && ((FunctionDecl) o).getSignature().equals(signature));
+ }
+
@Override
public Kind getKind() {
return Kind.FUNCTION_DECL;
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/FunctionDropStatement.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/FunctionDropStatement.java
index 4b96143..054bc5a 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/FunctionDropStatement.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/FunctionDropStatement.java
@@ -4,16 +4,15 @@
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;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
public class FunctionDropStatement implements Statement {
- private Identifier functionName;
- private int arity;
+ private final FunctionSignature signature;
private boolean ifExists;
- public FunctionDropStatement(Identifier functionName, int arity, boolean ifExists) {
- this.functionName = functionName;
- this.arity = arity;
+ public FunctionDropStatement(FunctionSignature signature, boolean ifExists) {
+ this.signature = signature;
this.ifExists = ifExists;
}
@@ -22,22 +21,14 @@
return Kind.FUNCTION_DROP;
}
- public Identifier getFunctionName() {
- return functionName;
+ public FunctionSignature getFunctionSignature() {
+ return signature;
}
public boolean getIfExists() {
return ifExists;
}
- public int getArity() {
- return arity;
- }
-
- public void setArity(int arity) {
- this.arity = arity;
- }
-
@Override
public <R, T> R accept(IAqlExpressionVisitor<R, T> visitor, T arg) throws AsterixException {
return visitor.visitFunctionDropStatement(this, arg);
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/IndexDropStatement.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/IndexDropStatement.java
index b69ccd1..43831d0 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/IndexDropStatement.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/IndexDropStatement.java
@@ -7,12 +7,14 @@
public class IndexDropStatement implements Statement {
+ private Identifier dataverseName;
private Identifier datasetName;
private Identifier indexName;
private boolean ifExists;
- public IndexDropStatement(Identifier dataverseName, Identifier indexName, boolean ifExists) {
- this.datasetName = dataverseName;
+ public IndexDropStatement(Identifier dataverseName, Identifier datasetName, Identifier indexName, boolean ifExists) {
+ this.dataverseName = dataverseName;
+ this.datasetName = datasetName;
this.indexName = indexName;
this.ifExists = ifExists;
}
@@ -22,6 +24,10 @@
return Kind.INDEX_DROP;
}
+ public Identifier getDataverseName() {
+ return dataverseName;
+ }
+
public Identifier getDatasetName() {
return datasetName;
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/InsertStatement.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/InsertStatement.java
index 7faa33e..c7b1f6d 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/InsertStatement.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/InsertStatement.java
@@ -7,11 +7,13 @@
public class InsertStatement implements Statement {
- private Identifier datasetName;
- private Query query;
- private int varCounter;
+ private final Identifier dataverseName;
+ private final Identifier datasetName;
+ private final Query query;
+ private final int varCounter;
- public InsertStatement(Identifier datasetName, Query query, int varCounter) {
+ public InsertStatement(Identifier dataverseName, Identifier datasetName, Query query, int varCounter) {
+ this.dataverseName = dataverseName;
this.datasetName = datasetName;
this.query = query;
this.varCounter = varCounter;
@@ -22,6 +24,10 @@
return Kind.INSERT;
}
+ public Identifier getDataverseName() {
+ return dataverseName;
+ }
+
public Identifier getDatasetName() {
return datasetName;
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/InternalDetailsDecl.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/InternalDetailsDecl.java
index a680e48..2a7c89c 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/InternalDetailsDecl.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/InternalDetailsDecl.java
@@ -14,31 +14,24 @@
*/
package edu.uci.ics.asterix.aql.expression;
-import java.util.ArrayList;
import java.util.List;
import edu.uci.ics.asterix.metadata.bootstrap.MetadataConstants;
public class InternalDetailsDecl implements IDatasetDetailsDecl {
- private Identifier nodegroupName = new Identifier(MetadataConstants.METADATA_DEFAULT_NODEGROUP_NAME);
- private List<String> partitioningExprs = new ArrayList<String>();
+ private final Identifier nodegroupName;
+ private final List<String> partitioningExprs;
- public void addPartitioningExpr(String pe) {
- this.partitioningExprs.add(pe);
- }
-
- public void addPartitioningExprList(List<String> peList) {
- this.partitioningExprs = peList;
+ public InternalDetailsDecl(Identifier nodeGroupName, List<String> partitioningExpr) {
+ this.nodegroupName = nodeGroupName == null ? new Identifier(MetadataConstants.METADATA_DEFAULT_NODEGROUP_NAME)
+ : nodeGroupName;
+ this.partitioningExprs = partitioningExpr;
}
public List<String> getPartitioningExprs() {
return partitioningExprs;
}
- public void setNodegroupName(Identifier nodegroupName) {
- this.nodegroupName = nodegroupName;
- }
-
public Identifier getNodegroupName() {
return nodegroupName;
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/LoadFromFileStatement.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/LoadFromFileStatement.java
index 011ee89..ecbdb42 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/LoadFromFileStatement.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/LoadFromFileStatement.java
@@ -10,12 +10,14 @@
public class LoadFromFileStatement implements Statement {
private Identifier datasetName;
+ private Identifier dataverseName;
private String adapter;
private Map<String, String> properties;
private boolean dataIsLocallySorted;
- public LoadFromFileStatement(Identifier datasetName, String adapter, Map<String, String> propertiees,
- boolean dataIsLocallySorted) {
+ public LoadFromFileStatement(Identifier dataverseName, Identifier datasetName, String adapter,
+ Map<String, String> propertiees, boolean dataIsLocallySorted) {
+ this.dataverseName = dataverseName;
this.datasetName = datasetName;
this.adapter = adapter;
this.properties = propertiees;
@@ -38,6 +40,14 @@
this.properties = properties;
}
+ public Identifier getDataverseName() {
+ return dataverseName;
+ }
+
+ public void setDataverseName(Identifier dataverseName) {
+ this.dataverseName = dataverseName;
+ }
+
@Override
public Kind getKind() {
return Kind.LOAD_FROM_FILE;
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/OperatorExpr.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/OperatorExpr.java
index b6bb55b..23d2179 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/OperatorExpr.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/OperatorExpr.java
@@ -2,12 +2,13 @@
import java.util.ArrayList;
+import edu.uci.ics.asterix.aql.base.AbstractExpression;
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 OperatorExpr implements Expression {
+public class OperatorExpr extends AbstractExpression {
private ArrayList<Expression> exprList;
private ArrayList<OperatorType> opList;
private ArrayList<Integer> exprBroadcastIdx;
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/Query.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/Query.java
index 6e851b0..92ad0ee 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/Query.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/Query.java
@@ -1,8 +1,5 @@
package edu.uci.ics.asterix.aql.expression;
-import java.util.ArrayList;
-import java.util.List;
-
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;
@@ -10,59 +7,39 @@
import edu.uci.ics.asterix.common.exceptions.AsterixException;
public class Query implements Statement {
- private Expression body;
- private List<Statement> prologDeclList = new ArrayList<Statement>();
- private boolean isDummyQuery = false;
+ private Expression body;
+ private int varCounter;
- public Query() {
- }
+ public Expression getBody() {
+ return body;
+ }
- public Query(boolean isDummyQuery) {
- this.isDummyQuery = isDummyQuery;
- }
+ public void setBody(Expression body) {
+ this.body = body;
+ }
- public boolean isDummyQuery() {
- return isDummyQuery;
- }
+ public int getVarCounter() {
+ return varCounter;
+ }
- public Expression getBody() {
- return body;
- }
+ public void setVarCounter(int varCounter) {
+ this.varCounter = varCounter;
+ }
- public void setBody(Expression body) {
- this.body = body;
- }
+ @Override
+ public Kind getKind() {
+ return Kind.QUERY;
+ }
- public void addPrologDecl(Statement stmt) {
- this.prologDeclList.add(stmt);
- }
+ @Override
+ public <T> void accept(IAqlVisitorWithVoidReturn<T> visitor, T step)
+ throws AsterixException {
+ visitor.visit(this, step);
+ }
- public List<Statement> getPrologDeclList() {
- return prologDeclList;
- }
-
- public void setPrologDeclList(List<Statement> prologDeclList) {
- this.prologDeclList = prologDeclList;
- }
-
- // public void addFunctionDecl(FunctionDeclClass fc){
- // if(functionDeclList == null){
- // functionDeclList = new ArrayList<FunctionDeclClass>();
- // }
- // functionDeclList.add(fc);
- // }
- @Override
- public Kind getKind() {
- return Kind.QUERY;
- }
-
- @Override
- public <T> void accept(IAqlVisitorWithVoidReturn<T> visitor, T step) throws AsterixException {
- visitor.visit(this, step);
- }
-
- @Override
- public <R, T> R accept(IAqlExpressionVisitor<R, T> visitor, T arg) throws AsterixException {
- return visitor.visitQuery(this, arg);
- }
+ @Override
+ public <R, T> R accept(IAqlExpressionVisitor<R, T> visitor, T arg)
+ throws AsterixException {
+ return visitor.visitQuery(this, arg);
+ }
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/TypeDecl.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/TypeDecl.java
index b7ccc8f..2e75ca7 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/TypeDecl.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/TypeDecl.java
@@ -8,26 +8,33 @@
public class TypeDecl implements Statement {
+ private final Identifier dataverseName;
private final Identifier ident;
private final TypeExpression typeDef;
private final TypeDataGen datagenAnnotation;
private final boolean ifNotExists;
- public TypeDecl(Identifier ident, TypeExpression typeDef, TypeDataGen datagen, boolean ifNotExists) {
+ public TypeDecl(Identifier dataverseName, Identifier ident, TypeExpression typeDef, TypeDataGen datagen,
+ boolean ifNotExists) {
+ this.dataverseName = dataverseName;
this.ident = ident;
this.typeDef = typeDef;
this.datagenAnnotation = datagen;
this.ifNotExists = ifNotExists;
}
- public TypeDecl(Identifier ident, TypeExpression typeDef) {
- this(ident, typeDef, null, false);
+ public TypeDecl(Identifier dataverse, Identifier ident, TypeExpression typeDef) {
+ this(dataverse, ident, typeDef, null, false);
}
public Identifier getIdent() {
return ident;
}
+ public Identifier getDataverseName() {
+ return dataverseName;
+ }
+
public TypeExpression getTypeDef() {
return typeDef;
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/TypeDropStatement.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/TypeDropStatement.java
index b50dbdd..4776b51 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/TypeDropStatement.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/TypeDropStatement.java
@@ -7,10 +7,12 @@
public class TypeDropStatement implements Statement {
+ private final Identifier dataverseName;
private Identifier typeName;
private boolean ifExists;
- public TypeDropStatement(Identifier typeName, boolean ifExists) {
+ public TypeDropStatement(Identifier dataverseName, Identifier typeName, boolean ifExists) {
+ this.dataverseName = dataverseName;
this.typeName = typeName;
this.ifExists = ifExists;
}
@@ -20,6 +22,10 @@
return Kind.TYPE_DROP;
}
+ public Identifier getDataverseName() {
+ return dataverseName;
+ }
+
public Identifier getTypeName() {
return typeName;
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/TypeReferenceExpression.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/TypeReferenceExpression.java
index 88673fa..dfd4dc8 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/TypeReferenceExpression.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/TypeReferenceExpression.java
@@ -6,7 +6,7 @@
public class TypeReferenceExpression extends TypeExpression {
- private Identifier ident;
+ private final Identifier ident;
public TypeReferenceExpression(Identifier ident) {
this.ident = ident;
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/WriteFromQueryResultStatement.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/WriteFromQueryResultStatement.java
index b45f5da..10a9bd6 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/WriteFromQueryResultStatement.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/WriteFromQueryResultStatement.java
@@ -7,12 +7,14 @@
public class WriteFromQueryResultStatement implements Statement {
+ private Identifier dataverseName;
private Identifier datasetName;
private Query query;
private int varCounter;
- public WriteFromQueryResultStatement(Identifier datasetName, Query query, int varCounter) {
+ public WriteFromQueryResultStatement(Identifier dataverseName, Identifier datasetName, Query query, int varCounter) {
+ this.dataverseName = dataverseName;
this.datasetName = datasetName;
this.query = query;
this.varCounter = varCounter;
@@ -23,6 +25,10 @@
return Kind.WRITE_FROM_QUERY_RESULT;
}
+ public Identifier getDataverseName() {
+ return dataverseName;
+ }
+
public Identifier getDatasetName() {
return datasetName;
}
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 1c681b1..ab55e34 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
@@ -33,6 +33,7 @@
import edu.uci.ics.asterix.aql.expression.IndexAccessor;
import edu.uci.ics.asterix.aql.expression.IndexDropStatement;
import edu.uci.ics.asterix.aql.expression.InsertStatement;
+import edu.uci.ics.asterix.aql.expression.InternalDetailsDecl;
import edu.uci.ics.asterix.aql.expression.LetClause;
import edu.uci.ics.asterix.aql.expression.LimitClause;
import edu.uci.ics.asterix.aql.expression.ListConstructor;
@@ -67,7 +68,6 @@
import edu.uci.ics.asterix.aql.expression.WriteStatement;
import edu.uci.ics.asterix.common.config.DatasetConfig.DatasetType;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.aql.expression.InternalDetailsDecl;
public class AQLPrintVisitor implements IAqlVisitorWithVoidReturn<Integer> {
// private int level =0;
@@ -90,9 +90,6 @@
@Override
public void visit(Query q, Integer step) throws AsterixException {
- for (Statement d : q.getPrologDeclList()) {
- d.accept(this, step);
- }
if (q.getBody() != null) {
out.println("Query:");
q.getBody().accept(this, step);
@@ -103,7 +100,7 @@
@Override
public void visit(LiteralExpr l, Integer step) {
- Literal lc = l.getValue();
+ Literal lc = l.getValue();
if (lc.getLiteralType().equals(Literal.Type.TRUE) || lc.getLiteralType().equals(Literal.Type.FALSE)
|| lc.getLiteralType().equals(Literal.Type.NULL)) {
out.println(skip(step) + "LiteralExpr [" + l.getValue().getLiteralType() + "]");
@@ -148,7 +145,7 @@
@Override
public void visit(CallExpr pf, Integer step) throws AsterixException {
- out.println(skip(step) + "FunctionCall " + pf.getIdent().toString() + "[");
+ out.println(skip(step) + "FunctionCall " + pf.getFunctionSignature().toString() + "[");
for (Expression expr : pf.getExprList()) {
expr.accept(this, step + 1);
}
@@ -294,7 +291,7 @@
@Override
public void visit(FunctionDecl fd, Integer step) throws AsterixException {
- out.println(skip(step) + "FunctionDecl " + fd.getIdent().getFunctionName() + "(" + fd.getParamList().toString()
+ out.println(skip(step) + "FunctionDecl " + fd.getSignature().getName() + "(" + fd.getParamList().toString()
+ ") {");
fd.getFuncBody().accept(this, step + 1);
out.println(skip(step) + "}");
@@ -522,19 +519,19 @@
@Override
public void visit(CreateFunctionStatement cfs, Integer arg) throws AsterixException {
// TODO Auto-generated method stub
-
+
}
@Override
public void visit(FunctionDropStatement fds, Integer arg) throws AsterixException {
// TODO Auto-generated method stub
-
+
}
@Override
public void visit(BeginFeedStatement stmtDel, Integer arg) throws AsterixException {
// TODO Auto-generated method stub
-
+
}
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/parser/ScopeChecker.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/parser/ScopeChecker.java
index 5171d5a..39edfda 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/parser/ScopeChecker.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/parser/ScopeChecker.java
@@ -4,7 +4,7 @@
import edu.uci.ics.asterix.aql.context.Scope;
import edu.uci.ics.asterix.aql.expression.Identifier;
-import edu.uci.ics.asterix.om.functions.AsterixFunction;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.Counter;
public abstract class ScopeChecker {
@@ -15,6 +15,14 @@
protected Stack<Scope> forbiddenScopeStack = new Stack<Scope>();
+ protected String[] inputLines;
+
+ protected String defaultDataverse;
+
+ protected void setInput(String s) {
+ inputLines = s.split("\n");
+ }
+
// Forbidden scopes are used to disallow, in a limit clause, variables
// having the same name as a variable defined by the FLWOR in which that
// limit clause appears.
@@ -95,9 +103,9 @@
*
* @return functionDescriptor
*/
- public final AsterixFunction lookupFunctionSignature(String name, int arity) {
- if (name != null) {
- return getCurrentScope().findFunctionSignature(name, arity);
+ public final FunctionSignature lookupFunctionSignature(String dataverse, String name, int arity) {
+ if (dataverse != null) {
+ return getCurrentScope().findFunctionSignature(dataverse, name, arity);
} else {
return null;
}
@@ -137,4 +145,18 @@
String stripped = s.substring(1, s.length() - 1);
return stripped.replaceAll("\\\\" + q, "\\" + q);
}
+
+ public String extractFragment(int beginLine, int beginColumn, int endLine, int endColumn) {
+ StringBuilder extract = new StringBuilder();
+ extract.append(inputLines[beginLine - 1].trim().length() > 1 ? inputLines[beginLine - 1].trim().substring(beginColumn)
+ : "");
+ for (int i = beginLine + 1; i < endLine; i++) {
+ extract.append("\n");
+ extract.append(inputLines[i - 1]);
+ }
+ extract.append("\n");
+ extract.append(inputLines[endLine - 1].substring(0, endColumn - 1));
+ return extract.toString().trim();
+ }
+
}
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 8f0a3ff..62e40fa 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
@@ -2,12 +2,13 @@
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
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.base.Expression.Kind;
import edu.uci.ics.asterix.aql.expression.BeginFeedStatement;
import edu.uci.ics.asterix.aql.expression.CallExpr;
@@ -67,6 +68,7 @@
import edu.uci.ics.asterix.aql.util.FunctionUtils;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
import edu.uci.ics.asterix.metadata.MetadataManager;
import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
import edu.uci.ics.asterix.metadata.entities.Function;
@@ -77,10 +79,10 @@
public final class AqlRewriter {
- private Query topExpr;
- private AqlRewritingContext context;
- private MetadataTransactionContext mdTxnCtx;
- private String dataverseName;
+ private final Query topExpr;
+ private final List<FunctionDecl> declaredFunctions;
+ private final AqlRewritingContext context;
+ private final MetadataTransactionContext mdTxnCtx;
private enum DfsColor {
WHITE,
@@ -88,12 +90,11 @@
BLACK
}
- public AqlRewriter(Query topExpr, int varCounter, MetadataTransactionContext txnContext, String dataverseName) {
+ public AqlRewriter(List<FunctionDecl> declaredFunctions, Query topExpr, MetadataTransactionContext mdTxnCtx) {
this.topExpr = topExpr;
- context = new AqlRewritingContext(varCounter);
- mdTxnCtx = txnContext;
- this.dataverseName = dataverseName;
-
+ context = new AqlRewritingContext(topExpr.getVarCounter());
+ this.declaredFunctions = declaredFunctions;
+ this.mdTxnCtx = mdTxnCtx;
}
public Query getExpr() {
@@ -131,130 +132,98 @@
if (topExpr == null) {
return;
}
- List<FunctionDecl> fdecls = buildFunctionDeclList(topExpr);
- List<AsterixFunction> funIds = new ArrayList<AsterixFunction>();
- for (FunctionDecl fdecl : fdecls) {
- funIds.add(fdecl.getIdent());
+ List<FunctionSignature> funIds = new ArrayList<FunctionSignature>();
+ for (FunctionDecl fdecl : declaredFunctions) {
+ funIds.add(fdecl.getSignature());
}
List<FunctionDecl> otherFDecls = new ArrayList<FunctionDecl>();
buildOtherUdfs(topExpr.getBody(), otherFDecls, funIds);
- fdecls.addAll(otherFDecls);
- if (!fdecls.isEmpty()) {
- checkRecursivity(fdecls);
+ declaredFunctions.addAll(otherFDecls);
+ if (!declaredFunctions.isEmpty()) {
InlineUdfsVisitor visitor = new InlineUdfsVisitor(context);
- while (topExpr.accept(visitor, fdecls)) {
+ while (topExpr.accept(visitor, declaredFunctions)) {
// loop until no more changes
}
}
}
private void buildOtherUdfs(Expression expression, List<FunctionDecl> functionDecls,
- List<AsterixFunction> declaredFunctions) throws AsterixException {
+ List<FunctionSignature> declaredFunctions) throws AsterixException {
if (expression == null) {
return;
}
- List<AsterixFunction> functionCalls = getFunctionCalls(expression);
- for (AsterixFunction funId : functionCalls) {
- if (AsterixBuiltinFunctions.isBuiltinCompilerFunction(new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- funId.getFunctionName()))) {
+ Set<FunctionSignature> functionCalls = getFunctionCalls(expression);
+ for (FunctionSignature signature : functionCalls) {
+
+ if (declaredFunctions != null && declaredFunctions.contains(signature)) {
continue;
}
- if (AsterixBuiltinFunctions.isBuiltinCompilerFunction(new FunctionIdentifier(
- AlgebricksBuiltinFunctions.ALGEBRICKS_NS, funId.getFunctionName()))) {
- continue;
+ FunctionDecl functionDecl = lookupUserDefinedFunctionDecl(signature);
+ if (functionDecl != null) {
+ if (functionDecls.contains(functionDecl)) {
+ throw new AsterixException(" Detected recursvity!");
+ } else {
+ functionDecls.add(functionDecl);
+ buildOtherUdfs(functionDecl.getFuncBody(), functionDecls, declaredFunctions);
+ }
+ } else {
+ if (isBuiltinFunction(signature)) {
+ continue;
+ } else {
+ throw new AsterixException(" unknown function " + signature);
+ }
}
-
- if (declaredFunctions != null && declaredFunctions.contains(funId)) {
- continue;
- }
-
- FunctionDecl functionDecl = getFunctionDecl(funId);
- if (functionDecls.contains(functionDecl)) {
- throw new AsterixException(" Detected recursvity!");
- }
- functionDecls.add(functionDecl);
- buildOtherUdfs(functionDecl.getFuncBody(), functionDecls, declaredFunctions);
}
}
- private FunctionDecl getFunctionDecl(AsterixFunction funId) throws AsterixException {
- Function function = MetadataManager.INSTANCE.getFunction(mdTxnCtx, dataverseName, funId.getFunctionName(),
- funId.getArity());
+ private FunctionDecl lookupUserDefinedFunctionDecl(FunctionSignature signature) throws AsterixException {
+ if (signature.getNamespace() == null) {
+ return null;
+ }
+ Function function = MetadataManager.INSTANCE.getFunction(mdTxnCtx, signature);
if (function == null) {
- throw new AsterixException(" unknown function " + funId);
+ return null;
}
return FunctionUtils.getFunctionDecl(function);
}
- private List<AsterixFunction> getFunctionCalls(Expression expression) throws AsterixException {
+ private boolean isBuiltinFunction(FunctionSignature functionSignature) {
+ if (AsterixBuiltinFunctions.isBuiltinCompilerFunction(new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
+ functionSignature.getName(), functionSignature.getArity()))) {
+ return true;
+ }
+
+ if (AsterixBuiltinFunctions.isBuiltinCompilerFunction(new FunctionIdentifier(
+ AlgebricksBuiltinFunctions.ALGEBRICKS_NS, functionSignature.getName(), functionSignature.getArity()))) {
+ return true;
+ }
+
+ return false;
+
+ }
+
+ private Set<FunctionSignature> getFunctionCalls(Expression expression) throws AsterixException {
Map<AsterixFunction, DfsColor> color = new HashMap<AsterixFunction, DfsColor>();
Map<AsterixFunction, List<AsterixFunction>> arcs = new HashMap<AsterixFunction, List<AsterixFunction>>();
GatherFunctionCalls gfc = new GatherFunctionCalls();
expression.accept(gfc, null);
- List<AsterixFunction> calls = gfc.getCalls();
- return calls;
- }
-
- private void checkRecursivity(List<FunctionDecl> fdecls) throws AsterixException {
- Map<AsterixFunction, DfsColor> color = new HashMap<AsterixFunction, DfsColor>();
- Map<AsterixFunction, List<AsterixFunction>> arcs = new HashMap<AsterixFunction, List<AsterixFunction>>();
- for (FunctionDecl fd : fdecls) {
- GatherFunctionCalls gfc = new GatherFunctionCalls();
- fd.getFuncBody().accept(gfc, null);
- List<AsterixFunction> calls = gfc.getCalls();
- arcs.put(fd.getIdent(), calls);
- color.put(fd.getIdent(), DfsColor.WHITE);
- }
- for (AsterixFunction a : arcs.keySet()) {
- if (color.get(a) == DfsColor.WHITE) {
- checkRecursivityDfs(a, arcs, color);
- }
- }
- }
-
- private void checkRecursivityDfs(AsterixFunction a, Map<AsterixFunction, List<AsterixFunction>> arcs,
- Map<AsterixFunction, DfsColor> color) throws AsterixException {
- color.put(a, DfsColor.GRAY);
- List<AsterixFunction> next = arcs.get(a);
- if (next != null) {
- for (AsterixFunction f : next) {
- DfsColor dc = color.get(f);
- if (dc == DfsColor.GRAY) {
- throw new AsterixException("Recursive function calls, created by calling " + f + " starting from "
- + a);
- }
- if (dc == DfsColor.WHITE) {
- checkRecursivityDfs(f, arcs, color);
- }
- }
- }
- color.put(a, DfsColor.BLACK);
- }
-
- private List<FunctionDecl> buildFunctionDeclList(Query q) {
- ArrayList<FunctionDecl> fdecls = new ArrayList<FunctionDecl>();
- for (Statement s : q.getPrologDeclList()) {
- if (s.getKind() == Statement.Kind.FUNCTION_DECL) {
- fdecls.add((FunctionDecl) s);
- }
- }
- return fdecls;
+ return gfc.getCalls();
}
private static class GatherFunctionCalls implements IAqlExpressionVisitor<Void, Void> {
- private final List<AsterixFunction> calls = new ArrayList<AsterixFunction>();
+ private final Set<FunctionSignature> calls = new HashSet<FunctionSignature>();
public GatherFunctionCalls() {
}
@Override
public Void visitCallExpr(CallExpr pf, Void arg) throws AsterixException {
- calls.add(pf.getIdent());
+ calls.add(pf.getFunctionSignature());
for (Expression e : pf.getExprList()) {
e.accept(this, arg);
}
@@ -532,7 +501,7 @@
return null;
}
- public List<AsterixFunction> getCalls() {
+ public Set<FunctionSignature> getCalls() {
return calls;
}
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 53c051b..5742ac6 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
@@ -207,7 +207,7 @@
public Pair<IAqlExpression, List<VariableSubstitution>> visitCallExpr(CallExpr pf, List<VariableSubstitution> arg)
throws AsterixException {
List<Expression> exprList = visitAndCloneExprList(pf.getExprList(), arg);
- CallExpr f = new CallExpr(pf.getIdent(), exprList);
+ CallExpr f = new CallExpr(pf.getFunctionSignature(), exprList);
return new Pair<IAqlExpression, List<VariableSubstitution>>(f, arg);
}
@@ -224,7 +224,7 @@
}
Pair<IAqlExpression, List<VariableSubstitution>> p1 = fd.getFuncBody().accept(this, arg);
- FunctionDecl newF = new FunctionDecl(fd.getIdent(), newList, (Expression) p1.first);
+ FunctionDecl newF = new FunctionDecl(fd.getSignature(), newList, (Expression) p1.first);
return new Pair<IAqlExpression, List<VariableSubstitution>>(newF, arg);
}
@@ -308,7 +308,6 @@
Query newQ = new Query();
Pair<IAqlExpression, List<VariableSubstitution>> p1 = q.getBody().accept(this, arg);
newQ.setBody((Expression) p1.first);
- newQ.setPrologDeclList(q.getPrologDeclList());
return new Pair<IAqlExpression, List<VariableSubstitution>>(newQ, p1.second);
}
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 3561539..f178d88 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
@@ -64,7 +64,7 @@
import edu.uci.ics.asterix.aql.expression.WriteStatement;
import edu.uci.ics.asterix.aql.expression.visitor.IAqlExpressionVisitor;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.om.functions.AsterixFunction;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
public class InlineUdfsVisitor implements IAqlExpressionVisitor<Boolean, List<FunctionDecl>> {
@@ -104,12 +104,20 @@
public Boolean visitRecordConstructor(RecordConstructor rc, List<FunctionDecl> arg) throws AsterixException {
boolean changed = false;
for (FieldBinding b : rc.getFbList()) {
- 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)) {
changed = true;
- }
+ }*/
}
return changed;
}
@@ -286,7 +294,7 @@
return new Pair<Boolean, Expression>(r, expr);
} else {
CallExpr f = (CallExpr) expr;
- FunctionDecl implem = findFuncDeclaration(f.getIdent(), arg);
+ FunctionDecl implem = findFuncDeclaration(f.getFunctionSignature(), arg);
if (implem == null) {
boolean r = expr.accept(this, arg);
return new Pair<Boolean, Expression>(r, expr);
@@ -337,9 +345,9 @@
return new Pair<Boolean, ArrayList<Expression>>(changed, newList);
}
- private static FunctionDecl findFuncDeclaration(AsterixFunction fid, List<FunctionDecl> sequence) {
+ private static FunctionDecl findFuncDeclaration(FunctionSignature fid, List<FunctionDecl> sequence) {
for (FunctionDecl f : sequence) {
- if (f.getIdent().equals(fid)) {
+ if (f.getSignature().equals(fid)) {
return f;
}
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/util/FunctionUtils.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/util/FunctionUtils.java
index 1a30693..e3f3641 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/util/FunctionUtils.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/util/FunctionUtils.java
@@ -1,5 +1,3 @@
-package edu.uci.ics.asterix.aql.util;
-
/*
* Copyright 2009-2011 by The Regents of the University of California
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,25 +12,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+package edu.uci.ics.asterix.aql.util;
+
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
+import edu.uci.ics.asterix.aql.base.Statement;
import edu.uci.ics.asterix.aql.expression.FunctionDecl;
-import edu.uci.ics.asterix.aql.expression.Query;
import edu.uci.ics.asterix.aql.expression.VarIdentifier;
import edu.uci.ics.asterix.aql.parser.AQLParser;
import edu.uci.ics.asterix.aql.parser.ParseException;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
-import edu.uci.ics.asterix.metadata.MetadataException;
-import edu.uci.ics.asterix.metadata.MetadataManager;
-import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
import edu.uci.ics.asterix.metadata.entities.Function;
import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
-import edu.uci.ics.asterix.om.functions.AsterixFunction;
-import edu.uci.ics.asterix.om.functions.AsterixFunctionInfo;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.AlgebricksBuiltinFunctions;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.IFunctionInfo;
@@ -44,7 +38,8 @@
List<VarIdentifier> varIdentifiers = new ArrayList<VarIdentifier>();
StringBuilder builder = new StringBuilder();
- builder.append(" declare function " + function.getFunctionName());
+ builder.append(" use dataverse " + function.getDataverseName() + ";");
+ builder.append(" declare function " + function.getName().split("@")[0]);
builder.append("(");
for (String param : params) {
VarIdentifier varId = new VarIdentifier(param);
@@ -52,21 +47,26 @@
builder.append(param);
builder.append(",");
}
- builder.delete(builder.length() - 1, builder.length());
+ if (params.size() > 0) {
+ builder.delete(builder.length() - 1, builder.length());
+ }
builder.append(")");
builder.append("{");
+ builder.append("\n");
builder.append(functionBody);
+ builder.append("\n");
builder.append("}");
+
AQLParser parser = new AQLParser(new StringReader(new String(builder)));
- Query query = null;
+ List<Statement> statements = null;
try {
- query = (Query) parser.Statement();
+ statements = parser.Statement();
} catch (ParseException pe) {
throw new AsterixException(pe);
}
- FunctionDecl decl = (FunctionDecl) query.getPrologDeclList().get(0);
+ FunctionDecl decl = (FunctionDecl) statements.get(1);
return decl;
}
@@ -74,22 +74,4 @@
return AsterixBuiltinFunctions.getAsterixFunctionInfo(fi);
}
- public static IFunctionInfo getFunctionInfo(MetadataTransactionContext mdTxnCtx, String dataverseName,
- AsterixFunction asterixFunction) throws MetadataException {
- FunctionIdentifier fid = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- asterixFunction.getFunctionName(), asterixFunction.getArity());
- IFunctionInfo finfo = AsterixBuiltinFunctions.getAsterixFunctionInfo(fid);
- if (fid == null) {
- fid = new FunctionIdentifier(AlgebricksBuiltinFunctions.ALGEBRICKS_NS, asterixFunction.getFunctionName(),
- asterixFunction.getArity());
- }
- if (fid == null) {
- Function function = MetadataManager.INSTANCE.getFunction(mdTxnCtx, dataverseName,
- asterixFunction.getFunctionName(), asterixFunction.getArity());
- if (function != null) {
- finfo = new AsterixFunctionInfo(dataverseName, asterixFunction);
- }
- }
- return finfo; // could be null
- }
}
diff --git a/asterix-aql/src/main/javacc/AQL.jj b/asterix-aql/src/main/javacc/AQL.jj
index 0767c4e..8672fd1 100644
--- a/asterix-aql/src/main/javacc/AQL.jj
+++ b/asterix-aql/src/main/javacc/AQL.jj
@@ -26,6 +26,7 @@
import edu.uci.ics.asterix.aql.literal.NullLiteral;
import edu.uci.ics.asterix.aql.literal.StringLiteral;
import edu.uci.ics.asterix.aql.literal.TrueLiteral;
+import edu.uci.ics.asterix.metadata.bootstrap.MetadataConstants;
import edu.uci.ics.asterix.aql.base.*;
import edu.uci.ics.asterix.aql.expression.*;
@@ -39,26 +40,22 @@
import edu.uci.ics.asterix.common.annotations.*;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.om.functions.AsterixFunction;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IExpressionAnnotation;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IndexedNLJoinExpressionAnnotation;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
+import edu.uci.ics.hyracks.algebricks.common.utils.Triple;
+
+
public class AQLParser extends ScopeChecker {
-/*
- private void printHints(Token t) {
- //System.err.println("token="+t.image+"\t special="+t.specialToken);
- if (t.specialToken == null) return;
- Token tmp_t = t.specialToken;
- while (tmp_t.specialToken != null) tmp_t = tmp_t.specialToken;
- while (tmp_t != null) {
- System.out.println(tmp_t.image);
- tmp_t = tmp_t.next;
- }
- }
-*/
-
// optimizer hints
private static final String HASH_GROUP_BY_HINT = "hash";
private static final String BROADCAST_JOIN_HINT = "bcast";
+ private static final String INDEXED_NESTED_LOOP_JOIN_HINT = "indexnl";
private static final String INMEMORY_HINT = "inmem";
private static final String VAL_FILE_HINT = "val-files";
private static final String VAL_FILE_SAME_INDEX_HINT = "val-file-same-idx";
@@ -89,12 +86,17 @@
return s.substring(1).trim();
}
+ public AQLParser(String s){
+ this(new StringReader(s));
+ super.setInput(s);
+ }
+
public static void main(String args[]) throws ParseException, TokenMgrError, IOException, FileNotFoundException, AsterixException {
File file = new File(args[0]);
Reader fis = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
AQLParser parser = new AQLParser(fis);
- Statement st = parser.Statement();
- st.accept(new AQLPrintVisitor(), 0);
+ List<Statement> st = parser.Statement();
+ //st.accept(new AQLPrintVisitor(), 0);
}
@@ -103,11 +105,11 @@
PARSER_END(AQLParser)
-Statement Statement() throws ParseException:
+List<Statement> Statement() throws ParseException:
{
- Query query = null;
scopeStack.push(RootScopeFactory.createRootScope(this));
List<Statement> decls = new ArrayList<Statement>();
+ Query query=null;
}
{
(
@@ -187,6 +189,10 @@
{
decls.add(DataverseDropStatement());
}
+ | "function"
+ {
+ decls.add(FunctionDropStatement());
+ }
)
| "write" {
decls.add(WriteStatement());
@@ -203,66 +209,78 @@
| "update" {
decls.add(UpdateStatement());
}
- | "begin" "feed" <IDENTIFIER> {
- Identifier datasetName = new Identifier(token.image);
- decls.add(new BeginFeedStatement(datasetName, getVarCounter()));
+ | "begin" "feed"
+ {
+ Pair<Identifier,Identifier> nameComponents = getDotSeparatedPair();
+ decls.add(new BeginFeedStatement(nameComponents.first, nameComponents.second, getVarCounter()));
+ } ";"
+
+ | "suspend" "feed"
+ {
+ decls.add(ControlFeedDeclaration(ControlFeedStatement.OperationType.SUSPEND));
+ } ";"
+ | "resume" "feed" {
+ decls.add(ControlFeedDeclaration(ControlFeedStatement.OperationType.RESUME));
} ";"
- | "suspend" "feed" <IDENTIFIER> {
- datasetName = new Identifier(token.image);
- decls.add(new ControlFeedStatement(ControlFeedStatement.OperationType.SUSPEND, datasetName));
- } ";"
- | "resume" "feed" <IDENTIFIER> {
- datasetName = new Identifier(token.image);
- decls.add(new ControlFeedStatement(ControlFeedStatement.OperationType.RESUME, datasetName));
- } ";"
- | "end" "feed" <IDENTIFIER> {
- datasetName = new Identifier(token.image);
- decls.add(new ControlFeedStatement(ControlFeedStatement.OperationType.END, datasetName));
+ | "end" "feed" {
+ decls.add(ControlFeedDeclaration(ControlFeedStatement.OperationType.END));
} ";"
- | "alter" "feed" <IDENTIFIER> {
- datasetName = new Identifier(token.image);
- decls.add(AlterFeedDeclaration(datasetName));
- }
-
- )*
- (query = Query())?
+ | "alter" "feed" {
+ decls.add(AlterFeedDeclaration());
+ } ";"
+
+ | (query = Query()) {
+ decls.add(query);
+ }
+ )*
+ // (query = Query())?
)
<EOF>
)
{
- if (query == null) {
- query = new Query(true);
- }
- query.setPrologDeclList(decls);
-
- return query;
+ return decls;
}
}
InsertStatement InsertStatement() throws ParseException:
{
+ Identifier dataverseName;
Identifier datasetName;
+ Pair<Identifier,Identifier> nameComponents = null;
Query query;
}
{
- "into" <DATASET> <IDENTIFIER> { datasetName = new Identifier(token.image); }
- <LEFTPAREN> query = Query() <RIGHTPAREN> ";"
- {return new InsertStatement(datasetName, query, getVarCounter());}
+ "into" <DATASET>
+
+ {
+ nameComponents = getDotSeparatedPair();
+ dataverseName = nameComponents.first;
+ datasetName = nameComponents.second;
+ }
+
+ <LEFTPAREN> query = Query() <RIGHTPAREN> ";"
+ {return new InsertStatement(dataverseName, datasetName, query, getVarCounter());}
}
DeleteStatement DeleteStatement() throws ParseException:
{
VariableExpr var = null;
+ Identifier dataverseName;
Identifier datasetName = null;
Expression condition = null;
Clause dieClause = null;
+ Pair<Identifier, Identifier> nameComponents;
}
{
var = Variable() { getCurrentScope().addNewVarSymbolToScope(var.getVar()); }
- "from" <DATASET> <IDENTIFIER> { datasetName = new Identifier(token.image); }
- ("where" condition = Expression())? (dieClause = DieClause())? ";"
- {return new DeleteStatement(var, datasetName, condition, dieClause, getVarCounter()); }
+ "from"
+ <DATASET>
+ {
+ nameComponents = getDotSeparatedPair();
+ }
+ ("where" condition = Expression())? (dieClause = DieClause())? ";"
+ {return new DeleteStatement(var, nameComponents.first, nameComponents.second, condition, dieClause, getVarCounter()); }
}
UpdateStatement UpdateStatement() throws ParseException:
@@ -322,10 +340,10 @@
{
Identifier nodeName = null;
String fileName = null;
- Identifier datasetName = null;
Statement stmt = null;
Query query;
String writerClass = null;
+ Pair<Identifier,Identifier> nameComponents = null;
}
{
(( "output" "to"
@@ -337,10 +355,15 @@
} )
|
( "into"
- <DATASET> <IDENTIFIER> { datasetName = new Identifier(token.image); }
+ <DATASET>
+
+ {
+ nameComponents = getDotSeparatedPair();
+ }
+
<LEFTPAREN> query = Query() <RIGHTPAREN>
{
- stmt = new WriteFromQueryResultStatement(datasetName, query, getVarCounter());
+ stmt = new WriteFromQueryResultStatement(nameComponents.first, nameComponents.second, query, getVarCounter());
} ))
";"
@@ -352,6 +375,7 @@
CreateIndexStatement CreateIndexStatement() throws ParseException:
{
CreateIndexStatement cis = new CreateIndexStatement();
+ Pair<Identifier,Identifier> nameComponents = null;
}
{
<IDENTIFIER> { cis.setIndexName(new Identifier(token.image)); }
@@ -362,7 +386,13 @@
}
)?
"on"
- <IDENTIFIER> { cis.setDatasetName(new Identifier(token.image)); }
+
+ {
+ nameComponents = getDotSeparatedPair();
+ cis.setDataverseName(nameComponents.first);
+ cis.setDatasetName(nameComponents.second);
+ }
+
<LEFTPAREN>
( <IDENTIFIER> { cis.addFieldExpr(token.image); } )
("," <IDENTIFIER> { cis.addFieldExpr(token.image); })*
@@ -394,23 +424,28 @@
Identifier dvName = null;
}
{
- "dataverse" <IDENTIFIER> { dvName = new Identifier(token.image); }
+ "dataverse" <IDENTIFIER> { defaultDataverse = token.image;}
";"
{
- return new DataverseDecl(dvName);
+ return new DataverseDecl(new Identifier(defaultDataverse));
}
}
DropStatement DropStatement() throws ParseException :
{
+ Identifier dataverseName = null;
Identifier datasetName = null;
boolean ifExists = false;
+ Pair<Identifier,Identifier> nameComponents=null;
}
{
- < IDENTIFIER >
- {
- datasetName = new Identifier(token.image);
- }
+ {
+ nameComponents = getDotSeparatedPair();
+ dataverseName = nameComponents.first;
+ datasetName = nameComponents.second;
+ }
+
+
(
"if exists"
{
@@ -418,25 +453,27 @@
}
)? ";"
{
- return new DropStatement(datasetName, ifExists);
+ return new DropStatement(dataverseName, datasetName, ifExists);
}
}
IndexDropStatement IndexDropStatement() throws ParseException :
{
+ Identifier dataverseName = null;
Identifier datasetName = null;
Identifier indexName = null;
boolean ifExists = false;
+ Triple<Identifier,Identifier,Identifier> nameComponents=null;
}
{
- < IDENTIFIER >
+
{
- datasetName = new Identifier(token.image);
- }
- "." < IDENTIFIER >
- {
- indexName = new Identifier(token.image);
- }
+ nameComponents = getDotSeparatedTriple();
+ dataverseName = nameComponents.first;
+ datasetName = nameComponents.second;
+ indexName = nameComponents.third;
+ }
+
(
"if exists"
{
@@ -444,7 +481,7 @@
}
)? ";"
{
- return new IndexDropStatement(datasetName, indexName, ifExists);
+ return new IndexDropStatement(dataverseName, datasetName, indexName, ifExists);
}
}
@@ -471,13 +508,16 @@
TypeDropStatement TypeDropStatement() throws ParseException :
{
+ Identifier dataverseName = null;
Identifier typeName = null;
boolean ifExists = false;
+ Pair<Identifier,Identifier> nameComponents;
}
{
- < IDENTIFIER >
{
- typeName = new Identifier(token.image);
+ nameComponents = getDotSeparatedPair();
+ dataverseName = nameComponents.first == null ? new Identifier(defaultDataverse) : nameComponents.first;
+ typeName = nameComponents.second;
}
(
"if exists"
@@ -486,7 +526,7 @@
}
)? ";"
{
- return new TypeDropStatement(typeName, ifExists);
+ return new TypeDropStatement(dataverseName, typeName, ifExists);
}
}
@@ -540,16 +580,61 @@
}
}
+
+FunctionDropStatement FunctionDropStatement() throws ParseException :
+{
+ String dataverse;
+ String functionName;
+ int arity=0;
+ boolean ifExists = false;
+ Pair<Identifier, Identifier> nameComponents=null;
+}
+{
+ {
+ nameComponents = getDotSeparatedPair();
+ dataverse = nameComponents.first != null ? nameComponents.first.getValue() : defaultDataverse;
+ functionName = nameComponents.second.getValue();
+ }
+
+ "@"
+ <INTEGER_LITERAL>
+ {
+ Token t= getToken(0);
+ arity = new Integer(t.image);
+ if( arity < 0 && arity != FunctionIdentifier.VARARGS){
+ throw new ParseException(" invalid arity:" + arity);
+ }
+ }
+
+ (
+ "if exists"
+ {
+ ifExists = true;
+ }
+ )? ";"
+ {
+ return new FunctionDropStatement(new FunctionSignature(dataverse, functionName, arity), ifExists);
+ }
+}
+
+
LoadFromFileStatement LoadStatement() throws ParseException:
{
+ Identifier dataverseName = null;
Identifier datasetName = null;
boolean alreadySorted = false;
String adapterClassname;
Map<String,String> properties;
+ Pair<Identifier,Identifier> nameComponents = null;
}
{
- <DATASET> <IDENTIFIER> { datasetName = new Identifier(token.image); }
-
+ <DATASET>
+ {
+ nameComponents = getDotSeparatedPair();
+ dataverseName = nameComponents.first;
+ datasetName = nameComponents.second;
+ }
+
"using"
<STRING_LITERAL>
@@ -567,7 +652,7 @@
";"
{
- return new LoadFromFileStatement(datasetName, adapterClassname, properties, alreadySorted);
+ return new LoadFromFileStatement(dataverseName, datasetName, adapterClassname, properties, alreadySorted);
}
}
@@ -577,15 +662,22 @@
{
DatasetDecl dd = null;
Identifier datasetName = null;
+ Identifier dataverseName = null;
+ Identifier itemDataverseName = null;
Identifier itemTypeName = null;
+ String nameComponentFirst = null;
+ String nameComponentSecond = null;
boolean ifNotExists = false;
- IDatasetDetailsDecl idd = null;
+ IDatasetDetailsDecl datasetDetails = null;
+ Pair<Identifier,Identifier> nameComponents = null;
}
{
- < IDENTIFIER >
{
- datasetName = new Identifier(token.image);
- }
+ nameComponents = getDotSeparatedPair();
+ dataverseName = nameComponents.first;
+ datasetName = nameComponents.second;
+ }
+
(
"if not exists"
{
@@ -593,26 +685,24 @@
}
)?
(
- < LEFTPAREN > < IDENTIFIER >
+ < LEFTPAREN > <IDENTIFIER>
{
itemTypeName = new Identifier(token.image);
}
< RIGHTPAREN >
- )?
+ )
{
if(datasetType == DatasetType.INTERNAL) {
- idd = InternalDatasetDeclaration();
- dd = new DatasetDecl(datasetName, itemTypeName, idd, ifNotExists);
+ datasetDetails = InternalDatasetDeclaration();
}
else if(datasetType == DatasetType.EXTERNAL) {
- idd = ExternalDatasetDeclaration();
- dd = new DatasetDecl(datasetName, itemTypeName, idd,ifNotExists);
+ datasetDetails = ExternalDatasetDeclaration();
}
else if(datasetType == DatasetType.FEED) {
- idd = FeedDatasetDeclaration();
- dd = new DatasetDecl(datasetName, itemTypeName, idd,ifNotExists);
+ datasetDetails = FeedDatasetDeclaration();
}
- dd.setDatasetType(datasetType);
+ dd = new DatasetDecl(dataverseName, datasetName, itemTypeName, datasetType, datasetDetails,ifNotExists);
+
}
{
return dd;
@@ -622,30 +712,30 @@
InternalDetailsDecl InternalDatasetDeclaration() throws ParseException :
{
InternalDetailsDecl idd = null;
+ List<String> partitioningExprs = new ArrayList<String>();
+ Identifier nodeGroupName=null;
}
{
- {
- idd = new InternalDetailsDecl();
- }
"partitioned" "by" "key"
< IDENTIFIER >
{
- idd.addPartitioningExpr(token.image);
+ partitioningExprs.add(token.image);
}
(
"," < IDENTIFIER >
{
- idd.addPartitioningExpr(token.image);
+ partitioningExprs.add(token.image);
}
)*
(
"on" < IDENTIFIER >
{
- idd.setNodegroupName(new Identifier(token.image));
+ nodeGroupName = new Identifier(token.image);
}
)?
";"
{
+ idd = new InternalDetailsDecl(nodeGroupName, partitioningExprs);
return idd;
}
}
@@ -687,19 +777,22 @@
FeedDetailsDecl FeedDatasetDeclaration() throws ParseException :
{
FeedDetailsDecl fdd = null;
- String adapterClassname = null;
+ String adapterFactoryClassname = null;
Map < String, String > properties;
+ Pair<Identifier,Identifier> nameComponents;
+ List<String> partitioningExprs = new ArrayList<String>();
+ Identifier nodeGroupName=null;
+ FunctionSignature appliedFunction=null;
+ String dataverse;
+ String functionName;
+ int arity;
}
{
- {
- fdd = new FeedDetailsDecl();
- }
-
"using"
<STRING_LITERAL>
{
- adapterClassname = removeQuotesAndEscapes(token.image);
+ adapterFactoryClassname = removeQuotesAndEscapes(token.image);
}
{
@@ -707,51 +800,75 @@
}
("apply" "function"
- < IDENTIFIER >
{
- fdd.setFunctionIdentifier(token.image);
+ nameComponents = getDotSeparatedPair();
+ dataverse = nameComponents.first != null ? nameComponents.first.getValue() : defaultDataverse;
+ functionName = nameComponents.second.getValue();
}
+ ("@" <INTEGER_LITERAL>
+ {
+ arity = Integer.parseInt(token.image);
+ }
+ )
+
+ {
+ appliedFunction = new FunctionSignature(dataverse, functionName, arity);
+ }
)?
"partitioned" "by" "key"
< IDENTIFIER >
{
- fdd.addPartitioningExpr(token.image);
+ partitioningExprs.add(token.image);
}
(
"," < IDENTIFIER >
{
- fdd.addPartitioningExpr(token.image);
+ partitioningExprs.add(token.image);
}
)*
(
"on" < IDENTIFIER >
{
- fdd.setNodegroupName(new Identifier(token.image));
+ nodeGroupName = new Identifier(token.image);
}
)?
";"
{
- fdd.setAdapterClassname(adapterClassname);
- fdd.setProperties(properties);
+ fdd = new FeedDetailsDecl(adapterFactoryClassname, properties, appliedFunction, nodeGroupName, partitioningExprs);
return fdd;
}
}
-ControlFeedStatement AlterFeedDeclaration(Identifier datasetName) throws ParseException :
+ControlFeedStatement ControlFeedDeclaration(ControlFeedStatement.OperationType operationType) throws ParseException :
{
- String name = null;
- String value = null;
+ Pair<Identifier,Identifier> nameComponents = null;
+}
+{
+ {
+ nameComponents = getDotSeparatedPair();
+ return new ControlFeedStatement(operationType, nameComponents.first, nameComponents.second);
+ }
+}
+
+
+ControlFeedStatement AlterFeedDeclaration() throws ParseException :
+{
+ Pair<Identifier,Identifier> nameComponents = null;
Map < String, String > configuration = new HashMap < String, String > ();
}
{
+ {
+ nameComponents = getDotSeparatedPair();
+ }
+
"set"
{
configuration = getConfiguration();
}
- ";"
+
{
- return new ControlFeedStatement(ControlFeedStatement.OperationType.ALTER, datasetName, configuration);
+ return new ControlFeedStatement(ControlFeedStatement.OperationType.ALTER, nameComponents.first, nameComponents.second, configuration);
}
}
@@ -843,15 +960,19 @@
TypeDecl TypeDeclaration(boolean dgen, String hint) throws ParseException:
{
+ Identifier dataverse;
Identifier ident;
TypeExpression typeExpr;
boolean ifNotExists = false;
+ Pair<Identifier,Identifier> nameComponents=null;
}
{
- <IDENTIFIER>
{
- ident = new Identifier(token.image.toString());
+ nameComponents = getDotSeparatedPair();
+ dataverse = nameComponents.first;
+ ident = nameComponents.second;
}
+
(
"if not exists"
{
@@ -860,6 +981,7 @@
)?
"as"
( typeExpr = TypeExpr() )
+ (";")?
{
long numValues = -1;
String filename = null;
@@ -872,7 +994,7 @@
numValues = Long.parseLong(splits[2]);
}
TypeDataGen tddg = new TypeDataGen(dgen, filename, numValues);
- return new TypeDecl(ident, typeExpr, tddg, ifNotExists);
+ return new TypeDecl(dataverse, ident, typeExpr, tddg, ifNotExists);
}
}
@@ -998,12 +1120,12 @@
TypeReferenceExpression TypeReference() throws ParseException:
{}
{
- <IDENTIFIER>
- {
- Token t = getToken(0);
- Identifier id = new Identifier(t.toString());
- return new TypeReferenceExpression(id);
- }
+ <IDENTIFIER>
+ {
+ Token t = getToken(0);
+ Identifier id = new Identifier(t.toString());
+ return new TypeReferenceExpression(id);
+ }
}
OrderedListTypeDefinition OrderedListTypeDef() throws ParseException:
@@ -1033,11 +1155,72 @@
}
}
+Pair<Identifier,Identifier> getDotSeparatedPair() throws ParseException:
+{
+ Identifier first = null;
+ Identifier second = null;
+}
+{
+ < IDENTIFIER >
+ {
+ first = new Identifier(token.image);
+ }
+ ("." <IDENTIFIER>
+ {
+ second = new Identifier(token.image);
+ }
+ )?
+
+ {
+ if(second == null){
+ second = first;
+ first = null;
+ }
+
+ return new Pair<Identifier,Identifier>(first,second);
+ }
+}
+
+Triple<Identifier,Identifier,Identifier> getDotSeparatedTriple() throws ParseException:
+{
+ Identifier first = null;
+ Identifier second = null;
+ Identifier third = null;
+}
+{
+ < IDENTIFIER >
+ {
+ first = new Identifier(token.image);
+ }
+ "." <IDENTIFIER>
+ {
+ second = new Identifier(token.image);
+ }
+ (
+ "." <IDENTIFIER>
+ {
+ third = new Identifier(token.image);
+ }
+ )?
+
+ {
+ if(third == null){
+ third = second;
+ second = first;
+ first = null;
+ }
+
+ return new Triple<Identifier,Identifier,Identifier>(first,second,third);
+ }
+}
+
+
+
FunctionDecl FunctionDeclaration() throws ParseException:
{
- FunctionDecl func = new FunctionDecl();
- AsterixFunction ident;
+ FunctionDecl funcDecl;
+ FunctionSignature signature;
String functionName;
int arity = 0;
List<VarIdentifier> paramList = new ArrayList<VarIdentifier>();
@@ -1070,33 +1253,34 @@
})*)? <RIGHTPAREN> "{" funcBody = Expression() "}"
{
- ident = new AsterixFunction(functionName,arity);
- getCurrentScope().addFunctionDescriptor(ident, false);
- func.setIdent(ident);
- func.setFuncBody(funcBody);
- func.setParamList(paramList);
- return func;
+ signature = new FunctionSignature(defaultDataverse, functionName, arity);
+ getCurrentScope().addFunctionDescriptor(signature, false);
+ funcDecl = new FunctionDecl(signature, paramList, funcBody);
+ return funcDecl;
}
}
CreateFunctionStatement FunctionCreation() throws ParseException:
{
CreateFunctionStatement cfs = null;
- AsterixFunction ident;
+ FunctionSignature signature;
+ String dataverse;
String functionName;
- int arity = 0;
boolean ifNotExists = false;
List<VarIdentifier> paramList = new ArrayList<VarIdentifier>();
- String funcBody;
+ String functionBody;
VarIdentifier var = null;
createNewScope();
+ Expression functionBodyExpr;
+ Token beginPos;
+ Token endPos;
+ Pair<Identifier,Identifier> nameComponents=null;
}
{
-
- <IDENTIFIER>
- {
- Token t = getToken(0);
- functionName= t.toString();
+ {
+ nameComponents = getDotSeparatedPair();
+ dataverse = nameComponents.first != null ? nameComponents.first.getValue() : defaultDataverse;
+ functionName= nameComponents.second.getValue();
}
(
@@ -1112,7 +1296,6 @@
var.setValue(getToken(0).toString());
paramList.add(var);
getCurrentScope().addNewVarSymbolToScope(var);
- arity++;
}
("," <VARIABLE>
{
@@ -1120,16 +1303,20 @@
var.setValue(getToken(0).toString());
paramList.add(var);
getCurrentScope().addNewVarSymbolToScope(var);
- arity++;
- })*)? <RIGHTPAREN> "{" <STRING_LITERAL>
+ })*)? <RIGHTPAREN> "{"
{
- funcBody = removeQuotesAndEscapes(token.image);
- }
+ beginPos = getToken(0);
+ }
+ functionBodyExpr = Expression()
"}"
+ {
+ endPos = getToken(0);
+ functionBody = extractFragment(beginPos.beginLine, beginPos.beginColumn, endPos.beginLine, endPos.beginColumn);
+ }
{
- ident = new AsterixFunction(functionName, arity);
- getCurrentScope().addFunctionDescriptor(ident, false);
- cfs = new CreateFunctionStatement(ident, paramList, funcBody, ifNotExists);
+ signature = new FunctionSignature(dataverse, functionName, paramList.size());
+ getCurrentScope().addFunctionDescriptor(signature, false);
+ cfs = new CreateFunctionStatement(signature, paramList, functionBody, ifNotExists);
return cfs;
}
}
@@ -1143,11 +1330,13 @@
}
{
expr = Expression()
-
+ (";")?
{
query.setBody(expr);
+ query.setVarCounter(getVarCounter());
return query;
}
+
}
@@ -1165,7 +1354,7 @@
| expr = IfThenElse()
| expr = FLWOGR()
| expr = QuantifiedExpression()
-
+
)
{
@@ -1246,14 +1435,15 @@
OperatorExpr op = null;
Expression operand = null;
boolean broadcast = false;
+ IExpressionAnnotation annotation = null;
}
{
operand = AddExpr()
- {
- if (operand instanceof VariableExpr) {
- String hint = getHint(token);
+ {
+ if (operand instanceof VariableExpr) {
+ String hint = getHint(token);
if (hint != null && hint.equals(BROADCAST_JOIN_HINT)) {
- broadcast = true;
+ broadcast = true;
}
}
}
@@ -1261,6 +1451,10 @@
(
LOOKAHEAD(2)( "<" | ">" | "<=" | ">=" | "=" | "!=" |"~=")
{
+ String mhint = getHint(token);
+ if (mhint != null && mhint.equals(INDEXED_NESTED_LOOP_JOIN_HINT)) {
+ annotation = IndexedNLJoinExpressionAnnotation.INSTANCE;
+ }
if (op == null) {
op = new OperatorExpr();
op.addOperand(operand, broadcast);
@@ -1273,18 +1467,21 @@
operand = AddExpr()
{
- broadcast = false;
- if (operand instanceof VariableExpr) {
- String hint = getHint(token);
+ broadcast = false;
+ if (operand instanceof VariableExpr) {
+ String hint = getHint(token);
if (hint != null && hint.equals(BROADCAST_JOIN_HINT)) {
broadcast = true;
}
- }
+ }
op.addOperand(operand, broadcast);
}
)?
{
+ if (annotation != null) {
+ op.addHint(annotation);
+ }
return op==null? operand: op;
}
}
@@ -1725,18 +1922,23 @@
}
}
+
Expression FunctionCallExpr() throws ParseException:
{
- CallExpr pf = new CallExpr();
- List<Expression > argList = new ArrayList<Expression >();
+ CallExpr callExpr;
+ List<Expression> argList = new ArrayList<Expression>();
Expression tmp;
int arity = 0;
- Token funcName;
+ String funcName;
+ String dataverse;
+ String hint=null;
+ String id1=null;
+ String id2=null;
}
-{
- ( <IDENTIFIER> | <DATASET> )
+{
+ ( <IDENTIFIER> { dataverse = defaultDataverse; funcName = token.image;} ("." <IDENTIFIER> { dataverse = funcName; funcName = token.image;})? | <DATASET> {dataverse = MetadataConstants.METADATA_DATAVERSE_NAME; funcName = getToken(0).toString();})
{
- funcName = getToken(0);
+ hint = getHint(token);
}
<LEFTPAREN> (tmp = Expression()
{
@@ -1745,20 +1947,21 @@
} ("," tmp = Expression() { argList.add(tmp); arity++; })*)? <RIGHTPAREN>
{
- AsterixFunction fd = lookupFunctionSignature(funcName.toString(), arity);
- if(fd == null)
- {
- fd = new AsterixFunction(funcName.toString(), arity);
-// notFoundFunctionList.add(fd);
- }
-// throw new ParseException("can't find function "+ funcName.toString() + "@" + arity);
- pf.setIdent(fd);
- pf.setExprList(argList);
- return pf;
+ FunctionSignature signature = lookupFunctionSignature(dataverse, funcName.toString(), arity);
+ if(signature == null)
+ {
+ signature = new FunctionSignature(dataverse, funcName.toString(), arity);
+ }
+ callExpr = new CallExpr(signature,argList);
+ if (hint != null && hint.startsWith(INDEXED_NESTED_LOOP_JOIN_HINT)) {
+ callExpr.addHint(IndexedNLJoinExpressionAnnotation.INSTANCE);
+ }
+ return callExpr;
}
}
+
Expression ParenthesizedExpression() throws ParseException:
{
Expression expr;
@@ -2214,6 +2417,7 @@
<IDENTIFIER : (<LETTER>)+ (<LETTER> | <DIGIT> | <SPECIALCHARS>)*>
}
+
<DEFAULT>
TOKEN :
{
diff --git a/asterix-common/pom.xml b/asterix-common/pom.xml
index facca1c..048c037 100644
--- a/asterix-common/pom.xml
+++ b/asterix-common/pom.xml
@@ -26,12 +26,12 @@
<dependency>
<groupId>edu.uci.ics.hyracks</groupId>
<artifactId>hyracks-algebricks-compiler</artifactId>
- <version>0.2.1-SNAPSHOT</version>
+ <version>0.2.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>edu.uci.ics.hyracks</groupId>
<artifactId>hyracks-dataflow-std</artifactId>
- <version>0.2.1-SNAPSHOT</version>
+ <version>0.2.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>edu.uci.ics.asterix</groupId>
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/annotations/RecordDataGenAnnotation.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/annotations/RecordDataGenAnnotation.java
index 8214b39..6b7a96b 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/annotations/RecordDataGenAnnotation.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/annotations/RecordDataGenAnnotation.java
@@ -1,6 +1,8 @@
package edu.uci.ics.asterix.common.annotations;
-public class RecordDataGenAnnotation implements IRecordTypeAnnotation {
+import java.io.Serializable;
+
+public class RecordDataGenAnnotation implements IRecordTypeAnnotation, Serializable {
private final IRecordFieldDataGen[] declaredFieldsDatagen;
private final UndeclaredFieldsDataGen undeclaredFieldsDataGen;
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/api/AsterixAppContextInfoImpl.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/api/AsterixAppContextInfoImpl.java
index 144a8824..00a2651 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/api/AsterixAppContextInfoImpl.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/api/AsterixAppContextInfoImpl.java
@@ -1,22 +1,50 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package edu.uci.ics.asterix.common.api;
-import java.util.Map;
-import java.util.Set;
-
import edu.uci.ics.asterix.common.context.AsterixIndexRegistryProvider;
import edu.uci.ics.asterix.common.context.AsterixStorageManagerInterface;
import edu.uci.ics.asterix.common.dataflow.IAsterixApplicationContextInfo;
+import edu.uci.ics.hyracks.api.application.ICCApplicationContext;
import edu.uci.ics.hyracks.storage.am.common.dataflow.IIndex;
import edu.uci.ics.hyracks.storage.am.common.dataflow.IIndexRegistryProvider;
import edu.uci.ics.hyracks.storage.common.IStorageManagerInterface;
+/*
+ * Acts as an holder class for IndexRegistryProvider, AsterixStorageManager
+ * instances that are accessed from the NCs. In addition an instance of ICCApplicationContext
+ * is stored for access by the CC.
+ */
public class AsterixAppContextInfoImpl implements IAsterixApplicationContextInfo {
- public static final AsterixAppContextInfoImpl INSTANCE = new AsterixAppContextInfoImpl();
+ private static AsterixAppContextInfoImpl INSTANCE;
- private static Map<String, Set<String>> nodeControllerMap;
+ private final ICCApplicationContext appCtx;
- private AsterixAppContextInfoImpl() {
+ public static void initialize(ICCApplicationContext ccAppCtx) {
+ if (INSTANCE == null) {
+ INSTANCE = new AsterixAppContextInfoImpl(ccAppCtx);
+ }
+ }
+
+ private AsterixAppContextInfoImpl(ICCApplicationContext ccAppCtx) {
+ this.appCtx = ccAppCtx;
+ }
+
+ public static IAsterixApplicationContextInfo getInstance() {
+ return INSTANCE;
}
@Override
@@ -29,12 +57,9 @@
return AsterixStorageManagerInterface.INSTANCE;
}
- public static void setNodeControllerInfo(Map<String, Set<String>> nodeControllerInfo) {
- nodeControllerMap = nodeControllerInfo;
- }
-
- public static Map<String, Set<String>> getNodeControllerMap() {
- return nodeControllerMap;
+ @Override
+ public ICCApplicationContext getCCApplicationContext() {
+ return appCtx;
}
}
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/OptimizationConfUtil.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/OptimizationConfUtil.java
index 0a125b4..271f216 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/OptimizationConfUtil.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/OptimizationConfUtil.java
@@ -1,6 +1,6 @@
package edu.uci.ics.asterix.common.config;
-import edu.uci.ics.hyracks.algebricks.core.rewriter.base.PhysicalOptimizationConfig;
+import edu.uci.ics.hyracks.algebricks.core.rewriter.base.PhysicalOptimizationConfig;
public class OptimizationConfUtil {
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/dataflow/IAsterixApplicationContextInfo.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/dataflow/IAsterixApplicationContextInfo.java
index 7bb0fd6..032e832 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/dataflow/IAsterixApplicationContextInfo.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/dataflow/IAsterixApplicationContextInfo.java
@@ -1,11 +1,48 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package edu.uci.ics.asterix.common.dataflow;
+import edu.uci.ics.hyracks.api.application.ICCApplicationContext;
import edu.uci.ics.hyracks.storage.am.common.dataflow.IIndex;
import edu.uci.ics.hyracks.storage.am.common.dataflow.IIndexRegistryProvider;
import edu.uci.ics.hyracks.storage.common.IStorageManagerInterface;
+/**
+ * Provides methods for obtaining the IIndexRegistryProvider, IStorageManager and
+ * ICCApplicationContext implementation.
+ */
public interface IAsterixApplicationContextInfo {
+
+ /**
+ * Returns an instance of the implementation for IIndexRegistryProvider.
+ *
+ * @return IIndexRegistryProvider implementation instance
+ */
public IIndexRegistryProvider<IIndex> getIndexRegistryProvider();
+ /**
+ * Returns an instance of the implementation for IStorageManagerInterface.
+ *
+ * @return IStorageManagerInterface implementation instance
+ */
public IStorageManagerInterface getStorageManagerInterface();
+
+ /**
+ * Returns an instance of the implementation for ICCApplicationContext.
+ *
+ * @return ICCApplicationContext implementation instance
+ */
+ public ICCApplicationContext getCCApplicationContext();
}
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/functions/FunctionSignature.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/functions/FunctionSignature.java
new file mode 100644
index 0000000..188593c
--- /dev/null
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/functions/FunctionSignature.java
@@ -0,0 +1,53 @@
+package edu.uci.ics.asterix.common.functions;
+
+import java.io.Serializable;
+
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+
+public class FunctionSignature implements Serializable {
+ private final String namespace;
+ private final String name;
+ private final int arity;
+ private final String rep;
+
+ public FunctionSignature(String namespace, String name, int arity) {
+ this.namespace = namespace;
+ this.name = name;
+ this.arity = arity;
+ rep = namespace + "." + name + "@" + arity;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof FunctionSignature)) {
+ return false;
+ } else {
+ FunctionSignature f = ((FunctionSignature) o);
+ return ((namespace != null && namespace.equals(f.getNamespace()) || (namespace == null && f.getNamespace() == null)))
+ && name.equals(f.getName())
+ && (arity == f.getArity() || arity == FunctionIdentifier.VARARGS || f.getArity() == FunctionIdentifier.VARARGS);
+ }
+ }
+
+ public String toString() {
+ return rep;
+ }
+
+ @Override
+ public int hashCode() {
+ return (namespace + "." + name).hashCode();
+ }
+
+ public String getNamespace() {
+ return namespace;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public int getArity() {
+ return arity;
+ }
+
+}
diff --git a/asterix-dist/pom.xml b/asterix-dist/pom.xml
index ec27b64..53168b4 100644
--- a/asterix-dist/pom.xml
+++ b/asterix-dist/pom.xml
@@ -32,14 +32,14 @@
<dependency>
<groupId>edu.uci.ics.hyracks</groupId>
<artifactId>hyracks-server</artifactId>
- <version>0.2.1-SNAPSHOT</version>
+ <version>0.2.2-SNAPSHOT</version>
<type>zip</type>
<classifier>binary-assembly</classifier>
</dependency>
<dependency>
<groupId>edu.uci.ics.hyracks</groupId>
<artifactId>hyracks-cli</artifactId>
- <version>0.2.1-SNAPSHOT</version>
+ <version>0.2.2-SNAPSHOT</version>
<type>zip</type>
<classifier>binary-assembly</classifier>
</dependency>
diff --git a/asterix-external-data/pom.xml b/asterix-external-data/pom.xml
index c297c08..7da6bd9 100644
--- a/asterix-external-data/pom.xml
+++ b/asterix-external-data/pom.xml
@@ -131,7 +131,7 @@
<dependency>
<groupId>edu.uci.ics.hyracks</groupId>
<artifactId>hyracks-dataflow-hadoop</artifactId>
- <version>0.2.1-SNAPSHOT</version>
+ <version>0.2.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>jdom</groupId>
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/datasource/data/listener/AbstractDataListeningProperty.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/datasource/data/listener/AbstractDataListeningProperty.java
deleted file mode 100644
index 88ce33c..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/datasource/data/listener/AbstractDataListeningProperty.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.datasource.data.listener;
-
-/**
- * A push-based datasource adapter allows registering a IDataListener instance.
- * Data listening property defines when data is pushed to a IDataListener.
- */
-
-public abstract class AbstractDataListeningProperty {
-
- /**
- * COUNT_BASED: Data is pushed to a data listener only if the count of
- * records exceeds the configured threshold value. TIME_BASED: Data is
- * pushed to a data listener in a periodic manner at the end of each time
- * interval.
- */
- public enum listeningPropertyType {
- COUNT_BASED,
- TIME_BASED
- }
-
- public abstract listeningPropertyType getListeningPropretyType();
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/datasource/data/listener/CountBasedDataListeningProperty.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/datasource/data/listener/CountBasedDataListeningProperty.java
deleted file mode 100644
index 0eb42dc..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/datasource/data/listener/CountBasedDataListeningProperty.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.datasource.data.listener;
-
-/**
- * A data listening property chosen by a data listener when it wants data to be
- * pushed when the count of records collected by the adapter exceeds a confiured
- * count value.
- */
-public class CountBasedDataListeningProperty extends AbstractDataListeningProperty {
-
- int numTuples;
-
- public int getNumTuples() {
- return numTuples;
- }
-
- public void setNumTuples(int numTuples) {
- this.numTuples = numTuples;
- }
-
- public CountBasedDataListeningProperty(int numTuples) {
- this.numTuples = numTuples;
- }
-
- @Override
- public listeningPropertyType getListeningPropretyType() {
- return listeningPropertyType.COUNT_BASED;
- }
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/datasource/data/listener/IDataListener.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/datasource/data/listener/IDataListener.java
deleted file mode 100644
index 269f060..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/datasource/data/listener/IDataListener.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.datasource.data.listener;
-
-import java.nio.ByteBuffer;
-
-/**
- * An interface providing a call back API for a subscriber interested in data
- * received from an external data source via the datasource adapter.
- */
-public interface IDataListener {
-
- /**
- * This method is a call back API and is invoked by an instance of
- * IPushBasedDatasourceReadAdapter. The caller passes a frame containing new
- * data. The protocol as to when the caller shall invoke this method is
- * decided by the configured @see DataListenerProperty .
- *
- * @param aObjects
- */
-
- public void dataReceived(ByteBuffer frame);
-
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/datasource/data/listener/TimeBasedDataListeningProperty.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/datasource/data/listener/TimeBasedDataListeningProperty.java
deleted file mode 100644
index a11cf94..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/datasource/data/listener/TimeBasedDataListeningProperty.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.datasource.data.listener;
-
-/**
- * A data listening property chosen by a data listener when it needs data to be
- * pushed in a periodic manner with a configured time-interval.
- */
-public class TimeBasedDataListeningProperty extends AbstractDataListeningProperty {
-
- // time interval in secs
- int interval;
-
- public int getInteval() {
- return interval;
- }
-
- public void setInterval(int interval) {
- this.interval = interval;
- }
-
- public TimeBasedDataListeningProperty(int interval) {
- this.interval = interval;
- }
-
- @Override
- public listeningPropertyType getListeningPropretyType() {
- return listeningPropertyType.TIME_BASED;
- }
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/CNNFeedAdapterFactory.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/CNNFeedAdapterFactory.java
new file mode 100644
index 0000000..f1f5884
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/CNNFeedAdapterFactory.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.adapter.factory;
+
+import java.util.Map;
+
+import edu.uci.ics.asterix.external.dataset.adapter.CNNFeedAdapter;
+import edu.uci.ics.asterix.external.dataset.adapter.IDatasourceAdapter;
+
+/**
+ * A factory class for creating the @see {CNNFeedAdapter}.
+ */
+public class CNNFeedAdapterFactory implements ITypedDatasetAdapterFactory {
+
+ @Override
+ public IDatasourceAdapter createAdapter(Map<String, String> configuration) throws Exception {
+ CNNFeedAdapter cnnFeedAdapter = new CNNFeedAdapter();
+ cnnFeedAdapter.configure(configuration);
+ return cnnFeedAdapter;
+ }
+
+ @Override
+ public String getName() {
+ return "cnn_feed";
+ }
+
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/HDFSAdapterFactory.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/HDFSAdapterFactory.java
new file mode 100644
index 0000000..6fcb710
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/HDFSAdapterFactory.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.adapter.factory;
+
+import java.util.Map;
+
+import edu.uci.ics.asterix.external.dataset.adapter.HDFSAdapter;
+import edu.uci.ics.asterix.external.dataset.adapter.IDatasourceAdapter;
+import edu.uci.ics.asterix.om.types.IAType;
+
+/**
+ * A factory class for creating an instance of HDFSAdapter
+ */
+public class HDFSAdapterFactory implements IGenericDatasetAdapterFactory {
+
+ public static final String HDFS_ADAPTER_NAME = "hdfs";
+
+ @Override
+ public IDatasourceAdapter createAdapter(Map<String, String> configuration, IAType atype) throws Exception {
+ HDFSAdapter hdfsAdapter = new HDFSAdapter(atype);
+ hdfsAdapter.configure(configuration);
+ return hdfsAdapter;
+ }
+
+ @Override
+ public String getName() {
+ return HDFS_ADAPTER_NAME;
+ }
+
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/HiveAdapterFactory.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/HiveAdapterFactory.java
new file mode 100644
index 0000000..5e28eed
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/HiveAdapterFactory.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.adapter.factory;
+
+import java.util.Map;
+
+import edu.uci.ics.asterix.external.dataset.adapter.HiveAdapter;
+import edu.uci.ics.asterix.external.dataset.adapter.IDatasourceAdapter;
+import edu.uci.ics.asterix.om.types.IAType;
+
+/**
+ * A factory class for creating an instance of HiveAdapter
+ */
+public class HiveAdapterFactory implements IGenericDatasetAdapterFactory {
+
+ @Override
+ public IDatasourceAdapter createAdapter(Map<String, String> configuration, IAType type) throws Exception {
+ HiveAdapter hiveAdapter = new HiveAdapter(type);
+ hiveAdapter.configure(configuration);
+ return hiveAdapter;
+ }
+
+ @Override
+ public String getName() {
+ return "hive";
+ }
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/IAdapterFactory.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/IAdapterFactory.java
new file mode 100644
index 0000000..45fd6cf
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/IAdapterFactory.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.adapter.factory;
+
+/**
+ * Base interface for IGenericDatasetAdapterFactory and ITypedDatasetAdapterFactory.
+ * Acts as a marker interface indicating that the implementation provides functionality
+ * for creating an adapter.
+ */
+public interface IAdapterFactory {
+
+ /**
+ * Returns the display name corresponding to the Adapter type that is created by the factory.
+ *
+ * @return the display name
+ */
+ public String getName();
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/IGenericDatasetAdapterFactory.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/IGenericDatasetAdapterFactory.java
new file mode 100644
index 0000000..093a3dd
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/IGenericDatasetAdapterFactory.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.adapter.factory;
+
+import java.util.Map;
+
+import edu.uci.ics.asterix.external.dataset.adapter.IDatasourceAdapter;
+import edu.uci.ics.asterix.om.types.IAType;
+
+/**
+ * A base interface for an adapter factory that creates instance of an adapter kind that
+ * is 'generic' in nature. A 'typed' adapter returns records with a configurable datatype.
+ */
+public interface IGenericDatasetAdapterFactory extends IAdapterFactory {
+
+ public static final String KEY_TYPE_NAME = "output-type-name";
+
+ /**
+ * Creates an instance of IDatasourceAdapter.
+ *
+ * @param configuration
+ * The configuration parameters for the adapter that is instantiated.
+ * The passed-in configuration is used to configure the created instance of the adapter.
+ * @param atype
+ * The type for the ADM records that are returned by the adapter.
+ * @return An instance of IDatasourceAdapter.
+ * @throws Exception
+ */
+ public IDatasourceAdapter createAdapter(Map<String, String> configuration, IAType atype) throws Exception;
+
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/ITypedDatasetAdapterFactory.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/ITypedDatasetAdapterFactory.java
new file mode 100644
index 0000000..0f9978e
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/ITypedDatasetAdapterFactory.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.adapter.factory;
+
+import java.util.Map;
+
+import edu.uci.ics.asterix.external.dataset.adapter.IDatasourceAdapter;
+
+/**
+ * A base interface for an adapter factory that creates instance of an adapter kind that
+ * is 'typed' in nature. A 'typed' adapter returns records with a pre-defined datatype.
+ */
+public interface ITypedDatasetAdapterFactory extends IAdapterFactory {
+
+ /**
+ * Creates an instance of IDatasourceAdapter.
+ *
+ * @param configuration
+ * The configuration parameters for the adapter that is instantiated.
+ * The passed-in configuration is used to configure the created instance of the adapter.
+ * @return An instance of IDatasourceAdapter.
+ * @throws Exception
+ */
+ public IDatasourceAdapter createAdapter(Map<String, String> configuration) throws Exception;
+
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/NCFileSystemAdapterFactory.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/NCFileSystemAdapterFactory.java
new file mode 100644
index 0000000..2040949
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/NCFileSystemAdapterFactory.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.adapter.factory;
+
+import java.util.Map;
+
+import edu.uci.ics.asterix.external.dataset.adapter.IDatasourceAdapter;
+import edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter;
+import edu.uci.ics.asterix.om.types.IAType;
+
+/**
+ * Factory class for creating an instance of NCFileSystemAdapter. An
+ * NCFileSystemAdapter reads external data residing on the local file system of
+ * an NC.
+ */
+public class NCFileSystemAdapterFactory implements IGenericDatasetAdapterFactory {
+
+ public static final String NC_FILE_SYSTEM_ADAPTER_NAME = "localfs";
+
+ @Override
+ public IDatasourceAdapter createAdapter(Map<String, String> configuration, IAType atype) throws Exception {
+ NCFileSystemAdapter fsAdapter = new NCFileSystemAdapter(atype);
+ fsAdapter.configure(configuration);
+ return fsAdapter;
+ }
+
+ @Override
+ public String getName() {
+ return NC_FILE_SYSTEM_ADAPTER_NAME;
+ }
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/PullBasedTwitterAdapterFactory.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/PullBasedTwitterAdapterFactory.java
new file mode 100644
index 0000000..bc00469
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/PullBasedTwitterAdapterFactory.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.adapter.factory;
+
+import java.util.Map;
+
+import edu.uci.ics.asterix.external.dataset.adapter.IDatasourceAdapter;
+import edu.uci.ics.asterix.external.dataset.adapter.PullBasedTwitterAdapter;
+
+/**
+ * Factory class for creating an instance of PullBasedTwitterAdapter.
+ * This adapter provides the functionality of fetching tweets from Twitter service
+ * via pull-based Twitter API.
+ */
+public class PullBasedTwitterAdapterFactory implements ITypedDatasetAdapterFactory {
+
+ public static final String PULL_BASED_TWITTER_ADAPTER_NAME = "pull_twitter";
+
+ @Override
+ public IDatasourceAdapter createAdapter(Map<String, String> configuration) throws Exception {
+ PullBasedTwitterAdapter twitterAdapter = new PullBasedTwitterAdapter();
+ twitterAdapter.configure(configuration);
+ return twitterAdapter;
+ }
+
+ @Override
+ public String getName() {
+ return PULL_BASED_TWITTER_ADAPTER_NAME;
+ }
+
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/RSSFeedAdapterFactory.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/RSSFeedAdapterFactory.java
new file mode 100644
index 0000000..bbbea38
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/adapter/factory/RSSFeedAdapterFactory.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.adapter.factory;
+
+import java.util.Map;
+
+import edu.uci.ics.asterix.external.dataset.adapter.IDatasourceAdapter;
+import edu.uci.ics.asterix.external.dataset.adapter.RSSFeedAdapter;
+
+/**
+ * Factory class for creating an instance of @see {RSSFeedAdapter}.
+ * RSSFeedAdapter provides the functionality of fetching an RSS based feed.
+ */
+public class RSSFeedAdapterFactory implements ITypedDatasetAdapterFactory {
+
+ public static final String RSS_FEED_ADAPTER_NAME = "rss_feed";
+
+ @Override
+ public IDatasourceAdapter createAdapter(Map<String, String> configuration) throws Exception {
+ RSSFeedAdapter rssFeedAdapter = new RSSFeedAdapter();
+ rssFeedAdapter.configure(configuration);
+ return rssFeedAdapter;
+ }
+
+ @Override
+ public String getName() {
+ return "rss_feed";
+ }
+
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/adapter/api/IDatasourceAdapter.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/adapter/api/IDatasourceAdapter.java
deleted file mode 100644
index f51e6b8..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/adapter/api/IDatasourceAdapter.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.external.data.adapter.api;
-
-import java.io.Serializable;
-import java.util.Map;
-
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
-import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-
-/**
- * A super interface implemented by a data source adapter. An adapter can be a
- * pull based or push based. This interface provides all common APIs that need
- * to be implemented by each adapter irrespective of the the kind of
- * adapter(pull or push).
- */
-public interface IDatasourceAdapter extends Serializable {
-
- /**
- * Represents the kind of data exchange that happens between the adapter and
- * the external data source. The data exchange can be either pull based or
- * push based. In the former case (pull), the request for data transfer is
- * initiated by the adapter. In the latter case (push) the adapter is
- * required to submit an initial request to convey intent for data.
- * Subsequently all data transfer requests are initiated by the external
- * data source.
- */
- public enum AdapterDataFlowType {
- PULL,
- PUSH
- }
-
- /**
- * An adapter can be used to read from an external data source and may also
- * allow writing to the external data source. This enum type indicates the
- * kind of operations supported by the adapter.
- *
- * @caller Compiler uses this method to assert the validity of an operation
- * on an external dataset. The type of adapter associated with an
- * external dataset determines the set of valid operations allowed
- * on the dataset.
- */
- public enum AdapterType {
- READ,
- WRITE,
- READ_WRITE
- }
-
- /**
- * An adapter can be a pull or a push based adapter. This method returns the
- * kind of adapter, that is whether it is a pull based adapter or a push
- * based adapter.
- *
- * @caller Compiler or wrapper operator: Compiler uses this API to choose
- * the right wrapper (push-based) operator that wraps around the
- * adapter and provides an iterator interface. If we decide to form
- * a single operator that handles both pull and push based adapter
- * kinds, then this method will be used by the wrapper operator for
- * switching between the logic for interacting with a pull based
- * adapter versus a push based adapter.
- * @return AdapterDataFlowType
- */
- public AdapterDataFlowType getAdapterDataFlowType();
-
- /**
- * Returns the type of adapter indicating if the adapter can be used for
- * reading from an external data source or writing to an external data
- * source or can be used for both purposes.
- *
- * @Caller: Compiler: The compiler uses this API to verify if an operation
- * is supported by the adapter. For example, an write query against
- * an external dataset will not compile successfully if the
- * external dataset was declared with a read_only adapter.
- * @see AdapterType
- * @return
- */
- public AdapterType getAdapterType();
-
- /**
- * Each adapter instance is configured with a set of parameters that are
- * key-value pairs. When creating an external or a feed dataset, an adapter
- * instance is used in conjunction with a set of configuration parameters
- * for the adapter instance. The configuration parameters are stored
- * internally with the adapter and can be retrieved using this API.
- *
- * @param propertyKey
- * @return String the value corresponding to the configuration parameter
- * represented by the key- attributeKey.
- */
- public String getAdapterProperty(String propertyKey);
-
- /**
- * Allows setting a configuration property of the adapter with a specified
- * value.
- *
- * @caller Used by the wrapper operator to modify the behavior of the
- * adapter, if required.
- * @param property
- * the property to be set
- * @param value
- * the value for the property
- */
- public void setAdapterProperty(String property, String value);
-
- /**
- * Configures the IDatasourceAdapter instance.
- *
- * @caller Scenario 1) Called during compilation of DDL statement that
- * creates a Feed dataset and associates the adapter with the
- * dataset. The (key,value) configuration parameters provided as
- * part of the DDL statement are collected by the compiler and
- * passed on to this method. The adapter may as part of
- * configuration connect with the external data source and determine
- * the IAType associated with data residing with the external
- * datasource.
- * Scenario 2) An adapter instance is created by an ASTERIX operator
- * that wraps around the adapter instance. The operator, as part of
- * its initialization invokes the configure method. The (key,value)
- * configuration parameters are passed on to the operator by the
- * compiler. Subsequent to the invocation, the wrapping operator
- * obtains the partition constraints (if any). In addition, in the
- * case of a read adapter, the wrapping operator obtains the output
- * ASTERIX type associated with the data that will be output from
- * the adapter.
- * @param arguments
- * A map with key-value pairs that contains the configuration
- * parameters for the adapter. The arguments are obtained from
- * the metadata. Recall that the DDL to create an external
- * dataset or a feed dataset requires using an adapter and
- * providing all arguments as a set of (key,value) pairs. These
- * arguments are put into the metadata.
- */
- public void configure(Map<String, String> arguments, IAType atype)
- throws Exception;
-
- /**
- * Returns a list of partition constraints. A partition constraint can be a
- * requirement to execute at a particular location or could be cardinality
- * constraints indicating the number of instances that need to run in
- * parallel. example, a IDatasourceAdapter implementation written for data
- * residing on the local file system of a node cannot run on any other node
- * and thus has a location partition constraint. The location partition
- * constraint can be expressed as a node IP address or a node controller id.
- * In the former case, the IP address is translated to a node controller id
- * running on the node with the given IP address.
- *
- * @Caller The wrapper operator configures its partition constraints from
- * the constraints obtained from the adapter.
- */
- public AlgebricksPartitionConstraint getPartitionConstraint();
-
- /**
- * Allows the adapter to establish connection with the external data source
- * expressing intent for data and providing any configuration parameters
- * required by the external data source for the transfer of data. This
- * method does not result in any data transfer, but is a prerequisite for
- * any subsequent data transfer to happen between the external data source
- * and the adapter.
- *
- * @caller This method is called by the wrapping ASTERIX operator that
- * @param ctx
- * @throws Exception
- */
- public void initialize(IHyracksTaskContext ctx) throws Exception;
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/adapter/api/IDatasourceReadAdapter.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/adapter/api/IDatasourceReadAdapter.java
deleted file mode 100644
index 737dde0..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/adapter/api/IDatasourceReadAdapter.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.external.data.adapter.api;
-
-import edu.uci.ics.asterix.external.data.parser.IDataParser;
-
-public interface IDatasourceReadAdapter extends IDatasourceAdapter {
-
- /**
- * Retrieves data from an external datasource, packs it in frames and uses a
- * frame writer to flush the frames to a recipient operator.
- *
- * @param partition
- * Multiple instances of the adapter can be configured to
- * retrieve data in parallel. Partition is an integer between 0
- * to N-1 where N is the number of parallel adapter instances.
- * The partition value helps configure a particular instance of
- * the adapter to fetch data.
- * @param writer
- * An instance of IFrameWriter that is used to flush frames to
- * the recipient operator
- * @throws Exception
- */
-
- public IDataParser getDataParser(int partition) throws Exception;
-
-
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/adapter/api/IDatasourceWriteAdapter.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/adapter/api/IDatasourceWriteAdapter.java
deleted file mode 100644
index 3cd1464..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/adapter/api/IDatasourceWriteAdapter.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.external.data.adapter.api;
-
-import java.nio.ByteBuffer;
-import java.util.Map;
-
-import edu.uci.ics.asterix.om.types.IAType;
-
-public interface IDatasourceWriteAdapter extends IDatasourceAdapter {
-
- /**
- * Flushes tuples contained in the frame to the dataset stored in an
- * external data source. If required, the content of the frame is converted
- * into an appropriate format as required by the external data source.
- *
- * @caller This method is invoked by the wrapping ASTERIX operator when data
- * needs to be written to the external data source.
- * @param sourceAType
- * The type associated with the data that is required to be
- * written
- * @param frame
- * the frame that needs to be flushed
- * @param datasourceSpecificParams
- * A map containing other parameters that are specific to the
- * target data source where data is to be written. For example
- * when writing to a data source such as HDFS, an optional
- * parameter is the replication factor.
- * @throws Exception
- */
- public void flush(IAType sourceAType, ByteBuffer frame, Map<String, String> datasourceSpecificParams)
- throws Exception;
-
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/operator/ExternalDataScanOperatorDescriptor.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/operator/ExternalDataScanOperatorDescriptor.java
index e189df3..fb4cc99 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/operator/ExternalDataScanOperatorDescriptor.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/operator/ExternalDataScanOperatorDescriptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2009-2011 by The Regents of the University of California
+ * Copyright 2009-2012 by The Regents of the University of California
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may obtain a copy of the License from
@@ -16,7 +16,8 @@
import java.util.Map;
-import edu.uci.ics.asterix.external.data.adapter.api.IDatasourceReadAdapter;
+import edu.uci.ics.asterix.external.adapter.factory.IGenericDatasetAdapterFactory;
+import edu.uci.ics.asterix.external.dataset.adapter.IDatasourceAdapter;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.hyracks.api.application.ICCApplicationContext;
import edu.uci.ics.hyracks.api.constraints.IConstraintAcceptor;
@@ -29,19 +30,24 @@
import edu.uci.ics.hyracks.dataflow.std.base.AbstractSingleActivityOperatorDescriptor;
import edu.uci.ics.hyracks.dataflow.std.base.AbstractUnaryOutputSourceOperatorNodePushable;
+/*
+ * A single activity operator that provides the functionality of scanning data using an
+ * instance of the configured adapter.
+ */
public class ExternalDataScanOperatorDescriptor extends AbstractSingleActivityOperatorDescriptor {
+
private static final long serialVersionUID = 1L;
- private final String adapter;
+ private final String adapterFactory;
private final Map<String, String> adapterConfiguration;
private final IAType atype;
- private IDatasourceReadAdapter datasourceReadAdapter;
+ private IGenericDatasetAdapterFactory datasourceAdapterFactory;
public ExternalDataScanOperatorDescriptor(JobSpecification spec, String adapter, Map<String, String> arguments,
IAType atype, RecordDescriptor rDesc) {
super(spec, 0, 1);
recordDescriptors[0] = rDesc;
- this.adapter = adapter;
+ this.adapterFactory = adapter;
this.adapterConfiguration = arguments;
this.atype = atype;
}
@@ -78,14 +84,12 @@
}
- public IOperatorNodePushable createPushRuntime(IHyracksTaskContext ctx,
+ @Override
+ public IOperatorNodePushable createPushRuntime(final IHyracksTaskContext ctx,
IRecordDescriptorProvider recordDescProvider, final int partition, int nPartitions)
throws HyracksDataException {
-
try {
- //datasourceReadAdapter = (IDatasourceReadAdapter) Class.forName(adapter).newInstance();
- datasourceReadAdapter.configure(adapterConfiguration, atype);
- datasourceReadAdapter.initialize(ctx);
+ datasourceAdapterFactory = (IGenericDatasetAdapterFactory) Class.forName(adapterFactory).newInstance();
} catch (Exception e) {
throw new HyracksDataException("initialization of adapter failed", e);
}
@@ -93,8 +97,12 @@
@Override
public void initialize() throws HyracksDataException {
writer.open();
+ IDatasourceAdapter adapter = null;
try {
- datasourceReadAdapter.getDataParser(partition).parse(writer);
+ adapter = ((IGenericDatasetAdapterFactory) datasourceAdapterFactory).createAdapter(
+ adapterConfiguration, atype);
+ adapter.initialize(ctx);
+ adapter.start(partition, writer);
} catch (Exception e) {
throw new HyracksDataException("exception during reading from external data source", e);
} finally {
@@ -104,7 +112,4 @@
};
}
- public void setDatasourceAdapter(IDatasourceReadAdapter adapterInstance) {
- this.datasourceReadAdapter = adapterInstance;
- }
}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/operator/FeedIntakeOperatorDescriptor.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/operator/FeedIntakeOperatorDescriptor.java
new file mode 100644
index 0000000..2da4e76
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/operator/FeedIntakeOperatorDescriptor.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.data.operator;
+
+import java.util.Map;
+
+import edu.uci.ics.asterix.external.adapter.factory.IAdapterFactory;
+import edu.uci.ics.asterix.external.adapter.factory.IGenericDatasetAdapterFactory;
+import edu.uci.ics.asterix.external.adapter.factory.ITypedDatasetAdapterFactory;
+import edu.uci.ics.asterix.external.dataset.adapter.ITypedDatasourceAdapter;
+import edu.uci.ics.asterix.external.feed.lifecycle.FeedId;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
+import edu.uci.ics.hyracks.api.dataflow.IOperatorNodePushable;
+import edu.uci.ics.hyracks.api.dataflow.value.IRecordDescriptorProvider;
+import edu.uci.ics.hyracks.api.dataflow.value.RecordDescriptor;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.api.job.JobSpecification;
+import edu.uci.ics.hyracks.dataflow.std.base.AbstractSingleActivityOperatorDescriptor;
+
+/**
+ * Operator responsible for ingesting data from an external source. This
+ * operator uses a (configurable) adapter associated with the feed dataset.
+ */
+public class FeedIntakeOperatorDescriptor extends
+ AbstractSingleActivityOperatorDescriptor {
+
+ private static final long serialVersionUID = 1L;
+
+ private final String adapterFactoryClassName;
+ private final Map<String, String> adapterConfiguration;
+ private final IAType atype;
+ private final FeedId feedId;
+
+ private transient IAdapterFactory datasourceAdapterFactory;
+
+ public FeedIntakeOperatorDescriptor(JobSpecification spec, FeedId feedId,
+ String adapter, Map<String, String> arguments, ARecordType atype,
+ RecordDescriptor rDesc) {
+ super(spec, 1, 1);
+ recordDescriptors[0] = rDesc;
+ this.adapterFactoryClassName = adapter;
+ this.adapterConfiguration = arguments;
+ this.atype = atype;
+ this.feedId = feedId;
+ }
+
+ public IOperatorNodePushable createPushRuntime(IHyracksTaskContext ctx,
+ IRecordDescriptorProvider recordDescProvider, final int partition,
+ int nPartitions) throws HyracksDataException {
+ ITypedDatasourceAdapter adapter;
+ try {
+ datasourceAdapterFactory = (IAdapterFactory) Class.forName(
+ adapterFactoryClassName).newInstance();
+ if (datasourceAdapterFactory instanceof IGenericDatasetAdapterFactory) {
+ adapter = (ITypedDatasourceAdapter) ((IGenericDatasetAdapterFactory) datasourceAdapterFactory)
+ .createAdapter(adapterConfiguration, atype);
+ } else if (datasourceAdapterFactory instanceof ITypedDatasetAdapterFactory) {
+ adapter = (ITypedDatasourceAdapter) ((ITypedDatasetAdapterFactory) datasourceAdapterFactory)
+ .createAdapter(adapterConfiguration);
+ } else {
+ throw new IllegalStateException(
+ " Unknown adapter factory type for "
+ + adapterFactoryClassName);
+ }
+ adapter.initialize(ctx);
+ } catch (Exception e) {
+ throw new HyracksDataException("initialization of adapter failed",
+ e);
+ }
+ return new FeedIntakeOperatorNodePushable(feedId, adapter, partition);
+ }
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/operator/FeedIntakeOperatorNodePushable.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/operator/FeedIntakeOperatorNodePushable.java
new file mode 100644
index 0000000..29fe72a
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/operator/FeedIntakeOperatorNodePushable.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.data.operator;
+
+import java.nio.ByteBuffer;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import edu.uci.ics.asterix.external.dataset.adapter.IDatasourceAdapter;
+import edu.uci.ics.asterix.external.feed.lifecycle.AlterFeedMessage;
+import edu.uci.ics.asterix.external.feed.lifecycle.FeedId;
+import edu.uci.ics.asterix.external.feed.lifecycle.FeedManager;
+import edu.uci.ics.asterix.external.feed.lifecycle.IFeedManager;
+import edu.uci.ics.asterix.external.feed.lifecycle.IFeedMessage;
+import edu.uci.ics.asterix.feed.managed.adapter.IManagedFeedAdapter;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.dataflow.std.base.AbstractUnaryInputUnaryOutputOperatorNodePushable;
+
+/**
+ * The runtime for @see{FeedIntakeOperationDescriptor}
+ */
+public class FeedIntakeOperatorNodePushable extends AbstractUnaryInputUnaryOutputOperatorNodePushable {
+
+ private final IDatasourceAdapter adapter;
+ private final int partition;
+ private final IFeedManager feedManager;
+ private final FeedId feedId;
+ private final LinkedBlockingQueue<IFeedMessage> inbox;
+ private FeedInboxMonitor feedInboxMonitor;
+
+ public FeedIntakeOperatorNodePushable(FeedId feedId, IDatasourceAdapter adapter, int partition) {
+ this.adapter = adapter;
+ this.partition = partition;
+ this.feedManager = (IFeedManager) FeedManager.INSTANCE;
+ this.feedId = feedId;
+ inbox = new LinkedBlockingQueue<IFeedMessage>();
+ }
+
+ @Override
+ public void open() throws HyracksDataException {
+ if (adapter instanceof IManagedFeedAdapter) {
+ feedInboxMonitor = new FeedInboxMonitor((IManagedFeedAdapter) adapter, inbox, partition);
+ feedInboxMonitor.start();
+ feedManager.registerFeedMsgQueue(feedId, inbox);
+ }
+ writer.open();
+ try {
+ adapter.start(partition, writer);
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new HyracksDataException(e);
+ /*
+ we do not throw an exception, but allow the operator to close
+ gracefully throwing an exception here would result in a job abort and a
+ transaction roll back that undoes all the work done so far.
+ */
+
+ } finally {
+ writer.close();
+ if (adapter instanceof IManagedFeedAdapter) {
+ feedManager.unregisterFeedMsgQueue(feedId, inbox);
+ }
+ }
+ }
+
+ @Override
+ public void fail() throws HyracksDataException {
+ writer.close();
+ }
+
+ @Override
+ public void close() throws HyracksDataException {
+ writer.close();
+ }
+
+ @Override
+ public void nextFrame(ByteBuffer buffer) throws HyracksDataException {
+ // do nothing
+ }
+}
+
+class FeedInboxMonitor extends Thread {
+
+ private LinkedBlockingQueue<IFeedMessage> inbox;
+ private final IManagedFeedAdapter adapter;
+
+ public FeedInboxMonitor(IManagedFeedAdapter adapter, LinkedBlockingQueue<IFeedMessage> inbox, int partition) {
+ this.inbox = inbox;
+ this.adapter = adapter;
+ }
+
+ @Override
+ public void run() {
+ while (true) {
+ try {
+ IFeedMessage feedMessage = inbox.take();
+ switch (feedMessage.getMessageType()) {
+ case STOP:
+ adapter.stop();
+ break;
+ case ALTER:
+ adapter.alter(((AlterFeedMessage) feedMessage).getAlteredConfParams());
+ break;
+ }
+ } catch (InterruptedException ie) {
+ break;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/operator/FeedMessageOperatorDescriptor.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/operator/FeedMessageOperatorDescriptor.java
new file mode 100644
index 0000000..d0dc5ca
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/operator/FeedMessageOperatorDescriptor.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.data.operator;
+
+import java.util.List;
+
+import edu.uci.ics.asterix.external.feed.lifecycle.FeedId;
+import edu.uci.ics.asterix.external.feed.lifecycle.IFeedMessage;
+import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
+import edu.uci.ics.hyracks.api.dataflow.IOperatorNodePushable;
+import edu.uci.ics.hyracks.api.dataflow.value.IRecordDescriptorProvider;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.api.job.JobSpecification;
+import edu.uci.ics.hyracks.dataflow.std.base.AbstractSingleActivityOperatorDescriptor;
+
+/**
+ * Sends a control message to the registered message queue for feed specified by its feedId.
+ */
+public class FeedMessageOperatorDescriptor extends AbstractSingleActivityOperatorDescriptor {
+
+ private static final long serialVersionUID = 1L;
+
+ private final FeedId feedId;
+ private final List<IFeedMessage> feedMessages;
+ private final boolean sendToAll = true;
+
+ public FeedMessageOperatorDescriptor(JobSpecification spec, String dataverse, String dataset,
+ List<IFeedMessage> feedMessages) {
+ super(spec, 0, 1);
+ this.feedId = new FeedId(dataverse, dataset);
+ this.feedMessages = feedMessages;
+ }
+
+ @Override
+ public IOperatorNodePushable createPushRuntime(IHyracksTaskContext ctx,
+ IRecordDescriptorProvider recordDescProvider, int partition, int nPartitions) throws HyracksDataException {
+ return new FeedMessageOperatorNodePushable(ctx, feedId, feedMessages, sendToAll, partition, nPartitions);
+ }
+
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/operator/FeedMessageOperatorNodePushable.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/operator/FeedMessageOperatorNodePushable.java
new file mode 100644
index 0000000..d03eeaa
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/operator/FeedMessageOperatorNodePushable.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.data.operator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import edu.uci.ics.asterix.external.feed.lifecycle.FeedId;
+import edu.uci.ics.asterix.external.feed.lifecycle.FeedManager;
+import edu.uci.ics.asterix.external.feed.lifecycle.IFeedManager;
+import edu.uci.ics.asterix.external.feed.lifecycle.IFeedMessage;
+import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.dataflow.std.base.AbstractUnaryOutputSourceOperatorNodePushable;
+
+/**
+ * Runtime for the @see{FeedMessageOperatorDescriptor}
+ */
+public class FeedMessageOperatorNodePushable extends AbstractUnaryOutputSourceOperatorNodePushable {
+
+ private final FeedId feedId;
+ private final List<IFeedMessage> feedMessages;
+ private IFeedManager feedManager;
+
+ public FeedMessageOperatorNodePushable(IHyracksTaskContext ctx, FeedId feedId, List<IFeedMessage> feedMessages,
+ boolean applyToAll, int partition, int nPartitions) {
+ this.feedId = feedId;
+ if (applyToAll) {
+ this.feedMessages = feedMessages;
+ } else {
+ this.feedMessages = new ArrayList<IFeedMessage>();
+ feedMessages.add(feedMessages.get(partition));
+ }
+ feedManager = (IFeedManager) FeedManager.INSTANCE;
+ }
+
+ @Override
+ public void initialize() throws HyracksDataException {
+ try {
+ writer.open();
+ for (IFeedMessage feedMessage : feedMessages) {
+ feedManager.deliverMessage(feedId, feedMessage);
+ }
+ } catch (Exception e) {
+ throw new HyracksDataException(e);
+ } finally {
+ writer.close();
+ }
+ }
+
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ADMStreamParser.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ADMStreamParser.java
deleted file mode 100644
index 658645c..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ADMStreamParser.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.external.data.parser;
-
-import java.util.Map;
-
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.runtime.operators.file.AdmSchemafullRecordParserFactory;
-import edu.uci.ics.hyracks.api.comm.IFrameWriter;
-import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-
-public class ADMStreamParser extends AbstractStreamDataParser {
-
- public ADMStreamParser() {
- }
-
- @Override
- public void initialize(ARecordType atype, IHyracksTaskContext ctx) {
- tupleParser = new AdmSchemafullRecordParserFactory(atype).createTupleParser(ctx);
- }
-
- @Override
- public void parse(IFrameWriter writer) throws HyracksDataException {
- tupleParser.parse(inputStream, writer);
- }
-
- @Override
- public void configure(Map<String, String> configuration) {
- }
-
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/AbstractStreamDataParser.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/AbstractStreamDataParser.java
deleted file mode 100644
index 98bd8e6..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/AbstractStreamDataParser.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.external.data.parser;
-
-import java.io.InputStream;
-import java.util.HashMap;
-
-import edu.uci.ics.asterix.om.base.temporal.ADateParserFactory;
-import edu.uci.ics.asterix.om.base.temporal.ADateTimeParserFactory;
-import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory;
-import edu.uci.ics.asterix.om.base.temporal.ATimeParserFactory;
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.hyracks.api.comm.IFrameWriter;
-import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.parsers.DoubleParserFactory;
-import edu.uci.ics.hyracks.dataflow.common.data.parsers.FloatParserFactory;
-import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParserFactory;
-import edu.uci.ics.hyracks.dataflow.common.data.parsers.IntegerParserFactory;
-import edu.uci.ics.hyracks.dataflow.common.data.parsers.LongParserFactory;
-import edu.uci.ics.hyracks.dataflow.common.data.parsers.UTF8StringParserFactory;
-import edu.uci.ics.hyracks.dataflow.std.file.ITupleParser;
-
-public abstract class AbstractStreamDataParser implements IDataStreamParser {
-
- public static final String KEY_DELIMITER = "delimiter";
-
- protected static final HashMap<ATypeTag, IValueParserFactory> typeToValueParserFactMap = new HashMap<ATypeTag, IValueParserFactory>();
-
- static {
- typeToValueParserFactMap.put(ATypeTag.INT32, IntegerParserFactory.INSTANCE);
- typeToValueParserFactMap.put(ATypeTag.FLOAT, FloatParserFactory.INSTANCE);
- typeToValueParserFactMap.put(ATypeTag.DOUBLE, DoubleParserFactory.INSTANCE);
- typeToValueParserFactMap.put(ATypeTag.INT64, LongParserFactory.INSTANCE);
- typeToValueParserFactMap.put(ATypeTag.STRING, UTF8StringParserFactory.INSTANCE);
-
- // temporal types
- typeToValueParserFactMap.put(ATypeTag.TIME, ATimeParserFactory.INSTANCE);
- typeToValueParserFactMap.put(ATypeTag.DATE, ADateParserFactory.INSTANCE);
- typeToValueParserFactMap.put(ATypeTag.DATETIME, ADateTimeParserFactory.INSTANCE);
- typeToValueParserFactMap.put(ATypeTag.DURATION, ADurationParserFactory.INSTANCE);
- }
-
- protected ITupleParser tupleParser;
- protected IFrameWriter frameWriter;
- protected InputStream inputStream;
-
- @Override
- public abstract void initialize(ARecordType recordType, IHyracksTaskContext ctx);
-
- @Override
- public abstract void parse(IFrameWriter frameWriter) throws HyracksDataException;
-
- @Override
- public void setInputStream(InputStream in) {
- inputStream = in;
-
- }
-
- @Override
- public InputStream getInputStream() {
- return inputStream;
- }
-
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/DelimitedDataStreamParser.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/DelimitedDataStreamParser.java
deleted file mode 100644
index 9efafa6..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/DelimitedDataStreamParser.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.external.data.parser;
-
-import java.util.Map;
-
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.runtime.operators.file.NtDelimitedDataTupleParserFactory;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
-import edu.uci.ics.hyracks.api.comm.IFrameWriter;
-import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParserFactory;
-
-public class DelimitedDataStreamParser extends AbstractStreamDataParser {
-
- protected Character delimiter = defaultDelimiter;
-
- protected static final Character defaultDelimiter = new Character('\n');
-
- public Character getDelimiter() {
- return delimiter;
- }
-
- public DelimitedDataStreamParser(Character delimiter) {
- this.delimiter = delimiter;
- }
-
- public DelimitedDataStreamParser() {
- }
-
- @Override
- public void initialize(ARecordType recordType, IHyracksTaskContext ctx) {
- int n = recordType.getFieldTypes().length;
- IValueParserFactory[] fieldParserFactories = new IValueParserFactory[n];
- for (int i = 0; i < n; i++) {
- ATypeTag tag = recordType.getFieldTypes()[i].getTypeTag();
- IValueParserFactory vpf = typeToValueParserFactMap.get(tag);
- if (vpf == null) {
- throw new NotImplementedException("No value parser factory for delimited fields of type " + tag);
- }
- fieldParserFactories[i] = vpf;
- }
- tupleParser = new NtDelimitedDataTupleParserFactory(recordType, fieldParserFactories, delimiter)
- .createTupleParser(ctx);
- }
-
- @Override
- public void parse(IFrameWriter writer) throws HyracksDataException {
- tupleParser.parse(inputStream, writer);
- }
-
- @Override
- public void configure(Map<String, String> configuration) {
- String delimiterArg = configuration.get(KEY_DELIMITER);
- if (delimiterArg != null) {
- delimiter = delimiterArg.charAt(0);
- } else {
- delimiter = '\n';
- }
- }
-
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/IDataParser.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/IDataParser.java
deleted file mode 100644
index eb7daf7..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/IDataParser.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.external.data.parser;
-
-import java.util.Map;
-
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.hyracks.api.comm.IFrameWriter;
-import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-
-/**
- * Represents an parser that processes an input stream to form records of a
- * given type. The parser creates frames that are flushed using a frame writer.
- */
-public interface IDataParser {
-
- /**
- * @param atype
- * The record type associated with each record output by the
- * parser
- * @param configuration
- * Any configuration parameters for the parser
- */
- public void configure(Map<String, String> configuration);
-
- /**
- * Initializes the instance. An implementation may use the passed-in
- * configuration parameters, the output record type to initialize itself so
- * that it can parse an input stream to form records of the given type.
- *
- * @param configuration
- * Any configuration parameters for the parser
- * @param ctx
- * The runtime HyracksStageletContext.
- */
- public void initialize(ARecordType recordType, IHyracksTaskContext ctx);
-
- /**
- * Parses the input stream to produce records of the configured type and
- * uses the frame writer instance to flush frames containing the produced
- * records.
- *
- * @param in
- * The source input stream
- * @param frameWriter
- * A frame writer instance that is used for flushing frames to
- * the recipient operator
- * @throws HyracksDataException
- */
- public void parse(IFrameWriter frameWriter) throws HyracksDataException;
-
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/IDataStreamParser.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/IDataStreamParser.java
deleted file mode 100644
index 1425707..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/IDataStreamParser.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.external.data.parser;
-
-import java.io.InputStream;
-
-public interface IDataStreamParser extends IDataParser {
-
- public void setInputStream(InputStream in);
-
- public InputStream getInputStream();
-
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/IManagedDataParser.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/IManagedDataParser.java
deleted file mode 100644
index 7c9bb7d..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/IManagedDataParser.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.external.data.parser;
-
-import edu.uci.ics.asterix.feed.managed.adapter.IManagedFeedAdapter;
-
-public interface IManagedDataParser extends IDataParser {
-
- public IManagedTupleParser getManagedTupleParser();
-
- public void setAdapter(IManagedFeedAdapter adapter);
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/IManagedTupleParser.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/IManagedTupleParser.java
deleted file mode 100644
index 14f6372..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/IManagedTupleParser.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.external.data.parser;
-
-import java.util.Map;
-
-import edu.uci.ics.hyracks.dataflow.std.file.ITupleParser;
-
-public interface IManagedTupleParser extends ITupleParser {
-
- public void suspend() throws Exception;
-
- public void resume() throws Exception;
-
- public void stop() throws Exception;
-
- public void alter(Map<String,String> alterParams) throws Exception;
-
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedAdmRecordParserFactory.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedAdmRecordParserFactory.java
deleted file mode 100644
index 3d31489..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedAdmRecordParserFactory.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.external.data.parser;
-
-import edu.uci.ics.asterix.feed.managed.adapter.IManagedFeedAdapter;
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.runtime.operators.file.AdmSchemafullRecordParserFactory;
-import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-import edu.uci.ics.hyracks.dataflow.std.file.ITupleParser;
-
-public class ManagedAdmRecordParserFactory extends AdmSchemafullRecordParserFactory {
-
- private final IManagedFeedAdapter adapter;
-
- public ManagedAdmRecordParserFactory(ARecordType recType, IManagedFeedAdapter adapter) {
- super(recType);
- this.adapter = adapter;
- }
-
- @Override
- public ITupleParser createTupleParser(final IHyracksTaskContext ctx) {
- return new ManagedAdmTupleParser(ctx, recType, adapter);
- }
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedAdmStreamParser.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedAdmStreamParser.java
deleted file mode 100644
index bfe9fe0..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedAdmStreamParser.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.external.data.parser;
-
-import java.util.Map;
-
-import edu.uci.ics.asterix.feed.managed.adapter.IManagedFeedAdapter;
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-
-public class ManagedAdmStreamParser extends ADMStreamParser implements IManagedDataParser{
-
- private IManagedFeedAdapter adapter;
-
- @Override
- public void initialize(ARecordType atype, IHyracksTaskContext ctx) {
- tupleParser = new ManagedAdmRecordParserFactory(atype, adapter).createTupleParser(ctx);
- }
-
- @Override
- public void configure(Map<String, String> configuration) {
-
- }
-
- @Override
- public IManagedTupleParser getManagedTupleParser() {
- return (IManagedTupleParser)tupleParser;
- }
-
- @Override
- public void setAdapter(IManagedFeedAdapter adapter) {
- this.adapter = adapter;
- }
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedAdmTupleParser.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedAdmTupleParser.java
deleted file mode 100644
index b7215a3..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedAdmTupleParser.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.external.data.parser;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import edu.uci.ics.asterix.adm.parser.nontagged.AdmLexer;
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.feed.managed.adapter.IManagedFeedAdapter;
-import edu.uci.ics.asterix.feed.managed.adapter.IManagedFeedAdapter.OperationState;
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.runtime.operators.file.AdmTupleParser;
-import edu.uci.ics.hyracks.api.comm.IFrameWriter;
-import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
-
-public class ManagedAdmTupleParser extends AdmTupleParser implements IManagedTupleParser {
-
- private OperationState state;
- private List<OperationState> nextState;
- private final IManagedFeedAdapter adapter;
- private long tupleInterval;
-
- public static final String TUPLE_INTERVAL_KEY = "tuple-interval";
-
- public ManagedAdmTupleParser(IHyracksTaskContext ctx, ARecordType recType, IManagedFeedAdapter adapter) {
- super(ctx, recType);
- nextState = new ArrayList<OperationState>();
- this.adapter = adapter;
- this.tupleInterval = adapter.getAdapterProperty(TUPLE_INTERVAL_KEY) == null ? 0 : Long.parseLong(adapter
- .getAdapterProperty(TUPLE_INTERVAL_KEY));
- }
-
- public ManagedAdmTupleParser(IHyracksTaskContext ctx, ARecordType recType, long tupleInterval,
- IManagedFeedAdapter adapter) {
- super(ctx, recType);
- nextState = new ArrayList<OperationState>();
- this.adapter = adapter;
- this.tupleInterval = tupleInterval;
- }
-
- @Override
- public void parse(InputStream in, IFrameWriter writer) throws HyracksDataException {
- admLexer = new AdmLexer(in);
- appender.reset(frame, true);
- int tupleNum = 0;
- try {
- while (true) {
- tb.reset();
- if (!parseAdmInstance(recType, true, dos)) {
- break;
- }
- tb.addFieldEndOffset();
- processNextTuple(nextState.isEmpty() ? null : nextState.get(0), writer);
- Thread.currentThread().sleep(tupleInterval);
- tupleNum++;
- }
- if (appender.getTupleCount() > 0) {
- FrameUtils.flushFrame(frame, writer);
- }
- } catch (AsterixException ae) {
- throw new HyracksDataException(ae);
- } catch (IOException ioe) {
- throw new HyracksDataException(ioe);
- } catch (InterruptedException ie) {
- throw new HyracksDataException(ie);
- }
- }
-
- private void addTupleToFrame(IFrameWriter writer, boolean forceFlush) throws HyracksDataException {
- boolean success = appender.append(tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize());
- if (!success) {
- FrameUtils.flushFrame(frame, writer);
- appender.reset(frame, true);
- if (!appender.append(tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize())) {
- throw new IllegalStateException();
- }
- }
-
- if (forceFlush) {
- FrameUtils.flushFrame(frame, writer);
- }
-
- }
-
- private void processNextTuple(OperationState feedState, IFrameWriter writer) throws HyracksDataException {
- try {
- if (feedState != null) {
- switch (state) {
- case SUSPENDED:
- suspendOperation(writer);
- break;
- case STOPPED:
- stopOperation(writer);
- break;
- }
- } else {
- addTupleToFrame(writer, false);
- }
- } catch (HyracksDataException hde) {
- throw hde;
- } catch (Exception e) {
- throw new HyracksDataException(e);
- }
- }
-
- private void suspendOperation(IFrameWriter writer) throws HyracksDataException, Exception {
- nextState.remove(0);
- addTupleToFrame(writer, false);
- adapter.beforeSuspend();
- synchronized (this) {
- this.wait();
- adapter.beforeResume();
- }
- }
-
- private void stopOperation(IFrameWriter writer) throws HyracksDataException, Exception {
- nextState.remove(0);
- addTupleToFrame(writer, true);
- adapter.beforeStop();
- writer.close();
- }
-
- @Override
- public void suspend() throws Exception {
- nextState.add(OperationState.SUSPENDED);
- }
-
- @Override
- public void resume() throws Exception {
- synchronized (this) {
- this.notifyAll();
- }
- }
-
- @Override
- public void stop() throws Exception {
- nextState.add(OperationState.STOPPED);
- }
-
- @Override
- public void alter(Map<String, String> alterParams) throws Exception {
- if (alterParams.get(TUPLE_INTERVAL_KEY) != null) {
- tupleInterval = Long.parseLong(alterParams.get(TUPLE_INTERVAL_KEY));
- }
- }
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedDelimitedDataRecordParserFactory.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedDelimitedDataRecordParserFactory.java
deleted file mode 100644
index 37a7162..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedDelimitedDataRecordParserFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.external.data.parser;
-
-import edu.uci.ics.asterix.feed.managed.adapter.IManagedFeedAdapter;
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.runtime.operators.file.NtDelimitedDataTupleParserFactory;
-import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParserFactory;
-import edu.uci.ics.hyracks.dataflow.std.file.ITupleParser;
-
-public class ManagedDelimitedDataRecordParserFactory extends NtDelimitedDataTupleParserFactory {
-
- private final IManagedFeedAdapter adapter;
-
- public ManagedDelimitedDataRecordParserFactory(IValueParserFactory[] fieldParserFactories, char fieldDelimiter,
- ARecordType recType, IManagedFeedAdapter adapter) {
- super(recType, fieldParserFactories, fieldDelimiter);
- this.adapter = adapter;
- }
-
- @Override
- public ITupleParser createTupleParser(final IHyracksTaskContext ctx) {
- return new ManagedDelimitedDataTupleParser(ctx, recordType, adapter, valueParserFactories, fieldDelimiter);
- }
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedDelimitedDataStreamParser.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedDelimitedDataStreamParser.java
deleted file mode 100644
index 69921b0..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedDelimitedDataStreamParser.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.external.data.parser;
-
-import edu.uci.ics.asterix.feed.managed.adapter.IManagedFeedAdapter;
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
-import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParserFactory;
-
-public class ManagedDelimitedDataStreamParser extends DelimitedDataStreamParser implements IManagedDataParser {
-
- private IManagedFeedAdapter adapter;
-
- @Override
- public void initialize(ARecordType recordType, IHyracksTaskContext ctx) {
- int n = recordType.getFieldTypes().length;
- IValueParserFactory[] fieldParserFactories = new IValueParserFactory[n];
- for (int i = 0; i < n; i++) {
- ATypeTag tag = recordType.getFieldTypes()[i].getTypeTag();
- IValueParserFactory vpf = typeToValueParserFactMap.get(tag);
- if (vpf == null) {
- throw new NotImplementedException("No value parser factory for delimited fields of type " + tag);
- }
- fieldParserFactories[i] = vpf;
- }
- tupleParser = new ManagedDelimitedDataRecordParserFactory(fieldParserFactories, delimiter.charValue(),
- recordType, adapter).createTupleParser(ctx);
- }
-
- @Override
- public IManagedTupleParser getManagedTupleParser() {
- return (IManagedTupleParser) tupleParser;
- }
-
- @Override
- public void setAdapter(IManagedFeedAdapter adapter) {
- this.adapter = adapter;
- }
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedDelimitedDataTupleParser.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedDelimitedDataTupleParser.java
deleted file mode 100644
index 86a5301..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedDelimitedDataTupleParser.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.external.data.parser;
-
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import edu.uci.ics.asterix.builders.IARecordBuilder;
-import edu.uci.ics.asterix.builders.RecordBuilder;
-import edu.uci.ics.asterix.feed.managed.adapter.IManagedFeedAdapter;
-import edu.uci.ics.asterix.feed.managed.adapter.IManagedFeedAdapter.OperationState;
-import edu.uci.ics.asterix.om.base.AMutableString;
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.runtime.operators.file.DelimitedDataTupleParser;
-import edu.uci.ics.hyracks.api.comm.IFrameWriter;
-import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
-import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
-import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParser;
-import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParserFactory;
-
-public class ManagedDelimitedDataTupleParser extends DelimitedDataTupleParser implements IManagedTupleParser {
-
- private List<OperationState> nextState;
- private IManagedFeedAdapter adapter;
- private long tupleInterval;
-
- public static final String TUPLE_INTERVAL_KEY = "tuple-interval";
-
- public ManagedDelimitedDataTupleParser(IHyracksTaskContext ctx, ARecordType recType, IManagedFeedAdapter adapter,
- IValueParserFactory[] valueParserFactories, char fieldDelimter) {
- super(ctx, recType, valueParserFactories, fieldDelimter);
- this.adapter = adapter;
- nextState = new ArrayList<OperationState>();
- tupleInterval = adapter.getAdapterProperty(TUPLE_INTERVAL_KEY) == null ? 0 : Long.parseLong(adapter
- .getAdapterProperty(TUPLE_INTERVAL_KEY));
- }
-
- @Override
- public void parse(InputStream in, IFrameWriter writer) throws HyracksDataException {
- try {
- IValueParser[] valueParsers = new IValueParser[valueParserFactories.length];
- for (int i = 0; i < valueParserFactories.length; ++i) {
- valueParsers[i] = valueParserFactories[i].createValueParser();
- }
-
- appender.reset(frame, true);
- tb = new ArrayTupleBuilder(1);
- recDos = tb.getDataOutput();
-
- ArrayBackedValueStorage fieldValueBuffer = new ArrayBackedValueStorage();
- DataOutput fieldValueBufferOutput = fieldValueBuffer.getDataOutput();
- IARecordBuilder recBuilder = new RecordBuilder();
- recBuilder.reset(recType);
- recBuilder.init();
-
- int n = recType.getFieldNames().length;
- byte[] fieldTypeTags = new byte[n];
- for (int i = 0; i < n; i++) {
- ATypeTag tag = recType.getFieldTypes()[i].getTypeTag();
- fieldTypeTags[i] = tag.serialize();
- }
-
- int[] fldIds = new int[n];
- ArrayBackedValueStorage[] nameBuffers = new ArrayBackedValueStorage[n];
- AMutableString str = new AMutableString(null);
- for (int i = 0; i < n; i++) {
- String name = recType.getFieldNames()[i];
- fldIds[i] = recBuilder.getFieldId(name);
- if (fldIds[i] < 0) {
- if (!recType.isOpen()) {
- throw new HyracksDataException("Illegal field " + name + " in closed type " + recType);
- } else {
- nameBuffers[i] = new ArrayBackedValueStorage();
- fieldNameToBytes(name, str, nameBuffers[i]);
- }
- }
- }
-
- FieldCursor cursor = new FieldCursor(new InputStreamReader(in));
- while (cursor.nextRecord()) {
- tb.reset();
- recBuilder.reset(recType);
- recBuilder.init();
-
- for (int i = 0; i < valueParsers.length; ++i) {
- if (!cursor.nextField()) {
- break;
- }
- fieldValueBuffer.reset();
- fieldValueBufferOutput.writeByte(fieldTypeTags[i]);
- valueParsers[i].parse(cursor.getBuffer(), cursor.getfStart(),
- cursor.getfEnd() - cursor.getfStart(), fieldValueBufferOutput);
- if (fldIds[i] < 0) {
- recBuilder.addField(nameBuffers[i], fieldValueBuffer);
- } else {
- recBuilder.addField(fldIds[i], fieldValueBuffer);
- }
- }
- recBuilder.write(recDos, true);
- processNextTuple(nextState.isEmpty() ? null : nextState.get(0), writer);
- Thread.currentThread().sleep(tupleInterval);
- }
- if (appender.getTupleCount() > 0) {
- FrameUtils.flushFrame(frame, writer);
- }
- } catch (IOException e) {
- throw new HyracksDataException(e);
- } catch (InterruptedException ie) {
- throw new HyracksDataException(ie);
- }
- }
-
- private void addTupleToFrame(IFrameWriter writer, boolean forceFlush) throws HyracksDataException {
- tb.addFieldEndOffset();
- boolean success = appender.append(tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize());
- if (!success) {
- FrameUtils.flushFrame(frame, writer);
- appender.reset(frame, true);
- if (!appender.append(tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize())) {
- throw new IllegalStateException();
- }
- }
-
- if (forceFlush) {
- FrameUtils.flushFrame(frame, writer);
- }
-
- }
-
- private void processNextTuple(OperationState feedState, IFrameWriter writer) throws HyracksDataException {
- try {
- if (feedState != null) {
- switch (feedState) {
- case SUSPENDED:
- suspendOperation(writer);
- break;
- case STOPPED:
- stopOperation(writer);
- break;
- }
- } else {
- addTupleToFrame(writer, false);
- }
- } catch (HyracksDataException hde) {
- throw hde;
- } catch (Exception e) {
- throw new HyracksDataException(e);
- }
- }
-
- private void suspendOperation(IFrameWriter writer) throws HyracksDataException, Exception {
- nextState.remove(0);
- addTupleToFrame(writer, false);
- adapter.beforeSuspend();
- synchronized (this) {
- this.wait();
- adapter.beforeResume();
- }
- }
-
- private void stopOperation(IFrameWriter writer) throws HyracksDataException, Exception {
- nextState.remove(0);
- addTupleToFrame(writer, false);
- adapter.beforeStop();
- adapter.stop();
- }
-
- @Override
- public void suspend() throws Exception {
- nextState.add(OperationState.SUSPENDED);
- }
-
- @Override
- public void resume() throws Exception {
- synchronized (this) {
- this.notifyAll();
- }
- }
-
- @Override
- public void stop() throws Exception {
- nextState.add(OperationState.STOPPED);
- }
-
- @Override
- public void alter(Map<String, String> alterParams) throws Exception {
- if (alterParams.get(TUPLE_INTERVAL_KEY) != null) {
- tupleInterval = Long.parseLong(alterParams.get(TUPLE_INTERVAL_KEY));
- }
- }
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/AbstractDatasourceAdapter.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/AbstractDatasourceAdapter.java
index b22132d..440ee8c 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/AbstractDatasourceAdapter.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/AbstractDatasourceAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2009-2011 by The Regents of the University of California
+ * Copyright 2009-2012 by The Regents of the University of California
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may obtain a copy of the License from
@@ -17,7 +17,6 @@
import java.util.HashMap;
import java.util.Map;
-import edu.uci.ics.asterix.external.data.adapter.api.IDatasourceAdapter;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
@@ -35,68 +34,58 @@
*/
public abstract class AbstractDatasourceAdapter implements IDatasourceAdapter {
- private static final long serialVersionUID = -3510610289692452466L;
+ private static final long serialVersionUID = 1L;
protected Map<String, String> configuration;
-
protected transient AlgebricksPartitionConstraint partitionConstraint;
-
protected IAType atype;
-
protected IHyracksTaskContext ctx;
-
- protected static final HashMap<ATypeTag, IValueParserFactory> typeToValueParserFactMap = new HashMap<ATypeTag, IValueParserFactory>();
-
- protected static final HashMap<String, String> formatToParserMap = new HashMap<String, String>();
-
- protected static final HashMap<String, String> formatToManagedParserMap = new HashMap<String, String>();
-
- protected AdapterDataFlowType dataFlowType;
-
protected AdapterType adapterType;
+ protected static final HashMap<ATypeTag, IValueParserFactory> typeToValueParserFactMap = new HashMap<ATypeTag, IValueParserFactory>();
static {
typeToValueParserFactMap.put(ATypeTag.INT32, IntegerParserFactory.INSTANCE);
typeToValueParserFactMap.put(ATypeTag.FLOAT, FloatParserFactory.INSTANCE);
typeToValueParserFactMap.put(ATypeTag.DOUBLE, DoubleParserFactory.INSTANCE);
typeToValueParserFactMap.put(ATypeTag.INT64, LongParserFactory.INSTANCE);
typeToValueParserFactMap.put(ATypeTag.STRING, UTF8StringParserFactory.INSTANCE);
-
- formatToParserMap.put("delimited-text", "edu.uci.ics.asterix.external.data.parser.DelimitedDataStreamParser");
- formatToParserMap.put("adm", "edu.uci.ics.asterix.external.data.parser.ADMStreamParser");
-
- formatToManagedParserMap.put("delimited-text",
- "edu.uci.ics.asterix.external.data.parser.ManagedDelimitedDataStreamParser");
- formatToManagedParserMap.put("adm", "edu.uci.ics.asterix.external.data.parser.ManagedAdmStreamParser");
-
}
- public static final String KEY_FORMAT = "format";
- public static final String KEY_PARSER = "parser";
+ protected static final Map<String, String> formatToParserFactoryMap = initializeFormatParserFactoryMap();
+ public static final String KEY_FORMAT = "format";
+ public static final String KEY_PARSER_FACTORY = "parser";
public static final String FORMAT_DELIMITED_TEXT = "delimited-text";
public static final String FORMAT_ADM = "adm";
- abstract public void initialize(IHyracksTaskContext ctx) throws Exception;
-
- abstract public void configure(Map<String, String> arguments, IAType atype) throws Exception;
-
- abstract public AdapterDataFlowType getAdapterDataFlowType();
-
- abstract public AdapterType getAdapterType();
-
- public AlgebricksPartitionConstraint getPartitionConstraint() {
- return partitionConstraint;
+ private static Map<String, String> initializeFormatParserFactoryMap() {
+ Map<String, String> map = new HashMap<String, String>();
+ map.put(FORMAT_DELIMITED_TEXT, "edu.uci.ics.asterix.runtime.operators.file.NtDelimitedDataTupleParserFactory");
+ map.put(FORMAT_ADM, "edu.uci.ics.asterix.runtime.operators.file.AdmSchemafullRecordParserFactory");
+ return map;
}
- public void setAdapterProperty(String property, String value) {
- configuration.put(property, value);
- }
+ /**
+ * Get the partition constraint chosen by the adapter.
+ * An adapter may have preferences as to where it needs to be instantiated and used.
+ */
+ public abstract AlgebricksPartitionConstraint getPartitionConstraint() throws Exception;
+ /**
+ * Get the configured value from the adapter configuration parameters, corresponding to the an attribute.
+ *
+ * @param attribute
+ * The attribute whose value needs to be obtained.
+ */
public String getAdapterProperty(String attribute) {
return configuration.get(attribute);
}
+ /**
+ * Get the adapter configuration parameters.
+ *
+ * @return A Map<String,String> instance representing the adapter configuration.
+ */
public Map<String, String> getConfiguration() {
return configuration;
}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/AdapterIdentifier.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/AdapterIdentifier.java
new file mode 100644
index 0000000..ac36733
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/AdapterIdentifier.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.dataset.adapter;
+
+import java.io.Serializable;
+
+/**
+ * A unique identifier for a datasource adapter.
+ */
+public class AdapterIdentifier implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private final String namespace;
+ private final String adapterName;
+
+ public AdapterIdentifier(String namespace, String adapterName) {
+ this.namespace = namespace;
+ this.adapterName = adapterName;
+ }
+
+ public String getNamespace() {
+ return namespace;
+ }
+
+ public String getAdapterName() {
+ return adapterName;
+ }
+
+ @Override
+ public int hashCode() {
+ return (namespace + "@" + adapterName).hashCode();
+
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof AdapterIdentifier)) {
+ return false;
+ }
+ return namespace.equals(((AdapterIdentifier) o).getNamespace())
+ && namespace.equals(((AdapterIdentifier) o).getNamespace());
+ }
+}
\ No newline at end of file
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/CNNFeedAdapter.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/CNNFeedAdapter.java
index 4d969e4..3898f7e 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/CNNFeedAdapter.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/CNNFeedAdapter.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package edu.uci.ics.asterix.external.dataset.adapter;
import java.util.ArrayList;
@@ -5,26 +19,20 @@
import java.util.List;
import java.util.Map;
-import edu.uci.ics.asterix.external.data.adapter.api.IDatasourceAdapter;
-import edu.uci.ics.asterix.external.data.parser.IDataParser;
-import edu.uci.ics.asterix.external.data.parser.IDataStreamParser;
-import edu.uci.ics.asterix.external.data.parser.ManagedDelimitedDataStreamParser;
-import edu.uci.ics.asterix.feed.intake.FeedStream;
-import edu.uci.ics.asterix.feed.intake.RSSFeedClient;
-import edu.uci.ics.asterix.feed.managed.adapter.IMutableFeedAdapter;
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.feed.managed.adapter.IManagedFeedAdapter;
-public class CNNFeedAdapter extends RSSFeedAdapter implements IDatasourceAdapter, IMutableFeedAdapter {
+/**
+ * An Adapter that provides the functionality of fetching news feed from CNN service
+ * The Adapter provides news feed as ADM records.
+ */
+public class CNNFeedAdapter extends RSSFeedAdapter implements IDatasourceAdapter, IManagedFeedAdapter {
+ private static final long serialVersionUID = 2523303758114582251L;
private List<String> feedURLs = new ArrayList<String>();
- private String id_prefix = "";
+ private static Map<String, String> topicFeeds = new HashMap<String, String>();
public static final String KEY_RSS_URL = "topic";
public static final String KEY_INTERVAL = "interval";
-
- private static Map<String, String> topicFeeds = new HashMap<String, String>();
-
public static final String TOP_STORIES = "topstories";
public static final String WORLD = "world";
public static final String US = "us";
@@ -62,20 +70,8 @@
}
@Override
- public IDataParser getDataParser(int partition) throws Exception {
- IDataParser dataParser = new ManagedDelimitedDataStreamParser();
- dataParser.configure(configuration);
- dataParser.initialize((ARecordType) atype, ctx);
- RSSFeedClient feedClient = new RSSFeedClient(this, feedURLs.get(partition), id_prefix);
- FeedStream feedStream = new FeedStream(feedClient, ctx);
- ((IDataStreamParser) dataParser).setInputStream(feedStream);
- return dataParser;
- }
-
- @Override
- public void configure(Map<String, String> arguments, IAType atype) throws Exception {
+ public void configure(Map<String, String> arguments) throws Exception {
configuration = arguments;
- this.atype = atype;
String rssURLProperty = configuration.get(KEY_RSS_URL);
if (rssURLProperty == null) {
throw new IllegalArgumentException("no rss url provided");
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/FileSystemBasedAdapter.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/FileSystemBasedAdapter.java
new file mode 100644
index 0000000..e46705d
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/FileSystemBasedAdapter.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.dataset.adapter;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.runtime.operators.file.AdmSchemafullRecordParserFactory;
+import edu.uci.ics.asterix.runtime.operators.file.NtDelimitedDataTupleParserFactory;
+import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
+import edu.uci.ics.hyracks.api.comm.IFrameWriter;
+import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
+import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParserFactory;
+import edu.uci.ics.hyracks.dataflow.std.file.ITupleParser;
+import edu.uci.ics.hyracks.dataflow.std.file.ITupleParserFactory;
+
+public abstract class FileSystemBasedAdapter extends AbstractDatasourceAdapter {
+
+ private static final long serialVersionUID = 1L;
+
+ protected ITupleParserFactory parserFactory;
+ protected ITupleParser parser;
+
+ public static final String KEY_DELIMITER = "delimiter";
+ public static final String KEY_PATH = "path";
+
+ public abstract InputStream getInputStream(int partition) throws IOException;
+
+ public FileSystemBasedAdapter(IAType atype) {
+ this.atype = atype;
+ }
+
+ @Override
+ public void start(int partition, IFrameWriter writer) throws Exception {
+ InputStream in = getInputStream(partition);
+ parser = getTupleParser();
+ parser.parse(in, writer);
+ }
+
+ @Override
+ public abstract void initialize(IHyracksTaskContext ctx) throws Exception;
+
+ @Override
+ public abstract void configure(Map<String, String> arguments) throws Exception;
+
+ @Override
+ public abstract AdapterType getAdapterType();
+
+ @Override
+ public abstract AlgebricksPartitionConstraint getPartitionConstraint() throws Exception;
+
+ protected ITupleParser getTupleParser() throws Exception {
+ return parserFactory.createTupleParser(ctx);
+ }
+
+ protected void configureFormat() throws Exception {
+ String parserFactoryClassname = configuration.get(KEY_PARSER_FACTORY);
+ if (parserFactoryClassname == null) {
+ String specifiedFormat = configuration.get(KEY_FORMAT);
+ if (specifiedFormat == null) {
+ throw new IllegalArgumentException(" Unspecified data format");
+ } else if (FORMAT_DELIMITED_TEXT.equalsIgnoreCase(specifiedFormat)) {
+ parserFactory = getDelimitedDataTupleParserFactory((ARecordType) atype);
+ } else if (FORMAT_ADM.equalsIgnoreCase(configuration.get(KEY_FORMAT))) {
+ parserFactory = getADMDataTupleParserFactory((ARecordType) atype);
+ } else {
+ throw new IllegalArgumentException(" format " + configuration.get(KEY_FORMAT) + " not supported");
+ }
+ } else {
+ parserFactory = (ITupleParserFactory) Class.forName(parserFactoryClassname).newInstance();
+ }
+
+ }
+
+ protected ITupleParserFactory getDelimitedDataTupleParserFactory(ARecordType recordType) throws AsterixException {
+ int n = recordType.getFieldTypes().length;
+ IValueParserFactory[] fieldParserFactories = new IValueParserFactory[n];
+ for (int i = 0; i < n; i++) {
+ ATypeTag tag = recordType.getFieldTypes()[i].getTypeTag();
+ IValueParserFactory vpf = typeToValueParserFactMap.get(tag);
+ if (vpf == null) {
+ throw new NotImplementedException("No value parser factory for delimited fields of type " + tag);
+ }
+ fieldParserFactories[i] = vpf;
+ }
+ String delimiterValue = (String) configuration.get(KEY_DELIMITER);
+ if (delimiterValue != null && delimiterValue.length() > 1) {
+ throw new AsterixException("improper delimiter");
+ }
+
+ Character delimiter = delimiterValue.charAt(0);
+ return new NtDelimitedDataTupleParserFactory(recordType, fieldParserFactories, delimiter);
+ }
+
+ protected ITupleParserFactory getADMDataTupleParserFactory(ARecordType recordType) throws AsterixException {
+ try {
+ return new AdmSchemafullRecordParserFactory(recordType);
+ } catch (Exception e) {
+ throw new AsterixException(e);
+ }
+
+ }
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/HDFSAdapter.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/HDFSAdapter.java
index f0e9ea4..1e05b2f 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/HDFSAdapter.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/HDFSAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2009-2011 by The Regents of the University of California
+ * Copyright 2009-2012 by The Regents of the University of California
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may obtain a copy of the License from
@@ -18,7 +18,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.UnknownHostException;
-import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -28,8 +27,6 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.Counters.Counter;
import org.apache.hadoop.mapred.InputSplit;
@@ -39,165 +36,137 @@
import org.apache.hadoop.mapred.SequenceFileInputFormat;
import org.apache.hadoop.mapred.TextInputFormat;
-import edu.uci.ics.asterix.external.data.adapter.api.IDatasourceReadAdapter;
-import edu.uci.ics.asterix.external.data.parser.IDataParser;
-import edu.uci.ics.asterix.external.data.parser.IDataStreamParser;
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.runtime.operators.file.AdmSchemafullRecordParserFactory;
-import edu.uci.ics.asterix.runtime.operators.file.NtDelimitedDataTupleParserFactory;
-import edu.uci.ics.asterix.runtime.util.AsterixRuntimeUtil;
+import edu.uci.ics.asterix.om.util.AsterixRuntimeUtil;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksAbsolutePartitionConstraint;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksCountPartitionConstraint;
+import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParserFactory;
import edu.uci.ics.hyracks.dataflow.hadoop.util.InputSplitsProxy;
-import edu.uci.ics.hyracks.dataflow.std.file.ITupleParserFactory;
-public class HDFSAdapter extends AbstractDatasourceAdapter implements IDatasourceReadAdapter {
+/**
+ * Provides functionality for fetching external data stored in an HDFS instance.
+ */
+@SuppressWarnings({ "deprecation", "rawtypes" })
+public class HDFSAdapter extends FileSystemBasedAdapter {
+ private static final long serialVersionUID = 1L;
private static final Logger LOGGER = Logger.getLogger(HDFSAdapter.class.getName());
- private String inputFormatClassName;
- private Object[] inputSplits;
- private transient JobConf conf;
- private IHyracksTaskContext ctx;
- private boolean isDelimited;
- private Character delimiter;
- private InputSplitsProxy inputSplitsProxy;
- private String parserClass;
- private static final Map<String, String> formatClassNames = new HashMap<String, String>();
-
public static final String KEY_HDFS_URL = "hdfs";
- public static final String KEY_HDFS_PATH = "path";
public static final String KEY_INPUT_FORMAT = "input-format";
-
public static final String INPUT_FORMAT_TEXT = "text-input-format";
public static final String INPUT_FORMAT_SEQUENCE = "sequence-input-format";
- static {
+ private Object[] inputSplits;
+ private transient JobConf conf;
+ private InputSplitsProxy inputSplitsProxy;
+ private static final Map<String, String> formatClassNames = initInputFormatMap();
+
+ private static Map<String, String> initInputFormatMap() {
+ Map<String, String> formatClassNames = new HashMap<String, String>();
formatClassNames.put(INPUT_FORMAT_TEXT, "org.apache.hadoop.mapred.TextInputFormat");
formatClassNames.put(INPUT_FORMAT_SEQUENCE, "org.apache.hadoop.mapred.SequenceFileInputFormat");
+ return formatClassNames;
+ }
+
+ public HDFSAdapter(IAType atype) {
+ super(atype);
}
@Override
- public void configure(Map<String, String> arguments, IAType atype) throws Exception {
+ public void configure(Map<String, String> arguments) throws Exception {
configuration = arguments;
configureFormat();
configureJobConf();
- configurePartitionConstraint();
- this.atype = atype;
+ configureSplits();
}
- private void configureFormat() throws Exception {
- String format = configuration.get(KEY_INPUT_FORMAT);
- inputFormatClassName = formatClassNames.get(format);
- if (inputFormatClassName == null) {
- throw new Exception("format " + format + " not supported");
+ private void configureSplits() throws IOException {
+ if (inputSplitsProxy == null) {
+ inputSplits = conf.getInputFormat().getSplits(conf, 0);
}
-
- parserClass = configuration.get(KEY_PARSER);
- if (parserClass == null) {
- if (FORMAT_DELIMITED_TEXT.equalsIgnoreCase(configuration.get(KEY_FORMAT))) {
- parserClass = formatToParserMap.get(FORMAT_DELIMITED_TEXT);
- } else if (FORMAT_ADM.equalsIgnoreCase(configuration.get(KEY_FORMAT))) {
- parserClass = formatToParserMap.get(FORMAT_ADM);
- }
- }
-
- }
-
- private IDataParser createDataParser() throws Exception {
- IDataParser dataParser = (IDataParser) Class.forName(parserClass).newInstance();
- dataParser.configure(configuration);
- return dataParser;
+ inputSplitsProxy = new InputSplitsProxy(conf, inputSplits);
}
private void configurePartitionConstraint() throws Exception {
- AlgebricksAbsolutePartitionConstraint absPartitionConstraint;
List<String> locations = new ArrayList<String>();
Random random = new Random();
- boolean couldConfigureLocationConstraints = true;
- if (inputSplitsProxy == null) {
- InputSplit[] inputSplits = conf.getInputFormat().getSplits(conf, 0);
- try {
- for (InputSplit inputSplit : inputSplits) {
- String[] dataNodeLocations = inputSplit.getLocations();
- for (String datanodeLocation : dataNodeLocations) {
- Set<String> nodeControllersAtLocation = AsterixRuntimeUtil
- .getNodeControllersOnHostName(datanodeLocation);
- if (nodeControllersAtLocation == null || nodeControllersAtLocation.size() == 0) {
- if (LOGGER.isLoggable(Level.INFO)) {
- LOGGER.log(Level.INFO, "No node controller found at " + datanodeLocation
- + " will look at replica location");
- }
- couldConfigureLocationConstraints = false;
- } else {
- int locationIndex = random.nextInt(nodeControllersAtLocation.size());
- String chosenLocation = (String) nodeControllersAtLocation.toArray()[locationIndex];
- locations.add(chosenLocation);
- if (LOGGER.isLoggable(Level.INFO)) {
- LOGGER.log(Level.INFO, "split : " + inputSplit + " to be processed by :"
- + chosenLocation);
- }
- couldConfigureLocationConstraints = true;
- break;
+ boolean couldConfigureLocationConstraints = false;
+ try {
+ Map<String, Set<String>> nodeControllers = AsterixRuntimeUtil.getNodeControllerMap();
+ for (Object inputSplit : inputSplits) {
+ String[] dataNodeLocations = ((InputSplit) inputSplit).getLocations();
+ if (dataNodeLocations == null || dataNodeLocations.length == 0) {
+ throw new IllegalArgumentException("No datanode locations found: check hdfs path");
+ }
+
+ // loop over all replicas until a split location coincides
+ // with an asterix datanode location
+ for (String datanodeLocation : dataNodeLocations) {
+ Set<String> nodeControllersAtLocation = null;
+ try {
+ nodeControllersAtLocation = nodeControllers.get(AsterixRuntimeUtil
+ .getIPAddress(datanodeLocation));
+ } catch (UnknownHostException uhe) {
+ if (LOGGER.isLoggable(Level.WARNING)) {
+ LOGGER.log(Level.WARNING, "Unknown host :" + datanodeLocation);
}
+ continue;
}
- if(!couldConfigureLocationConstraints){
- if (LOGGER.isLoggable(Level.INFO)) {
- LOGGER.log(Level.INFO, "No local node controller found to process split : " + inputSplit + " will use count constraint!");
+ if (nodeControllersAtLocation == null || nodeControllersAtLocation.size() == 0) {
+ if (LOGGER.isLoggable(Level.WARNING)) {
+ LOGGER.log(Level.WARNING, "No node controller found at " + datanodeLocation
+ + " will look at replica location");
}
+ couldConfigureLocationConstraints = false;
+ } else {
+ int locationIndex = random.nextInt(nodeControllersAtLocation.size());
+ String chosenLocation = (String) nodeControllersAtLocation.toArray()[locationIndex];
+ locations.add(chosenLocation);
+ if (LOGGER.isLoggable(Level.INFO)) {
+ LOGGER.log(Level.INFO, "split : " + inputSplit + " to be processed by :" + chosenLocation);
+ }
+ couldConfigureLocationConstraints = true;
break;
}
}
- if (couldConfigureLocationConstraints) {
- partitionConstraint = new AlgebricksAbsolutePartitionConstraint(locations.toArray(new String[] {}));
- } else {
- partitionConstraint = new AlgebricksCountPartitionConstraint(inputSplits.length);
- }
- } catch (UnknownHostException e) {
- partitionConstraint = new AlgebricksCountPartitionConstraint(inputSplits.length);
- }
- inputSplitsProxy = new InputSplitsProxy(conf, inputSplits);
- }
- }
- private ITupleParserFactory createTupleParserFactory(ARecordType recType) {
- if (isDelimited) {
- int n = recType.getFieldTypes().length;
- IValueParserFactory[] fieldParserFactories = new IValueParserFactory[n];
- for (int i = 0; i < n; i++) {
- ATypeTag tag = recType.getFieldTypes()[i].getTypeTag();
- IValueParserFactory vpf = typeToValueParserFactMap.get(tag);
- if (vpf == null) {
- throw new NotImplementedException("No value parser factory for delimited fields of type " + tag);
+ /* none of the replica locations coincides with an Asterix
+ node controller location.
+ */
+ if (!couldConfigureLocationConstraints) {
+ List<String> allNodeControllers = AsterixRuntimeUtil.getAllNodeControllers();
+ int locationIndex = random.nextInt(allNodeControllers.size());
+ String chosenLocation = allNodeControllers.get(locationIndex);
+ locations.add(chosenLocation);
+ if (LOGGER.isLoggable(Level.SEVERE)) {
+ LOGGER.log(Level.SEVERE, "No local node controller found to process split : " + inputSplit
+ + " will be processed by a remote node controller:" + chosenLocation);
+ }
}
- fieldParserFactories[i] = vpf;
}
- return new NtDelimitedDataTupleParserFactory(recType, fieldParserFactories, delimiter);
- } else {
- return new AdmSchemafullRecordParserFactory(recType);
+ partitionConstraint = new AlgebricksAbsolutePartitionConstraint(locations.toArray(new String[] {}));
+ } catch (Exception e) {
+ if (LOGGER.isLoggable(Level.SEVERE)) {
+ LOGGER.log(Level.SEVERE, "Encountered exception :" + e + " using count constraints");
+ }
+ partitionConstraint = new AlgebricksCountPartitionConstraint(inputSplits.length);
}
}
private JobConf configureJobConf() throws Exception {
conf = new JobConf();
- conf.set("fs.default.name", configuration.get(KEY_HDFS_URL));
+ conf.set("fs.default.name", configuration.get(KEY_HDFS_URL).trim());
conf.set("fs.hdfs.impl", "org.apache.hadoop.hdfs.DistributedFileSystem");
conf.setClassLoader(HDFSAdapter.class.getClassLoader());
- conf.set("mapred.input.dir", configuration.get(KEY_HDFS_PATH));
- conf.set("mapred.input.format.class", formatClassNames.get(configuration.get(KEY_INPUT_FORMAT)));
+ conf.set("mapred.input.dir", configuration.get(KEY_PATH).trim());
+ conf.set("mapred.input.format.class", formatClassNames.get(configuration.get(KEY_INPUT_FORMAT).trim()));
return conf;
}
- public AdapterDataFlowType getAdapterDataFlowType() {
- return AdapterDataFlowType.PULL;
- }
-
public AdapterType getAdapterType() {
return AdapterType.READ_WRITE;
}
@@ -246,93 +215,98 @@
return reporter;
}
+ @SuppressWarnings("unchecked")
@Override
- public IDataParser getDataParser(int partition) throws Exception {
- Path path = new Path(inputSplits[partition].toString());
- FileSystem fs = FileSystem.get(conf);
- InputStream inputStream;
- if (conf.getInputFormat() instanceof SequenceFileInputFormat) {
- SequenceFileInputFormat format = (SequenceFileInputFormat) conf.getInputFormat();
- RecordReader reader = format.getRecordReader((org.apache.hadoop.mapred.FileSplit) inputSplits[partition],
- conf, getReporter());
- inputStream = new HDFSStream(reader, ctx);
- } else {
- try {
- TextInputFormat format = (TextInputFormat) conf.getInputFormat();
+ public InputStream getInputStream(int partition) throws IOException {
+ try {
+ InputStream inputStream;
+ if (conf.getInputFormat() instanceof SequenceFileInputFormat) {
+ SequenceFileInputFormat format = (SequenceFileInputFormat) conf.getInputFormat();
RecordReader reader = format.getRecordReader(
(org.apache.hadoop.mapred.FileSplit) inputSplits[partition], conf, getReporter());
inputStream = new HDFSStream(reader, ctx);
- } catch (FileNotFoundException e) {
- throw new HyracksDataException(e);
+ } else {
+ try {
+ TextInputFormat format = (TextInputFormat) conf.getInputFormat();
+ RecordReader reader = format.getRecordReader(
+ (org.apache.hadoop.mapred.FileSplit) inputSplits[partition], conf, getReporter());
+ inputStream = new HDFSStream(reader, ctx);
+ } catch (FileNotFoundException e) {
+ throw new HyracksDataException(e);
+ }
}
+ return inputStream;
+ } catch (Exception e) {
+ throw new IOException(e);
}
- IDataParser dataParser = createDataParser();
- if (dataParser instanceof IDataStreamParser) {
- ((IDataStreamParser) dataParser).setInputStream(inputStream);
- } else {
- throw new IllegalArgumentException(" parser not compatible");
+ }
+
+ @Override
+ public AlgebricksPartitionConstraint getPartitionConstraint() throws Exception {
+ if (partitionConstraint == null) {
+ configurePartitionConstraint();
}
- dataParser.configure(configuration);
- dataParser.initialize((ARecordType) atype, ctx);
- return dataParser;
+ return partitionConstraint;
}
}
class HDFSStream extends InputStream {
- private ByteBuffer buffer;
- private int capacity;
- private RecordReader reader;
- private boolean readNext = true;
+ private RecordReader<Object, Text> reader;
private final Object key;
private final Text value;
+ private boolean hasMore = false;
+ private static final int EOL = "\n".getBytes()[0];
+ private Text pendingValue = null;
- public HDFSStream(RecordReader reader, IHyracksTaskContext ctx) throws Exception {
- capacity = ctx.getFrameSize();
- buffer = ByteBuffer.allocate(capacity);
+ public HDFSStream(RecordReader<Object, Text> reader, IHyracksTaskContext ctx) throws Exception {
this.reader = reader;
key = reader.createKey();
try {
value = (Text) reader.createValue();
} catch (ClassCastException cce) {
- throw new Exception("context is not of type org.apache.hadoop.io.Text"
+ throw new Exception("value is not of type org.apache.hadoop.io.Text"
+ " type not supported in sequence file format", cce);
}
- initialize();
- }
-
- private void initialize() throws Exception {
- boolean hasMore = reader.next(key, value);
- if (!hasMore) {
- buffer.limit(0);
- } else {
- buffer.position(0);
- buffer.limit(capacity);
- buffer.put(value.getBytes());
- buffer.put("\n".getBytes());
- buffer.flip();
- }
}
@Override
- public int read() throws IOException {
- if (!buffer.hasRemaining()) {
- boolean hasMore = reader.next(key, value);
- if (!hasMore) {
- return -1;
- }
- buffer.position(0);
- buffer.limit(capacity);
- buffer.put(value.getBytes());
- buffer.put("\n".getBytes());
- buffer.flip();
- return buffer.get();
- } else {
- return buffer.get();
+ public int read(byte[] buffer, int offset, int len) throws IOException {
+ int numBytes = 0;
+ if (pendingValue != null) {
+ System.arraycopy(pendingValue.getBytes(), 0, buffer, offset + numBytes, pendingValue.getLength());
+ buffer[offset + numBytes + pendingValue.getLength()] = (byte) EOL;
+ numBytes += pendingValue.getLength() + 1;
+ pendingValue = null;
}
+ while (numBytes < len) {
+ hasMore = reader.next(key, value);
+ if (!hasMore) {
+ return (numBytes == 0) ? -1 : numBytes;
+ }
+ int sizeOfNextTuple = value.getLength() + 1;
+ if (numBytes + sizeOfNextTuple > len) {
+ // cannot add tuple to current buffer
+ // but the reader has moved pass the fetched tuple
+ // we need to store this for a subsequent read call.
+ // and return this then.
+ pendingValue = value;
+ break;
+ } else {
+ System.arraycopy(value.getBytes(), 0, buffer, offset + numBytes, value.getLength());
+ buffer[offset + numBytes + value.getLength()] = (byte) EOL;
+ numBytes += sizeOfNextTuple;
+ }
+ }
+ return numBytes;
+ }
+
+ @Override
+ public int read() throws IOException {
+ throw new NotImplementedException("Use read(byte[], int, int");
}
}
\ No newline at end of file
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/HiveAdapter.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/HiveAdapter.java
index 44dab4c..3731eba 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/HiveAdapter.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/HiveAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2009-2011 by The Regents of the University of California
+ * Copyright 2009-2012 by The Regents of the University of California
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may obtain a copy of the License from
@@ -16,79 +16,80 @@
import java.util.Map;
-import edu.uci.ics.asterix.external.data.adapter.api.IDatasourceReadAdapter;
-import edu.uci.ics.asterix.external.data.parser.IDataParser;
import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
import edu.uci.ics.hyracks.api.comm.IFrameWriter;
import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-public class HiveAdapter extends AbstractDatasourceAdapter implements
- IDatasourceReadAdapter {
+/**
+ * Provides the functionality of fetching data in form of ADM records from a Hive dataset.
+ */
+public class HiveAdapter extends AbstractDatasourceAdapter {
- public static final String HIVE_DATABASE = "database";
- public static final String HIVE_TABLE = "table";
- public static final String HIVE_HOME = "hive-home";
- public static final String HIVE_METASTORE_URI = "metastore-uri";
- public static final String HIVE_WAREHOUSE_DIR = "warehouse-dir";
- public static final String HIVE_METASTORE_RAWSTORE_IMPL = "rawstore-impl";
+ private static final long serialVersionUID = 1L;
- private HDFSAdapter hdfsAdapter;
+ public static final String HIVE_DATABASE = "database";
+ public static final String HIVE_TABLE = "table";
+ public static final String HIVE_HOME = "hive-home";
+ public static final String HIVE_METASTORE_URI = "metastore-uri";
+ public static final String HIVE_WAREHOUSE_DIR = "warehouse-dir";
+ public static final String HIVE_METASTORE_RAWSTORE_IMPL = "rawstore-impl";
- @Override
- public AdapterType getAdapterType() {
- return AdapterType.READ;
- }
+ private HDFSAdapter hdfsAdapter;
- @Override
- public AdapterDataFlowType getAdapterDataFlowType() {
- return AdapterDataFlowType.PULL;
- }
-
- @Override
- public void configure(Map<String, String> arguments, IAType atype)
- throws Exception {
- configuration = arguments;
- this.atype = atype;
- configureHadoopAdapter();
- }
-
- private void configureHadoopAdapter() throws Exception {
- String database = configuration.get(HIVE_DATABASE);
- String tablePath = null;
- if (database == null) {
- tablePath = configuration.get(HIVE_WAREHOUSE_DIR) + "/"
- + configuration.get(HIVE_TABLE);
- } else {
- tablePath = configuration.get(HIVE_WAREHOUSE_DIR) + "/" + tablePath
- + ".db" + "/" + configuration.get(HIVE_TABLE);
- }
- configuration.put(HDFSAdapter.KEY_HDFS_PATH, tablePath);
- if (!configuration.get(KEY_FORMAT).equals(FORMAT_DELIMITED_TEXT)) {
- throw new IllegalArgumentException("format"
- + configuration.get(KEY_FORMAT) + " is not supported");
- }
-
- if (!(configuration.get(HDFSAdapter.KEY_INPUT_FORMAT).equals(
- HDFSAdapter.INPUT_FORMAT_TEXT) || configuration.get(
- HDFSAdapter.KEY_INPUT_FORMAT).equals(
- HDFSAdapter.INPUT_FORMAT_SEQUENCE))) {
- throw new IllegalArgumentException("file input format"
- + configuration.get(HDFSAdapter.KEY_INPUT_FORMAT)
- + " is not supported");
- }
-
- hdfsAdapter = new HDFSAdapter();
- hdfsAdapter.configure(configuration, atype);
- }
-
- @Override
- public void initialize(IHyracksTaskContext ctx) throws Exception {
- hdfsAdapter.initialize(ctx);
- }
+ public HiveAdapter(IAType atype) {
+ this.hdfsAdapter = new HDFSAdapter(atype);
+ this.atype = atype;
+ }
@Override
- public IDataParser getDataParser(int partition) throws Exception {
- return hdfsAdapter.getDataParser(partition);
+ public AdapterType getAdapterType() {
+ return AdapterType.READ;
+ }
+
+ @Override
+ public void configure(Map<String, String> arguments) throws Exception {
+ configuration = arguments;
+ configureHadoopAdapter();
+ }
+
+ private void configureHadoopAdapter() throws Exception {
+ String database = configuration.get(HIVE_DATABASE);
+ String tablePath = null;
+ if (database == null) {
+ tablePath = configuration.get(HIVE_WAREHOUSE_DIR) + "/" + configuration.get(HIVE_TABLE);
+ } else {
+ tablePath = configuration.get(HIVE_WAREHOUSE_DIR) + "/" + tablePath + ".db" + "/"
+ + configuration.get(HIVE_TABLE);
+ }
+ configuration.put(HDFSAdapter.KEY_PATH, tablePath);
+ if (!configuration.get(KEY_FORMAT).equals(FORMAT_DELIMITED_TEXT)) {
+ throw new IllegalArgumentException("format" + configuration.get(KEY_FORMAT) + " is not supported");
+ }
+
+ if (!(configuration.get(HDFSAdapter.KEY_INPUT_FORMAT).equals(HDFSAdapter.INPUT_FORMAT_TEXT) || configuration
+ .get(HDFSAdapter.KEY_INPUT_FORMAT).equals(HDFSAdapter.INPUT_FORMAT_SEQUENCE))) {
+ throw new IllegalArgumentException("file input format" + configuration.get(HDFSAdapter.KEY_INPUT_FORMAT)
+ + " is not supported");
+ }
+
+ hdfsAdapter = new HDFSAdapter(atype);
+ hdfsAdapter.configure(configuration);
+ }
+
+ @Override
+ public void initialize(IHyracksTaskContext ctx) throws Exception {
+ hdfsAdapter.initialize(ctx);
+ }
+
+ @Override
+ public void start(int partition, IFrameWriter writer) throws Exception {
+ hdfsAdapter.start(partition, writer);
+ }
+
+ @Override
+ public AlgebricksPartitionConstraint getPartitionConstraint() throws Exception {
+ return hdfsAdapter.getPartitionConstraint();
}
}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/IDatasourceAdapter.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/IDatasourceAdapter.java
new file mode 100644
index 0000000..b0dc32f
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/IDatasourceAdapter.java
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.dataset.adapter;
+
+import java.io.Serializable;
+import java.util.Map;
+
+import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
+import edu.uci.ics.hyracks.api.comm.IFrameWriter;
+import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
+
+/**
+ * A super interface implemented by a data source adapter. An adapter can be a
+ * pull based or push based. This interface provides all common APIs that need
+ * to be implemented by each adapter irrespective of the the kind of
+ * adapter(pull or push).
+ */
+public interface IDatasourceAdapter extends Serializable {
+
+ /**
+ * An adapter can be used to read from an external data source and may also
+ * allow writing to the external data source. This enum type indicates the
+ * kind of operations supported by the adapter.
+ *
+ * @caller Compiler uses this method to assert the validity of an operation
+ * on an external dataset. The type of adapter associated with an
+ * external dataset determines the set of valid operations allowed
+ * on the dataset.
+ */
+ public enum AdapterType {
+ READ,
+ WRITE,
+ READ_WRITE
+ }
+
+ /**
+ * Returns the type of adapter indicating if the adapter can be used for
+ * reading from an external data source or writing to an external data
+ * source or can be used for both purposes.
+ *
+ * @Caller: Compiler: The compiler uses this API to verify if an operation
+ * is supported by the adapter. For example, an write query against
+ * an external dataset will not compile successfully if the
+ * external dataset was declared with a read_only adapter.
+ * @see AdapterType
+ * @return
+ */
+ public AdapterType getAdapterType();
+
+ /**
+ * Each adapter instance is configured with a set of parameters that are
+ * key-value pairs. When creating an external or a feed dataset, an adapter
+ * instance is used in conjunction with a set of configuration parameters
+ * for the adapter instance. The configuration parameters are stored
+ * internally with the adapter and can be retrieved using this API.
+ *
+ * @param propertyKey
+ * @return String the value corresponding to the configuration parameter
+ * represented by the key- attributeKey.
+ */
+ public String getAdapterProperty(String propertyKey);
+
+ /**
+ * Configures the IDatasourceAdapter instance.
+ *
+ * @caller Scenario 1) Called during compilation of DDL statement that
+ * creates a Feed dataset and associates the adapter with the
+ * dataset. The (key,value) configuration parameters provided as
+ * part of the DDL statement are collected by the compiler and
+ * passed on to this method. The adapter may as part of
+ * configuration connect with the external data source and determine
+ * the IAType associated with data residing with the external
+ * datasource.
+ * Scenario 2) An adapter instance is created by an ASTERIX operator
+ * that wraps around the adapter instance. The operator, as part of
+ * its initialization invokes the configure method. The (key,value)
+ * configuration parameters are passed on to the operator by the
+ * compiler. Subsequent to the invocation, the wrapping operator
+ * obtains the partition constraints (if any). In addition, in the
+ * case of a read adapter, the wrapping operator obtains the output
+ * ASTERIX type associated with the data that will be output from
+ * the adapter.
+ * @param arguments
+ * A map with key-value pairs that contains the configuration
+ * parameters for the adapter. The arguments are obtained from
+ * the metadata. Recall that the DDL to create an external
+ * dataset or a feed dataset requires using an adapter and
+ * providing all arguments as a set of (key,value) pairs. These
+ * arguments are put into the metadata.
+ */
+ public void configure(Map<String, String> arguments) throws Exception;
+
+ /**
+ * Returns a list of partition constraints. A partition constraint can be a
+ * requirement to execute at a particular location or could be cardinality
+ * constraints indicating the number of instances that need to run in
+ * parallel. example, a IDatasourceAdapter implementation written for data
+ * residing on the local file system of a node cannot run on any other node
+ * and thus has a location partition constraint. The location partition
+ * constraint can be expressed as a node IP address or a node controller id.
+ * In the former case, the IP address is translated to a node controller id
+ * running on the node with the given IP address.
+ *
+ * @Caller The wrapper operator configures its partition constraints from
+ * the constraints obtained from the adapter.
+ */
+ public AlgebricksPartitionConstraint getPartitionConstraint() throws Exception;
+
+ /**
+ * Allows the adapter to establish connection with the external data source
+ * expressing intent for data and providing any configuration parameters
+ * required by the external data source for the transfer of data. This
+ * method does not result in any data transfer, but is a prerequisite for
+ * any subsequent data transfer to happen between the external data source
+ * and the adapter.
+ *
+ * @caller This method is called by the wrapping ASTERIX operator that
+ * @param ctx
+ * @throws Exception
+ */
+ public void initialize(IHyracksTaskContext ctx) throws Exception;
+
+ /**
+ * Triggers the adapter to begin ingestion of data from the external source.
+ *
+ * @param partition
+ * The adapter could be running with a degree of parallelism.
+ * partition corresponds to the i'th parallel instance.
+ * @param writer
+ * The instance of frame writer that is used by the adapter to
+ * write frame to. Adapter packs the fetched bytes (from external source),
+ * packs them into frames and forwards the frames to an upstream receiving
+ * operator using the instance of IFrameWriter.
+ * @throws Exception
+ */
+ public void start(int partition, IFrameWriter writer) throws Exception;
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/IPullBasedFeedClient.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/IPullBasedFeedClient.java
new file mode 100644
index 0000000..a1eb075
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/IPullBasedFeedClient.java
@@ -0,0 +1,37 @@
+package edu.uci.ics.asterix.external.dataset.adapter;
+
+import java.io.DataOutput;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+
+public interface IPullBasedFeedClient {
+
+ /**
+ * Writes the next fetched tuple into the provided instance of DatatOutput.
+ *
+ * @param dataOutput
+ * The receiving channel for the feed client to write ADM records to.
+ * @return true if a record was written to the DataOutput instance
+ * false if no record was written to the DataOutput instance indicating non-availability of new data.
+ * @throws AsterixException
+ */
+ public boolean nextTuple(DataOutput dataOutput) throws AsterixException;
+
+ /**
+ * Provides logic for any corrective action that feed client needs to execute on
+ * encountering an exception.
+ *
+ * @param e
+ * The exception encountered during fetching of data from external source
+ * @throws AsterixException
+ */
+ public void resetOnFailure(Exception e) throws AsterixException;
+
+ /**
+ * Terminates a feed, that is data ingestion activity ceases.
+ *
+ * @throws Exception
+ */
+ public void stop() throws Exception;
+
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/ITypedDatasourceAdapter.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/ITypedDatasourceAdapter.java
new file mode 100644
index 0000000..3a4b97b
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/ITypedDatasourceAdapter.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.dataset.adapter;
+
+import edu.uci.ics.asterix.om.types.ARecordType;
+
+/**
+ * Implemented by datasource adapter that has a fixed output type.
+ * Example @see {PullBasedTwitterAdapter}
+ */
+public interface ITypedDatasourceAdapter extends IDatasourceAdapter {
+
+ public ARecordType getAdapterOutputType();
+
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/NCFileSystemAdapter.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/NCFileSystemAdapter.java
index efa0b70..bcc90c8 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/NCFileSystemAdapter.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/NCFileSystemAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2009-2011 by The Regents of the University of California
+ * Copyright 2009-2012 by The Regents of the University of California
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may obtain a copy of the License from
@@ -17,54 +17,37 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
+import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
-import edu.uci.ics.asterix.external.data.adapter.api.IDatasourceReadAdapter;
-import edu.uci.ics.asterix.external.data.parser.IDataParser;
-import edu.uci.ics.asterix.external.data.parser.IDataStreamParser;
-import edu.uci.ics.asterix.om.types.ARecordType;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksAbsolutePartitionConstraint;
+import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
import edu.uci.ics.hyracks.api.io.FileReference;
import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
-public class NCFileSystemAdapter extends AbstractDatasourceAdapter implements IDatasourceReadAdapter {
+/**
+ * Factory class for creating an instance of NCFileSystemAdapter. An
+ * NCFileSystemAdapter reads external data residing on the local file system of
+ * an NC.
+ */
+public class NCFileSystemAdapter extends FileSystemBasedAdapter {
- private static final long serialVersionUID = -4154256369973615710L;
+ private static final long serialVersionUID = 1L;
private FileSplit[] fileSplits;
- private String parserClass;
- public class Constants {
- public static final String KEY_SPLITS = "path";
- public static final String KEY_FORMAT = "format";
- public static final String KEY_PARSER = "parser";
- public static final String FORMAT_DELIMITED_TEXT = "delimited-text";
- public static final String FORMAT_ADM = "adm";
+ public NCFileSystemAdapter(IAType atype) {
+ super(atype);
}
@Override
- public void configure(Map<String, String> arguments, IAType atype) throws Exception {
+ public void configure(Map<String, String> arguments) throws Exception {
this.configuration = arguments;
- String[] splits = arguments.get(Constants.KEY_SPLITS).split(",");
+ String[] splits = arguments.get(KEY_PATH).split(",");
configureFileSplits(splits);
- configurePartitionConstraint();
configureFormat();
- if (atype == null) {
- configureInputType();
- } else {
- setInputAType(atype);
- }
- }
-
- public IAType getAType() {
- return atype;
- }
-
- public void setInputAType(IAType atype) {
- this.atype = atype;
}
@Override
@@ -73,70 +56,27 @@
}
@Override
- public AdapterDataFlowType getAdapterDataFlowType() {
- return AdapterDataFlowType.PULL;
- }
-
- @Override
public AdapterType getAdapterType() {
return AdapterType.READ;
}
- @Override
- public IDataParser getDataParser(int partition) throws Exception {
- FileSplit split = fileSplits[partition];
- File inputFile = split.getLocalFile().getFile();
- InputStream in;
- try {
- in = new FileInputStream(inputFile);
- } catch (FileNotFoundException e) {
- throw new HyracksDataException(e);
- }
-
- IDataParser dataParser = (IDataParser) Class.forName(parserClass).newInstance();
- if (dataParser instanceof IDataStreamParser) {
- ((IDataStreamParser) dataParser).setInputStream(in);
- } else {
- throw new IllegalArgumentException(" parser not compatible");
- }
- dataParser.configure(configuration);
- dataParser.initialize((ARecordType) atype, ctx);
- return dataParser;
- }
-
private void configureFileSplits(String[] splits) {
if (fileSplits == null) {
fileSplits = new FileSplit[splits.length];
String nodeName;
String nodeLocalPath;
int count = 0;
+ String trimmedValue;
for (String splitPath : splits) {
- nodeName = splitPath.split(":")[0];
- nodeLocalPath = splitPath.split("://")[1];
+ trimmedValue = splitPath.trim();
+ nodeName = trimmedValue.split(":")[0];
+ nodeLocalPath = trimmedValue.split("://")[1];
FileSplit fileSplit = new FileSplit(nodeName, new FileReference(new File(nodeLocalPath)));
fileSplits[count++] = fileSplit;
}
}
}
- protected void configureFormat() throws Exception {
- parserClass = configuration.get(Constants.KEY_PARSER);
- if (parserClass == null) {
- if (Constants.FORMAT_DELIMITED_TEXT.equalsIgnoreCase(configuration.get(KEY_FORMAT))) {
- parserClass = formatToParserMap.get(FORMAT_DELIMITED_TEXT);
- } else if (Constants.FORMAT_ADM.equalsIgnoreCase(configuration.get(Constants.KEY_FORMAT))) {
- parserClass = formatToParserMap.get(Constants.FORMAT_ADM);
- } else {
- throw new IllegalArgumentException(" format " + configuration.get(KEY_FORMAT) + " not supported");
- }
- }
-
- }
-
- private void configureInputType() {
- throw new UnsupportedOperationException(" Cannot resolve input type, operation not supported");
- }
-
private void configurePartitionConstraint() {
String[] locs = new String[fileSplits.length];
for (int i = 0; i < fileSplits.length; i++) {
@@ -145,4 +85,24 @@
partitionConstraint = new AlgebricksAbsolutePartitionConstraint(locs);
}
+ @Override
+ public InputStream getInputStream(int partition) throws IOException {
+ FileSplit split = fileSplits[partition];
+ File inputFile = split.getLocalFile().getFile();
+ InputStream in;
+ try {
+ in = new FileInputStream(inputFile);
+ return in;
+ } catch (FileNotFoundException e) {
+ throw new IOException(e);
+ }
+ }
+
+ @Override
+ public AlgebricksPartitionConstraint getPartitionConstraint() throws Exception {
+ if (partitionConstraint == null) {
+ configurePartitionConstraint();
+ }
+ return partitionConstraint;
+ }
}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/PullBasedAdapter.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/PullBasedAdapter.java
new file mode 100644
index 0000000..38686c2
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/PullBasedAdapter.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.dataset.adapter;
+
+import java.nio.ByteBuffer;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.hyracks.api.comm.IFrameWriter;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
+import edu.uci.ics.hyracks.dataflow.common.comm.io.FrameTupleAppender;
+import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
+
+/**
+ * Acts as an abstract class for all pull-based external data adapters.
+ * Captures the common logic for obtaining bytes from an external source
+ * and packing them into frames as tuples.
+ */
+public abstract class PullBasedAdapter extends AbstractDatasourceAdapter implements ITypedDatasourceAdapter {
+
+ private static final long serialVersionUID = 1L;
+
+ protected ArrayTupleBuilder tupleBuilder = new ArrayTupleBuilder(1);
+ protected IPullBasedFeedClient pullBasedFeedClient;
+ protected ARecordType adapterOutputType;
+ private FrameTupleAppender appender;
+ private ByteBuffer frame;
+
+ public abstract IPullBasedFeedClient getFeedClient(int partition) throws Exception;
+
+ @Override
+ public void start(int partition, IFrameWriter writer) throws Exception {
+ appender = new FrameTupleAppender(ctx.getFrameSize());
+ frame = ctx.allocateFrame();
+ appender.reset(frame, true);
+
+ pullBasedFeedClient = getFeedClient(partition);
+ boolean moreData = false;
+ while (true) {
+ tupleBuilder.reset();
+ try {
+ moreData = pullBasedFeedClient.nextTuple(tupleBuilder.getDataOutput());
+ if (moreData) {
+ tupleBuilder.addFieldEndOffset();
+ appendTupleToFrame(writer);
+ } else {
+ FrameUtils.flushFrame(frame, writer);
+ break;
+ }
+ } catch (Exception failureException) {
+ try {
+ pullBasedFeedClient.resetOnFailure(failureException);
+ continue;
+ } catch (Exception recoveryException) {
+ throw new Exception(recoveryException);
+ }
+ }
+ }
+ }
+
+ /**
+ * Allows an adapter to handle a runtime exception.
+ * @param e exception encountered during runtime
+ * @throws AsterixException
+ */
+ public void resetOnFailure(Exception e) throws AsterixException {
+ pullBasedFeedClient.resetOnFailure(e);
+ tupleBuilder.reset();
+ }
+
+ private void appendTupleToFrame(IFrameWriter writer) throws HyracksDataException {
+ if (!appender.append(tupleBuilder.getFieldEndOffsets(), tupleBuilder.getByteArray(), 0, tupleBuilder.getSize())) {
+ FrameUtils.flushFrame(frame, writer);
+ appender.reset(frame, true);
+ if (!appender.append(tupleBuilder.getFieldEndOffsets(), tupleBuilder.getByteArray(), 0,
+ tupleBuilder.getSize())) {
+ throw new IllegalStateException();
+ }
+ }
+ }
+
+ @Override
+ public ARecordType getAdapterOutputType() {
+ return adapterOutputType;
+ }
+
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/PullBasedFeedClient.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/PullBasedFeedClient.java
new file mode 100644
index 0000000..17ecd86
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/PullBasedFeedClient.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.dataset.adapter;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ARecordSerializerDeserializer;
+import edu.uci.ics.asterix.om.base.AMutableRecord;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+
+public abstract class PullBasedFeedClient implements IPullBasedFeedClient {
+
+ protected ARecordSerializerDeserializer recordSerDe;
+ protected AMutableRecord mutableRecord;
+ protected boolean messageReceived;
+ protected boolean continueIngestion=true;
+
+ public abstract boolean setNextRecord() throws Exception;
+
+ @Override
+ public boolean nextTuple(DataOutput dataOutput) throws AsterixException {
+ try {
+ boolean newData = setNextRecord();
+ if (newData && continueIngestion) {
+ IAType t = mutableRecord.getType();
+ ATypeTag tag = t.getTypeTag();
+ try {
+ dataOutput.writeByte(tag.serialize());
+ } catch (IOException e) {
+ throw new HyracksDataException(e);
+ }
+ recordSerDe.serialize(mutableRecord, dataOutput);
+ return true;
+ }
+ return false;
+ } catch (Exception e) {
+ throw new AsterixException(e);
+ }
+
+ }
+
+ @Override
+ public void stop() {
+ continueIngestion = false;
+ }
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/PullBasedTwitterAdapter.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/PullBasedTwitterAdapter.java
index e95dbd8..ebfbcad 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/PullBasedTwitterAdapter.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/PullBasedTwitterAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2009-2011 by The Regents of the University of California
+ * Copyright 2009-2012 by The Regents of the University of California
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may obtain a copy of the License from
@@ -14,111 +14,67 @@
*/
package edu.uci.ics.asterix.external.dataset.adapter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
-import twitter4j.Query;
-import twitter4j.QueryResult;
-import twitter4j.Tweet;
-import twitter4j.Twitter;
-import twitter4j.TwitterFactory;
-import edu.uci.ics.asterix.external.data.adapter.api.IDatasourceReadAdapter;
-import edu.uci.ics.asterix.external.data.parser.AbstractStreamDataParser;
-import edu.uci.ics.asterix.external.data.parser.IDataParser;
-import edu.uci.ics.asterix.external.data.parser.IDataStreamParser;
-import edu.uci.ics.asterix.external.data.parser.IManagedDataParser;
-import edu.uci.ics.asterix.external.data.parser.ManagedDelimitedDataStreamParser;
-import edu.uci.ics.asterix.feed.intake.IFeedClient;
import edu.uci.ics.asterix.feed.managed.adapter.IManagedFeedAdapter;
-import edu.uci.ics.asterix.feed.managed.adapter.IMutableFeedAdapter;
import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksCountPartitionConstraint;
+import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-public class PullBasedTwitterAdapter extends AbstractDatasourceAdapter implements IDatasourceReadAdapter,
- IManagedFeedAdapter, IMutableFeedAdapter {
+/**
+ * An adapter that provides the functionality of receiving tweets from the
+ * Twitter service in the form of ADM formatted records.
+ */
+public class PullBasedTwitterAdapter extends PullBasedAdapter implements IManagedFeedAdapter {
- private IDataStreamParser parser;
- private int parallelism = 1;
- private boolean stopRequested = false;
- private boolean alterRequested = false;
- private Map<String, String> alteredParams = new HashMap<String, String>();
-
+
+ private static final long serialVersionUID = 1L;
+
public static final String QUERY = "query";
public static final String INTERVAL = "interval";
+ private boolean alterRequested = false;
+ private Map<String, String> alteredParams = new HashMap<String, String>();
+ private ARecordType recordType;
+
+ private PullBasedTwitterFeedClient tweetClient;
+
@Override
- public void configure(Map<String, String> arguments, IAType atype) throws Exception {
+ public IPullBasedFeedClient getFeedClient(int partition) {
+ return tweetClient;
+ }
+
+ @Override
+ public void configure(Map<String, String> arguments) throws Exception {
configuration = arguments;
- this.atype = atype;
- partitionConstraint = new AlgebricksCountPartitionConstraint(1);
- }
-
- @Override
- public AdapterDataFlowType getAdapterDataFlowType() {
- return dataFlowType.PULL;
- }
-
- @Override
- public AdapterType getAdapterType() {
- return adapterType.READ;
+ String[] fieldNames = { "id", "username", "location", "text", "timestamp" };
+ IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ASTRING, BuiltinType.ASTRING, BuiltinType.ASTRING,
+ BuiltinType.ASTRING };
+ recordType = new ARecordType("FeedRecordType", fieldNames, fieldTypes, false);
}
@Override
public void initialize(IHyracksTaskContext ctx) throws Exception {
this.ctx = ctx;
+ tweetClient = new PullBasedTwitterFeedClient(ctx, this);
}
@Override
- public void beforeSuspend() throws Exception {
- // TODO Auto-generated method stub
-
+ public AdapterType getAdapterType() {
+ return AdapterType.READ;
}
@Override
- public void beforeResume() throws Exception {
- // TODO Auto-generated method stub
-
+ public void stop() {
+ tweetClient.stop();
}
@Override
- public void beforeStop() throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public IDataParser getDataParser(int partition) throws Exception {
- if (parser == null) {
- parser = new ManagedDelimitedDataStreamParser();
- ((IManagedDataParser) parser).setAdapter(this);
- configuration.put(AbstractStreamDataParser.KEY_DELIMITER, "|");
- parser.configure(configuration);
- parser.initialize((ARecordType) atype, ctx);
- TweetClient tweetClient = new TweetClient(ctx.getJobletContext().getApplicationContext().getNodeId(), this);
- TweetStream tweetStream = new TweetStream(tweetClient, ctx);
- parser.setInputStream(tweetStream);
- }
- return parser;
- }
-
- @Override
- public void stop() throws Exception {
- stopRequested = true;
- }
-
- public boolean isStopRequested() {
- return stopRequested;
- }
-
- @Override
- public void alter(Map<String, String> properties) throws Exception {
+ public void alter(Map<String, String> properties) {
alterRequested = true;
this.alteredParams = properties;
}
@@ -135,132 +91,18 @@
alteredParams = null;
alterRequested = false;
}
-}
-class TweetStream extends InputStream {
-
- private ByteBuffer buffer;
- private int capacity;
- private TweetClient tweetClient;
- private List<String> tweets = new ArrayList<String>();
-
- public TweetStream(TweetClient tweetClient, IHyracksTaskContext ctx) throws Exception {
- capacity = ctx.getFrameSize();
- buffer = ByteBuffer.allocate(capacity);
- this.tweetClient = tweetClient;
- initialize();
- }
-
- private void initialize() throws Exception {
- boolean hasMore = tweetClient.next(tweets);
- if (!hasMore) {
- buffer.limit(0);
- } else {
- buffer.position(0);
- buffer.limit(capacity);
- for (String tweet : tweets) {
- buffer.put(tweet.getBytes());
- buffer.put("\n".getBytes());
- }
- buffer.flip();
- }
+ @Override
+ public ARecordType getAdapterOutputType() {
+ return recordType;
}
@Override
- public int read() throws IOException {
- if (!buffer.hasRemaining()) {
-
- boolean hasMore = tweetClient.next(tweets);
- if (!hasMore) {
- return -1;
- }
- buffer.position(0);
- buffer.limit(capacity);
- for (String tweet : tweets) {
- buffer.put(tweet.getBytes());
- buffer.put("\n".getBytes());
- }
- buffer.flip();
- return buffer.get();
- } else {
- return buffer.get();
+ public AlgebricksPartitionConstraint getPartitionConstraint() throws Exception {
+ if (partitionConstraint == null) {
+ partitionConstraint = new AlgebricksCountPartitionConstraint(1);
}
-
- }
-}
-
-class TweetClient implements IFeedClient {
-
- private String query;
- private int timeInterval = 5;
- private Character delimiter = '|';
- private long id = 0;
- private String id_prefix;
-
- private final PullBasedTwitterAdapter adapter;
-
- public TweetClient(String id_prefix, PullBasedTwitterAdapter adapter) {
- this.id_prefix = id_prefix;
- this.adapter = adapter;
- initialize(adapter.getConfiguration());
- }
-
- private void initialize(Map<String, String> params) {
- this.query = params.get(PullBasedTwitterAdapter.QUERY);
- if (params.get(PullBasedTwitterAdapter.INTERVAL) != null) {
- this.timeInterval = Integer.parseInt(params.get(PullBasedTwitterAdapter.INTERVAL));
- }
- }
-
- @Override
- public boolean next(List<String> tweets) {
- try {
- if (adapter.isStopRequested()) {
- return false;
- }
- if (adapter.isAlterRequested()) {
- initialize(((PullBasedTwitterAdapter) adapter).getAlteredParams());
- adapter.postAlteration();
- }
- Thread.currentThread().sleep(1000 * timeInterval);
- tweets.clear();
- Twitter twitter = new TwitterFactory().getInstance();
- QueryResult result = twitter.search(new Query(query));
- List<Tweet> sourceTweets = result.getTweets();
- for (Tweet tweet : sourceTweets) {
- String tweetContent = formFeedTuple(tweet);
- tweets.add(tweetContent);
- System.out.println(tweetContent);
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- return false;
- }
- return true;
- }
-
- public String formFeedTuple(Object tweetObject) {
- Tweet tweet = (Tweet) tweetObject;
- StringBuilder builder = new StringBuilder();
- builder.append(id_prefix + ":" + id);
- builder.append(delimiter);
- builder.append(tweet.getFromUserId());
- builder.append(delimiter);
- builder.append("Orange County");
- builder.append(delimiter);
- builder.append(escapeChars(tweet));
- builder.append(delimiter);
- builder.append(tweet.getCreatedAt().toString());
- id++;
- return new String(builder);
- }
-
- private String escapeChars(Tweet tweet) {
- if (tweet.getText().contains("\n")) {
- return tweet.getText().replace("\n", " ");
- }
- return tweet.getText();
+ return partitionConstraint;
}
}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/PullBasedTwitterFeedClient.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/PullBasedTwitterFeedClient.java
new file mode 100644
index 0000000..2a07472
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/PullBasedTwitterFeedClient.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.dataset.adapter;
+
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Queue;
+
+import twitter4j.Query;
+import twitter4j.QueryResult;
+import twitter4j.Tweet;
+import twitter4j.Twitter;
+import twitter4j.TwitterException;
+import twitter4j.TwitterFactory;
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ARecordSerializerDeserializer;
+import edu.uci.ics.asterix.om.base.AMutableRecord;
+import edu.uci.ics.asterix.om.base.AMutableString;
+import edu.uci.ics.asterix.om.base.IAObject;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
+
+/**
+ * An implementation of @see {PullBasedFeedClient} for the Twitter service.
+ * The feed client fetches data from Twitter service by sending request at
+ * regular (configurable) interval.
+ */
+public class PullBasedTwitterFeedClient extends PullBasedFeedClient {
+
+ private String keywords;
+ private Query query;
+ private long id = 0;
+ private String id_prefix;
+ private Twitter twitter;
+ private int requestInterval = 10; // seconds
+ private Queue<Tweet> tweetBuffer = new LinkedList<Tweet>();
+
+ IAObject[] mutableFields;
+ String[] tupleFieldValues;
+ private ARecordType recordType;
+
+ public PullBasedTwitterFeedClient(IHyracksTaskContext ctx, PullBasedTwitterAdapter adapter) {
+ this.id_prefix = ctx.getJobletContext().getApplicationContext().getNodeId();
+ twitter = new TwitterFactory().getInstance();
+ mutableFields = new IAObject[] { new AMutableString(null), new AMutableString(null), new AMutableString(null),
+ new AMutableString(null), new AMutableString(null) };
+ recordType = adapter.getAdapterOutputType();
+ recordSerDe = new ARecordSerializerDeserializer(recordType);
+ mutableRecord = new AMutableRecord(recordType, mutableFields);
+ initialize(adapter.getConfiguration());
+ tupleFieldValues = new String[recordType.getFieldNames().length];
+ }
+
+ public void initialize(Map<String, String> params) {
+ this.keywords = params.get(PullBasedTwitterAdapter.QUERY);
+ this.query = new Query(keywords);
+ query.setRpp(100);
+ }
+
+ private Tweet getNextTweet() throws TwitterException, InterruptedException {
+ if (tweetBuffer.isEmpty()) {
+ QueryResult result;
+ Thread.sleep(1000 * requestInterval);
+ result = twitter.search(query);
+ tweetBuffer.addAll(result.getTweets());
+ }
+ return tweetBuffer.remove();
+ }
+
+ public ARecordType getRecordType() {
+ return recordType;
+ }
+
+ public AMutableRecord getMutableRecord() {
+ return mutableRecord;
+ }
+
+ @Override
+ public boolean setNextRecord() throws Exception {
+ Tweet tweet;
+ tweet = getNextTweet();
+ if (tweet == null) {
+ return false;
+ }
+ int numFields = recordType.getFieldNames().length;
+
+ tupleFieldValues[0] = id_prefix + ":" + id;
+ tupleFieldValues[1] = tweet.getFromUser();
+ tupleFieldValues[2] = tweet.getLocation() == null ? "" : tweet.getLocation();
+ tupleFieldValues[3] = tweet.getText();
+ tupleFieldValues[4] = tweet.getCreatedAt().toString();
+ for (int i = 0; i < numFields; i++) {
+ ((AMutableString) mutableFields[i]).setValue(tupleFieldValues[i]);
+ mutableRecord.setValueAtPos(i, mutableFields[i]);
+ }
+ id++;
+ return true;
+ }
+
+ @Override
+ public void resetOnFailure(Exception e) throws AsterixException {
+ // TOOO: implement resetting logic for Twitter
+ }
+
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/RSSFeedAdapter.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/RSSFeedAdapter.java
index 7eaf7cd..611183c 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/RSSFeedAdapter.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/RSSFeedAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2009-2011 by The Regents of the University of California
+ * Copyright 2009-2012 by The Regents of the University of California
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may obtain a copy of the License from
@@ -19,29 +19,29 @@
import java.util.List;
import java.util.Map;
-import edu.uci.ics.asterix.external.data.adapter.api.IDatasourceAdapter;
-import edu.uci.ics.asterix.external.data.parser.IDataParser;
-import edu.uci.ics.asterix.external.data.parser.IDataStreamParser;
-import edu.uci.ics.asterix.external.data.parser.IManagedDataParser;
-import edu.uci.ics.asterix.external.data.parser.ManagedDelimitedDataStreamParser;
-import edu.uci.ics.asterix.feed.intake.FeedStream;
-import edu.uci.ics.asterix.feed.intake.IFeedClient;
-import edu.uci.ics.asterix.feed.intake.RSSFeedClient;
import edu.uci.ics.asterix.feed.managed.adapter.IManagedFeedAdapter;
-import edu.uci.ics.asterix.feed.managed.adapter.IMutableFeedAdapter;
import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksCountPartitionConstraint;
+import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-public class RSSFeedAdapter extends AbstractDatasourceAdapter implements IDatasourceAdapter, IManagedFeedAdapter,
- IMutableFeedAdapter {
+/**
+ * RSSFeedAdapter provides the functionality of fetching an RSS based feed.
+ */
+public class RSSFeedAdapter extends PullBasedAdapter implements IManagedFeedAdapter {
+
+ private static final long serialVersionUID = 1L;
private List<String> feedURLs = new ArrayList<String>();
private boolean isStopRequested = false;
private boolean isAlterRequested = false;
private Map<String, String> alteredParams = new HashMap<String, String>();
private String id_prefix = "";
+ private ARecordType recordType;
+
+ private IPullBasedFeedClient rssFeedClient;
public static final String KEY_RSS_URL = "url";
public static final String KEY_INTERVAL = "interval";
@@ -55,73 +55,34 @@
}
@Override
- public IDataParser getDataParser(int partition) throws Exception {
- IDataParser dataParser = new ManagedDelimitedDataStreamParser();
- ((IManagedDataParser) dataParser).setAdapter(this);
- dataParser.configure(configuration);
- dataParser.initialize((ARecordType) atype, ctx);
- IFeedClient feedClient = new RSSFeedClient(this, feedURLs.get(partition), id_prefix);
- FeedStream feedStream = new FeedStream(feedClient, ctx);
- ((IDataStreamParser) dataParser).setInputStream(feedStream);
- return dataParser;
- }
-
- @Override
- public void alter(Map<String, String> properties) throws Exception {
+ public void alter(Map<String, String> properties) {
isAlterRequested = true;
this.alteredParams = properties;
reconfigure(properties);
}
- public void postAlteration() {
- alteredParams = null;
- isAlterRequested = false;
- }
-
@Override
- public void beforeSuspend() throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void beforeResume() throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void beforeStop() throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void stop() throws Exception {
+ public void stop() {
isStopRequested = true;
}
@Override
- public AdapterDataFlowType getAdapterDataFlowType() {
- return AdapterDataFlowType.PULL;
- }
-
- @Override
public AdapterType getAdapterType() {
return AdapterType.READ;
}
@Override
- public void configure(Map<String, String> arguments, IAType atype) throws Exception {
+ public void configure(Map<String, String> arguments) throws Exception {
configuration = arguments;
- this.atype = atype;
String rssURLProperty = configuration.get(KEY_RSS_URL);
if (rssURLProperty == null) {
throw new IllegalArgumentException("no rss url provided");
}
initializeFeedURLs(rssURLProperty);
configurePartitionConstraints();
-
+ recordType = new ARecordType("FeedRecordType", new String[] { "id", "title", "description", "link" },
+ new IAType[] { BuiltinType.ASTRING, BuiltinType.ASTRING, BuiltinType.ASTRING, BuiltinType.ASTRING },
+ false);
}
private void initializeFeedURLs(String rssURLProperty) {
@@ -157,4 +118,25 @@
return alteredParams;
}
+ @Override
+ public IPullBasedFeedClient getFeedClient(int partition) throws Exception {
+ if (rssFeedClient == null) {
+ rssFeedClient = new RSSFeedClient(this, feedURLs.get(partition), id_prefix);
+ }
+ return rssFeedClient;
+ }
+
+ @Override
+ public ARecordType getAdapterOutputType() {
+ return recordType;
+ }
+
+ @Override
+ public AlgebricksPartitionConstraint getPartitionConstraint() throws Exception {
+ if (partitionConstraint == null) {
+ configurePartitionConstraints();
+ }
+ return partitionConstraint;
+ }
+
}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/RSSFeedClient.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/RSSFeedClient.java
new file mode 100644
index 0000000..366b4af
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/RSSFeedClient.java
@@ -0,0 +1,166 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.dataset.adapter;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Queue;
+
+import com.sun.syndication.feed.synd.SyndEntryImpl;
+import com.sun.syndication.feed.synd.SyndFeed;
+import com.sun.syndication.fetcher.FeedFetcher;
+import com.sun.syndication.fetcher.FetcherEvent;
+import com.sun.syndication.fetcher.FetcherListener;
+import com.sun.syndication.fetcher.impl.FeedFetcherCache;
+import com.sun.syndication.fetcher.impl.HashMapFeedInfoCache;
+import com.sun.syndication.fetcher.impl.HttpURLFeedFetcher;
+
+import edu.uci.ics.asterix.om.base.AMutableRecord;
+import edu.uci.ics.asterix.om.base.AMutableString;
+import edu.uci.ics.asterix.om.base.IAObject;
+import edu.uci.ics.asterix.om.types.ARecordType;
+
+/**
+ * An implementation of @see {PullBasedFeedClient} responsible for
+ * fetching from an RSS feed source at regular interval.
+ */
+@SuppressWarnings("rawtypes")
+public class RSSFeedClient extends PullBasedFeedClient {
+
+ private final String feedURL;
+ private long id = 0;
+ private String idPrefix;
+ private boolean feedModified = false;
+
+ private Queue<SyndEntryImpl> rssFeedBuffer = new LinkedList<SyndEntryImpl>();
+
+ IAObject[] mutableFields;
+
+ private final FeedFetcherCache feedInfoCache;
+ private final FeedFetcher fetcher;
+ private final FetcherEventListenerImpl listener;
+ private final URL feedUrl;
+ private ARecordType recordType;
+ String[] tupleFieldValues;
+
+ public boolean isFeedModified() {
+ return feedModified;
+ }
+
+ public void setFeedModified(boolean feedModified) {
+ this.feedModified = feedModified;
+ }
+
+ public RSSFeedClient(RSSFeedAdapter adapter, String feedURL, String id_prefix) throws MalformedURLException {
+ this.feedURL = feedURL;
+ this.idPrefix = id_prefix;
+ feedUrl = new URL(feedURL);
+ feedInfoCache = HashMapFeedInfoCache.getInstance();
+ fetcher = new HttpURLFeedFetcher(feedInfoCache);
+ listener = new FetcherEventListenerImpl(this);
+ fetcher.addFetcherEventListener(listener);
+ mutableFields = new IAObject[] { new AMutableString(null), new AMutableString(null), new AMutableString(null),
+ new AMutableString(null) };
+ recordType = adapter.getAdapterOutputType();
+ mutableRecord = new AMutableRecord(recordType, mutableFields);
+ tupleFieldValues = new String[recordType.getFieldNames().length];
+ }
+
+ @Override
+ public boolean setNextRecord() throws Exception {
+ SyndEntryImpl feedEntry = getNextRSSFeed();
+ if (feedEntry == null) {
+ return false;
+ }
+ tupleFieldValues[0] = idPrefix + ":" + id;
+ tupleFieldValues[1] = feedEntry.getTitle();
+ tupleFieldValues[2] = feedEntry.getDescription().getValue();
+ tupleFieldValues[3] = feedEntry.getLink();
+ int numFields = recordType.getFieldNames().length;
+ for (int i = 0; i < numFields; i++) {
+ ((AMutableString) mutableFields[i]).setValue(tupleFieldValues[i]);
+ mutableRecord.setValueAtPos(i, mutableFields[i]);
+ }
+ id++;
+ return true;
+ }
+
+ private SyndEntryImpl getNextRSSFeed() throws Exception {
+ if (rssFeedBuffer.isEmpty()) {
+ fetchFeed();
+ }
+ if (rssFeedBuffer.isEmpty()) {
+ return null;
+ } else {
+ return rssFeedBuffer.remove();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private void fetchFeed() {
+ try {
+ System.err.println("Retrieving feed " + feedURL);
+ // Retrieve the feed.
+ // We will get a Feed Polled Event and then a
+ // Feed Retrieved event (assuming the feed is valid)
+ SyndFeed feed = fetcher.retrieveFeed(feedUrl);
+ if (feedModified) {
+ System.err.println(feedUrl + " retrieved");
+ System.err.println(feedUrl + " has a title: " + feed.getTitle() + " and contains "
+ + feed.getEntries().size() + " entries.");
+
+ List fetchedFeeds = feed.getEntries();
+ rssFeedBuffer.addAll(fetchedFeeds);
+ }
+ } catch (Exception ex) {
+ System.out.println("ERROR: " + ex.getMessage());
+ ex.printStackTrace();
+ }
+ }
+
+ @Override
+ public void resetOnFailure(Exception e) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
+
+class FetcherEventListenerImpl implements FetcherListener {
+
+ private final IPullBasedFeedClient feedClient;
+
+ public FetcherEventListenerImpl(IPullBasedFeedClient feedClient) {
+ this.feedClient = feedClient;
+ }
+
+ /**
+ * @see com.sun.syndication.fetcher.FetcherListener#fetcherEvent(com.sun.syndication.fetcher.FetcherEvent)
+ */
+ public void fetcherEvent(FetcherEvent event) {
+ String eventType = event.getEventType();
+ if (FetcherEvent.EVENT_TYPE_FEED_POLLED.equals(eventType)) {
+ System.err.println("\tEVENT: Feed Polled. URL = " + event.getUrlString());
+ } else if (FetcherEvent.EVENT_TYPE_FEED_RETRIEVED.equals(eventType)) {
+ System.err.println("\tEVENT: Feed Retrieved. URL = " + event.getUrlString());
+ ((RSSFeedClient) feedClient).setFeedModified(true);
+ } else if (FetcherEvent.EVENT_TYPE_FEED_UNCHANGED.equals(eventType)) {
+ System.err.println("\tEVENT: Feed Unchanged. URL = " + event.getUrlString());
+ ((RSSFeedClient) feedClient).setFeedModified(true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/feed/lifecycle/AlterFeedMessage.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/feed/lifecycle/AlterFeedMessage.java
new file mode 100644
index 0000000..537bf07
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/feed/lifecycle/AlterFeedMessage.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.feed.lifecycle;
+
+import java.util.Map;
+
+/**
+ * A feed control message containing the altered values for
+ * adapter configuration parameters. This message is dispatched
+ * to all runtime instances of the feed's adapter.
+ */
+public class AlterFeedMessage extends FeedMessage {
+
+ private static final long serialVersionUID = 1L;
+
+ private final Map<String, String> alteredConfParams;
+
+ public AlterFeedMessage(Map<String, String> alteredConfParams) {
+ super(MessageType.ALTER);
+ this.alteredConfParams = alteredConfParams;
+ }
+
+ @Override
+ public MessageType getMessageType() {
+ return MessageType.ALTER;
+ }
+
+ public Map<String, String> getAlteredConfParams() {
+ return alteredConfParams;
+ }
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/feed/lifecycle/FeedId.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/feed/lifecycle/FeedId.java
new file mode 100644
index 0000000..b1889ee
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/feed/lifecycle/FeedId.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.feed.lifecycle;
+
+import java.io.Serializable;
+
+/**
+ * A unique identifier for a feed (dataset).
+ */
+public class FeedId implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private final String dataverse;
+ private final String dataset;
+ private final int hashcode;
+
+ public FeedId(String dataverse, String dataset) {
+ this.dataset = dataset;
+ this.dataverse = dataverse;
+ this.hashcode = (dataverse + "." + dataset).hashCode();
+ }
+
+ public String getDataverse() {
+ return dataverse;
+ }
+
+ public String getDataset() {
+ return dataset;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == null || !(o instanceof FeedId)) {
+ return false;
+ }
+ if (((FeedId) o).getDataset().equals(dataset) && ((FeedId) o).getDataverse().equals(dataverse)) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return hashcode;
+ }
+
+ @Override
+ public String toString() {
+ return dataverse + "." + dataset;
+ }
+
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/feed/lifecycle/FeedManager.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/feed/lifecycle/FeedManager.java
new file mode 100644
index 0000000..29e4486
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/feed/lifecycle/FeedManager.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.feed.lifecycle;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+
+/**
+ * Handle (de-)registration of feeds for delivery of control messages.
+ */
+public class FeedManager implements IFeedManager {
+
+ public static FeedManager INSTANCE = new FeedManager();
+
+ private FeedManager() {
+
+ }
+
+ private Map<FeedId, Set<LinkedBlockingQueue<IFeedMessage>>> outGoingMsgQueueMap = new HashMap<FeedId, Set<LinkedBlockingQueue<IFeedMessage>>>();
+
+ @Override
+ public void deliverMessage(FeedId feedId, IFeedMessage feedMessage) throws AsterixException {
+ Set<LinkedBlockingQueue<IFeedMessage>> operatorQueues = outGoingMsgQueueMap.get(feedId);
+ try {
+ if (operatorQueues != null) {
+ for (LinkedBlockingQueue<IFeedMessage> queue : operatorQueues) {
+ queue.put(feedMessage);
+ }
+ } else {
+ throw new AsterixException("Unable to deliver message. Unknown feed :" + feedId);
+ }
+ } catch (Exception e) {
+ throw new AsterixException(e);
+ }
+ }
+
+ @Override
+ public void registerFeedMsgQueue(FeedId feedId, LinkedBlockingQueue<IFeedMessage> queue) {
+ Set<LinkedBlockingQueue<IFeedMessage>> feedQueues = outGoingMsgQueueMap.get(feedId);
+ if (feedQueues == null) {
+ feedQueues = new HashSet<LinkedBlockingQueue<IFeedMessage>>();
+ }
+ feedQueues.add(queue);
+ outGoingMsgQueueMap.put(feedId, feedQueues);
+ }
+
+ @Override
+ public void unregisterFeedMsgQueue(FeedId feedId, LinkedBlockingQueue<IFeedMessage> queue) {
+ Set<LinkedBlockingQueue<IFeedMessage>> feedQueues = outGoingMsgQueueMap.get(feedId);
+ if (feedQueues == null || !feedQueues.contains(queue)) {
+ throw new IllegalArgumentException(" Unable to de-register feed message queue. Unknown feedId " + feedId);
+ }
+ feedQueues.remove(queue);
+ }
+
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/feed/lifecycle/FeedMessage.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/feed/lifecycle/FeedMessage.java
new file mode 100644
index 0000000..af84d4f
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/feed/lifecycle/FeedMessage.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.feed.lifecycle;
+
+/**
+ * A control message that can be sent to the runtime instance of a
+ * feed's adapter.
+ */
+public class FeedMessage implements IFeedMessage {
+
+ private static final long serialVersionUID = 1L;
+
+ protected MessageType messageType;
+
+ public FeedMessage(MessageType messageType) {
+ this.messageType = messageType;
+ }
+
+ public MessageType getMessageType() {
+ return messageType;
+ }
+
+ public void setMessageType(MessageType messageType) {
+ this.messageType = messageType;
+ }
+
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/feed/lifecycle/IFeedManager.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/feed/lifecycle/IFeedManager.java
new file mode 100644
index 0000000..587d5a7
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/feed/lifecycle/IFeedManager.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.feed.lifecycle;
+
+import java.util.concurrent.LinkedBlockingQueue;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+
+/**
+ * Handle (de-)registration of feeds for delivery of control messages.
+ */
+public interface IFeedManager {
+
+ /**
+ * Register an input message queue for a feed specified by feedId.
+ * All messages sent to a feed are directed to the registered queue(s).
+ *
+ * @param feedId
+ * an identifier for the feed dataset.
+ * @param queue
+ * an input message queue for receiving control messages.
+ */
+ public void registerFeedMsgQueue(FeedId feedId, LinkedBlockingQueue<IFeedMessage> queue);
+
+ /**
+ * Unregister an input message queue for a feed specified by feedId.
+ * A feed prior to finishing should unregister all previously registered queue(s)
+ * as it is no longer active and thus need not process any control messages.
+ *
+ * @param feedId
+ * an identifier for the feed dataset.
+ * @param queue
+ * an input message queue for receiving control messages.
+ */
+ public void unregisterFeedMsgQueue(FeedId feedId, LinkedBlockingQueue<IFeedMessage> queue);
+
+ /**
+ * Deliver a message to a feed with a given feedId.
+ *
+ * @param feedId
+ * identifier for the feed dataset.
+ * @param feedMessage
+ * control message that needs to be delivered.
+ * @throws Exception
+ */
+ public void deliverMessage(FeedId feedId, IFeedMessage feedMessage) throws AsterixException;
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/feed/lifecycle/IFeedMessage.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/feed/lifecycle/IFeedMessage.java
new file mode 100644
index 0000000..9e1e907
--- /dev/null
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/feed/lifecycle/IFeedMessage.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.external.feed.lifecycle;
+
+import java.io.Serializable;
+
+public interface IFeedMessage extends Serializable {
+
+ public enum MessageType {
+ STOP,
+ ALTER,
+ }
+
+ public MessageType getMessageType();
+
+}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/comm/AlterFeedMessage.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/comm/AlterFeedMessage.java
deleted file mode 100644
index d34af73..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/comm/AlterFeedMessage.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.feed.comm;
-
-import java.util.Map;
-
-public class AlterFeedMessage extends FeedMessage {
-
- private final Map<String, String> alteredConfParams;
-
- public AlterFeedMessage(Map<String, String> alteredConfParams) {
- super(MessageType.ALTER);
- messageResponseMode = MessageResponseMode.SYNCHRONOUS;
- this.alteredConfParams = alteredConfParams;
- }
-
- public AlterFeedMessage(MessageResponseMode mode, Map<String, String> alteredConfParams) {
- super(MessageType.ALTER);
- messageResponseMode = mode;
- this.alteredConfParams = alteredConfParams;
- }
-
- @Override
- public MessageResponseMode getMessageResponseMode() {
- return messageResponseMode;
- }
-
- @Override
- public MessageType getMessageType() {
- return MessageType.ALTER;
- }
-
- public Map<String, String> getAlteredConfParams() {
- return alteredConfParams;
- }
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/comm/FeedMessage.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/comm/FeedMessage.java
deleted file mode 100644
index 1f1a020..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/comm/FeedMessage.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.feed.comm;
-
-public class FeedMessage implements IFeedMessage {
-
- protected MessageResponseMode messageResponseMode = MessageResponseMode.SYNCHRONOUS;
- protected MessageType messageType;
-
-
- public FeedMessage(MessageType messageType){
- this.messageType = messageType;
- }
-
-
- public MessageResponseMode getMessageResponseMode() {
- return messageResponseMode;
- }
-
-
- public void setMessageResponseMode(MessageResponseMode messageResponseMode) {
- this.messageResponseMode = messageResponseMode;
- }
-
-
- public MessageType getMessageType() {
- return messageType;
- }
-
-
- public void setMessageType(MessageType messageType) {
- this.messageType = messageType;
- }
-
-
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/comm/IFeedMessage.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/comm/IFeedMessage.java
deleted file mode 100644
index dfb4f91..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/comm/IFeedMessage.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.feed.comm;
-
-import java.io.Serializable;
-
-public interface IFeedMessage extends Serializable {
-
- public enum MessageResponseMode {
- SYNCHRONOUS,
- ASYNCHRONOUS,
- }
-
- public enum MessageType {
- STOP,
- SUSPEND,
- RESUME,
- ALTER,
- }
-
- public MessageResponseMode getMessageResponseMode();
-
- public MessageType getMessageType();
-
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/intake/AbstractFeedStream.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/intake/AbstractFeedStream.java
deleted file mode 100644
index 3d3856d..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/intake/AbstractFeedStream.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package edu.uci.ics.asterix.feed.intake;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.ByteBuffer;
-import java.util.List;
-
-import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-
-public abstract class AbstractFeedStream extends InputStream {
-
- private ByteBuffer buffer;
- private int capacity;
- private IFeedClient feedClient;
- private List<String> feedObjects;
-
- public AbstractFeedStream(IFeedClient feedClient, IHyracksTaskContext ctx)
- throws Exception {
- capacity = ctx.getFrameSize();
- buffer = ByteBuffer.allocate(capacity);
- this.feedClient = feedClient;
- initialize();
- }
-
- @Override
- public int read() throws IOException {
- if (!buffer.hasRemaining()) {
-
- boolean hasMore = feedClient.next(feedObjects);
- if (!hasMore) {
- return -1;
- }
- buffer.position(0);
- buffer.limit(capacity);
- for (String feed : feedObjects) {
- buffer.put(feed.getBytes());
- buffer.put("\n".getBytes());
- }
- buffer.flip();
- return buffer.get();
- } else {
- return buffer.get();
- }
-
- }
-
- private void initialize() throws Exception {
- boolean hasMore = feedClient.next(feedObjects);
- if (!hasMore) {
- buffer.limit(0);
- } else {
- buffer.position(0);
- buffer.limit(capacity);
- for (String feed : feedObjects) {
- buffer.put(feed.getBytes());
- buffer.put("\n".getBytes());
- }
- buffer.flip();
- }
- }
-
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/intake/FeedStream.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/intake/FeedStream.java
deleted file mode 100644
index 9d75182..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/intake/FeedStream.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package edu.uci.ics.asterix.feed.intake;
-
-import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-
-
-public class FeedStream extends AbstractFeedStream {
-
- public FeedStream(IFeedClient feedClient, IHyracksTaskContext ctx)
- throws Exception {
- super(feedClient, ctx);
- }
-
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/intake/IFeedClient.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/intake/IFeedClient.java
deleted file mode 100644
index b67561d..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/intake/IFeedClient.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package edu.uci.ics.asterix.feed.intake;
-
-import java.util.List;
-
-public interface IFeedClient {
-
- public boolean next(List<String> list);
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/intake/RSSFeedClient.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/intake/RSSFeedClient.java
deleted file mode 100644
index 2e77499..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/intake/RSSFeedClient.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package edu.uci.ics.asterix.feed.intake;
-
-import java.net.URL;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import com.sun.syndication.feed.synd.SyndEntryImpl;
-import com.sun.syndication.feed.synd.SyndFeed;
-import com.sun.syndication.fetcher.FeedFetcher;
-import com.sun.syndication.fetcher.FetcherEvent;
-import com.sun.syndication.fetcher.FetcherListener;
-import com.sun.syndication.fetcher.impl.FeedFetcherCache;
-import com.sun.syndication.fetcher.impl.HashMapFeedInfoCache;
-import com.sun.syndication.fetcher.impl.HttpURLFeedFetcher;
-
-import edu.uci.ics.asterix.external.dataset.adapter.RSSFeedAdapter;
-
-@SuppressWarnings("rawtypes")
-public class RSSFeedClient implements IFeedClient {
-
- private final String feedURL;
- private int timeInterval = 1;
- private Character delimiter = '|';
- private long id = 0;
- private String id_prefix;
- private boolean feedModified = false;
- private RSSFeedAdapter adapter;
-
- public boolean isFeedModified() {
- return feedModified;
- }
-
- public void setFeedModified(boolean feedModified) {
- this.feedModified = feedModified;
- }
-
- public RSSFeedClient(RSSFeedAdapter adapter, String feedURL,
- String id_prefix) {
- this.adapter = adapter;
- this.feedURL = feedURL;
- this.id_prefix = id_prefix;
- }
-
- private void initialize(Map<String, String> params) {
- if (params.get(adapter.KEY_INTERVAL) != null) {
- this.timeInterval = Integer.parseInt(params
- .get(adapter.KEY_INTERVAL));
- }
- }
-
- @Override
- public boolean next(List<String> feeds) {
- try {
- if (adapter.isStopRequested()) {
- return false;
- }
- if (adapter.isAlterRequested()) {
- initialize(adapter.getAlteredParams());
- adapter.postAlteration();
- }
- Thread.sleep(timeInterval * 1000);
- feeds.clear();
- try {
- getFeed(feeds);
- } catch (Exception te) {
- te.printStackTrace();
- System.out.println("Failed to get feed: " + te.getMessage());
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- return true;
- }
-
- public String formFeedTuple(Object entry) {
- StringBuilder builder = new StringBuilder();
- builder.append(id_prefix + ":" + id);
- builder.append(delimiter);
- builder.append(((SyndEntryImpl) entry).getTitle());
- builder.append(delimiter);
- builder.append(((SyndEntryImpl) entry).getLink());
- id++;
- return new String(builder);
- }
-
- private void getFeed(List<String> feeds) {
- try {
- URL feedUrl = new URL(feedURL);
- FeedFetcherCache feedInfoCache = HashMapFeedInfoCache.getInstance();
- FeedFetcher fetcher = new HttpURLFeedFetcher(feedInfoCache);
-
- FetcherEventListenerImpl listener = new FetcherEventListenerImpl(
- this);
- fetcher.addFetcherEventListener(listener);
- System.err.println("Retrieving feed " + feedUrl);
- // Retrieve the feed.
- // We will get a Feed Polled Event and then a
- // Feed Retrieved event (assuming the feed is valid)
- SyndFeed feed = fetcher.retrieveFeed(feedUrl);
- if (feedModified) {
- System.err.println(feedUrl + " retrieved");
- System.err.println(feedUrl + " has a title: " + feed.getTitle()
- + " and contains " + feed.getEntries().size()
- + " entries.");
-
- List fetchedFeeds = feed.getEntries();
- Iterator feedIterator = fetchedFeeds.iterator();
- while (feedIterator.hasNext()) {
- SyndEntryImpl feedEntry = (SyndEntryImpl) feedIterator
- .next();
- String feedContent = formFeedTuple(feedEntry);
- feeds.add(escapeChars(feedContent));
- System.out.println(feedContent);
- }
- }
- } catch (Exception ex) {
- System.out.println("ERROR: " + ex.getMessage());
- ex.printStackTrace();
- }
- }
-
- private String escapeChars(String content) {
- if (content.contains("\n")) {
- return content.replace("\n", " ");
- }
- return content;
- }
-
-}
-
-class FetcherEventListenerImpl implements FetcherListener {
-
- private final IFeedClient feedClient;
-
- public FetcherEventListenerImpl(IFeedClient feedClient) {
- this.feedClient = feedClient;
- }
-
- /**
- * @see com.sun.syndication.fetcher.FetcherListener#fetcherEvent(com.sun.syndication.fetcher.FetcherEvent)
- */
- public void fetcherEvent(FetcherEvent event) {
- String eventType = event.getEventType();
- if (FetcherEvent.EVENT_TYPE_FEED_POLLED.equals(eventType)) {
- System.err.println("\tEVENT: Feed Polled. URL = "
- + event.getUrlString());
- } else if (FetcherEvent.EVENT_TYPE_FEED_RETRIEVED.equals(eventType)) {
- System.err.println("\tEVENT: Feed Retrieved. URL = "
- + event.getUrlString());
- ((RSSFeedClient) feedClient).setFeedModified(true);
- } else if (FetcherEvent.EVENT_TYPE_FEED_UNCHANGED.equals(eventType)) {
- System.err.println("\tEVENT: Feed Unchanged. URL = "
- + event.getUrlString());
- ((RSSFeedClient) feedClient).setFeedModified(true);
- }
- }
-}
\ No newline at end of file
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/managed/adapter/IManagedFeedAdapter.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/managed/adapter/IManagedFeedAdapter.java
index 1eb1079..6f993ae 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/managed/adapter/IManagedFeedAdapter.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/managed/adapter/IManagedFeedAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2009-2011 by The Regents of the University of California
+ * Copyright 2009-2012 by The Regents of the University of California
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may obtain a copy of the License from
@@ -14,27 +14,30 @@
*/
package edu.uci.ics.asterix.feed.managed.adapter;
-import edu.uci.ics.asterix.external.data.adapter.api.IDatasourceReadAdapter;
+import java.util.Map;
-public interface IManagedFeedAdapter extends IDatasourceReadAdapter {
+/**
+ * Interface implemented by an adapter that can be controlled or managed by external
+ * commands (stop,alter)
+ */
+public interface IManagedFeedAdapter {
- public enum OperationState {
- SUSPENDED,
- // INACTIVE state signifies that the feed dataset is not
- // connected with the external world through the feed
- // adapter.
- ACTIVE,
- // ACTIVE state signifies that the feed dataset is connected to the
- // external world using an adapter that may put data into the dataset.
- STOPPED, INACTIVE
- }
-
- public void beforeSuspend() throws Exception;
+ /**
+ * Discontinue the ingestion of data and end the feed.
+ *
+ * @throws Exception
+ */
+ public void stop();
- public void beforeResume() throws Exception;
-
- public void beforeStop() throws Exception;
-
- public void stop() throws Exception;
+ /**
+ * Modify the adapter configuration parameters. This method is called
+ * when the configuration parameters need to be modified while the adapter
+ * is ingesting data in an active feed.
+ *
+ * @param properties
+ * A HashMap containing the set of configuration parameters
+ * that need to be altered.
+ */
+ public void alter(Map<String, String> properties);
}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/managed/adapter/IMutableFeedAdapter.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/managed/adapter/IMutableFeedAdapter.java
deleted file mode 100644
index 290c7d6..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/managed/adapter/IMutableFeedAdapter.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.feed.managed.adapter;
-
-import java.util.Map;
-
-public interface IMutableFeedAdapter extends IManagedFeedAdapter {
-
- public void alter(Map<String,String> properties) throws Exception;
-
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/mgmt/FeedId.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/mgmt/FeedId.java
deleted file mode 100644
index 19076c4..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/mgmt/FeedId.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-package edu.uci.ics.asterix.feed.mgmt;
-
-import java.io.Serializable;
-
-public class FeedId implements Serializable {
-
- private final String dataverse;
- private final String dataset;
-
- public FeedId(String dataverse, String dataset) {
- this.dataset = dataset;
- this.dataverse = dataverse;
- }
-
- public String getDataverse() {
- return dataverse;
- }
-
- public String getDataset() {
- return dataset;
- }
-
- @Override
- public boolean equals(Object o) {
- if (o == null || !(o instanceof FeedId)) {
- return false;
- }
- if (((FeedId) o).getDataset().equals(dataset) && ((FeedId) o).getDataverse().equals(dataverse)) {
- return true;
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- return dataverse.hashCode() + dataset.hashCode();
- }
-
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/mgmt/FeedManager.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/mgmt/FeedManager.java
deleted file mode 100644
index 39c0442..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/mgmt/FeedManager.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.feed.mgmt;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import edu.uci.ics.asterix.feed.comm.IFeedMessage;
-
-public class FeedManager implements IFeedManager {
-
- private Map<FeedId, Set<LinkedBlockingQueue<IFeedMessage>>> outGoingMsgQueueMap = new HashMap<FeedId, Set<LinkedBlockingQueue<IFeedMessage>>>();
- private LinkedBlockingQueue<IFeedMessage> incomingMsgQueue = new LinkedBlockingQueue<IFeedMessage>();
-
-
- @Override
- public boolean deliverMessage(FeedId feedId, IFeedMessage feedMessage) throws Exception {
- Set<LinkedBlockingQueue<IFeedMessage>> operatorQueues = outGoingMsgQueueMap.get(feedId);
- if (operatorQueues == null) {
- throw new IllegalArgumentException(" unknown feed id " + feedId.getDataverse() + ":" + feedId.getDataset());
- }
-
- for (LinkedBlockingQueue<IFeedMessage> queue : operatorQueues) {
- queue.put(feedMessage);
- }
- return false;
- }
-
- @Override
- public void registerFeedOperatorMsgQueue(FeedId feedId, LinkedBlockingQueue<IFeedMessage> queue) {
- Set<LinkedBlockingQueue<IFeedMessage>> feedQueues = outGoingMsgQueueMap.get(feedId);
- if (feedQueues == null) {
- feedQueues = new HashSet<LinkedBlockingQueue<IFeedMessage>>();
- }
- feedQueues.add(queue);
- outGoingMsgQueueMap.put(feedId, feedQueues);
-
- }
-
- @Override
- public void unregisterFeedOperatorMsgQueue(FeedId feedId, LinkedBlockingQueue<IFeedMessage> queue) {
- Set<LinkedBlockingQueue<IFeedMessage>> feedQueues = outGoingMsgQueueMap.get(feedId);
- if (feedQueues == null || !feedQueues.contains(queue)) {
- throw new IllegalArgumentException(" unable to de-register feed message queue");
- }
- feedQueues.remove(queue);
- }
-
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/mgmt/FeedSystemProvider.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/mgmt/FeedSystemProvider.java
deleted file mode 100644
index 82fb67d..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/mgmt/FeedSystemProvider.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.feed.mgmt;
-
-
-/**
- * Provider for all the sub-systems (transaction/lock/log/recovery) managers.
- * Users of transaction sub-systems must obtain them from the provider.
- */
-public class FeedSystemProvider {
- private static final IFeedManager feedManager = new FeedManager();
-
- public static IFeedManager getFeedManager() {
- return feedManager;
- }
-}
\ No newline at end of file
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/mgmt/IFeedManager.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/mgmt/IFeedManager.java
deleted file mode 100644
index a8c1303..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/mgmt/IFeedManager.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.feed.mgmt;
-
-import java.util.concurrent.LinkedBlockingQueue;
-
-import edu.uci.ics.asterix.feed.comm.IFeedMessage;
-
-public interface IFeedManager {
-
- public void registerFeedOperatorMsgQueue(FeedId feedId, LinkedBlockingQueue<IFeedMessage> queue);
-
- public void unregisterFeedOperatorMsgQueue(FeedId feedId, LinkedBlockingQueue<IFeedMessage> queue);
-
- public boolean deliverMessage(FeedId feedId, IFeedMessage feedMessage) throws Exception;
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/operator/FeedIntakeOperatorDescriptor.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/operator/FeedIntakeOperatorDescriptor.java
deleted file mode 100644
index 93b8fc5..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/operator/FeedIntakeOperatorDescriptor.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.feed.operator;
-
-import java.util.Map;
-
-import edu.uci.ics.asterix.external.data.adapter.api.IDatasourceReadAdapter;
-import edu.uci.ics.asterix.feed.mgmt.FeedId;
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-import edu.uci.ics.hyracks.api.dataflow.IOperatorNodePushable;
-import edu.uci.ics.hyracks.api.dataflow.value.IRecordDescriptorProvider;
-import edu.uci.ics.hyracks.api.dataflow.value.RecordDescriptor;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.api.job.JobSpecification;
-import edu.uci.ics.hyracks.dataflow.std.base.AbstractSingleActivityOperatorDescriptor;
-
-public class FeedIntakeOperatorDescriptor extends AbstractSingleActivityOperatorDescriptor {
- private static final long serialVersionUID = 1L;
-
- private final String adapter;
- private final Map<String, String> adapterConfiguration;
- private final IAType atype;
- private final FeedId feedId;
-
- private transient IDatasourceReadAdapter datasourceReadAdapter;
-
- public FeedIntakeOperatorDescriptor(JobSpecification spec, FeedId feedId, String adapter,
- Map<String, String> arguments, ARecordType atype, RecordDescriptor rDesc) {
- super(spec, 1, 1);
- recordDescriptors[0] = rDesc;
- this.adapter = adapter;
- this.adapterConfiguration = arguments;
- this.atype = atype;
- this.feedId = feedId;
- }
-
- public IOperatorNodePushable createPushRuntime(IHyracksTaskContext ctx,
- IRecordDescriptorProvider recordDescProvider, final int partition, int nPartitions)
- throws HyracksDataException {
-
- try {
- datasourceReadAdapter = (IDatasourceReadAdapter) Class.forName(adapter).newInstance();
- datasourceReadAdapter.configure(adapterConfiguration, atype);
- datasourceReadAdapter.initialize(ctx);
-
- } catch (Exception e) {
- throw new HyracksDataException("initialization of adapter failed", e);
- }
- return new FeedIntakeOperatorNodePushable(feedId, datasourceReadAdapter, partition);
- }
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/operator/FeedIntakeOperatorNodePushable.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/operator/FeedIntakeOperatorNodePushable.java
deleted file mode 100644
index 4603208..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/operator/FeedIntakeOperatorNodePushable.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package edu.uci.ics.asterix.feed.operator;
-
-import java.nio.ByteBuffer;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import edu.uci.ics.asterix.external.data.adapter.api.IDatasourceReadAdapter;
-import edu.uci.ics.asterix.external.data.parser.IManagedDataParser;
-import edu.uci.ics.asterix.feed.managed.adapter.IManagedFeedAdapter;
-import edu.uci.ics.asterix.feed.managed.adapter.IMutableFeedAdapter;
-import edu.uci.ics.asterix.feed.mgmt.FeedId;
-import edu.uci.ics.asterix.feed.mgmt.FeedSystemProvider;
-import edu.uci.ics.asterix.feed.mgmt.IFeedManager;
-import edu.uci.ics.asterix.feed.comm.AlterFeedMessage;
-import edu.uci.ics.asterix.feed.comm.IFeedMessage;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.std.base.AbstractUnaryInputUnaryOutputOperatorNodePushable;
-import edu.uci.ics.hyracks.dataflow.std.base.AbstractUnaryOutputSourceOperatorNodePushable;
-
-public class FeedIntakeOperatorNodePushable extends AbstractUnaryInputUnaryOutputOperatorNodePushable {
-
- private final IDatasourceReadAdapter adapter;
- private final int partition;
- private final IFeedManager feedManager;
- private final FeedId feedId;
- private final LinkedBlockingQueue<IFeedMessage> inbox;
- private FeedInboxMonitor feedInboxMonitor;
-
- public FeedIntakeOperatorNodePushable(FeedId feedId, IDatasourceReadAdapter adapter, int partition) {
- this.adapter = adapter;
- this.partition = partition;
- this.feedManager = (IFeedManager) FeedSystemProvider.getFeedManager();
- this.feedId = feedId;
- inbox = new LinkedBlockingQueue<IFeedMessage>();
- }
-
- @Override
- public void open() throws HyracksDataException {
- feedInboxMonitor = new FeedInboxMonitor((IManagedFeedAdapter) adapter, inbox, partition);
- feedInboxMonitor.start();
- feedManager.registerFeedOperatorMsgQueue(feedId, inbox);
- writer.open();
- try {
- adapter.getDataParser(partition).parse(writer);
- } catch (Exception e) {
- throw new HyracksDataException("exception during reading from external data source", e);
- } finally {
- writer.close();
- }
- }
-
- @Override
- public void fail() throws HyracksDataException {
- writer.close();
- }
-
- @Override
- public void close() throws HyracksDataException {
- writer.close();
- }
-
- @Override
- public void nextFrame(ByteBuffer buffer) throws HyracksDataException {
- // TODO Auto-generated method stub
-
- }
-}
-
-class FeedInboxMonitor extends Thread {
-
- private LinkedBlockingQueue<IFeedMessage> inbox;
- private final IManagedFeedAdapter adapter;
- private final int partition;
-
- public FeedInboxMonitor(IManagedFeedAdapter adapter, LinkedBlockingQueue<IFeedMessage> inbox, int partition) {
- this.inbox = inbox;
- this.adapter = adapter;
- this.partition = partition;
- }
-
- @Override
- public void run() {
- while (true) {
- try {
- IFeedMessage feedMessage = inbox.take();
- switch (feedMessage.getMessageType()) {
- case SUSPEND:
- ((IManagedDataParser) adapter.getDataParser(partition)).getManagedTupleParser().suspend();
- break;
- case RESUME:
- ((IManagedDataParser) adapter.getDataParser(partition)).getManagedTupleParser().resume();
- break;
- case STOP:
- ((IManagedDataParser) adapter.getDataParser(partition)).getManagedTupleParser().stop();
- break;
- case ALTER:
- ((IMutableFeedAdapter) adapter).alter(((AlterFeedMessage) feedMessage).getAlteredConfParams());
- break;
- }
- } catch (InterruptedException ie) {
- break;
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- }
-
-}
\ No newline at end of file
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/operator/FeedMessageOperatorDescriptor.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/operator/FeedMessageOperatorDescriptor.java
deleted file mode 100644
index c66c49e..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/operator/FeedMessageOperatorDescriptor.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.feed.operator;
-
-import java.util.List;
-
-import edu.uci.ics.asterix.feed.comm.IFeedMessage;
-import edu.uci.ics.asterix.feed.mgmt.FeedId;
-import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-import edu.uci.ics.hyracks.api.dataflow.IOperatorNodePushable;
-import edu.uci.ics.hyracks.api.dataflow.value.IRecordDescriptorProvider;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.api.job.JobSpecification;
-import edu.uci.ics.hyracks.dataflow.std.base.AbstractSingleActivityOperatorDescriptor;
-
-public class FeedMessageOperatorDescriptor extends
- AbstractSingleActivityOperatorDescriptor {
-
- private final FeedId feedId;
- private final List<IFeedMessage> feedMessages;
- private final boolean sendToAll = true;
-
- public FeedMessageOperatorDescriptor(JobSpecification spec,
- String dataverse, String dataset, List<IFeedMessage> feedMessages) {
- super(spec, 0, 1);
- this.feedId = new FeedId(dataverse, dataset);
- this.feedMessages = feedMessages;
- }
-
- @Override
- public IOperatorNodePushable createPushRuntime(IHyracksTaskContext ctx,
- IRecordDescriptorProvider recordDescProvider, int partition,
- int nPartitions) throws HyracksDataException {
- return new FeedMessageOperatorNodePushable(ctx, feedId, feedMessages,
- sendToAll, partition, nPartitions);
- }
-
-}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/operator/FeedMessageOperatorNodePushable.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/operator/FeedMessageOperatorNodePushable.java
deleted file mode 100644
index 37e3ba3..0000000
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/feed/operator/FeedMessageOperatorNodePushable.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.feed.operator;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import edu.uci.ics.asterix.feed.comm.IFeedMessage;
-import edu.uci.ics.asterix.feed.mgmt.FeedId;
-import edu.uci.ics.asterix.feed.mgmt.FeedSystemProvider;
-import edu.uci.ics.asterix.feed.mgmt.IFeedManager;
-import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.std.base.AbstractUnaryOutputSourceOperatorNodePushable;
-
-public class FeedMessageOperatorNodePushable extends
- AbstractUnaryOutputSourceOperatorNodePushable {
-
- private final FeedId feedId;
- private final List<IFeedMessage> feedMessages;
- private IFeedManager feedManager;
-
- public FeedMessageOperatorNodePushable(IHyracksTaskContext ctx,
- FeedId feedId, List<IFeedMessage> feedMessages, boolean applyToAll,
- int partition, int nPartitions) {
- this.feedId = feedId;
- if (applyToAll) {
- this.feedMessages = feedMessages;
- } else {
- this.feedMessages = new ArrayList<IFeedMessage>();
- feedMessages.add(feedMessages.get(partition));
- }
- feedManager = (IFeedManager) FeedSystemProvider.getFeedManager();
- }
-
- @Override
- public void initialize() throws HyracksDataException {
- try {
- writer.open();
- for (IFeedMessage feedMessage : feedMessages) {
- feedManager.deliverMessage(feedId, feedMessage);
- }
- } catch (Exception e) {
- throw new HyracksDataException(e);
- } finally {
- writer.close();
- }
- }
-
-}
diff --git a/asterix-metadata/pom.xml b/asterix-metadata/pom.xml
index 043bc13..67f16ff 100644
--- a/asterix-metadata/pom.xml
+++ b/asterix-metadata/pom.xml
@@ -45,12 +45,12 @@
<dependency>
<groupId>edu.uci.ics.hyracks</groupId>
<artifactId>hyracks-storage-am-invertedindex</artifactId>
- <version>0.2.1-SNAPSHOT</version>
+ <version>0.2.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>edu.uci.ics.hyracks</groupId>
<artifactId>hyracks-storage-am-rtree</artifactId>
- <version>0.2.1-SNAPSHOT</version>
+ <version>0.2.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>edu.uci.ics.asterix</groupId>
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataCache.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataCache.java
index e205acf..66d46f9 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataCache.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataCache.java
@@ -20,13 +20,14 @@
import java.util.List;
import java.util.Map;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
import edu.uci.ics.asterix.metadata.api.IMetadataEntity;
+import edu.uci.ics.asterix.metadata.entities.DatasourceAdapter;
import edu.uci.ics.asterix.metadata.entities.Dataset;
import edu.uci.ics.asterix.metadata.entities.Datatype;
import edu.uci.ics.asterix.metadata.entities.Dataverse;
import edu.uci.ics.asterix.metadata.entities.Function;
import edu.uci.ics.asterix.metadata.entities.NodeGroup;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
/**
* Caches metadata entities such that the MetadataManager does not have to
@@ -44,7 +45,9 @@
// Key is dataverse name.
protected final Map<String, NodeGroup> nodeGroups = new HashMap<String, NodeGroup>();
// Key is function Identifier . Key of value map is function name.
- protected final Map<FunctionIdentifier, Function> functions = new HashMap<FunctionIdentifier, Function>();
+ protected final Map<FunctionSignature, Function> functions = new HashMap<FunctionSignature, Function>();
+ // Key is adapter dataverse. Key of value map is the adapter name
+ protected final Map<String, Map<String, DatasourceAdapter>> adapters = new HashMap<String, Map<String, DatasourceAdapter>>();
// Atomically executes all metadata operations in ctx's log.
public void commit(MetadataTransactionContext ctx) {
@@ -78,10 +81,14 @@
synchronized (datasets) {
synchronized (datatypes) {
synchronized (functions) {
- dataverses.clear();
- nodeGroups.clear();
- datasets.clear();
- datatypes.clear();
+ synchronized (adapters) {
+ dataverses.clear();
+ nodeGroups.clear();
+ datasets.clear();
+ datatypes.clear();
+ functions.clear();
+ adapters.clear();
+ }
}
}
}
@@ -93,12 +100,11 @@
synchronized (dataverses) {
synchronized (datasets) {
synchronized (datatypes) {
- synchronized (functions) {
- if (!dataverses.containsKey(dataverse)) {
- datasets.put(dataverse.getDataverseName(), new HashMap<String, Dataset>());
- datatypes.put(dataverse.getDataverseName(), new HashMap<String, Datatype>());
- return dataverses.put(dataverse.getDataverseName(), dataverse);
- }
+ if (!dataverses.containsKey(dataverse)) {
+ datasets.put(dataverse.getDataverseName(), new HashMap<String, Dataset>());
+ datatypes.put(dataverse.getDataverseName(), new HashMap<String, Datatype>());
+ adapters.put(dataverse.getDataverseName(), new HashMap<String, DatasourceAdapter>());
+ return dataverses.put(dataverse.getDataverseName(), dataverse);
}
return null;
}
@@ -150,6 +156,16 @@
synchronized (functions) {
datasets.remove(dataverse.getDataverseName());
datatypes.remove(dataverse.getDataverseName());
+ adapters.remove(dataverse.getDataverseName());
+ List<FunctionSignature> markedFunctionsForRemoval = new ArrayList<FunctionSignature>();
+ for (FunctionSignature signature : functions.keySet()) {
+ if (signature.getNamespace().equals(dataverse.getDataverseName())) {
+ markedFunctionsForRemoval.add(signature);
+ }
+ }
+ for (FunctionSignature signature : markedFunctionsForRemoval) {
+ functions.remove(signature);
+ }
return dataverses.remove(dataverse.getDataverseName());
}
}
@@ -215,9 +231,9 @@
}
}
- public Function getFunction(String dataverse, String functionName, int arity) {
+ public Function getFunction(FunctionSignature functionSignature) {
synchronized (functions) {
- return functions.get(new FunctionIdentifier(dataverse, functionName, arity));
+ return functions.get(functionSignature);
}
}
@@ -268,12 +284,11 @@
public Object addFunctionIfNotExists(Function function) {
synchronized (functions) {
- FunctionIdentifier fId = new FunctionIdentifier(function.getDataverseName(), function.getFunctionName(),
- function.getFunctionArity());
-
- Function fun = functions.get(fId);
+ FunctionSignature signature = new FunctionSignature(function.getDataverseName(), function.getName(),
+ function.getArity());
+ Function fun = functions.get(signature);
if (fun == null) {
- return functions.put(fId, function);
+ return functions.put(signature, function);
}
return null;
}
@@ -281,13 +296,39 @@
public Object dropFunction(Function function) {
synchronized (functions) {
- FunctionIdentifier fId = new FunctionIdentifier(function.getDataverseName(), function.getFunctionName(),
- function.getFunctionArity());
- Function fun = functions.get(fId);
+ FunctionSignature signature = new FunctionSignature(function.getDataverseName(), function.getName(),
+ function.getArity());
+ Function fun = functions.get(signature);
if (fun == null) {
return null;
}
- return functions.remove(fId);
+ return functions.remove(signature);
+ }
+ }
+
+ public Object addAdapterIfNotExists(DatasourceAdapter adapter) {
+ synchronized (adapters) {
+ DatasourceAdapter adapterObject = adapters.get(adapter.getAdapterIdentifier().getNamespace()).get(
+ adapter.getAdapterIdentifier().getAdapterName());
+ if (adapterObject != null) {
+ Map<String, DatasourceAdapter> adaptersInDataverse = adapters.get(adapter.getAdapterIdentifier().getNamespace());
+ if (adaptersInDataverse == null) {
+ adaptersInDataverse = new HashMap<String, DatasourceAdapter>();
+ adapters.put(adapter.getAdapterIdentifier().getNamespace(), adaptersInDataverse);
+ }
+ return adaptersInDataverse.put(adapter.getAdapterIdentifier().getAdapterName(), adapter);
+ }
+ return null;
+ }
+ }
+
+ public Object dropAdapter(DatasourceAdapter adapter) {
+ synchronized (adapters) {
+ Map<String, DatasourceAdapter> adaptersInDataverse = adapters.get(adapter.getAdapterIdentifier().getNamespace());
+ if (adaptersInDataverse != null) {
+ return adaptersInDataverse.remove(adapter.getAdapterIdentifier().getAdapterName());
+ }
+ return null;
}
}
}
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataManager.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataManager.java
index bd4f9bb..9f1b9b5 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataManager.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataManager.java
@@ -18,9 +18,12 @@
import java.rmi.RemoteException;
import java.util.List;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
import edu.uci.ics.asterix.metadata.api.IAsterixStateProxy;
import edu.uci.ics.asterix.metadata.api.IMetadataManager;
import edu.uci.ics.asterix.metadata.api.IMetadataNode;
+import edu.uci.ics.asterix.metadata.bootstrap.MetadataConstants;
+import edu.uci.ics.asterix.metadata.entities.DatasourceAdapter;
import edu.uci.ics.asterix.metadata.entities.Dataset;
import edu.uci.ics.asterix.metadata.entities.Datatype;
import edu.uci.ics.asterix.metadata.entities.Dataverse;
@@ -237,11 +240,13 @@
// in the cache.
return null;
}
- if (ctx.getDataverse(dataverseName) != null) {
+
+ if (!MetadataConstants.METADATA_DATAVERSE_NAME.equals(dataverseName) && ctx.getDataverse(dataverseName) != null) {
// This transaction has dropped and subsequently created the same
// dataverse.
return null;
}
+
dataset = cache.getDataset(dataverseName, datasetName);
if (dataset != null) {
// Dataset is already in the cache, don't add it again.
@@ -309,11 +314,13 @@
// in the cache.
return null;
}
- if (ctx.getDataverse(dataverseName) != null) {
+
+ if (!MetadataConstants.METADATA_DATAVERSE_NAME.equals(dataverseName) && ctx.getDataverse(dataverseName) != null) {
// This transaction has dropped and subsequently created the same
// dataverse.
return null;
}
+
datatype = cache.getDatatype(dataverseName, datatypeName);
if (datatype != null) {
// Datatype is already in the cache, don't add it again.
@@ -342,6 +349,17 @@
}
@Override
+ public void addAdapter(MetadataTransactionContext mdTxnCtx, DatasourceAdapter adapter) throws MetadataException {
+ try {
+ metadataNode.addAdapter(mdTxnCtx.getTxnId(), adapter);
+ } catch (RemoteException e) {
+ throw new MetadataException(e);
+ }
+ mdTxnCtx.addAdapter(adapter);
+
+ }
+
+ @Override
public void dropIndex(MetadataTransactionContext ctx, String dataverseName, String datasetName, String indexName)
throws MetadataException {
try {
@@ -434,44 +452,44 @@
}
@Override
- public void dropFunction(MetadataTransactionContext ctx, String dataverseName, String functionName, int arity)
+ public void dropFunction(MetadataTransactionContext ctx, FunctionSignature functionSignature)
throws MetadataException {
try {
- metadataNode.dropFunction(ctx.getTxnId(), dataverseName, functionName, arity);
+ metadataNode.dropFunction(ctx.getTxnId(), functionSignature);
} catch (RemoteException e) {
throw new MetadataException(e);
}
- ctx.dropFunction(dataverseName, functionName, arity);
+ ctx.dropFunction(functionSignature);
}
@Override
- public Function getFunction(MetadataTransactionContext ctx, String dataverseName, String functionName, int arity)
+ public Function getFunction(MetadataTransactionContext ctx, FunctionSignature functionSignature)
throws MetadataException {
// First look in the context to see if this transaction created the
// requested dataset itself (but the dataset is still uncommitted).
- Function function = ctx.getFunction(dataverseName, functionName, arity);
+ Function function = ctx.getFunction(functionSignature);
if (function != null) {
// Don't add this dataverse to the cache, since it is still
// uncommitted.
return function;
}
- if (ctx.functionIsDropped(dataverseName, functionName, arity)) {
- // Dataset has been dropped by this transaction but could still be
+ if (ctx.functionIsDropped(functionSignature)) {
+ // Function has been dropped by this transaction but could still be
// in the cache.
return null;
}
- if (ctx.getDataverse(dataverseName) != null) {
+ if (ctx.getDataverse(functionSignature.getNamespace()) != null) {
// This transaction has dropped and subsequently created the same
// dataverse.
return null;
}
- function = cache.getFunction(dataverseName, functionName, arity);
+ function = cache.getFunction(functionSignature);
if (function != null) {
// Function is already in the cache, don't add it again.
return function;
}
try {
- function = metadataNode.getFunction(ctx.getTxnId(), dataverseName, functionName, arity);
+ function = metadataNode.getFunction(ctx.getTxnId(), functionSignature);
} catch (RemoteException e) {
throw new MetadataException(e);
}
@@ -483,4 +501,42 @@
return function;
}
+
+ @Override
+ public List<Function> getDataverseFunctions(MetadataTransactionContext ctx, String dataverseName)
+ throws MetadataException {
+ List<Function> dataverseFunctions;
+ try {
+ // Assuming that the transaction can read its own writes on the
+ // metadata node.
+ dataverseFunctions = metadataNode.getDataverseFunctions(ctx.getTxnId(), dataverseName);
+ } catch (RemoteException e) {
+ throw new MetadataException(e);
+ }
+ // Don't update the cache to avoid checking against the transaction's
+ // uncommitted functions.
+ return dataverseFunctions;
+ }
+
+ @Override
+ public void dropAdapter(MetadataTransactionContext ctx, String dataverseName, String name) throws MetadataException {
+ try {
+ metadataNode.dropAdapter(ctx.getTxnId(), dataverseName, name);
+ } catch (RemoteException e) {
+ throw new MetadataException(e);
+ }
+ }
+
+ @Override
+ public DatasourceAdapter getAdapter(MetadataTransactionContext ctx, String dataverseName, String name)
+ throws MetadataException {
+ DatasourceAdapter adapter = null;
+ try {
+ adapter = metadataNode.getAdapter(ctx.getTxnId(), dataverseName, name);
+ } catch (RemoteException e) {
+ throw new MetadataException(e);
+ }
+ return adapter;
+ }
+
}
\ No newline at end of file
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataNode.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataNode.java
index 591154a..120f1a5 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataNode.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataNode.java
@@ -23,12 +23,14 @@
import edu.uci.ics.asterix.common.config.DatasetConfig.IndexType;
import edu.uci.ics.asterix.common.context.AsterixAppRuntimeContext;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.metadata.api.IMetadataIndex;
import edu.uci.ics.asterix.metadata.api.IMetadataNode;
import edu.uci.ics.asterix.metadata.api.IValueExtractor;
import edu.uci.ics.asterix.metadata.bootstrap.MetadataPrimaryIndexes;
import edu.uci.ics.asterix.metadata.bootstrap.MetadataSecondaryIndexes;
+import edu.uci.ics.asterix.metadata.entities.DatasourceAdapter;
import edu.uci.ics.asterix.metadata.entities.Dataset;
import edu.uci.ics.asterix.metadata.entities.Datatype;
import edu.uci.ics.asterix.metadata.entities.Dataverse;
@@ -37,6 +39,7 @@
import edu.uci.ics.asterix.metadata.entities.InternalDatasetDetails;
import edu.uci.ics.asterix.metadata.entities.Node;
import edu.uci.ics.asterix.metadata.entities.NodeGroup;
+import edu.uci.ics.asterix.metadata.entitytupletranslators.DatasourceAdapterTupleTranslator;
import edu.uci.ics.asterix.metadata.entitytupletranslators.DatasetTupleTranslator;
import edu.uci.ics.asterix.metadata.entitytupletranslators.DatatypeTupleTranslator;
import edu.uci.ics.asterix.metadata.entitytupletranslators.DataverseTupleTranslator;
@@ -236,9 +239,8 @@
insertTupleIntoIndex(txnId, MetadataPrimaryIndexes.FUNCTION_DATASET, functionTuple);
} catch (BTreeDuplicateKeyException e) {
- throw new MetadataException("A dataset with this name " + function.getFunctionName() + " and arity "
- + function.getFunctionArity() + " already exists in dataverse '" + function.getDataverseName()
- + "'.", e);
+ throw new MetadataException("A function with this name " + function.getName() + " and arity "
+ + function.getArity() + " already exists in dataverse '" + function.getDataverseName() + "'.", e);
} catch (Exception e) {
throw new MetadataException(e);
}
@@ -285,6 +287,27 @@
forceDropDatatype(txnId, dataverseName, dataverseDatatypes.get(i).getDatatypeName());
}
}
+
+ // As a side effect, acquires an S lock on the 'Function' dataset
+ // on behalf of txnId.
+ List<Function> dataverseFunctions = getDataverseFunctions(txnId, dataverseName);
+ if (dataverseFunctions != null && dataverseFunctions.size() > 0) {
+ // Drop all functions in this dataverse.
+ for (Function function : dataverseFunctions) {
+ dropFunction(txnId, new FunctionSignature(dataverseName, function.getName(), function.getArity()));
+ }
+ }
+
+ // As a side effect, acquires an S lock on the 'Adapter' dataset
+ // on behalf of txnId.
+ List<DatasourceAdapter> dataverseAdapters = getDataverseAdapters(txnId, dataverseName);
+ if (dataverseAdapters != null && dataverseAdapters.size() > 0) {
+ // Drop all functions in this dataverse.
+ for (DatasourceAdapter adapter : dataverseAdapters) {
+ dropAdapter(txnId, dataverseName, adapter.getAdapterIdentifier().getAdapterName());
+ }
+ }
+
// Delete the dataverse entry from the 'dataverse' dataset.
ITupleReference searchKey = createTuple(dataverseName);
// As a side effect, acquires an S lock on the 'dataverse' dataset
@@ -435,9 +458,10 @@
// Searches the index for the tuple to be deleted. Acquires an S
// lock on the 'datatype' dataset.
ITupleReference tuple = getTupleToBeDeleted(txnId, MetadataPrimaryIndexes.DATATYPE_DATASET, searchKey);
+ // This call uses the secondary index on datatype. Get nested types before deleting entry from secondary index.
+ List<String> nestedTypes = getNestedDatatypeNames(txnId, dataverseName, datatypeName);
deleteTupleFromIndex(txnId, MetadataPrimaryIndexes.DATATYPE_DATASET, tuple);
deleteFromDatatypeSecondaryIndex(txnId, dataverseName, datatypeName);
- List<String> nestedTypes = getNestedDatatypeNames(txnId, dataverseName, datatypeName);
for (String nestedType : nestedTypes) {
Datatype dt = getDatatype(txnId, dataverseName, nestedType);
if (dt != null && dt.getIsAnonymous()) {
@@ -580,7 +604,7 @@
private List<String> getDatasetNamesDeclaredByThisDatatype(long txnId, String dataverseName, String datatypeName)
throws MetadataException, RemoteException {
try {
- ITupleReference searchKey = createTuple(dataverseName, dataverseName);
+ ITupleReference searchKey = createTuple(dataverseName, datatypeName);
List<String> results = new ArrayList<String>();
IValueExtractor<String> valueExtractor = new DatasetNameValueExtractor();
searchIndex(txnId, MetadataSecondaryIndexes.DATATYPENAME_ON_DATASET_INDEX, searchKey, valueExtractor,
@@ -701,10 +725,11 @@
}
@Override
- public Function getFunction(long txnId, String dataverseName, String functionName, int arity)
- throws MetadataException, RemoteException {
+ public Function getFunction(long txnId, FunctionSignature functionSignature) throws MetadataException,
+ RemoteException {
try {
- ITupleReference searchKey = createTuple(dataverseName, functionName, "" + arity);
+ ITupleReference searchKey = createTuple(functionSignature.getNamespace(), functionSignature.getName(), ""
+ + functionSignature.getArity());
FunctionTupleTranslator tupleReaderWriter = new FunctionTupleTranslator(false);
List<Function> results = new ArrayList<Function>();
IValueExtractor<Function> valueExtractor = new MetadataEntityValueExtractor<Function>(tupleReaderWriter);
@@ -714,26 +739,16 @@
}
return results.get(0);
} catch (Exception e) {
+ e.printStackTrace();
throw new MetadataException(e);
}
}
@Override
- public void dropFunction(long txnId, String dataverseName, String functionName, int arity)
- throws MetadataException, RemoteException {
- Function function;
- try {
- function = getFunction(txnId, dataverseName, functionName, arity);
- } catch (Exception e) {
- throw new MetadataException(e);
- }
- if (function == null) {
- throw new MetadataException("Cannot drop function '" + functionName + " and arity " + arity
- + "' because it doesn't exist.");
- }
+ public void dropFunction(long txnId, FunctionSignature functionSignature) throws MetadataException, RemoteException {
try {
// Delete entry from the 'function' dataset.
- ITupleReference searchKey = createTuple(dataverseName, functionName, "" + arity);
+ ITupleReference searchKey = createTuple(functionSignature.getNamespace(), functionSignature.getName());
// Searches the index for the tuple to be deleted. Acquires an S
// lock on the 'function' dataset.
ITupleReference datasetTuple = getTupleToBeDeleted(txnId, MetadataPrimaryIndexes.FUNCTION_DATASET,
@@ -743,8 +758,8 @@
// TODO: Change this to be a BTree specific exception, e.g.,
// BTreeKeyDoesNotExistException.
} catch (TreeIndexException e) {
- throw new MetadataException("Cannot drop function '" + functionName + " and arity " + arity
- + "' because it doesn't exist.", e);
+ throw new MetadataException("There is no function with the name " + functionSignature.getName()
+ + " and arity " + functionSignature.getArity(), e);
} catch (Exception e) {
throw new MetadataException(e);
}
@@ -812,4 +827,100 @@
tuple.reset(tupleBuilder.getFieldEndOffsets(), tupleBuilder.getByteArray());
return tuple;
}
+
+ @Override
+ public List<Function> getDataverseFunctions(long txnId, String dataverseName) throws MetadataException,
+ RemoteException {
+ try {
+ ITupleReference searchKey = createTuple(dataverseName);
+ FunctionTupleTranslator tupleReaderWriter = new FunctionTupleTranslator(false);
+ IValueExtractor<Function> valueExtractor = new MetadataEntityValueExtractor<Function>(tupleReaderWriter);
+ List<Function> results = new ArrayList<Function>();
+ searchIndex(txnId, MetadataPrimaryIndexes.FUNCTION_DATASET, searchKey, valueExtractor, results);
+ return results;
+ } catch (Exception e) {
+ throw new MetadataException(e);
+ }
+ }
+
+ @Override
+ public void addAdapter(long txnId, DatasourceAdapter adapter) throws MetadataException, RemoteException {
+ try {
+ // Insert into the 'Adapter' dataset.
+ DatasourceAdapterTupleTranslator tupleReaderWriter = new DatasourceAdapterTupleTranslator(true);
+ ITupleReference adapterTuple = tupleReaderWriter.getTupleFromMetadataEntity(adapter);
+ insertTupleIntoIndex(txnId, MetadataPrimaryIndexes.DATASOURCE_ADAPTER_DATASET, adapterTuple);
+
+ } catch (BTreeDuplicateKeyException e) {
+ throw new MetadataException("A adapter with this name " + adapter.getAdapterIdentifier().getAdapterName()
+ + " already exists in dataverse '" + adapter.getAdapterIdentifier().getNamespace() + "'.", e);
+ } catch (Exception e) {
+ throw new MetadataException(e);
+ }
+
+ }
+
+ @Override
+ public void dropAdapter(long txnId, String dataverseName, String adapterName) throws MetadataException,
+ RemoteException {
+ DatasourceAdapter adapter;
+ try {
+ adapter = getAdapter(txnId, dataverseName, adapterName);
+ } catch (Exception e) {
+ throw new MetadataException(e);
+ }
+ if (adapter == null) {
+ throw new MetadataException("Cannot drop adapter '" + adapter + "' because it doesn't exist.");
+ }
+ try {
+ // Delete entry from the 'Adapter' dataset.
+ ITupleReference searchKey = createTuple(dataverseName, adapterName);
+ // Searches the index for the tuple to be deleted. Acquires an S
+ // lock on the 'Adapter' dataset.
+ ITupleReference datasetTuple = getTupleToBeDeleted(txnId, MetadataPrimaryIndexes.DATASOURCE_ADAPTER_DATASET, searchKey);
+ deleteTupleFromIndex(txnId, MetadataPrimaryIndexes.DATASOURCE_ADAPTER_DATASET, datasetTuple);
+
+ // TODO: Change this to be a BTree specific exception, e.g.,
+ // BTreeKeyDoesNotExistException.
+ } catch (TreeIndexException e) {
+ throw new MetadataException("Cannot drop adapter '" + adapterName, e);
+ } catch (Exception e) {
+ throw new MetadataException(e);
+ }
+
+ }
+
+ @Override
+ public DatasourceAdapter getAdapter(long txnId, String dataverseName, String adapterName) throws MetadataException,
+ RemoteException {
+ try {
+ ITupleReference searchKey = createTuple(dataverseName, adapterName);
+ DatasourceAdapterTupleTranslator tupleReaderWriter = new DatasourceAdapterTupleTranslator(false);
+ List<DatasourceAdapter> results = new ArrayList<DatasourceAdapter>();
+ IValueExtractor<DatasourceAdapter> valueExtractor = new MetadataEntityValueExtractor<DatasourceAdapter>(tupleReaderWriter);
+ searchIndex(txnId, MetadataPrimaryIndexes.DATASOURCE_ADAPTER_DATASET, searchKey, valueExtractor, results);
+ if (results.isEmpty()) {
+ return null;
+ }
+ return results.get(0);
+ } catch (Exception e) {
+ throw new MetadataException(e);
+ }
+ }
+
+ @Override
+ public List<DatasourceAdapter> getDataverseAdapters(long txnId, String dataverseName) throws MetadataException,
+ RemoteException {
+ try {
+ ITupleReference searchKey = createTuple(dataverseName);
+ DatasourceAdapterTupleTranslator tupleReaderWriter = new DatasourceAdapterTupleTranslator(false);
+ IValueExtractor<DatasourceAdapter> valueExtractor = new MetadataEntityValueExtractor<DatasourceAdapter>(tupleReaderWriter);
+ List<DatasourceAdapter> results = new ArrayList<DatasourceAdapter>();
+ searchIndex(txnId, MetadataPrimaryIndexes.DATASOURCE_ADAPTER_DATASET, searchKey, valueExtractor, results);
+ return results;
+ } catch (Exception e) {
+ throw new MetadataException(e);
+ }
+ }
+
}
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataTransactionContext.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataTransactionContext.java
index e0aa69b..6c3bb5e 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataTransactionContext.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataTransactionContext.java
@@ -17,11 +17,15 @@
import java.util.ArrayList;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
+import edu.uci.ics.asterix.external.dataset.adapter.AdapterIdentifier;
+import edu.uci.ics.asterix.metadata.entities.DatasourceAdapter;
import edu.uci.ics.asterix.metadata.entities.Dataset;
import edu.uci.ics.asterix.metadata.entities.Datatype;
import edu.uci.ics.asterix.metadata.entities.Dataverse;
import edu.uci.ics.asterix.metadata.entities.Function;
import edu.uci.ics.asterix.metadata.entities.NodeGroup;
+import edu.uci.ics.asterix.om.functions.AsterixFunction;
/**
* Used to implement serializable transactions against the MetadataCache.
@@ -46,123 +50,130 @@
*/
public class MetadataTransactionContext extends MetadataCache {
- // Keeps track of deleted metadata entities.
- // An entity can either be in the droppedCache or in the inherited members
- // of MetadataCache (the "added" entities).
- // The APIs in this class make sure that these two caches are kept in sync.
- protected MetadataCache droppedCache = new MetadataCache();
+ // Keeps track of deleted metadata entities.
+ // An entity can either be in the droppedCache or in the inherited members
+ // of MetadataCache (the "added" entities).
+ // The APIs in this class make sure that these two caches are kept in sync.
+ protected MetadataCache droppedCache = new MetadataCache();
- protected ArrayList<MetadataLogicalOperation> opLog = new ArrayList<MetadataLogicalOperation>();
- private final long txnId;
+ protected ArrayList<MetadataLogicalOperation> opLog = new ArrayList<MetadataLogicalOperation>();
+ private final long txnId;
- public MetadataTransactionContext(long txnId) {
- this.txnId = txnId;
- }
+ public MetadataTransactionContext(long txnId) {
+ this.txnId = txnId;
+ }
- public long getTxnId() {
- return txnId;
- }
+ public long getTxnId() {
+ return txnId;
+ }
- public void addDataverse(Dataverse dataverse) {
- droppedCache.dropDataverse(dataverse);
- logAndApply(new MetadataLogicalOperation(dataverse, true));
- }
+ public void addDataverse(Dataverse dataverse) {
+ droppedCache.dropDataverse(dataverse);
+ logAndApply(new MetadataLogicalOperation(dataverse, true));
+ }
- public void addDataset(Dataset dataset) {
- droppedCache.dropDataset(dataset);
- logAndApply(new MetadataLogicalOperation(dataset, true));
- }
+ public void addDataset(Dataset dataset) {
+ droppedCache.dropDataset(dataset);
+ logAndApply(new MetadataLogicalOperation(dataset, true));
+ }
- public void addDatatype(Datatype datatype) {
- droppedCache.dropDatatype(datatype);
- logAndApply(new MetadataLogicalOperation(datatype, true));
- }
+ public void addDatatype(Datatype datatype) {
+ droppedCache.dropDatatype(datatype);
+ logAndApply(new MetadataLogicalOperation(datatype, true));
+ }
- public void addNogeGroup(NodeGroup nodeGroup) {
- droppedCache.dropNodeGroup(nodeGroup);
- logAndApply(new MetadataLogicalOperation(nodeGroup, true));
- }
+ public void addNogeGroup(NodeGroup nodeGroup) {
+ droppedCache.dropNodeGroup(nodeGroup);
+ logAndApply(new MetadataLogicalOperation(nodeGroup, true));
+ }
- public void addFunction(Function function) {
- droppedCache.dropFunction(function);
- logAndApply(new MetadataLogicalOperation(function, true));
- }
+ public void addFunction(Function function) {
+ droppedCache.dropFunction(function);
+ logAndApply(new MetadataLogicalOperation(function, true));
+ }
- public void dropDataverse(String dataverseName) {
- Dataverse dataverse = new Dataverse(dataverseName, null);
- droppedCache.addDataverseIfNotExists(dataverse);
- logAndApply(new MetadataLogicalOperation(dataverse, false));
- }
+ public void addAdapter(DatasourceAdapter adapter) {
+ droppedCache.dropAdapter(adapter);
+ logAndApply(new MetadataLogicalOperation(adapter, true));
+ }
- public void dropDataset(String dataverseName, String datasetName) {
- Dataset dataset = new Dataset(dataverseName, datasetName, null, null,
- null);
- droppedCache.addDatasetIfNotExists(dataset);
- logAndApply(new MetadataLogicalOperation(dataset, false));
- }
+ public void dropDataverse(String dataverseName) {
+ Dataverse dataverse = new Dataverse(dataverseName, null);
+ droppedCache.addDataverseIfNotExists(dataverse);
+ logAndApply(new MetadataLogicalOperation(dataverse, false));
+ }
- public void dropDataDatatype(String dataverseName, String datatypeName) {
- Datatype datatype = new Datatype(dataverseName, datatypeName, null,
- false);
- droppedCache.addDatatypeIfNotExists(datatype);
- logAndApply(new MetadataLogicalOperation(datatype, false));
- }
+ public void dropDataset(String dataverseName, String datasetName) {
+ Dataset dataset = new Dataset(dataverseName, datasetName, null, null, null);
+ droppedCache.addDatasetIfNotExists(dataset);
+ logAndApply(new MetadataLogicalOperation(dataset, false));
+ }
- public void dropNodeGroup(String nodeGroupName) {
- NodeGroup nodeGroup = new NodeGroup(nodeGroupName, null);
- droppedCache.addNodeGroupIfNotExists(nodeGroup);
- logAndApply(new MetadataLogicalOperation(nodeGroup, false));
- }
+ public void dropDataDatatype(String dataverseName, String datatypeName) {
+ Datatype datatype = new Datatype(dataverseName, datatypeName, null, false);
+ droppedCache.addDatatypeIfNotExists(datatype);
+ logAndApply(new MetadataLogicalOperation(datatype, false));
+ }
- public void dropFunction(String dataverseName, String functionName,
- int arity) {
- Function function = new Function(dataverseName, functionName, arity,
- null, null);
- droppedCache.addFunctionIfNotExists(function);
- logAndApply(new MetadataLogicalOperation(function, false));
- }
+ public void dropNodeGroup(String nodeGroupName) {
+ NodeGroup nodeGroup = new NodeGroup(nodeGroupName, null);
+ droppedCache.addNodeGroupIfNotExists(nodeGroup);
+ logAndApply(new MetadataLogicalOperation(nodeGroup, false));
+ }
- public void logAndApply(MetadataLogicalOperation op) {
- opLog.add(op);
- doOperation(op);
- }
+ public void dropFunction(FunctionSignature signature) {
+ Function function = new Function(signature.getNamespace(), signature.getName(), signature.getArity(), null,
+ null, null, null, null);
+ droppedCache.addFunctionIfNotExists(function);
+ logAndApply(new MetadataLogicalOperation(function, false));
+ }
- public boolean dataverseIsDropped(String dataverseName) {
- return droppedCache.getDataverse(dataverseName) != null;
- }
+ public void dropAdapter(String dataverseName, String adapterName) {
+ AdapterIdentifier adapterIdentifier = new AdapterIdentifier(dataverseName, adapterName);
+ DatasourceAdapter adapter = new DatasourceAdapter(adapterIdentifier, null, null);
+ droppedCache.addAdapterIfNotExists(adapter);
+ logAndApply(new MetadataLogicalOperation(adapter, false));
+ }
- public boolean datasetIsDropped(String dataverseName, String datasetName) {
- if (droppedCache.getDataverse(dataverseName) != null) {
- return true;
- }
- return droppedCache.getDataset(dataverseName, datasetName) != null;
- }
+ public void logAndApply(MetadataLogicalOperation op) {
+ opLog.add(op);
+ doOperation(op);
+ }
- public boolean datatypeIsDropped(String dataverseName, String datatypeName) {
- if (droppedCache.getDataverse(dataverseName) != null) {
- return true;
- }
- return droppedCache.getDatatype(dataverseName, datatypeName) != null;
- }
+ public boolean dataverseIsDropped(String dataverseName) {
+ return droppedCache.getDataverse(dataverseName) != null;
+ }
- public boolean nodeGroupIsDropped(String nodeGroup) {
- return droppedCache.getNodeGroup(nodeGroup) != null;
- }
+ public boolean datasetIsDropped(String dataverseName, String datasetName) {
+ if (droppedCache.getDataverse(dataverseName) != null) {
+ return true;
+ }
+ return droppedCache.getDataset(dataverseName, datasetName) != null;
+ }
+ public boolean datatypeIsDropped(String dataverseName, String datatypeName) {
+ if (droppedCache.getDataverse(dataverseName) != null) {
+ return true;
+ }
+ return droppedCache.getDatatype(dataverseName, datatypeName) != null;
+ }
- public boolean functionIsDropped(String dataverseName, String functionName,
- int arity) {
- return droppedCache.getFunction(dataverseName, functionName, arity) != null;
- }
-
- public ArrayList<MetadataLogicalOperation> getOpLog() {
- return opLog;
- }
+ public boolean nodeGroupIsDropped(String nodeGroup) {
+ return droppedCache.getNodeGroup(nodeGroup) != null;
+ }
- @Override
- public void clear() {
- super.clear();
- droppedCache.clear();
- opLog.clear();
- }
+ public boolean functionIsDropped(FunctionSignature functionSignature) {
+ return droppedCache.getFunction(functionSignature) != null;
+ }
+
+ public ArrayList<MetadataLogicalOperation> getOpLog() {
+ return opLog;
+ }
+
+ @Override
+ public void clear() {
+ super.clear();
+ droppedCache.clear();
+ opLog.clear();
+ }
}
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/api/IMetadataManager.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/api/IMetadataManager.java
index adba1c2..01e9649 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/api/IMetadataManager.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/api/IMetadataManager.java
@@ -18,8 +18,10 @@
import java.rmi.RemoteException;
import java.util.List;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
import edu.uci.ics.asterix.metadata.MetadataException;
import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
+import edu.uci.ics.asterix.metadata.entities.DatasourceAdapter;
import edu.uci.ics.asterix.metadata.entities.Dataset;
import edu.uci.ics.asterix.metadata.entities.Datatype;
import edu.uci.ics.asterix.metadata.entities.Dataverse;
@@ -352,49 +354,80 @@
* For example, if the node already exists.
*/
public void addNode(MetadataTransactionContext ctx, Node node) throws MetadataException;
-
+
/**
- *
- * @param mdTxnCtx
- * MetadataTransactionContext of an active metadata transaction.
- * @param function
- * An instance of type Function that represents the function
- * being added
- * @throws MetadataException
- */
- public void addFunction(MetadataTransactionContext mdTxnCtx,
- Function function) throws MetadataException;
+ * @param mdTxnCtx
+ * MetadataTransactionContext of an active metadata transaction.
+ * @param function
+ * An instance of type Function that represents the function
+ * being added
+ * @throws MetadataException
+ */
+ public void addFunction(MetadataTransactionContext mdTxnCtx, Function function) throws MetadataException;
- /**
- *
- * @param ctx
- * MetadataTransactionContext of an active metadata transaction.
- * @param dataverseName
- * the dataverse associated with the function being searched
- * @param functionName
- * name of the function
- * @param arity
- * arity of the function
- * @return
- * @throws MetadataException
- */
- public Function getFunction(MetadataTransactionContext ctx,
- String dataverseName, String functionName, int arity)
- throws MetadataException;
+ /**
+ * @param ctx
+ * MetadataTransactionContext of an active metadata transaction.
+ * @param functionSignature
+ * the functions signature (unique to the function)
+ * @return
+ * @throws MetadataException
+ */
- /**
- *
- * @param ctx
- * MetadataTransactionContext of an active metadata transaction.
- * @param dataverseName
- * the dataverse associated with the function being dropped
- * @param functionName
- * name of the function
- * @param arity
- * arity of the function
- * @throws MetadataException
- */
- public void dropFunction(MetadataTransactionContext ctx,
- String dataverseName, String functionName, int arity)
- throws MetadataException;
+ public Function getFunction(MetadataTransactionContext ctx, FunctionSignature functionSignature)
+ throws MetadataException;
+
+ /**
+ * @param ctx
+ * MetadataTransactionContext of an active metadata transaction.
+ * @param functionSignature
+ * the functions signature (unique to the function)
+ * @throws MetadataException
+ */
+ public void dropFunction(MetadataTransactionContext ctx, FunctionSignature functionSignature)
+ throws MetadataException;
+
+ /**
+ * @param mdTxnCtx
+ * MetadataTransactionContext of an active metadata transaction.
+ * @param function
+ * An instance of type Adapter that represents the adapter being
+ * added
+ * @throws MetadataException
+ */
+ public void addAdapter(MetadataTransactionContext mdTxnCtx, DatasourceAdapter adapter) throws MetadataException;
+
+ /**
+ * @param ctx
+ * MetadataTransactionContext of an active metadata transaction.
+ * @param dataverseName
+ * the dataverse associated with the adapter being searched
+ * @param Name
+ * name of the adapter
+ * @return
+ * @throws MetadataException
+ */
+ public DatasourceAdapter getAdapter(MetadataTransactionContext ctx, String dataverseName, String name)
+ throws MetadataException;
+
+ /**
+ * @param ctx
+ * MetadataTransactionContext of an active metadata transaction.
+ * @param dataverseName
+ * the dataverse associated with the adapter being dropped
+ * @param name
+ * name of the adapter
+ * @throws MetadataException
+ */
+ public void dropAdapter(MetadataTransactionContext ctx, String dataverseName, String name) throws MetadataException;
+
+ /**
+ * @param ctx
+ * @param dataverseName
+ * @return
+ * @throws MetadataException
+ */
+ public List<Function> getDataverseFunctions(MetadataTransactionContext ctx, String dataverseName)
+ throws MetadataException;
+
}
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/api/IMetadataNode.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/api/IMetadataNode.java
index 10555be..76c5746 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/api/IMetadataNode.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/api/IMetadataNode.java
@@ -20,7 +20,9 @@
import java.rmi.RemoteException;
import java.util.List;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
import edu.uci.ics.asterix.metadata.MetadataException;
+import edu.uci.ics.asterix.metadata.entities.DatasourceAdapter;
import edu.uci.ics.asterix.metadata.entities.Dataset;
import edu.uci.ics.asterix.metadata.entities.Datatype;
import edu.uci.ics.asterix.metadata.entities.Dataverse;
@@ -365,57 +367,94 @@
* @throws RemoteException
*/
public void addNode(long txnId, Node node) throws MetadataException, RemoteException;
-
+
/**
- *
- * @param txnId
- * A globally unique id for an active metadata transaction.
- * @param dataverseName
- * dataverse asociated with the function that is to be deleted.
- * @param functionName
- * Name of function to be deleted.
- * @param arity
- * Arity of the function to be deleted
- * @return
- * @throws MetadataException
- * @throws RemoteException
- */
- public Function getFunction(long txnId, String dataverseName,
- String functionName, int arity) throws MetadataException,
- RemoteException;
+ * @param txnId
+ * A globally unique id for an active metadata transaction.
+ * @param functionSignature
+ * An instance of functionSignature representing the function
+ * @return
+ * @throws MetadataException
+ * @throws RemoteException
+ */
+ public Function getFunction(long txnId, FunctionSignature functionSignature) throws MetadataException,
+ RemoteException;
- /**
- * Deletes a function , acquiring local locks on behalf of the given
- * transaction id.
- *
- * @param txnId
- * A globally unique id for an active metadata transaction.
- * @param dataverseName
- * dataverse asociated with the function that is to be deleted.
- * @param functionName
- * Name of function to be deleted.
- * @param arity
- * Arity of the function to be deleted
- * @throws MetadataException
- * For example, there are still datasets partitioned on the node
- * group to be deleted.
- * @throws RemoteException
- */
- public void dropFunction(long txnId, String dataverseName,
- String functionName, int arity) throws MetadataException,
- RemoteException;
+ /**
+ * Deletes a function, acquiring local locks on behalf of the given
+ * transaction id.
+ *
+ * @param txnId
+ * A globally unique id for an active metadata transaction.
+ * @param functionSignature
+ * An instance of functionSignature representing the function
+ * @throws MetadataException
+ * For example, there are still datasets partitioned on the node
+ * group to be deleted.
+ * @throws RemoteException
+ */
+ public void dropFunction(long txnId, FunctionSignature functionSignature) throws MetadataException, RemoteException;
- /**
- *
- * @param txnId
- * A globally unique id for an active metadata transaction.
- * @param function
- * Function to be inserted
- * @throws MetadataException
- * for example, if the function already exists or refers to an
- * unknown function
- * @throws RemoteException
- */
- public void addFunction(long txnId, Function function)
- throws MetadataException, RemoteException;
+ /**
+ * @param txnId
+ * A globally unique id for an active metadata transaction.
+ * @param function
+ * Function to be inserted
+ * @throws MetadataException
+ * for example, if the function already exists or refers to an
+ * unknown function
+ * @throws RemoteException
+ */
+ public void addFunction(long txnId, Function function) throws MetadataException, RemoteException;
+
+ /**
+ * @param ctx
+ * @param dataverseName
+ * @return List<Function> A list containing the functions in the specified dataverse
+ * @throws MetadataException
+ * @throws RemoteException
+ */
+ public List<Function> getDataverseFunctions(long txnId, String dataverseName) throws MetadataException,
+ RemoteException;
+
+ /**
+ * @param ctx
+ * @param dataverseName
+ * @return List<Adapter> A list containing the adapters in the specified dataverse
+ * @throws MetadataException
+ * @throws RemoteException
+ */
+ public List<DatasourceAdapter> getDataverseAdapters(long txnId, String dataverseName) throws MetadataException,
+ RemoteException;
+
+ public DatasourceAdapter getAdapter(long txnId, String dataverseName, String adapterName) throws MetadataException,
+ RemoteException;
+
+ /**
+ * Deletes a adapter , acquiring local locks on behalf of the given
+ * transaction id.
+ *
+ * @param txnId
+ * A globally unique id for an active metadata transaction.
+ * @param dataverseName
+ * dataverse asociated with the adapter that is to be deleted.
+ * @param adapterName
+ * Name of adapter to be deleted. MetadataException for example,
+ * if the adapter does not exists.
+ * @throws RemoteException
+ */
+ public void dropAdapter(long txnId, String dataverseName, String adapterName) throws MetadataException,
+ RemoteException;
+
+ /**
+ * @param txnId
+ * A globally unique id for an active metadata transaction.
+ * @param adapter
+ * Adapter to be inserted
+ * @throws MetadataException
+ * for example, if the adapter already exists.
+ * @throws RemoteException
+ */
+ public void addAdapter(long txnId, DatasourceAdapter adapter) throws MetadataException, RemoteException;
+
}
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataBootstrap.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataBootstrap.java
index 6c388c2..24fe244 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataBootstrap.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataBootstrap.java
@@ -26,10 +26,14 @@
import edu.uci.ics.asterix.common.config.DatasetConfig.DatasetType;
import edu.uci.ics.asterix.common.config.DatasetConfig.IndexType;
import edu.uci.ics.asterix.common.context.AsterixAppRuntimeContext;
+import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.external.adapter.factory.IAdapterFactory;
+import edu.uci.ics.asterix.external.dataset.adapter.AdapterIdentifier;
import edu.uci.ics.asterix.metadata.IDatasetDetails;
import edu.uci.ics.asterix.metadata.MetadataManager;
import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
import edu.uci.ics.asterix.metadata.api.IMetadataIndex;
+import edu.uci.ics.asterix.metadata.entities.DatasourceAdapter;
import edu.uci.ics.asterix.metadata.entities.AsterixBuiltinTypeMap;
import edu.uci.ics.asterix.metadata.entities.Dataset;
import edu.uci.ics.asterix.metadata.entities.Datatype;
@@ -42,6 +46,7 @@
import edu.uci.ics.asterix.metadata.entities.NodeGroup;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat;
import edu.uci.ics.asterix.transaction.management.exception.ACIDException;
import edu.uci.ics.asterix.transaction.management.resource.TransactionalResourceRepository;
import edu.uci.ics.asterix.transaction.management.service.logging.DataUtil;
@@ -96,7 +101,8 @@
primaryIndexes = new IMetadataIndex[] { MetadataPrimaryIndexes.DATAVERSE_DATASET,
MetadataPrimaryIndexes.DATASET_DATASET, MetadataPrimaryIndexes.DATATYPE_DATASET,
MetadataPrimaryIndexes.INDEX_DATASET, MetadataPrimaryIndexes.NODE_DATASET,
- MetadataPrimaryIndexes.NODEGROUP_DATASET, MetadataPrimaryIndexes.FUNCTION_DATASET };
+ MetadataPrimaryIndexes.NODEGROUP_DATASET, MetadataPrimaryIndexes.FUNCTION_DATASET,
+ MetadataPrimaryIndexes.DATASOURCE_ADAPTER_DATASET };
secondaryIndexes = new IMetadataIndex[] { MetadataSecondaryIndexes.GROUPNAME_ON_DATASET_INDEX,
MetadataSecondaryIndexes.DATATYPENAME_ON_DATASET_INDEX,
MetadataSecondaryIndexes.DATATYPENAME_ON_DATATYPE_INDEX };
@@ -166,6 +172,7 @@
insertInitialIndexes(mdTxnCtx);
insertNodes(mdTxnCtx);
insertInitialGroups(mdTxnCtx);
+ insertInitialAdapters(mdTxnCtx);
LOGGER.info("FINISHED CREATING METADATA B-TREES.");
} else {
for (int i = 0; i < primaryIndexes.length; i++) {
@@ -230,7 +237,7 @@
public static void insertInitialDataverses(MetadataTransactionContext mdTxnCtx) throws Exception {
String dataverseName = MetadataPrimaryIndexes.DATAVERSE_DATASET.getDataverseName();
- String dataFormat = "edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat";
+ String dataFormat = NonTaggedDataFormat.NON_TAGGED_DATA_FORMAT;
MetadataManager.INSTANCE.addDataverse(mdTxnCtx, new Dataverse(dataverseName, dataFormat));
}
@@ -304,6 +311,27 @@
}
+ private static void insertInitialAdapters(MetadataTransactionContext mdTxnCtx) throws Exception {
+ String[] builtInAdapterClassNames = new String[] {
+ "edu.uci.ics.asterix.external.adapter.factory.NCFileSystemAdapterFactory",
+ "edu.uci.ics.asterix.external.adapter.factory.HDFSAdapterFactory",
+ "edu.uci.ics.asterix.external.adapter.factory.HiveAdapterFactory",
+ "edu.uci.ics.asterix.external.adapter.factory.PullBasedTwitterAdapterFactory",
+ "edu.uci.ics.asterix.external.adapter.factory.RSSFeedAdapterFactory",
+ "edu.uci.ics.asterix.external.adapter.factory.CNNFeedAdapterFactory", };
+ DatasourceAdapter adapter;
+ for (String adapterClassName : builtInAdapterClassNames) {
+ adapter = getAdapter(adapterClassName);
+ MetadataManager.INSTANCE.addAdapter(mdTxnCtx, adapter);
+ }
+ }
+
+ private static DatasourceAdapter getAdapter(String adapterFactoryClassName) throws Exception {
+ String adapterName = ((IAdapterFactory) (Class.forName(adapterFactoryClassName).newInstance())).getName();
+ return new DatasourceAdapter(new AdapterIdentifier(MetadataConstants.METADATA_DATAVERSE_NAME, adapterName), adapterFactoryClassName,
+ DatasourceAdapter.AdapterType.INTERNAL);
+ }
+
public static void createIndex(IMetadataIndex dataset) throws Exception {
int fileId = dataset.getFileId();
ITypeTraits[] typeTraits = dataset.getTypeTraits();
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataIndex.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataIndex.java
index 165a605..5fcac2e 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataIndex.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataIndex.java
@@ -30,7 +30,6 @@
import edu.uci.ics.asterix.transaction.management.exception.ACIDException;
import edu.uci.ics.asterix.transaction.management.service.logging.DataUtil;
import edu.uci.ics.asterix.transaction.management.service.logging.TreeLogger;
-import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.OrderOperator.IOrder.OrderKind;
import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory;
import edu.uci.ics.hyracks.api.dataflow.value.IBinaryHashFunctionFactory;
import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataPrimaryIndexes.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataPrimaryIndexes.java
index 2a40e73..b1f6796 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataPrimaryIndexes.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataPrimaryIndexes.java
@@ -32,7 +32,7 @@
public static IMetadataIndex NODE_DATASET;
public static IMetadataIndex NODEGROUP_DATASET;
public static IMetadataIndex FUNCTION_DATASET;
-
+ public static IMetadataIndex DATASOURCE_ADAPTER_DATASET;
/**
* Create all metadata primary index descriptors. MetadataRecordTypes must
@@ -68,11 +68,14 @@
NODEGROUP_DATASET = new MetadataIndex("Nodegroup", null, 2, new IAType[] { BuiltinType.ASTRING },
new String[] { "GroupName" }, MetadataRecordTypes.NODEGROUP_RECORDTYPE);
-
- FUNCTION_DATASET = new MetadataIndex("Function", null, 4,
- new IAType[] { BuiltinType.ASTRING, BuiltinType.ASTRING,
- BuiltinType.ASTRING }, new String[] { "DataverseName",
- "FunctionName", "FunctionArity" }, MetadataRecordTypes.FUNCTION_RECORDTYPE);
+
+ FUNCTION_DATASET = new MetadataIndex("Function", null, 4, new IAType[] { BuiltinType.ASTRING,
+ BuiltinType.ASTRING, BuiltinType.ASTRING }, new String[] { "DataverseName", "Name", "Arity" },
+ MetadataRecordTypes.FUNCTION_RECORDTYPE);
+
+ DATASOURCE_ADAPTER_DATASET = new MetadataIndex("DatasourceAdapter", null, 3,
+ new IAType[] { BuiltinType.ASTRING, BuiltinType.ASTRING }, new String[] { "DataverseName", "Name" },
+ MetadataRecordTypes.DATASOURCE_ADAPTER_RECORDTYPE);
}
}
\ No newline at end of file
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataRecordTypes.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataRecordTypes.java
index 6936d0d..1db4886 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataRecordTypes.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataRecordTypes.java
@@ -29,322 +29,318 @@
* Contains static ARecordType's of all metadata record types.
*/
public final class MetadataRecordTypes {
- public static ARecordType DATAVERSE_RECORDTYPE;
- public static ARecordType DATASET_RECORDTYPE;
- public static ARecordType INTERNAL_DETAILS_RECORDTYPE;
- public static ARecordType EXTERNAL_DETAILS_RECORDTYPE;
- public static ARecordType FEED_DETAILS_RECORDTYPE;
- public static ARecordType ADAPTER_PROPERTIES_RECORDTYPE;
- public static ARecordType FIELD_RECORDTYPE;
- public static ARecordType RECORD_RECORDTYPE;
- public static ARecordType DERIVEDTYPE_RECORDTYPE;
- public static ARecordType DATATYPE_RECORDTYPE;
- public static ARecordType INDEX_RECORDTYPE;
- public static ARecordType NODE_RECORDTYPE;
- public static ARecordType NODEGROUP_RECORDTYPE;
- public static ARecordType FUNCTION_RECORDTYPE;
+ public static ARecordType DATAVERSE_RECORDTYPE;
+ public static ARecordType DATASET_RECORDTYPE;
+ public static ARecordType INTERNAL_DETAILS_RECORDTYPE;
+ public static ARecordType EXTERNAL_DETAILS_RECORDTYPE;
+ public static ARecordType FEED_DETAILS_RECORDTYPE;
+ public static ARecordType DATASOURCE_ADAPTER_PROPERTIES_RECORDTYPE;
+ public static ARecordType FIELD_RECORDTYPE;
+ public static ARecordType RECORD_RECORDTYPE;
+ public static ARecordType DERIVEDTYPE_RECORDTYPE;
+ public static ARecordType DATATYPE_RECORDTYPE;
+ public static ARecordType INDEX_RECORDTYPE;
+ public static ARecordType NODE_RECORDTYPE;
+ public static ARecordType NODEGROUP_RECORDTYPE;
+ public static ARecordType FUNCTION_RECORDTYPE;
+ public static ARecordType DATASOURCE_ADAPTER_RECORDTYPE;
- /**
- * Create all metadata record types.
- */
- public static void init() {
- // Attention: The order of these calls is important because some types
- // depend on other types being created first.
- // These calls are one "dependency chain".
- ADAPTER_PROPERTIES_RECORDTYPE = createAdapterPropertiesRecordType();
- INTERNAL_DETAILS_RECORDTYPE = createInternalDetailsRecordType();
- EXTERNAL_DETAILS_RECORDTYPE = createExternalDetailsRecordType();
- FEED_DETAILS_RECORDTYPE = createFeedDetailsRecordType();
+ /**
+ * Create all metadata record types.
+ */
+ public static void init() {
+ // Attention: The order of these calls is important because some types
+ // depend on other types being created first.
+ // These calls are one "dependency chain".
+ DATASOURCE_ADAPTER_PROPERTIES_RECORDTYPE = createDatasourceAdapterPropertiesRecordType();
+ INTERNAL_DETAILS_RECORDTYPE = createInternalDetailsRecordType();
+ EXTERNAL_DETAILS_RECORDTYPE = createExternalDetailsRecordType();
+ FEED_DETAILS_RECORDTYPE = createFeedDetailsRecordType();
- DATASET_RECORDTYPE = createDatasetRecordType();
+ DATASET_RECORDTYPE = createDatasetRecordType();
- // Starting another dependency chain.
- FIELD_RECORDTYPE = createFieldRecordType();
- RECORD_RECORDTYPE = createRecordTypeRecordType();
- DERIVEDTYPE_RECORDTYPE = createDerivedTypeRecordType();
- DATATYPE_RECORDTYPE = createDatatypeRecordType();
+ // Starting another dependency chain.
+ FIELD_RECORDTYPE = createFieldRecordType();
+ RECORD_RECORDTYPE = createRecordTypeRecordType();
+ DERIVEDTYPE_RECORDTYPE = createDerivedTypeRecordType();
+ DATATYPE_RECORDTYPE = createDatatypeRecordType();
- // Independent of any other types.
- DATAVERSE_RECORDTYPE = createDataverseRecordType();
- INDEX_RECORDTYPE = createIndexRecordType();
- NODE_RECORDTYPE = createNodeRecordType();
- NODEGROUP_RECORDTYPE = createNodeGroupRecordType();
- FUNCTION_RECORDTYPE = createFunctionRecordType();
+ // Independent of any other types.
+ DATAVERSE_RECORDTYPE = createDataverseRecordType();
+ INDEX_RECORDTYPE = createIndexRecordType();
+ NODE_RECORDTYPE = createNodeRecordType();
+ NODEGROUP_RECORDTYPE = createNodeGroupRecordType();
+ FUNCTION_RECORDTYPE = createFunctionRecordType();
+ DATASOURCE_ADAPTER_RECORDTYPE = createDatasourceAdapterRecordType();
- }
+ }
- // Helper constants for accessing fields in an ARecord of type
- // DataverseRecordType.
- public static final int DATAVERSE_ARECORD_NAME_FIELD_INDEX = 0;
- public static final int DATAVERSE_ARECORD_FORMAT_FIELD_INDEX = 1;
- public static final int DATAVERSE_ARECORD_TIMESTAMP_FIELD_INDEX = 2;
+ // Helper constants for accessing fields in an ARecord of type
+ // DataverseRecordType.
+ public static final int DATAVERSE_ARECORD_NAME_FIELD_INDEX = 0;
+ public static final int DATAVERSE_ARECORD_FORMAT_FIELD_INDEX = 1;
+ public static final int DATAVERSE_ARECORD_TIMESTAMP_FIELD_INDEX = 2;
- private static final ARecordType createDataverseRecordType() {
- return new ARecordType("DataverseRecordType", new String[] {
- "DataverseName", "DataFormat", "Timestamp" },
- new IAType[] { BuiltinType.ASTRING, BuiltinType.ASTRING,
- BuiltinType.ASTRING }, true);
- }
+ private static final ARecordType createDataverseRecordType() {
+ return new ARecordType("DataverseRecordType", new String[] { "DataverseName", "DataFormat", "Timestamp" },
+ new IAType[] { BuiltinType.ASTRING, BuiltinType.ASTRING, BuiltinType.ASTRING }, true);
+ }
- // Helper constants for accessing fields in an ARecord of anonymous type
- // external properties.
- public static final int ADAPTER_PROPERTIES_ARECORD_NAME_FIELD_INDEX = 0;
- public static final int ADAPTER_PROPERTIES_ARECORD_VALUE_FIELD_INDEX = 1;
+ // Helper constants for accessing fields in an ARecord of anonymous type
+ // external properties.
+ public static final int DATASOURCE_ADAPTER_PROPERTIES_ARECORD_NAME_FIELD_INDEX = 0;
+ public static final int DATASOURCE_ADAPTER_PROPERTIES_ARECORD_VALUE_FIELD_INDEX = 1;
- private static final ARecordType createAdapterPropertiesRecordType() {
- String[] fieldNames = { "Name", "Value" };
- IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ASTRING };
- return new ARecordType(null, fieldNames, fieldTypes, true);
- };
+ private static final ARecordType createDatasourceAdapterPropertiesRecordType() {
+ String[] fieldNames = { "Name", "Value" };
+ IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ASTRING };
+ return new ARecordType(null, fieldNames, fieldTypes, true);
+ };
- // Helper constants for accessing fields in an ARecord of anonymous type
- // internal details.
- public static final int INTERNAL_DETAILS_ARECORD_FILESTRUCTURE_FIELD_INDEX = 0;
- public static final int INTERNAL_DETAILS_ARECORD_PARTITIONSTRATEGY_FIELD_INDEX = 1;
- public static final int INTERNAL_DETAILS_ARECORD_PARTITIONKEY_FIELD_INDEX = 2;
- public static final int INTERNAL_DETAILS_ARECORD_PRIMARYKEY_FIELD_INDEX = 3;
- public static final int INTERNAL_DETAILS_ARECORD_GROUPNAME_FIELD_INDEX = 4;
+ // Helper constants for accessing fields in an ARecord of anonymous type
+ // internal details.
+ public static final int INTERNAL_DETAILS_ARECORD_FILESTRUCTURE_FIELD_INDEX = 0;
+ public static final int INTERNAL_DETAILS_ARECORD_PARTITIONSTRATEGY_FIELD_INDEX = 1;
+ public static final int INTERNAL_DETAILS_ARECORD_PARTITIONKEY_FIELD_INDEX = 2;
+ public static final int INTERNAL_DETAILS_ARECORD_PRIMARYKEY_FIELD_INDEX = 3;
+ public static final int INTERNAL_DETAILS_ARECORD_GROUPNAME_FIELD_INDEX = 4;
- private static final ARecordType createInternalDetailsRecordType() {
- AOrderedListType olType = new AOrderedListType(BuiltinType.ASTRING,
- null);
- String[] fieldNames = { "FileStructure", "PartitioningStrategy",
- "PartitioningKey", "PrimaryKey", "GroupName" };
- IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ASTRING,
- olType, olType, BuiltinType.ASTRING };
- return new ARecordType(null, fieldNames, fieldTypes, true);
- }
+ private static final ARecordType createInternalDetailsRecordType() {
+ AOrderedListType olType = new AOrderedListType(BuiltinType.ASTRING, null);
+ String[] fieldNames = { "FileStructure", "PartitioningStrategy", "PartitioningKey", "PrimaryKey", "GroupName" };
+ IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ASTRING, olType, olType, BuiltinType.ASTRING };
+ return new ARecordType(null, fieldNames, fieldTypes, true);
+ }
- // Helper constants for accessing fields in an ARecord of anonymous type
- // external details.
- public static final int EXTERNAL_DETAILS_ARECORD_ADAPTER_FIELD_INDEX = 0;
- public static final int EXTERNAL_DETAILS_ARECORD_PROPERTIES_FIELD_INDEX = 1;
+ // Helper constants for accessing fields in an ARecord of anonymous type
+ // external details.
+ public static final int EXTERNAL_DETAILS_ARECORD_DATASOURCE_ADAPTER_FIELD_INDEX = 0;
+ public static final int EXTERNAL_DETAILS_ARECORD_PROPERTIES_FIELD_INDEX = 1;
- private static final ARecordType createExternalDetailsRecordType() {
+ private static final ARecordType createExternalDetailsRecordType() {
- AOrderedListType orderedPropertyListType = new AOrderedListType(
- ADAPTER_PROPERTIES_RECORDTYPE, null);
- String[] fieldNames = { "Adapter", "Properties" };
- IAType[] fieldTypes = { BuiltinType.ASTRING, orderedPropertyListType };
- return new ARecordType(null, fieldNames, fieldTypes, true);
- }
+ AOrderedListType orderedPropertyListType = new AOrderedListType(DATASOURCE_ADAPTER_PROPERTIES_RECORDTYPE, null);
+ String[] fieldNames = { "DatasourceAdapter", "Properties" };
+ IAType[] fieldTypes = { BuiltinType.ASTRING, orderedPropertyListType };
+ return new ARecordType(null, fieldNames, fieldTypes, true);
+ }
- public static final int FEED_DETAILS_ARECORD_FILESTRUCTURE_FIELD_INDEX = 0;
- public static final int FEED_DETAILS_ARECORD_PARTITIONSTRATEGY_FIELD_INDEX = 1;
- public static final int FEEDL_DETAILS_ARECORD_PARTITIONKEY_FIELD_INDEX = 2;
- public static final int FEED_DETAILS_ARECORD_PRIMARYKEY_FIELD_INDEX = 3;
- public static final int FEED_DETAILS_ARECORD_GROUPNAME_FIELD_INDEX = 4;
- public static final int FEED_DETAILS_ARECORD_ADAPTER_FIELD_INDEX = 5;
- public static final int FEED_DETAILS_ARECORD_PROPERTIES_FIELD_INDEX = 6;
- public static final int FEED_DETAILS_ARECORD_FUNCTION_FIELD_INDEX = 7;
- public static final int FEED_DETAILS_ARECORD_STATE_FIELD_INDEX = 8;
+ public static final int FEED_DETAILS_ARECORD_FILESTRUCTURE_FIELD_INDEX = 0;
+ public static final int FEED_DETAILS_ARECORD_PARTITIONSTRATEGY_FIELD_INDEX = 1;
+ public static final int FEED_DETAILS_ARECORD_PARTITIONKEY_FIELD_INDEX = 2;
+ public static final int FEED_DETAILS_ARECORD_PRIMARYKEY_FIELD_INDEX = 3;
+ public static final int FEED_DETAILS_ARECORD_GROUPNAME_FIELD_INDEX = 4;
+ public static final int FEED_DETAILS_ARECORD_DATASOURCE_ADAPTER_FIELD_INDEX = 5;
+ public static final int FEED_DETAILS_ARECORD_PROPERTIES_FIELD_INDEX = 6;
+ public static final int FEED_DETAILS_ARECORD_FUNCTION_FIELD_INDEX = 7;
+ public static final int FEED_DETAILS_ARECORD_STATE_FIELD_INDEX = 8;
- private static final ARecordType createFeedDetailsRecordType() {
- AOrderedListType orderedListType = new AOrderedListType(
- BuiltinType.ASTRING, null);
- AOrderedListType orderedListOfPropertiesType = new AOrderedListType(
- ADAPTER_PROPERTIES_RECORDTYPE, null);
- String[] fieldNames = { "FileStructure", "PartitioningStrategy",
- "PartitioningKey", "PrimaryKey", "GroupName", "Adapter",
- "Properties", "Function", "Status" };
+ private static final ARecordType createFeedDetailsRecordType() {
+ AOrderedListType orderedListType = new AOrderedListType(BuiltinType.ASTRING, null);
+ AOrderedListType orderedListOfPropertiesType = new AOrderedListType(DATASOURCE_ADAPTER_PROPERTIES_RECORDTYPE,
+ null);
+ String[] fieldNames = { "FileStructure", "PartitioningStrategy", "PartitioningKey", "PrimaryKey", "GroupName",
+ "DatasourceAdapter", "Properties", "Function", "Status" };
- IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ASTRING,
- orderedListType, orderedListType, BuiltinType.ASTRING,
- BuiltinType.ASTRING, orderedListOfPropertiesType,
- BuiltinType.ASTRING, BuiltinType.ASTRING };
+ List<IAType> feedFunctionUnionList = new ArrayList<IAType>();
+ feedFunctionUnionList.add(BuiltinType.ANULL);
+ feedFunctionUnionList.add(BuiltinType.ASTRING);
+ AUnionType feedFunctionUnion = new AUnionType(feedFunctionUnionList, null);
- return new ARecordType(null, fieldNames, fieldTypes, true);
- }
+ IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ASTRING, orderedListType, orderedListType,
+ BuiltinType.ASTRING, BuiltinType.ASTRING, orderedListOfPropertiesType, feedFunctionUnion,
+ BuiltinType.ASTRING };
- // Helper constants for accessing fields in an ARecord of type
- // DatasetRecordType.
- public static final int DATASET_ARECORD_DATAVERSENAME_FIELD_INDEX = 0;
- public static final int DATASET_ARECORD_DATASETNAME_FIELD_INDEX = 1;
- public static final int DATASET_ARECORD_DATATYPENAME_FIELD_INDEX = 2;
- public static final int DATASET_ARECORD_DATASETTYPE_FIELD_INDEX = 3;
- public static final int DATASET_ARECORD_INTERNALDETAILS_FIELD_INDEX = 4;
- public static final int DATASET_ARECORD_EXTERNALDETAILS_FIELD_INDEX = 5;
- public static final int DATASET_ARECORD_FEEDDETAILS_FIELD_INDEX = 6;
- public static final int DATASET_ARECORD_TIMESTAMP_FIELD_INDEX = 7;
+ return new ARecordType(null, fieldNames, fieldTypes, true);
+ }
- private static final ARecordType createDatasetRecordType() {
- String[] fieldNames = { "DataverseName", "DatasetName", "DataTypeName",
- "DatasetType", "InternalDetails", "ExternalDetails",
- "FeedDetails", "Timestamp" };
+ // Helper constants for accessing fields in an ARecord of type
+ // DatasetRecordType.
+ public static final int DATASET_ARECORD_DATAVERSENAME_FIELD_INDEX = 0;
+ public static final int DATASET_ARECORD_DATASETNAME_FIELD_INDEX = 1;
+ public static final int DATASET_ARECORD_DATATYPENAME_FIELD_INDEX = 2;
+ public static final int DATASET_ARECORD_DATASETTYPE_FIELD_INDEX = 3;
+ public static final int DATASET_ARECORD_INTERNALDETAILS_FIELD_INDEX = 4;
+ public static final int DATASET_ARECORD_EXTERNALDETAILS_FIELD_INDEX = 5;
+ public static final int DATASET_ARECORD_FEEDDETAILS_FIELD_INDEX = 6;
+ public static final int DATASET_ARECORD_TIMESTAMP_FIELD_INDEX = 7;
- List<IAType> internalRecordUnionList = new ArrayList<IAType>();
- internalRecordUnionList.add(BuiltinType.ANULL);
- internalRecordUnionList.add(INTERNAL_DETAILS_RECORDTYPE);
- AUnionType internalRecordUnion = new AUnionType(
- internalRecordUnionList, null);
+ private static final ARecordType createDatasetRecordType() {
+ String[] fieldNames = { "DataverseName", "DatasetName", "DataTypeName", "DatasetType", "InternalDetails",
+ "ExternalDetails", "FeedDetails", "Timestamp" };
- List<IAType> externalRecordUnionList = new ArrayList<IAType>();
- externalRecordUnionList.add(BuiltinType.ANULL);
- externalRecordUnionList.add(EXTERNAL_DETAILS_RECORDTYPE);
- AUnionType externalRecordUnion = new AUnionType(
- externalRecordUnionList, null);
+ List<IAType> internalRecordUnionList = new ArrayList<IAType>();
+ internalRecordUnionList.add(BuiltinType.ANULL);
+ internalRecordUnionList.add(INTERNAL_DETAILS_RECORDTYPE);
+ AUnionType internalRecordUnion = new AUnionType(internalRecordUnionList, null);
- List<IAType> feedRecordUnionList = new ArrayList<IAType>();
- feedRecordUnionList.add(BuiltinType.ANULL);
- feedRecordUnionList.add(FEED_DETAILS_RECORDTYPE);
- AUnionType feedRecordUnion = new AUnionType(feedRecordUnionList, null);
+ List<IAType> externalRecordUnionList = new ArrayList<IAType>();
+ externalRecordUnionList.add(BuiltinType.ANULL);
+ externalRecordUnionList.add(EXTERNAL_DETAILS_RECORDTYPE);
+ AUnionType externalRecordUnion = new AUnionType(externalRecordUnionList, null);
- IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ASTRING,
- BuiltinType.ASTRING, BuiltinType.ASTRING, internalRecordUnion,
- externalRecordUnion, feedRecordUnion, BuiltinType.ASTRING };
- return new ARecordType("DatasetRecordType", fieldNames, fieldTypes,
- true);
- }
+ List<IAType> feedRecordUnionList = new ArrayList<IAType>();
+ feedRecordUnionList.add(BuiltinType.ANULL);
+ feedRecordUnionList.add(FEED_DETAILS_RECORDTYPE);
+ AUnionType feedRecordUnion = new AUnionType(feedRecordUnionList, null);
- // Helper constants for accessing fields in an ARecord of anonymous type
- // field type.
- public static final int FIELD_ARECORD_FIELDNAME_FIELD_INDEX = 0;
- public static final int FIELD_ARECORD_FIELDTYPE_FIELD_INDEX = 1;
+ IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ASTRING, BuiltinType.ASTRING, BuiltinType.ASTRING,
+ internalRecordUnion, externalRecordUnion, feedRecordUnion, BuiltinType.ASTRING };
+ return new ARecordType("DatasetRecordType", fieldNames, fieldTypes, true);
+ }
- private static final ARecordType createFieldRecordType() {
- String[] fieldNames = { "FieldName", "FieldType" };
- IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ASTRING };
- return new ARecordType(null, fieldNames, fieldTypes, true);
- };
+ // Helper constants for accessing fields in an ARecord of anonymous type
+ // field type.
+ public static final int FIELD_ARECORD_FIELDNAME_FIELD_INDEX = 0;
+ public static final int FIELD_ARECORD_FIELDTYPE_FIELD_INDEX = 1;
- // Helper constants for accessing fields in an ARecord of anonymous type
- // record type.
- public static final int RECORDTYPE_ARECORD_ISOPEN_FIELD_INDEX = 0;
- public static final int RECORDTYPE_ARECORD_FIELDS_FIELD_INDEX = 1;
+ private static final ARecordType createFieldRecordType() {
+ String[] fieldNames = { "FieldName", "FieldType" };
+ IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ASTRING };
+ return new ARecordType(null, fieldNames, fieldTypes, true);
+ };
- private static final ARecordType createRecordTypeRecordType() {
- AOrderedListType olType = new AOrderedListType(FIELD_RECORDTYPE, null);
- String[] fieldNames = { "IsOpen", "Fields" };
- IAType[] fieldTypes = { BuiltinType.ABOOLEAN, olType };
- return new ARecordType(null, fieldNames, fieldTypes, true);
- };
+ // Helper constants for accessing fields in an ARecord of anonymous type
+ // record type.
+ public static final int RECORDTYPE_ARECORD_ISOPEN_FIELD_INDEX = 0;
+ public static final int RECORDTYPE_ARECORD_FIELDS_FIELD_INDEX = 1;
- // Helper constants for accessing fields in an ARecord of anonymous type
- // derived type.
- public static final int DERIVEDTYPE_ARECORD_TAG_FIELD_INDEX = 0;
- public static final int DERIVEDTYPE_ARECORD_ISANONYMOUS_FIELD_INDEX = 1;
- public static final int DERIVEDTYPE_ARECORD_ENUMVALUES_FIELD_INDEX = 2;
- public static final int DERIVEDTYPE_ARECORD_RECORD_FIELD_INDEX = 3;
- public static final int DERIVEDTYPE_ARECORD_UNION_FIELD_INDEX = 4;
- public static final int DERIVEDTYPE_ARECORD_UNORDEREDLIST_FIELD_INDEX = 5;
- public static final int DERIVEDTYPE_ARECORD_ORDEREDLIST_FIELD_INDEX = 6;
+ private static final ARecordType createRecordTypeRecordType() {
+ AOrderedListType olType = new AOrderedListType(FIELD_RECORDTYPE, null);
+ String[] fieldNames = { "IsOpen", "Fields" };
+ IAType[] fieldTypes = { BuiltinType.ABOOLEAN, olType };
+ return new ARecordType(null, fieldNames, fieldTypes, true);
+ };
- private static final ARecordType createDerivedTypeRecordType() {
- String[] fieldNames = { "Tag", "IsAnonymous", "EnumValues", "Record",
- "Union", "UnorderedList", "OrderedList" };
- List<IAType> recordUnionList = new ArrayList<IAType>();
- recordUnionList.add(BuiltinType.ANULL);
- recordUnionList.add(RECORD_RECORDTYPE);
- AUnionType recordUnion = new AUnionType(recordUnionList, null);
+ // Helper constants for accessing fields in an ARecord of anonymous type
+ // derived type.
+ public static final int DERIVEDTYPE_ARECORD_TAG_FIELD_INDEX = 0;
+ public static final int DERIVEDTYPE_ARECORD_ISANONYMOUS_FIELD_INDEX = 1;
+ public static final int DERIVEDTYPE_ARECORD_ENUMVALUES_FIELD_INDEX = 2;
+ public static final int DERIVEDTYPE_ARECORD_RECORD_FIELD_INDEX = 3;
+ public static final int DERIVEDTYPE_ARECORD_UNION_FIELD_INDEX = 4;
+ public static final int DERIVEDTYPE_ARECORD_UNORDEREDLIST_FIELD_INDEX = 5;
+ public static final int DERIVEDTYPE_ARECORD_ORDEREDLIST_FIELD_INDEX = 6;
- List<IAType> unionUnionList = new ArrayList<IAType>();
- unionUnionList.add(BuiltinType.ANULL);
- unionUnionList.add(new AOrderedListType(BuiltinType.ASTRING, null));
- AUnionType unionUnion = new AUnionType(unionUnionList, null);
+ private static final ARecordType createDerivedTypeRecordType() {
+ String[] fieldNames = { "Tag", "IsAnonymous", "EnumValues", "Record", "Union", "UnorderedList", "OrderedList" };
+ List<IAType> recordUnionList = new ArrayList<IAType>();
+ recordUnionList.add(BuiltinType.ANULL);
+ recordUnionList.add(RECORD_RECORDTYPE);
+ AUnionType recordUnion = new AUnionType(recordUnionList, null);
- List<IAType> collectionUnionList = new ArrayList<IAType>();
- collectionUnionList.add(BuiltinType.ANULL);
- collectionUnionList.add(BuiltinType.ASTRING);
- AUnionType collectionUnion = new AUnionType(collectionUnionList, null);
+ List<IAType> unionUnionList = new ArrayList<IAType>();
+ unionUnionList.add(BuiltinType.ANULL);
+ unionUnionList.add(new AOrderedListType(BuiltinType.ASTRING, null));
+ AUnionType unionUnion = new AUnionType(unionUnionList, null);
- IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ABOOLEAN,
- unionUnion, recordUnion, unionUnion, collectionUnion,
- collectionUnion };
- return new ARecordType(null, fieldNames, fieldTypes, true);
- };
+ List<IAType> collectionUnionList = new ArrayList<IAType>();
+ collectionUnionList.add(BuiltinType.ANULL);
+ collectionUnionList.add(BuiltinType.ASTRING);
+ AUnionType collectionUnion = new AUnionType(collectionUnionList, null);
- // Helper constants for accessing fields in an ARecord of type
- // DatatypeRecordType.
- public static final int DATATYPE_ARECORD_DATAVERSENAME_FIELD_INDEX = 0;
- public static final int DATATYPE_ARECORD_DATATYPENAME_FIELD_INDEX = 1;
- public static final int DATATYPE_ARECORD_DERIVED_FIELD_INDEX = 2;
- public static final int DATATYPE_ARECORD_TIMESTAMP_FIELD_INDEX = 3;
+ IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ABOOLEAN, unionUnion, recordUnion, unionUnion,
+ collectionUnion, collectionUnion };
+ return new ARecordType(null, fieldNames, fieldTypes, true);
+ };
- private static final ARecordType createDatatypeRecordType() {
- String[] fieldNames = { "DataverseName", "DatatypeName", "Derived",
- "Timestamp" };
- List<IAType> recordUnionList = new ArrayList<IAType>();
- recordUnionList.add(BuiltinType.ANULL);
- recordUnionList.add(DERIVEDTYPE_RECORDTYPE);
- AUnionType recordUnion = new AUnionType(recordUnionList, null);
- IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ASTRING,
- recordUnion, BuiltinType.ASTRING };
- return new ARecordType("DatatypeRecordType", fieldNames, fieldTypes,
- true);
- };
+ // Helper constants for accessing fields in an ARecord of type
+ // DatatypeRecordType.
+ public static final int DATATYPE_ARECORD_DATAVERSENAME_FIELD_INDEX = 0;
+ public static final int DATATYPE_ARECORD_DATATYPENAME_FIELD_INDEX = 1;
+ public static final int DATATYPE_ARECORD_DERIVED_FIELD_INDEX = 2;
+ public static final int DATATYPE_ARECORD_TIMESTAMP_FIELD_INDEX = 3;
- // Helper constants for accessing fields in an ARecord of type
- // IndexRecordType.
- public static final int INDEX_ARECORD_DATAVERSENAME_FIELD_INDEX = 0;
- public static final int INDEX_ARECORD_DATASETNAME_FIELD_INDEX = 1;
- public static final int INDEX_ARECORD_INDEXNAME_FIELD_INDEX = 2;
- public static final int INDEX_ARECORD_INDEXSTRUCTURE_FIELD_INDEX = 3;
- public static final int INDEX_ARECORD_SEARCHKEY_FIELD_INDEX = 4;
- public static final int INDEX_ARECORD_ISPRIMARY_FIELD_INDEX = 5;
- public static final int INDEX_ARECORD_TIMESTAMP_FIELD_INDEX = 6;
+ private static final ARecordType createDatatypeRecordType() {
+ String[] fieldNames = { "DataverseName", "DatatypeName", "Derived", "Timestamp" };
+ List<IAType> recordUnionList = new ArrayList<IAType>();
+ recordUnionList.add(BuiltinType.ANULL);
+ recordUnionList.add(DERIVEDTYPE_RECORDTYPE);
+ AUnionType recordUnion = new AUnionType(recordUnionList, null);
+ IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ASTRING, recordUnion, BuiltinType.ASTRING };
+ return new ARecordType("DatatypeRecordType", fieldNames, fieldTypes, true);
+ };
- private static final ARecordType createIndexRecordType() {
- AOrderedListType olType = new AOrderedListType(BuiltinType.ASTRING,
- null);
- String[] fieldNames = { "DataverseName", "DatasetName", "IndexName",
- "IndexStructure", "SearchKey", "IsPrimary", "Timestamp" };
- IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ASTRING,
- BuiltinType.ASTRING, BuiltinType.ASTRING, olType,
- BuiltinType.ABOOLEAN, BuiltinType.ASTRING };
- return new ARecordType("IndexRecordType", fieldNames, fieldTypes, true);
- };
+ // Helper constants for accessing fields in an ARecord of type
+ // IndexRecordType.
+ public static final int INDEX_ARECORD_DATAVERSENAME_FIELD_INDEX = 0;
+ public static final int INDEX_ARECORD_DATASETNAME_FIELD_INDEX = 1;
+ public static final int INDEX_ARECORD_INDEXNAME_FIELD_INDEX = 2;
+ public static final int INDEX_ARECORD_INDEXSTRUCTURE_FIELD_INDEX = 3;
+ public static final int INDEX_ARECORD_SEARCHKEY_FIELD_INDEX = 4;
+ public static final int INDEX_ARECORD_ISPRIMARY_FIELD_INDEX = 5;
+ public static final int INDEX_ARECORD_TIMESTAMP_FIELD_INDEX = 6;
- // Helper constants for accessing fields in an ARecord of type
- // NodeRecordType.
- public static final int NODE_ARECORD_NODENAME_FIELD_INDEX = 0;
- public static final int NODE_ARECORD_NUMBEROFCORES_FIELD_INDEX = 1;
- public static final int NODE_ARECORD_WORKINGMEMORYSIZE_FIELD_INDEX = 2;
+ private static final ARecordType createIndexRecordType() {
+ AOrderedListType olType = new AOrderedListType(BuiltinType.ASTRING, null);
+ String[] fieldNames = { "DataverseName", "DatasetName", "IndexName", "IndexStructure", "SearchKey",
+ "IsPrimary", "Timestamp" };
+ IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ASTRING, BuiltinType.ASTRING, BuiltinType.ASTRING,
+ olType, BuiltinType.ABOOLEAN, BuiltinType.ASTRING };
+ return new ARecordType("IndexRecordType", fieldNames, fieldTypes, true);
+ };
- private static final ARecordType createNodeRecordType() {
- String[] fieldNames = { "NodeName", "NumberOfCores",
- "WorkingMemorySize" };
- IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.AINT32,
- BuiltinType.AINT32 };
- return new ARecordType("NodeRecordType", fieldNames, fieldTypes, true);
- };
+ // Helper constants for accessing fields in an ARecord of type
+ // NodeRecordType.
+ public static final int NODE_ARECORD_NODENAME_FIELD_INDEX = 0;
+ public static final int NODE_ARECORD_NUMBEROFCORES_FIELD_INDEX = 1;
+ public static final int NODE_ARECORD_WORKINGMEMORYSIZE_FIELD_INDEX = 2;
- // Helper constants for accessing fields in an ARecord of type
- // NodeGroupRecordType.
- public static final int NODEGROUP_ARECORD_GROUPNAME_FIELD_INDEX = 0;
- public static final int NODEGROUP_ARECORD_NODENAMES_FIELD_INDEX = 1;
- public static final int NODEGROUP_ARECORD_TIMESTAMP_FIELD_INDEX = 2;
+ private static final ARecordType createNodeRecordType() {
+ String[] fieldNames = { "NodeName", "NumberOfCores", "WorkingMemorySize" };
+ IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.AINT32, BuiltinType.AINT32 };
+ return new ARecordType("NodeRecordType", fieldNames, fieldTypes, true);
+ };
- private static final ARecordType createNodeGroupRecordType() {
- AUnorderedListType ulType = new AUnorderedListType(BuiltinType.ASTRING,
- null);
- String[] fieldNames = { "GroupName", "NodeNames", "Timestamp" };
- IAType[] fieldTypes = { BuiltinType.ASTRING, ulType,
- BuiltinType.ASTRING };
- return new ARecordType("NodeGroupRecordType", fieldNames, fieldTypes,
- true);
- };
+ // Helper constants for accessing fields in an ARecord of type
+ // NodeGroupRecordType.
+ public static final int NODEGROUP_ARECORD_GROUPNAME_FIELD_INDEX = 0;
+ public static final int NODEGROUP_ARECORD_NODENAMES_FIELD_INDEX = 1;
+ public static final int NODEGROUP_ARECORD_TIMESTAMP_FIELD_INDEX = 2;
- private static IAType createFunctionParamsRecordType() {
- AOrderedListType orderedParamListType = new AOrderedListType(
- BuiltinType.ASTRING, null);
- return orderedParamListType;
+ private static final ARecordType createNodeGroupRecordType() {
+ AUnorderedListType ulType = new AUnorderedListType(BuiltinType.ASTRING, null);
+ String[] fieldNames = { "GroupName", "NodeNames", "Timestamp" };
+ IAType[] fieldTypes = { BuiltinType.ASTRING, ulType, BuiltinType.ASTRING };
+ return new ARecordType("NodeGroupRecordType", fieldNames, fieldTypes, true);
+ };
- }
+ private static IAType createFunctionParamsRecordType() {
+ AOrderedListType orderedParamListType = new AOrderedListType(BuiltinType.ASTRING, null);
+ return orderedParamListType;
- public static final int FUNCTION_ARECORD_DATAVERSENAME_FIELD_INDEX = 0;
- public static final int FUNCTION_ARECORD_FUNCTIONNAME_FIELD_INDEX = 1;
- public static final int FUNCTION_ARECORD_FUNCTIONARITY_FIELD_INDEX = 2;
- public static final int FUNCTION_ARECORD_FUNCTION_PARAM_LIST_FIELD_INDEX = 3;
- public static final int FUNCTION_ARECORD_FUNCTION_BODY_FIELD_INDEX = 4;
+ }
- private static final ARecordType createFunctionRecordType() {
+ public static final int FUNCTION_ARECORD_DATAVERSENAME_FIELD_INDEX = 0;
+ public static final int FUNCTION_ARECORD_FUNCTIONNAME_FIELD_INDEX = 1;
+ public static final int FUNCTION_ARECORD_FUNCTION_ARITY_FIELD_INDEX = 2;
+ public static final int FUNCTION_ARECORD_FUNCTION_PARAM_LIST_FIELD_INDEX = 3;
+ public static final int FUNCTION_ARECORD_FUNCTION_RETURN_TYPE_FIELD_INDEX = 4;
+ public static final int FUNCTION_ARECORD_FUNCTION_DEFINITION_FIELD_INDEX = 5;
+ public static final int FUNCTION_ARECORD_FUNCTION_LANGUAGE_FIELD_INDEX = 6;
+ public static final int FUNCTION_ARECORD_FUNCTION_KIND_FIELD_INDEX = 7;
- String[] fieldNames = { "DataverseName", "FunctionName",
- "FunctionArity", "FunctionParams", "FunctionBody" };
- IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ASTRING,
- BuiltinType.ASTRING, createFunctionParamsRecordType(),
- BuiltinType.ASTRING };
- return new ARecordType("FunctionRecordType", fieldNames, fieldTypes,
- true);
- }
+ private static final ARecordType createFunctionRecordType() {
+
+ String[] fieldNames = { "DataverseName", "Name", "Arity", "Params", "ReturnType", "Definition", "Language",
+ "Kind" };
+ IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ASTRING, BuiltinType.ASTRING,
+ createFunctionParamsRecordType(), BuiltinType.ASTRING, BuiltinType.ASTRING, BuiltinType.ASTRING,
+ BuiltinType.ASTRING };
+ return new ARecordType("FunctionRecordType", fieldNames, fieldTypes, true);
+ }
+
+ public static final int DATASOURCE_ADAPTER_ARECORD_DATAVERSENAME_FIELD_INDEX = 0;
+ public static final int DATASOURCE_ADAPTER_ARECORD_NAME_FIELD_INDEX = 1;
+ public static final int DATASOURCE_ADAPTER_ARECORD_CLASSNAME_FIELD_INDEX = 2;
+ public static final int DATASOURCE_ADAPTER_ARECORD_TYPE_FIELD_INDEX = 3;
+ public static final int DATASOURCE_ADAPTER_ARECORD_TIMESTAMP_FIELD_INDEX = 4;
+
+ private static ARecordType createDatasourceAdapterRecordType() {
+ String[] fieldNames = { "DataverseName", "Name", "Classname", "Type", "Timestamp" };
+ IAType[] fieldTypes = { BuiltinType.ASTRING, BuiltinType.ASTRING, BuiltinType.ASTRING, BuiltinType.ASTRING,
+ BuiltinType.ASTRING };
+ return new ARecordType("DatasourceAdapterRecordType", fieldNames, fieldTypes, true);
+ }
+
}
\ No newline at end of file
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlCompiledMetadataDeclarations.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlCompiledMetadataDeclarations.java
deleted file mode 100644
index ba7c797..0000000
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlCompiledMetadataDeclarations.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package edu.uci.ics.asterix.metadata.declared;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import edu.uci.ics.asterix.common.annotations.TypeDataGen;
-import edu.uci.ics.asterix.common.config.DatasetConfig.DatasetType;
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.formats.base.IDataFormat;
-import edu.uci.ics.asterix.metadata.MetadataException;
-import edu.uci.ics.asterix.metadata.MetadataManager;
-import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
-import edu.uci.ics.asterix.metadata.api.IMetadataManager;
-import edu.uci.ics.asterix.metadata.bootstrap.AsterixProperties;
-import edu.uci.ics.asterix.metadata.entities.Dataset;
-import edu.uci.ics.asterix.metadata.entities.Datatype;
-import edu.uci.ics.asterix.metadata.entities.Dataverse;
-import edu.uci.ics.asterix.metadata.entities.Index;
-import edu.uci.ics.asterix.metadata.entities.InternalDatasetDetails;
-import edu.uci.ics.asterix.metadata.entities.NodeGroup;
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksAbsolutePartitionConstraint;
-import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
-import edu.uci.ics.hyracks.algebricks.data.IAWriterFactory;
-import edu.uci.ics.hyracks.api.io.FileReference;
-import edu.uci.ics.hyracks.dataflow.std.file.ConstantFileSplitProvider;
-import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
-import edu.uci.ics.hyracks.dataflow.std.file.IFileSplitProvider;
-
-public class AqlCompiledMetadataDeclarations {
- private static Logger LOGGER = Logger.getLogger(AqlCompiledMetadataDeclarations.class.getName());
-
- // We are assuming that there is a one AqlCompiledMetadataDeclarations per
- // transaction.
- private final MetadataTransactionContext mdTxnCtx;
- private String dataverseName = null;
- private FileSplit outputFile;
- private Map<String, String[]> stores;
- private IDataFormat format;
- private Map<String, String> config;
-
- private final Map<String, IAType> types;
- private final Map<String, TypeDataGen> typeDataGenMap;
- private final IAWriterFactory writerFactory;
-
- private IMetadataManager metadataManager = MetadataManager.INSTANCE;
- private boolean isConnected = false;
-
- public AqlCompiledMetadataDeclarations(MetadataTransactionContext mdTxnCtx, String dataverseName,
- FileSplit outputFile, Map<String, String> config, Map<String, String[]> stores, Map<String, IAType> types,
- Map<String, TypeDataGen> typeDataGenMap, IAWriterFactory writerFactory, boolean online) {
- this.mdTxnCtx = mdTxnCtx;
- this.dataverseName = dataverseName;
- this.outputFile = outputFile;
- this.config = config;
- if (stores == null && online) {
- this.stores = AsterixProperties.INSTANCE.getStores();
- } else {
- this.stores = stores;
- }
- this.types = types;
- this.typeDataGenMap = typeDataGenMap;
- this.writerFactory = writerFactory;
- }
-
- public void connectToDataverse(String dvName) throws AlgebricksException, AsterixException {
- if (isConnected) {
- throw new AlgebricksException("You are already connected to " + dataverseName + " dataverse");
- }
- Dataverse dv;
- try {
- dv = metadataManager.getDataverse(mdTxnCtx, dvName);
- } catch (Exception e) {
- throw new AsterixException(e);
- }
- if (dv == null) {
- throw new AlgebricksException("There is no dataverse with this name " + dvName + " to connect to.");
- }
- dataverseName = dvName;
- isConnected = true;
- try {
- format = (IDataFormat) Class.forName(dv.getDataFormat()).newInstance();
- } catch (Exception e) {
- throw new AsterixException(e);
- }
- }
-
- public void disconnectFromDataverse() throws AlgebricksException {
- if (!isConnected) {
- throw new AlgebricksException("You are not connected to any dataverse");
- }
- dataverseName = null;
- format = null;
- isConnected = false;
- }
-
- public boolean isConnectedToDataverse() {
- return isConnected;
- }
-
- public String getDataverseName() {
- return dataverseName;
- }
-
- public FileSplit getOutputFile() {
- return outputFile;
- }
-
- public IDataFormat getFormat() throws AlgebricksException {
- if (!isConnected) {
- throw new AlgebricksException("You need first to connect to a dataverse.");
- }
- return format;
- }
-
- public String getPropertyValue(String propertyName) {
- return config.get(propertyName);
- }
-
- public IAType findType(String typeName) {
- Datatype type;
- try {
- type = metadataManager.getDatatype(mdTxnCtx, dataverseName, typeName);
- } catch (Exception e) {
- throw new IllegalStateException();
- }
- if (type == null) {
- throw new IllegalStateException();
- }
- return type.getDatatype();
- }
-
- public List<String> findNodeGroupNodeNames(String nodeGroupName) throws AlgebricksException {
- NodeGroup ng;
- try {
- ng = metadataManager.getNodegroup(mdTxnCtx, nodeGroupName);
- } catch (MetadataException e) {
- throw new AlgebricksException(e);
- }
- if (ng == null) {
- throw new AlgebricksException("No node group with this name " + nodeGroupName);
- }
- return ng.getNodeNames();
- }
-
- public String[] getStores(String nodeName) {
- return stores.get(nodeName);
- }
-
- public Map<String, String[]> getAllStores() {
- return stores;
- }
-
- public Dataset findDataset(String datasetName) throws AlgebricksException {
- try {
- return metadataManager.getDataset(mdTxnCtx, dataverseName, datasetName);
- } catch (MetadataException e) {
- throw new AlgebricksException(e);
- }
- }
-
- public List<Index> getDatasetIndexes(String dataverseName, String datasetName) throws AlgebricksException {
- try {
- return metadataManager.getDatasetIndexes(mdTxnCtx, dataverseName, datasetName);
- } catch (MetadataException e) {
- throw new AlgebricksException(e);
- }
- }
-
- public Index getDatasetPrimaryIndex(String dataverseName, String datasetName) throws AlgebricksException {
- try {
- return metadataManager.getIndex(mdTxnCtx, dataverseName, datasetName, datasetName);
- } catch (MetadataException e) {
- throw new AlgebricksException(e);
- }
- }
-
- public Index getIndex(String dataverseName, String datasetName, String indexName) throws AlgebricksException {
- try {
- return metadataManager.getIndex(mdTxnCtx, dataverseName, datasetName, indexName);
- } catch (MetadataException e) {
- throw new AlgebricksException(e);
- }
- }
-
- public void setOutputFile(FileSplit outputFile) {
- this.outputFile = outputFile;
- }
-
- public Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitProviderAndPartitionConstraintsForInternalOrFeedDataset(
- String datasetName, String targetIdxName) throws AlgebricksException {
- FileSplit[] splits = splitsForInternalOrFeedDataset(datasetName, targetIdxName);
- IFileSplitProvider splitProvider = new ConstantFileSplitProvider(splits);
- String[] loc = new String[splits.length];
- for (int p = 0; p < splits.length; p++) {
- loc[p] = splits[p].getNodeName();
- }
- AlgebricksPartitionConstraint pc = new AlgebricksAbsolutePartitionConstraint(loc);
- return new Pair<IFileSplitProvider, AlgebricksPartitionConstraint>(splitProvider, pc);
- }
-
- public Pair<IFileSplitProvider, IFileSplitProvider> getInvertedIndexFileSplitProviders(
- IFileSplitProvider splitProvider) {
- int numSplits = splitProvider.getFileSplits().length;
- FileSplit[] btreeSplits = new FileSplit[numSplits];
- FileSplit[] invListsSplits = new FileSplit[numSplits];
- for (int i = 0; i < numSplits; i++) {
- String nodeName = splitProvider.getFileSplits()[i].getNodeName();
- String path = splitProvider.getFileSplits()[i].getLocalFile().getFile().getPath();
- btreeSplits[i] = new FileSplit(nodeName, path + "_$btree");
- invListsSplits[i] = new FileSplit(nodeName, path + "_$invlists");
- }
- return new Pair<IFileSplitProvider, IFileSplitProvider>(new ConstantFileSplitProvider(btreeSplits),
- new ConstantFileSplitProvider(invListsSplits));
- }
-
- private FileSplit[] splitsForInternalOrFeedDataset(String datasetName, String targetIdxName)
- throws AlgebricksException {
-
- File relPathFile = new File(getRelativePath(datasetName + "_idx_" + targetIdxName));
- Dataset dataset = findDataset(datasetName);
- if (dataset.getDatasetType() != DatasetType.INTERNAL & dataset.getDatasetType() != DatasetType.FEED) {
- throw new AlgebricksException("Not an internal or feed dataset");
- }
- InternalDatasetDetails datasetDetails = (InternalDatasetDetails) dataset.getDatasetDetails();
- List<String> nodeGroup = findNodeGroupNodeNames(datasetDetails.getNodeGroupName());
- if (nodeGroup == null) {
- throw new AlgebricksException("Couldn't find node group " + datasetDetails.getNodeGroupName());
- }
-
- List<FileSplit> splitArray = new ArrayList<FileSplit>();
- for (String nd : nodeGroup) {
- String[] nodeStores = stores.get(nd);
- if (nodeStores == null) {
- LOGGER.warning("Node " + nd + " has no stores.");
- throw new AlgebricksException("Node " + nd + " has no stores.");
- } else {
- for (int j = 0; j < nodeStores.length; j++) {
- File f = new File(nodeStores[j] + File.separator + relPathFile);
- splitArray.add(new FileSplit(nd, new FileReference(f)));
- }
- }
- }
- FileSplit[] splits = new FileSplit[splitArray.size()];
- int i = 0;
- for (FileSplit fs : splitArray) {
- splits[i++] = fs;
- }
- return splits;
- }
-
- public String getRelativePath(String fileName) {
- return dataverseName + File.separator + fileName;
- }
-
- public Map<String, TypeDataGen> getTypeDataGenMap() {
- return typeDataGenMap;
- }
-
- public Map<String, IAType> getTypeDeclarations() {
- return types;
- }
-
- public IAWriterFactory getWriterFactory() {
- return writerFactory;
- }
-
- public MetadataTransactionContext getMetadataTransactionContext() {
- return mdTxnCtx;
- }
-}
\ No newline at end of file
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlIndex.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlIndex.java
index bac7733..81f2329 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlIndex.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlIndex.java
@@ -16,31 +16,32 @@
package edu.uci.ics.asterix.metadata.declared;
import edu.uci.ics.asterix.metadata.entities.Index;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IDataSource;
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IDataSourceIndex;
public class AqlIndex implements IDataSourceIndex<String, AqlSourceId> {
private final Index index;
- private final AqlCompiledMetadataDeclarations acmd;
- private final String datasetName;
+ private final String dataset;
+ private final String dataverse;
+ private final AqlMetadataProvider metadataProvider;
// Every transactions needs to work with its own instance of an
// AqlMetadataProvider.
- public AqlIndex(Index index, AqlCompiledMetadataDeclarations acmd, String datasetName) {
+ public AqlIndex(Index index, String dataverse, String dataset, AqlMetadataProvider metadatProvider) {
this.index = index;
- this.acmd = acmd;
- this.datasetName = datasetName;
+ this.dataset = dataset;
+ this.dataverse = dataverse;
+ this.metadataProvider = metadatProvider;
}
// TODO: Maybe Index can directly implement IDataSourceIndex<String, AqlSourceId>
@Override
public IDataSource<AqlSourceId> getDataSource() {
try {
- AqlSourceId asid = new AqlSourceId(acmd.getDataverseName(), datasetName);
- return AqlMetadataProvider.lookupSourceInMetadata(acmd, asid);
- } catch (AlgebricksException e) {
+ AqlSourceId asid = new AqlSourceId(dataverse, dataset);
+ return metadataProvider.lookupSourceInMetadata(asid);
+ } catch (Exception me) {
return null;
}
}
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlLogicalPlanAndMetadataImpl.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlLogicalPlanAndMetadataImpl.java
index 293e43d..5bf0351 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlLogicalPlanAndMetadataImpl.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlLogicalPlanAndMetadataImpl.java
@@ -45,8 +45,7 @@
@Override
public AlgebricksPartitionConstraint getClusterLocations() {
- AqlCompiledMetadataDeclarations metadata = metadataProvider.getMetadataDeclarations();
- Map<String, String[]> stores = metadata.getAllStores();
+ Map<String, String[]> stores = metadataProvider.getAllStores();
ArrayList<String> locs = new ArrayList<String>();
for (String k : stores.keySet()) {
String[] nodeStores = stores.get(k);
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlMetadataProvider.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlMetadataProvider.java
index a3d3472..d92c76d 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlMetadataProvider.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlMetadataProvider.java
@@ -16,28 +16,43 @@
package edu.uci.ics.asterix.metadata.declared;
import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
+import java.util.logging.Logger;
import edu.uci.ics.asterix.common.config.DatasetConfig.DatasetType;
import edu.uci.ics.asterix.common.config.GlobalConfig;
import edu.uci.ics.asterix.common.dataflow.IAsterixApplicationContextInfo;
import edu.uci.ics.asterix.common.parse.IParseFileSplitsDecl;
import edu.uci.ics.asterix.dataflow.data.nontagged.valueproviders.AqlPrimitiveValueProviderFactory;
-import edu.uci.ics.asterix.external.data.adapter.api.IDatasourceAdapter;
-import edu.uci.ics.asterix.external.data.adapter.api.IDatasourceReadAdapter;
+import edu.uci.ics.asterix.external.adapter.factory.IAdapterFactory;
+import edu.uci.ics.asterix.external.adapter.factory.IGenericDatasetAdapterFactory;
+import edu.uci.ics.asterix.external.adapter.factory.ITypedDatasetAdapterFactory;
import edu.uci.ics.asterix.external.data.operator.ExternalDataScanOperatorDescriptor;
-import edu.uci.ics.asterix.feed.comm.IFeedMessage;
-import edu.uci.ics.asterix.feed.mgmt.FeedId;
-import edu.uci.ics.asterix.feed.operator.FeedIntakeOperatorDescriptor;
-import edu.uci.ics.asterix.feed.operator.FeedMessageOperatorDescriptor;
+import edu.uci.ics.asterix.external.data.operator.FeedIntakeOperatorDescriptor;
+import edu.uci.ics.asterix.external.data.operator.FeedMessageOperatorDescriptor;
+import edu.uci.ics.asterix.external.dataset.adapter.IDatasourceAdapter;
+import edu.uci.ics.asterix.external.dataset.adapter.ITypedDatasourceAdapter;
+import edu.uci.ics.asterix.external.feed.lifecycle.FeedId;
+import edu.uci.ics.asterix.external.feed.lifecycle.IFeedMessage;
import edu.uci.ics.asterix.formats.base.IDataFormat;
import edu.uci.ics.asterix.formats.nontagged.AqlBinaryComparatorFactoryProvider;
-import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.formats.nontagged.AqlTypeTraitProvider;
+import edu.uci.ics.asterix.metadata.MetadataException;
+import edu.uci.ics.asterix.metadata.MetadataManager;
+import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
+import edu.uci.ics.asterix.metadata.bootstrap.AsterixProperties;
+import edu.uci.ics.asterix.metadata.bootstrap.MetadataConstants;
import edu.uci.ics.asterix.metadata.entities.Dataset;
+import edu.uci.ics.asterix.metadata.entities.DatasourceAdapter;
+import edu.uci.ics.asterix.metadata.entities.Datatype;
+import edu.uci.ics.asterix.metadata.entities.Dataverse;
import edu.uci.ics.asterix.metadata.entities.ExternalDatasetDetails;
import edu.uci.ics.asterix.metadata.entities.FeedDatasetDetails;
import edu.uci.ics.asterix.metadata.entities.Index;
+import edu.uci.ics.asterix.metadata.entities.InternalDatasetDetails;
import edu.uci.ics.asterix.metadata.utils.DatasetUtils;
import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.types.ARecordType;
@@ -45,6 +60,8 @@
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
import edu.uci.ics.asterix.runtime.base.AsterixTupleFilterFactory;
+import edu.uci.ics.asterix.runtime.formats.FormatUtils;
+import edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat;
import edu.uci.ics.asterix.runtime.transaction.TreeIndexInsertUpdateDeleteOperatorDescriptor;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksAbsolutePartitionConstraint;
import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
@@ -63,6 +80,7 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.IOperatorSchema;
import edu.uci.ics.hyracks.algebricks.core.jobgen.impl.JobGenContext;
import edu.uci.ics.hyracks.algebricks.core.jobgen.impl.JobGenHelper;
+import edu.uci.ics.hyracks.algebricks.data.IAWriterFactory;
import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
import edu.uci.ics.hyracks.algebricks.runtime.base.IPushRuntimeFactory;
import edu.uci.ics.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
@@ -72,6 +90,7 @@
import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
import edu.uci.ics.hyracks.api.dataflow.value.ITypeTraits;
import edu.uci.ics.hyracks.api.dataflow.value.RecordDescriptor;
+import edu.uci.ics.hyracks.api.io.FileReference;
import edu.uci.ics.hyracks.api.job.JobSpecification;
import edu.uci.ics.hyracks.dataflow.std.file.ConstantFileSplitProvider;
import edu.uci.ics.hyracks.dataflow.std.file.FileScanOperatorDescriptor;
@@ -91,24 +110,87 @@
import edu.uci.ics.hyracks.storage.am.rtree.dataflow.RTreeSearchOperatorDescriptor;
public class AqlMetadataProvider implements IMetadataProvider<AqlSourceId, String> {
- private final long txnId;
- private boolean isWriteTransaction;
- private final AqlCompiledMetadataDeclarations metadata;
- public AqlMetadataProvider(long txnId, boolean isWriteTransaction, AqlCompiledMetadataDeclarations metadata) {
- this.txnId = txnId;
- this.isWriteTransaction = isWriteTransaction;
- this.metadata = metadata;
+ private static Logger LOGGER = Logger.getLogger(AqlMetadataProvider.class.getName());
+
+ private final MetadataTransactionContext mdTxnCtx;
+ private boolean isWriteTransaction;
+ private Map<String, String[]> stores;
+ private Map<String, String> config;
+ private IAWriterFactory writerFactory;
+ private FileSplit outputFile;
+ private long jobTxnId;
+
+ private final Dataverse defaultDataverse;
+
+ private static final Map<String, String> adapterFactoryMapping = initializeAdapterFactoryMapping();
+
+ public String getPropertyValue(String propertyName) {
+ return config.get(propertyName);
+ }
+
+ public void setConfig(Map<String, String> config) {
+ this.config = config;
+ }
+
+ public Map<String, String[]> getAllStores() {
+ return stores;
+ }
+
+ public Map<String, String> getConfig() {
+ return config;
+ }
+
+ public AqlMetadataProvider(MetadataTransactionContext mdTxnCtx, Dataverse defaultDataverse) {
+ this.mdTxnCtx = mdTxnCtx;
+ this.defaultDataverse = defaultDataverse;
+ this.stores = AsterixProperties.INSTANCE.getStores();
+ }
+
+ public void setJobTxnId(long txnId) {
+ this.jobTxnId = txnId;
+ }
+
+ public Dataverse getDefaultDataverse() {
+ return defaultDataverse;
+ }
+
+ public String getDefaultDataverseName() {
+ return defaultDataverse == null ? null : defaultDataverse.getDataverseName();
+ }
+
+ public void setWriteTransaction(boolean writeTransaction) {
+ this.isWriteTransaction = writeTransaction;
+ }
+
+ public void setWriterFactory(IAWriterFactory writerFactory) {
+ this.writerFactory = writerFactory;
+ }
+
+ public MetadataTransactionContext getMetadataTxnContext() {
+ return mdTxnCtx;
+ }
+
+ public IAWriterFactory getWriterFactory() {
+ return this.writerFactory;
+ }
+
+ public FileSplit getOutputFile() {
+ return outputFile;
+ }
+
+ public void setOutputFile(FileSplit outputFile) {
+ this.outputFile = outputFile;
}
@Override
public AqlDataSource findDataSource(AqlSourceId id) throws AlgebricksException {
AqlSourceId aqlId = (AqlSourceId) id;
- return lookupSourceInMetadata(metadata, aqlId);
- }
-
- public AqlCompiledMetadataDeclarations getMetadataDeclarations() {
- return metadata;
+ try {
+ return lookupSourceInMetadata(aqlId);
+ } catch (MetadataException e) {
+ throw new AlgebricksException(e);
+ }
}
public boolean isWriteTransaction() {
@@ -121,69 +203,100 @@
List<LogicalVariable> projectVariables, boolean projectPushed, IOperatorSchema opSchema,
IVariableTypeEnvironment typeEnv, JobGenContext context, JobSpecification jobSpec)
throws AlgebricksException {
- Dataset dataset = metadata.findDataset(dataSource.getId().getDatasetName());
- if (dataset == null) {
- throw new AlgebricksException("Unknown dataset " + dataSource.getId().getDatasetName());
- }
- switch (dataset.getDatasetType()) {
- case FEED:
- if (dataSource instanceof ExternalFeedDataSource) {
- return buildExternalDatasetScan(jobSpec, dataset, dataSource);
- } else {
+ Dataset dataset;
+ try {
+ dataset = MetadataManager.INSTANCE.getDataset(mdTxnCtx, dataSource.getId().getDataverseName(), dataSource
+ .getId().getDatasetName());
+
+ if (dataset == null) {
+ throw new AlgebricksException("Unknown dataset " + dataSource.getId().getDatasetName()
+ + " in dataverse " + dataSource.getId().getDataverseName());
+ }
+ switch (dataset.getDatasetType()) {
+ case FEED:
+ if (dataSource instanceof ExternalFeedDataSource) {
+ return buildExternalDatasetScan(jobSpec, dataset, dataSource);
+ } else {
+ return buildInternalDatasetScan(jobSpec, scanVariables, opSchema, typeEnv, dataset, dataSource,
+ context);
+
+ }
+ case INTERNAL: {
return buildInternalDatasetScan(jobSpec, scanVariables, opSchema, typeEnv, dataset, dataSource,
context);
}
- case INTERNAL: {
- return buildInternalDatasetScan(jobSpec, scanVariables, opSchema, typeEnv, dataset, dataSource, context);
+ case EXTERNAL: {
+ return buildExternalDatasetScan(jobSpec, dataset, dataSource);
+ }
+ default: {
+ throw new IllegalArgumentException();
+ }
}
- case EXTERNAL: {
- return buildExternalDatasetScan(jobSpec, dataset, dataSource);
- }
- default: {
- throw new IllegalArgumentException();
- }
+ } catch (MetadataException e) {
+ throw new AlgebricksException(e);
}
}
private Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> buildInternalDatasetScan(JobSpecification jobSpec,
List<LogicalVariable> outputVars, IOperatorSchema opSchema, IVariableTypeEnvironment typeEnv,
- Dataset dataset, IDataSource<AqlSourceId> dataSource, JobGenContext context) throws AlgebricksException {
+ Dataset dataset, IDataSource<AqlSourceId> dataSource, JobGenContext context) throws AlgebricksException,
+ MetadataException {
AqlSourceId asid = dataSource.getId();
String dataverseName = asid.getDataverseName();
String datasetName = asid.getDatasetName();
- Index primaryIndex = metadata.getDatasetPrimaryIndex(dataverseName, datasetName);
- return buildBtreeRuntime(jobSpec, outputVars, opSchema, typeEnv, metadata, context, false, datasetName,
- dataset, primaryIndex.getIndexName(), null, null, true, true);
+ Index primaryIndex = MetadataManager.INSTANCE.getIndex(mdTxnCtx, dataverseName, datasetName, datasetName);
+ return buildBtreeRuntime(jobSpec, outputVars, opSchema, typeEnv, context, false, dataset,
+ primaryIndex.getIndexName(), null, null, true, true);
}
private Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> buildExternalDatasetScan(JobSpecification jobSpec,
- Dataset dataset, IDataSource<AqlSourceId> dataSource) throws AlgebricksException {
+ Dataset dataset, IDataSource<AqlSourceId> dataSource) throws AlgebricksException, MetadataException {
String itemTypeName = dataset.getItemTypeName();
- IAType itemType = metadata.findType(itemTypeName);
+ IAType itemType = MetadataManager.INSTANCE.getDatatype(mdTxnCtx, dataset.getDataverseName(), itemTypeName)
+ .getDatatype();
if (dataSource instanceof ExternalFeedDataSource) {
- FeedDatasetDetails datasetDetails = (FeedDatasetDetails) dataset.getDatasetDetails();
- return buildFeedIntakeRuntime(jobSpec, metadata.getDataverseName(), dataset.getDatasetName(), itemType,
- datasetDetails, metadata.getFormat());
+ return buildFeedIntakeRuntime(jobSpec, dataset);
} else {
return buildExternalDataScannerRuntime(jobSpec, itemType,
- (ExternalDatasetDetails) dataset.getDatasetDetails(), metadata.getFormat());
+ (ExternalDatasetDetails) dataset.getDatasetDetails(), NonTaggedDataFormat.INSTANCE);
}
}
@SuppressWarnings("rawtypes")
- public static Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> buildExternalDataScannerRuntime(
+ public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> buildExternalDataScannerRuntime(
JobSpecification jobSpec, IAType itemType, ExternalDatasetDetails datasetDetails, IDataFormat format)
throws AlgebricksException {
if (itemType.getTypeTag() != ATypeTag.RECORD) {
throw new AlgebricksException("Can only scan datasets of records.");
}
- IDatasourceReadAdapter adapter;
+ IGenericDatasetAdapterFactory adapterFactory;
+ IDatasourceAdapter adapter;
+ String adapterName;
+ DatasourceAdapter adapterEntity;
+ String adapterFactoryClassname;
try {
- adapter = (IDatasourceReadAdapter) Class.forName(datasetDetails.getAdapter()).newInstance();
+ adapterName = datasetDetails.getAdapter();
+ adapterEntity = MetadataManager.INSTANCE.getAdapter(mdTxnCtx, MetadataConstants.METADATA_DATAVERSE_NAME,
+ adapterName);
+ if (adapterEntity != null) {
+ adapterFactoryClassname = adapterEntity.getClassname();
+ adapterFactory = (IGenericDatasetAdapterFactory) Class.forName(adapterFactoryClassname).newInstance();
+ } else {
+ adapterFactoryClassname = adapterFactoryMapping.get(adapterName);
+ if (adapterFactoryClassname == null) {
+ throw new AlgebricksException(" Unknown adapter :" + adapterName);
+ }
+ adapterFactory = (IGenericDatasetAdapterFactory) Class.forName(adapterFactoryClassname).newInstance();
+ }
+
+ adapter = ((IGenericDatasetAdapterFactory) adapterFactory).createAdapter(datasetDetails.getProperties(),
+ itemType);
+ } catch (AlgebricksException ae) {
+ throw ae;
} catch (Exception e) {
e.printStackTrace();
- throw new AlgebricksException("unable to load the adapter class " + e);
+ throw new AlgebricksException("Unable to create adapter " + e);
}
if (!(adapter.getAdapterType().equals(IDatasourceAdapter.AdapterType.READ) || adapter.getAdapterType().equals(
@@ -192,27 +305,25 @@
}
ARecordType rt = (ARecordType) itemType;
- try {
- adapter.configure(datasetDetails.getProperties(), itemType);
- } catch (Exception e) {
- e.printStackTrace();
- throw new AlgebricksException("unable to configure the datasource adapter " + e);
- }
-
ISerializerDeserializer payloadSerde = format.getSerdeProvider().getSerializerDeserializer(itemType);
RecordDescriptor scannerDesc = new RecordDescriptor(new ISerializerDeserializer[] { payloadSerde });
ExternalDataScanOperatorDescriptor dataScanner = new ExternalDataScanOperatorDescriptor(jobSpec,
- datasetDetails.getAdapter(), datasetDetails.getProperties(), rt, scannerDesc);
- dataScanner.setDatasourceAdapter(adapter);
- AlgebricksPartitionConstraint constraint = adapter.getPartitionConstraint();
+ adapterFactoryClassname, datasetDetails.getProperties(), rt, scannerDesc);
+
+ AlgebricksPartitionConstraint constraint;
+ try {
+ constraint = adapter.getPartitionConstraint();
+ } catch (Exception e) {
+ throw new AlgebricksException(e);
+ }
+
return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(dataScanner, constraint);
}
@SuppressWarnings("rawtypes")
- public static Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> buildScannerRuntime(
- JobSpecification jobSpec, IAType itemType, IParseFileSplitsDecl decl, IDataFormat format)
- throws AlgebricksException {
+ public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> buildScannerRuntime(JobSpecification jobSpec,
+ IAType itemType, IParseFileSplitsDecl decl, IDataFormat format) throws AlgebricksException {
if (itemType.getTypeTag() != ATypeTag.RECORD) {
throw new AlgebricksException("Can only scan datasets of records.");
}
@@ -233,165 +344,185 @@
}
@SuppressWarnings("rawtypes")
- public static Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> buildFeedIntakeRuntime(
- JobSpecification jobSpec, String dataverse, String dataset, IAType itemType,
- FeedDatasetDetails datasetDetails, IDataFormat format) throws AlgebricksException {
- if (itemType.getTypeTag() != ATypeTag.RECORD) {
- throw new AlgebricksException("Can only consume records.");
- }
+ public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> buildFeedIntakeRuntime(JobSpecification jobSpec,
+ Dataset dataset) throws AlgebricksException {
+
+ FeedDatasetDetails datasetDetails = (FeedDatasetDetails) dataset.getDatasetDetails();
+ DatasourceAdapter adapterEntity;
IDatasourceAdapter adapter;
+ IAdapterFactory adapterFactory;
+ IAType adapterOutputType;
+ String adapterName;
+ String adapterFactoryClassname;
+
try {
- adapter = (IDatasourceAdapter) Class.forName(datasetDetails.getAdapter()).newInstance();
+ adapterName = datasetDetails.getAdapterFactory();
+ adapterEntity = MetadataManager.INSTANCE.getAdapter(mdTxnCtx, MetadataConstants.METADATA_DATAVERSE_NAME,
+ adapterName);
+ if (adapterEntity != null) {
+ adapterFactoryClassname = adapterEntity.getClassname();
+ adapterFactory = (IAdapterFactory) Class.forName(adapterFactoryClassname).newInstance();
+ } else {
+ adapterFactoryClassname = adapterFactoryMapping.get(adapterName);
+ if (adapterFactoryClassname != null) {
+ } else {
+ // adapterName has been provided as a fully qualified classname
+ adapterFactoryClassname = adapterName;
+ }
+ adapterFactory = (IAdapterFactory) Class.forName(adapterFactoryClassname).newInstance();
+ }
+
+ if (adapterFactory instanceof ITypedDatasetAdapterFactory) {
+ adapter = ((ITypedDatasetAdapterFactory) adapterFactory).createAdapter(datasetDetails.getProperties());
+ adapterOutputType = ((ITypedDatasourceAdapter) adapter).getAdapterOutputType();
+ } else if (adapterFactory instanceof IGenericDatasetAdapterFactory) {
+ String outputTypeName = datasetDetails.getProperties().get(IGenericDatasetAdapterFactory.KEY_TYPE_NAME);
+ adapterOutputType = MetadataManager.INSTANCE.getDatatype(mdTxnCtx, dataset.getDataverseName(),
+ outputTypeName).getDatatype();
+ adapter = ((IGenericDatasetAdapterFactory) adapterFactory).createAdapter(
+ datasetDetails.getProperties(), adapterOutputType);
+ } else {
+ throw new IllegalStateException(" Unknown factory type for " + adapterFactoryClassname);
+ }
+ } catch (AlgebricksException ae) {
+ throw ae;
} catch (Exception e) {
e.printStackTrace();
- throw new AlgebricksException("unable to load the adapter class " + e);
+ throw new AlgebricksException("unable to create adapter " + e);
}
- ARecordType rt = (ARecordType) itemType;
- try {
- adapter.configure(datasetDetails.getProperties(), itemType);
- } catch (Exception e) {
- e.printStackTrace();
- throw new AlgebricksException("unable to configure the datasource adapter " + e);
- }
-
- ISerializerDeserializer payloadSerde = format.getSerdeProvider().getSerializerDeserializer(itemType);
+ ISerializerDeserializer payloadSerde = NonTaggedDataFormat.INSTANCE.getSerdeProvider()
+ .getSerializerDeserializer(adapterOutputType);
RecordDescriptor feedDesc = new RecordDescriptor(new ISerializerDeserializer[] { payloadSerde });
- FeedIntakeOperatorDescriptor feedIngestor = new FeedIntakeOperatorDescriptor(jobSpec, new FeedId(dataverse,
- dataset), datasetDetails.getAdapter(), datasetDetails.getProperties(), rt, feedDesc);
+ FeedIntakeOperatorDescriptor feedIngestor = new FeedIntakeOperatorDescriptor(jobSpec, new FeedId(
+ dataset.getDataverseName(), dataset.getDatasetName()), adapterFactoryClassname,
+ datasetDetails.getProperties(), (ARecordType) adapterOutputType, feedDesc);
- AlgebricksPartitionConstraint constraint = adapter.getPartitionConstraint();
+ AlgebricksPartitionConstraint constraint = null;
+ try {
+ constraint = adapter.getPartitionConstraint();
+ } catch (Exception e) {
+ throw new AlgebricksException(e);
+ }
return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(feedIngestor, constraint);
}
- public static Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> buildFeedMessengerRuntime(
- JobSpecification jobSpec, AqlCompiledMetadataDeclarations metadata, FeedDatasetDetails datasetDetails,
+ public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> buildFeedMessengerRuntime(
+ AqlMetadataProvider metadataProvider, JobSpecification jobSpec, FeedDatasetDetails datasetDetails,
String dataverse, String dataset, List<IFeedMessage> feedMessages) throws AlgebricksException {
- Pair<IFileSplitProvider, AlgebricksPartitionConstraint> spPc = metadata
- .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(dataset, dataset);
+ Pair<IFileSplitProvider, AlgebricksPartitionConstraint> spPc = metadataProvider
+ .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(dataverse, dataset, dataset);
FeedMessageOperatorDescriptor feedMessenger = new FeedMessageOperatorDescriptor(jobSpec, dataverse, dataset,
feedMessages);
return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(feedMessenger, spPc.second);
}
- public static Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> buildBtreeRuntime(JobSpecification jobSpec,
+ public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> buildBtreeRuntime(JobSpecification jobSpec,
List<LogicalVariable> outputVars, IOperatorSchema opSchema, IVariableTypeEnvironment typeEnv,
- AqlCompiledMetadataDeclarations metadata, JobGenContext context, boolean retainInput, String datasetName,
- Dataset dataset, String indexName, int[] lowKeyFields, int[] highKeyFields, boolean lowKeyInclusive,
- boolean highKeyInclusive) throws AlgebricksException {
+ JobGenContext context, boolean retainInput, Dataset dataset, String indexName, int[] lowKeyFields,
+ int[] highKeyFields, boolean lowKeyInclusive, boolean highKeyInclusive) throws AlgebricksException {
boolean isSecondary = true;
- Index primaryIndex = metadata.getDatasetPrimaryIndex(dataset.getDataverseName(), dataset.getDatasetName());
- if (primaryIndex != null) {
- isSecondary = !indexName.equals(primaryIndex.getIndexName());
- }
- int numPrimaryKeys = DatasetUtils.getPartitioningKeys(dataset).size();
- RecordDescriptor outputRecDesc = JobGenHelper.mkRecordDescriptor(typeEnv, opSchema, context);
- int numKeys = numPrimaryKeys;
- int keysStartIndex = outputRecDesc.getFieldCount() - numKeys - 1;
- if (isSecondary) {
- Index secondaryIndex = metadata.getIndex(dataset.getDataverseName(), dataset.getDatasetName(), indexName);
- int numSecondaryKeys = secondaryIndex.getKeyFieldNames().size();
- numKeys += numSecondaryKeys;
- keysStartIndex = outputRecDesc.getFieldCount() - numKeys;
- }
- IBinaryComparatorFactory[] comparatorFactories = JobGenHelper.variablesToAscBinaryComparatorFactories(
- outputVars, keysStartIndex, numKeys, typeEnv, context);
- ITypeTraits[] typeTraits = JobGenHelper.variablesToTypeTraits(outputVars, keysStartIndex, numKeys, typeEnv,
- context);
-
- IAsterixApplicationContextInfo appContext = (IAsterixApplicationContextInfo) context.getAppContext();
- Pair<IFileSplitProvider, AlgebricksPartitionConstraint> spPc;
try {
- spPc = metadata.splitProviderAndPartitionConstraintsForInternalOrFeedDataset(datasetName, indexName);
- } catch (Exception e) {
- throw new AlgebricksException(e);
+ Index primaryIndex = MetadataManager.INSTANCE.getIndex(mdTxnCtx, dataset.getDataverseName(),
+ dataset.getDatasetName(), dataset.getDatasetName());
+ if (primaryIndex != null) {
+ isSecondary = !indexName.equals(primaryIndex.getIndexName());
+ }
+ int numPrimaryKeys = DatasetUtils.getPartitioningKeys(dataset).size();
+ RecordDescriptor outputRecDesc = JobGenHelper.mkRecordDescriptor(typeEnv, opSchema, context);
+ int numKeys = numPrimaryKeys;
+ int keysStartIndex = outputRecDesc.getFieldCount() - numKeys - 1;
+ if (isSecondary) {
+ Index secondaryIndex = MetadataManager.INSTANCE.getIndex(mdTxnCtx, dataset.getDataverseName(),
+ dataset.getDatasetName(), indexName);
+ int numSecondaryKeys = secondaryIndex.getKeyFieldNames().size();
+ numKeys += numSecondaryKeys;
+ keysStartIndex = outputVars.size() - numKeys;
+ }
+ IBinaryComparatorFactory[] comparatorFactories = JobGenHelper.variablesToAscBinaryComparatorFactories(
+ outputVars, keysStartIndex, numKeys, typeEnv, context);
+ ITypeTraits[] typeTraits = null;
+
+ if (isSecondary) {
+ typeTraits = JobGenHelper.variablesToTypeTraits(outputVars, keysStartIndex, numKeys, typeEnv, context);
+ } else {
+ typeTraits = JobGenHelper.variablesToTypeTraits(outputVars, keysStartIndex, numKeys + 1, typeEnv,
+ context);
+ }
+
+ IAsterixApplicationContextInfo appContext = (IAsterixApplicationContextInfo) context.getAppContext();
+ Pair<IFileSplitProvider, AlgebricksPartitionConstraint> spPc;
+ try {
+ spPc = splitProviderAndPartitionConstraintsForInternalOrFeedDataset(dataset.getDataverseName(),
+ dataset.getDatasetName(), indexName);
+ } catch (Exception e) {
+ throw new AlgebricksException(e);
+ }
+ BTreeSearchOperatorDescriptor btreeSearchOp = new BTreeSearchOperatorDescriptor(jobSpec, outputRecDesc,
+ appContext.getStorageManagerInterface(), appContext.getIndexRegistryProvider(), spPc.first,
+ typeTraits, comparatorFactories, lowKeyFields, highKeyFields, lowKeyInclusive, highKeyInclusive,
+ new BTreeDataflowHelperFactory(), retainInput, NoOpOperationCallbackProvider.INSTANCE);
+ return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(btreeSearchOp, spPc.second);
+ } catch (MetadataException me) {
+ throw new AlgebricksException(me);
}
- BTreeSearchOperatorDescriptor btreeSearchOp = new BTreeSearchOperatorDescriptor(jobSpec, outputRecDesc,
- appContext.getStorageManagerInterface(), appContext.getIndexRegistryProvider(), spPc.first, typeTraits,
- comparatorFactories, lowKeyFields, highKeyFields, lowKeyInclusive, highKeyInclusive,
- new BTreeDataflowHelperFactory(), retainInput, NoOpOperationCallbackProvider.INSTANCE);
- return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(btreeSearchOp, spPc.second);
}
- @SuppressWarnings("rawtypes")
- public static Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> buildRtreeRuntime(
- AqlCompiledMetadataDeclarations metadata, JobGenContext context, JobSpecification jobSpec,
- String datasetName, Dataset dataset, String indexName, int[] keyFields) throws AlgebricksException {
- ARecordType recType = (ARecordType) metadata.findType(dataset.getItemTypeName());
- boolean isSecondary = true;
- Index primaryIndex = metadata.getDatasetPrimaryIndex(dataset.getDataverseName(), dataset.getDatasetName());
- if (primaryIndex != null) {
- isSecondary = !indexName.equals(primaryIndex.getIndexName());
- }
+ public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> buildRtreeRuntime(JobSpecification jobSpec,
+ List<LogicalVariable> outputVars, IOperatorSchema opSchema, IVariableTypeEnvironment typeEnv,
+ JobGenContext context, boolean retainInput, Dataset dataset, String indexName, int[] keyFields)
+ throws AlgebricksException {
+ try {
+ ARecordType recType = (ARecordType) findType(dataset.getDataverseName(), dataset.getItemTypeName());
+ int numPrimaryKeys = DatasetUtils.getPartitioningKeys(dataset).size();
- int numPrimaryKeys = DatasetUtils.getPartitioningKeys(dataset).size();
- ISerializerDeserializer[] recordFields;
- IBinaryComparatorFactory[] comparatorFactories;
- ITypeTraits[] typeTraits;
- IPrimitiveValueProviderFactory[] valueProviderFactories;
- int numSecondaryKeys = 0;
- int numNestedSecondaryKeyFields = 0;
- int i = 0;
- if (!isSecondary) {
- throw new AlgebricksException("R-tree can only be used as a secondary index");
- }
- Index secondaryIndex = metadata.getIndex(dataset.getDataverseName(), dataset.getDatasetName(), indexName);
- if (secondaryIndex == null) {
- throw new AlgebricksException("Code generation error: no index " + indexName + " for dataset "
- + datasetName);
- }
- List<String> secondaryKeyFields = secondaryIndex.getKeyFieldNames();
- numSecondaryKeys = secondaryKeyFields.size();
- if (numSecondaryKeys != 1) {
- throw new AlgebricksException(
- "Cannot use "
- + numSecondaryKeys
- + " fields as a key for the R-tree index. There can be only one field as a key for the R-tree index.");
- }
- Pair<IAType, Boolean> keyTypePair = Index.getNonNullableKeyFieldType(secondaryKeyFields.get(0), recType);
- IAType keyType = keyTypePair.first;
- if (keyType == null) {
- throw new AlgebricksException("Could not find field " + secondaryKeyFields.get(0) + " in the schema.");
- }
- int dimension = NonTaggedFormatUtil.getNumDimensions(keyType.getTypeTag());
- numNestedSecondaryKeyFields = dimension * 2;
+ Index secondaryIndex = MetadataManager.INSTANCE.getIndex(mdTxnCtx, dataset.getDataverseName(),
+ dataset.getDatasetName(), indexName);
+ if (secondaryIndex == null) {
+ throw new AlgebricksException("Code generation error: no index " + indexName + " for dataset "
+ + dataset.getDatasetName());
+ }
+ List<String> secondaryKeyFields = secondaryIndex.getKeyFieldNames();
+ int numSecondaryKeys = secondaryKeyFields.size();
+ if (numSecondaryKeys != 1) {
+ throw new AlgebricksException(
+ "Cannot use "
+ + numSecondaryKeys
+ + " fields as a key for the R-tree index. There can be only one field as a key for the R-tree index.");
+ }
+ Pair<IAType, Boolean> keyTypePair = Index.getNonNullableKeyFieldType(secondaryKeyFields.get(0), recType);
+ IAType keyType = keyTypePair.first;
+ if (keyType == null) {
+ throw new AlgebricksException("Could not find field " + secondaryKeyFields.get(0) + " in the schema.");
+ }
+ int numDimensions = NonTaggedFormatUtil.getNumDimensions(keyType.getTypeTag());
+ int numNestedSecondaryKeyFields = numDimensions * 2;
+ IPrimitiveValueProviderFactory[] valueProviderFactories = new IPrimitiveValueProviderFactory[numNestedSecondaryKeyFields];
+ for (int i = 0; i < numNestedSecondaryKeyFields; i++) {
+ valueProviderFactories[i] = AqlPrimitiveValueProviderFactory.INSTANCE;
+ }
- int numFields = numNestedSecondaryKeyFields + numPrimaryKeys;
- recordFields = new ISerializerDeserializer[numFields];
- typeTraits = new ITypeTraits[numFields];
- comparatorFactories = new IBinaryComparatorFactory[numNestedSecondaryKeyFields];
- valueProviderFactories = new IPrimitiveValueProviderFactory[numNestedSecondaryKeyFields];
-
- IAType nestedKeyType = NonTaggedFormatUtil.getNestedSpatialType(keyType.getTypeTag());
- for (i = 0; i < numNestedSecondaryKeyFields; i++) {
- ISerializerDeserializer keySerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(nestedKeyType);
- recordFields[i] = keySerde;
- comparatorFactories[i] = AqlBinaryComparatorFactoryProvider.INSTANCE.getBinaryComparatorFactory(
- nestedKeyType, true);
- typeTraits[i] = AqlTypeTraitProvider.INSTANCE.getTypeTrait(nestedKeyType);
- valueProviderFactories[i] = AqlPrimitiveValueProviderFactory.INSTANCE;
+ RecordDescriptor outputRecDesc = JobGenHelper.mkRecordDescriptor(typeEnv, opSchema, context);
+ int keysStartIndex = outputRecDesc.getFieldCount() - numNestedSecondaryKeyFields - numPrimaryKeys;
+ if (retainInput) {
+ keysStartIndex -= numNestedSecondaryKeyFields;
+ }
+ IBinaryComparatorFactory[] comparatorFactories = JobGenHelper.variablesToAscBinaryComparatorFactories(
+ outputVars, keysStartIndex, numNestedSecondaryKeyFields, typeEnv, context);
+ ITypeTraits[] typeTraits = JobGenHelper.variablesToTypeTraits(outputVars, keysStartIndex,
+ numNestedSecondaryKeyFields, typeEnv, context);
+ IAsterixApplicationContextInfo appContext = (IAsterixApplicationContextInfo) context.getAppContext();
+ Pair<IFileSplitProvider, AlgebricksPartitionConstraint> spPc = splitProviderAndPartitionConstraintsForInternalOrFeedDataset(
+ dataset.getDataverseName(), dataset.getDatasetName(), indexName);
+ RTreeSearchOperatorDescriptor rtreeSearchOp = new RTreeSearchOperatorDescriptor(jobSpec, outputRecDesc,
+ appContext.getStorageManagerInterface(), appContext.getIndexRegistryProvider(), spPc.first,
+ typeTraits, comparatorFactories, keyFields, new RTreeDataflowHelperFactory(valueProviderFactories),
+ retainInput, NoOpOperationCallbackProvider.INSTANCE);
+ return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(rtreeSearchOp, spPc.second);
+ } catch (MetadataException me) {
+ throw new AlgebricksException(me);
}
-
- List<String> partitioningKeys = DatasetUtils.getPartitioningKeys(dataset);
- for (String partitioningKey : partitioningKeys) {
- IAType type = recType.getFieldType(partitioningKey);
- ISerializerDeserializer keySerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(type);
- recordFields[i] = keySerde;
- typeTraits[i] = AqlTypeTraitProvider.INSTANCE.getTypeTrait(type);
- ++i;
- }
- IAsterixApplicationContextInfo appContext = (IAsterixApplicationContextInfo) context.getAppContext();
- RecordDescriptor recDesc = new RecordDescriptor(recordFields);
- Pair<IFileSplitProvider, AlgebricksPartitionConstraint> spPc = metadata
- .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(datasetName, indexName);
- RTreeSearchOperatorDescriptor rtreeSearchOp = new RTreeSearchOperatorDescriptor(jobSpec, recDesc,
- appContext.getStorageManagerInterface(), appContext.getIndexRegistryProvider(), spPc.first, typeTraits,
- comparatorFactories, keyFields, new RTreeDataflowHelperFactory(valueProviderFactories), false,
- NoOpOperationCallbackProvider.INSTANCE);
- return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(rtreeSearchOp, spPc.second);
}
@Override
@@ -404,7 +535,7 @@
String nodeId = fs.getNodeName();
SinkWriterRuntimeFactory runtime = new SinkWriterRuntimeFactory(printColumns, printerFactories, outFile,
- metadata.getWriterFactory(), inputDesc);
+ getWriterFactory(), inputDesc);
AlgebricksPartitionConstraint apc = new AlgebricksAbsolutePartitionConstraint(new String[] { nodeId });
return new Pair<IPushRuntimeFactory, AlgebricksPartitionConstraint>(runtime, apc);
}
@@ -417,47 +548,50 @@
if (dataset.getDatasetType() == DatasetType.EXTERNAL) {
throw new AlgebricksException("No index for external dataset " + dataSourceId);
}
-
- String indexName = (String) indexId;
- Index secondaryIndex = metadata.getIndex(dataset.getDataverseName(), dataset.getDatasetName(), indexName);
- if (secondaryIndex != null) {
- return new AqlIndex(secondaryIndex, metadata, dataset.getDatasetName());
- } else {
- Index primaryIndex = metadata.getDatasetPrimaryIndex(dataset.getDataverseName(), dataset.getDatasetName());
- if (primaryIndex.getIndexName().equals(indexId)) {
- return new AqlIndex(primaryIndex, metadata, dataset.getDatasetName());
+ try {
+ String indexName = (String) indexId;
+ Index secondaryIndex = MetadataManager.INSTANCE.getIndex(mdTxnCtx, dataset.getDataverseName(),
+ dataset.getDatasetName(), indexName);
+ if (secondaryIndex != null) {
+ return new AqlIndex(secondaryIndex, dataset.getDataverseName(), dataset.getDatasetName(), this);
} else {
- return null;
+ Index primaryIndex = MetadataManager.INSTANCE.getIndex(mdTxnCtx, dataset.getDataverseName(),
+ dataset.getDatasetName(), dataset.getDatasetName());
+ if (primaryIndex.getIndexName().equals(indexId)) {
+ return new AqlIndex(primaryIndex, dataset.getDataverseName(), dataset.getDatasetName(), this);
+ } else {
+ return null;
+ }
}
+ } catch (MetadataException me) {
+ throw new AlgebricksException(me);
}
}
- public static AqlDataSource lookupSourceInMetadata(AqlCompiledMetadataDeclarations metadata, AqlSourceId aqlId)
- throws AlgebricksException {
- if (!aqlId.getDataverseName().equals(metadata.getDataverseName())) {
- return null;
- }
- Dataset dataset = metadata.findDataset(aqlId.getDatasetName());
+ public AqlDataSource lookupSourceInMetadata(AqlSourceId aqlId) throws AlgebricksException, MetadataException {
+ Dataset dataset = findDataset(aqlId.getDataverseName(), aqlId.getDatasetName());
if (dataset == null) {
throw new AlgebricksException("Datasource with id " + aqlId + " was not found.");
}
String tName = dataset.getItemTypeName();
- IAType itemType = metadata.findType(tName);
+ IAType itemType = MetadataManager.INSTANCE.getDatatype(mdTxnCtx, aqlId.getDataverseName(), tName).getDatatype();
return new AqlDataSource(aqlId, dataset, itemType);
}
@Override
public boolean scannerOperatorIsLeaf(IDataSource<AqlSourceId> dataSource) {
AqlSourceId asid = dataSource.getId();
+ String dataverseName = asid.getDataverseName();
String datasetName = asid.getDatasetName();
Dataset dataset = null;
try {
- dataset = metadata.findDataset(datasetName);
- } catch (AlgebricksException e) {
+ dataset = MetadataManager.INSTANCE.getDataset(mdTxnCtx, dataverseName, datasetName);
+ } catch (MetadataException e) {
throw new IllegalStateException(e);
}
+
if (dataset == null) {
- throw new IllegalArgumentException("Unknown dataset " + datasetName);
+ throw new IllegalArgumentException("Unknown dataset " + datasetName + " in dataverse " + dataverseName);
}
return dataset.getDatasetType() == DatasetType.EXTERNAL;
}
@@ -466,6 +600,7 @@
public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getWriteResultRuntime(
IDataSource<AqlSourceId> dataSource, IOperatorSchema propagatedSchema, List<LogicalVariable> keys,
LogicalVariable payload, JobGenContext context, JobSpecification spec) throws AlgebricksException {
+ String dataverseName = dataSource.getId().getDataverseName();
String datasetName = dataSource.getId().getDatasetName();
int numKeys = keys.size();
// move key fields to front
@@ -479,29 +614,38 @@
}
fieldPermutation[numKeys] = propagatedSchema.findVariable(payload);
- Dataset dataset = metadata.findDataset(datasetName);
+ Dataset dataset = findDataset(dataverseName, datasetName);
if (dataset == null) {
- throw new AlgebricksException("Unknown dataset " + datasetName);
+ throw new AlgebricksException("Unknown dataset " + datasetName + " in dataverse " + dataverseName);
}
- Index primaryIndex = metadata.getDatasetPrimaryIndex(dataset.getDataverseName(), dataset.getDatasetName());
- String indexName = primaryIndex.getIndexName();
- String itemTypeName = dataset.getItemTypeName();
- ARecordType itemType = (ARecordType) metadata.findType(itemTypeName);
+ try {
+ Index primaryIndex = MetadataManager.INSTANCE.getIndex(mdTxnCtx, dataset.getDataverseName(),
+ dataset.getDatasetName(), dataset.getDatasetName());
+ String indexName = primaryIndex.getIndexName();
- ITypeTraits[] typeTraits = DatasetUtils.computeTupleTypeTraits(dataset, itemType);
- IBinaryComparatorFactory[] comparatorFactories = DatasetUtils.computeKeysBinaryComparatorFactories(dataset,
- itemType, context.getBinaryComparatorFactoryProvider());
+ String itemTypeName = dataset.getItemTypeName();
+ ARecordType itemType = (ARecordType) MetadataManager.INSTANCE.getDatatype(mdTxnCtx,
+ dataset.getDataverseName(), itemTypeName).getDatatype();
- Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitsAndConstraint = metadata
- .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(datasetName, indexName);
- IAsterixApplicationContextInfo appContext = (IAsterixApplicationContextInfo) context.getAppContext();
- TreeIndexBulkLoadOperatorDescriptor btreeBulkLoad = new TreeIndexBulkLoadOperatorDescriptor(spec,
- appContext.getStorageManagerInterface(), appContext.getIndexRegistryProvider(),
- splitsAndConstraint.first, typeTraits, comparatorFactories, fieldPermutation,
- GlobalConfig.DEFAULT_BTREE_FILL_FACTOR, new BTreeDataflowHelperFactory(),
- NoOpOperationCallbackProvider.INSTANCE);
- return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(btreeBulkLoad, splitsAndConstraint.second);
+ ITypeTraits[] typeTraits = DatasetUtils.computeTupleTypeTraits(dataset, itemType);
+ IBinaryComparatorFactory[] comparatorFactories = DatasetUtils.computeKeysBinaryComparatorFactories(dataset,
+ itemType, context.getBinaryComparatorFactoryProvider());
+
+ Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitsAndConstraint = splitProviderAndPartitionConstraintsForInternalOrFeedDataset(
+ dataSource.getId().getDataverseName(), datasetName, indexName);
+ IAsterixApplicationContextInfo appContext = (IAsterixApplicationContextInfo) context.getAppContext();
+ TreeIndexBulkLoadOperatorDescriptor btreeBulkLoad = new TreeIndexBulkLoadOperatorDescriptor(spec,
+ appContext.getStorageManagerInterface(), appContext.getIndexRegistryProvider(),
+ splitsAndConstraint.first, typeTraits, comparatorFactories, fieldPermutation,
+ GlobalConfig.DEFAULT_BTREE_FILL_FACTOR, new BTreeDataflowHelperFactory(),
+ NoOpOperationCallbackProvider.INSTANCE);
+ return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(btreeBulkLoad,
+ splitsAndConstraint.second);
+
+ } catch (MetadataException me) {
+ throw new AlgebricksException(me);
+ }
}
public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getInsertOrDeleteRuntime(IndexOp indexOp,
@@ -520,28 +664,36 @@
}
fieldPermutation[numKeys] = propagatedSchema.findVariable(payload);
- Dataset dataset = metadata.findDataset(datasetName);
+ Dataset dataset = findDataset(dataSource.getId().getDataverseName(), datasetName);
if (dataset == null) {
- throw new AlgebricksException("Unknown dataset " + datasetName);
+ throw new AlgebricksException("Unknown dataset " + datasetName + " in dataverse "
+ + dataSource.getId().getDataverseName());
}
- Index primaryIndex = metadata.getDatasetPrimaryIndex(dataset.getDataverseName(), dataset.getDatasetName());
- String indexName = primaryIndex.getIndexName();
+ try {
+ Index primaryIndex = MetadataManager.INSTANCE.getIndex(mdTxnCtx, dataset.getDataverseName(),
+ dataset.getDatasetName(), dataset.getDatasetName());
+ String indexName = primaryIndex.getIndexName();
- String itemTypeName = dataset.getItemTypeName();
- ARecordType itemType = (ARecordType) metadata.findType(itemTypeName);
+ String itemTypeName = dataset.getItemTypeName();
+ ARecordType itemType = (ARecordType) MetadataManager.INSTANCE.getDatatype(mdTxnCtx,
+ dataSource.getId().getDataverseName(), itemTypeName).getDatatype();
- ITypeTraits[] typeTraits = DatasetUtils.computeTupleTypeTraits(dataset, itemType);
+ ITypeTraits[] typeTraits = DatasetUtils.computeTupleTypeTraits(dataset, itemType);
- IAsterixApplicationContextInfo appContext = (IAsterixApplicationContextInfo) context.getAppContext();
- IBinaryComparatorFactory[] comparatorFactories = DatasetUtils.computeKeysBinaryComparatorFactories(dataset,
- itemType, context.getBinaryComparatorFactoryProvider());
- Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitsAndConstraint = metadata
- .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(datasetName, indexName);
- TreeIndexInsertUpdateDeleteOperatorDescriptor btreeBulkLoad = new TreeIndexInsertUpdateDeleteOperatorDescriptor(
- spec, recordDesc, appContext.getStorageManagerInterface(), appContext.getIndexRegistryProvider(),
- splitsAndConstraint.first, typeTraits, comparatorFactories, fieldPermutation, indexOp,
- new BTreeDataflowHelperFactory(), null, NoOpOperationCallbackProvider.INSTANCE, txnId);
- return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(btreeBulkLoad, splitsAndConstraint.second);
+ IAsterixApplicationContextInfo appContext = (IAsterixApplicationContextInfo) context.getAppContext();
+ IBinaryComparatorFactory[] comparatorFactories = DatasetUtils.computeKeysBinaryComparatorFactories(dataset,
+ itemType, context.getBinaryComparatorFactoryProvider());
+ Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitsAndConstraint = splitProviderAndPartitionConstraintsForInternalOrFeedDataset(
+ dataSource.getId().getDataverseName(), datasetName, indexName);
+ TreeIndexInsertUpdateDeleteOperatorDescriptor btreeBulkLoad = new TreeIndexInsertUpdateDeleteOperatorDescriptor(
+ spec, recordDesc, appContext.getStorageManagerInterface(), appContext.getIndexRegistryProvider(),
+ splitsAndConstraint.first, typeTraits, comparatorFactories, fieldPermutation, indexOp,
+ new BTreeDataflowHelperFactory(), null, NoOpOperationCallbackProvider.INSTANCE, jobTxnId);
+ return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(btreeBulkLoad,
+ splitsAndConstraint.second);
+ } catch (MetadataException me) {
+ throw new AlgebricksException(me);
+ }
}
@Override
@@ -568,21 +720,29 @@
List<LogicalVariable> secondaryKeys, ILogicalExpression filterExpr, RecordDescriptor recordDesc,
JobGenContext context, JobSpecification spec) throws AlgebricksException {
String indexName = dataSourceIndex.getId();
+ String dataverseName = dataSourceIndex.getDataSource().getId().getDataverseName();
String datasetName = dataSourceIndex.getDataSource().getId().getDatasetName();
- Dataset dataset = metadata.findDataset(datasetName);
+
+ Dataset dataset = findDataset(dataverseName, datasetName);
if (dataset == null) {
throw new AlgebricksException("Unknown dataset " + datasetName);
}
- Index secondaryIndex = metadata.getIndex(dataset.getDataverseName(), dataset.getDatasetName(), indexName);
+ Index secondaryIndex;
+ try {
+ secondaryIndex = MetadataManager.INSTANCE.getIndex(mdTxnCtx, dataset.getDataverseName(),
+ dataset.getDatasetName(), indexName);
+ } catch (MetadataException e) {
+ throw new AlgebricksException(e);
+ }
AsterixTupleFilterFactory filterFactory = createTupleFilterFactory(inputSchemas, typeEnv, filterExpr, context);
switch (secondaryIndex.getIndexType()) {
case BTREE: {
- return getBTreeDmlRuntime(datasetName, indexName, propagatedSchema, primaryKeys, secondaryKeys,
- filterFactory, recordDesc, context, spec, indexOp);
+ return getBTreeDmlRuntime(dataverseName, datasetName, indexName, propagatedSchema, primaryKeys,
+ secondaryKeys, filterFactory, recordDesc, context, spec, indexOp);
}
case RTREE: {
- return getRTreeDmlRuntime(datasetName, indexName, propagatedSchema, primaryKeys, secondaryKeys,
- filterFactory, recordDesc, context, spec, indexOp);
+ return getRTreeDmlRuntime(dataverseName, datasetName, indexName, propagatedSchema, primaryKeys,
+ secondaryKeys, filterFactory, recordDesc, context, spec, indexOp);
}
default: {
throw new AlgebricksException("Insert and delete not implemented for index type: "
@@ -624,8 +784,8 @@
return new AsterixTupleFilterFactory(filterEvalFactory, context.getBinaryBooleanInspectorFactory());
}
- private Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getBTreeDmlRuntime(String datasetName,
- String indexName, IOperatorSchema propagatedSchema, List<LogicalVariable> primaryKeys,
+ private Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getBTreeDmlRuntime(String dataverseName,
+ String datasetName, String indexName, IOperatorSchema propagatedSchema, List<LogicalVariable> primaryKeys,
List<LogicalVariable> secondaryKeys, AsterixTupleFilterFactory filterFactory, RecordDescriptor recordDesc,
JobGenContext context, JobSpecification spec, IndexOp indexOp) throws AlgebricksException {
int numKeys = primaryKeys.size() + secondaryKeys.size();
@@ -643,113 +803,128 @@
i++;
}
- Dataset dataset = metadata.findDataset(datasetName);
+ Dataset dataset = findDataset(dataverseName, datasetName);
if (dataset == null) {
- throw new AlgebricksException("Unknown dataset " + datasetName);
+ throw new AlgebricksException("Unknown dataset " + datasetName + " in dataverse " + dataverseName);
}
String itemTypeName = dataset.getItemTypeName();
- IAType itemType = metadata.findType(itemTypeName);
- if (itemType.getTypeTag() != ATypeTag.RECORD) {
- throw new AlgebricksException("Only record types can be indexed.");
- }
- ARecordType recType = (ARecordType) itemType;
+ IAType itemType;
+ try {
+ itemType = MetadataManager.INSTANCE.getDatatype(mdTxnCtx, dataset.getDataverseName(), itemTypeName)
+ .getDatatype();
- // Index parameters.
- Index secondaryIndex = metadata.getIndex(dataset.getDataverseName(), dataset.getDatasetName(), indexName);
- List<String> secondaryKeyExprs = secondaryIndex.getKeyFieldNames();
- ITypeTraits[] typeTraits = new ITypeTraits[numKeys];
- IBinaryComparatorFactory[] comparatorFactories = new IBinaryComparatorFactory[numKeys];
- for (i = 0; i < secondaryKeys.size(); ++i) {
- Pair<IAType, Boolean> keyPairType = Index.getNonNullableKeyFieldType(secondaryKeyExprs.get(i).toString(),
- recType);
- IAType keyType = keyPairType.first;
- comparatorFactories[i] = AqlBinaryComparatorFactoryProvider.INSTANCE.getBinaryComparatorFactory(keyType,
- true);
- typeTraits[i] = AqlTypeTraitProvider.INSTANCE.getTypeTrait(keyType);
- }
- List<String> partitioningKeys = DatasetUtils.getPartitioningKeys(dataset);
- for (String partitioningKey : partitioningKeys) {
- IAType keyType = recType.getFieldType(partitioningKey);
- comparatorFactories[i] = AqlBinaryComparatorFactoryProvider.INSTANCE.getBinaryComparatorFactory(keyType,
- true);
- typeTraits[i] = AqlTypeTraitProvider.INSTANCE.getTypeTrait(keyType);
- ++i;
- }
+ if (itemType.getTypeTag() != ATypeTag.RECORD) {
+ throw new AlgebricksException("Only record types can be indexed.");
+ }
- IAsterixApplicationContextInfo appContext = (IAsterixApplicationContextInfo) context.getAppContext();
- Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitsAndConstraint = metadata
- .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(datasetName, indexName);
- TreeIndexInsertUpdateDeleteOperatorDescriptor btreeBulkLoad = new TreeIndexInsertUpdateDeleteOperatorDescriptor(
- spec, recordDesc, appContext.getStorageManagerInterface(), appContext.getIndexRegistryProvider(),
- splitsAndConstraint.first, typeTraits, comparatorFactories, fieldPermutation, indexOp,
- new BTreeDataflowHelperFactory(), filterFactory, NoOpOperationCallbackProvider.INSTANCE, txnId);
- return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(btreeBulkLoad, splitsAndConstraint.second);
+ ARecordType recType = (ARecordType) itemType;
+
+ // Index parameters.
+ Index secondaryIndex = MetadataManager.INSTANCE.getIndex(mdTxnCtx, dataset.getDataverseName(),
+ dataset.getDatasetName(), indexName);
+
+ List<String> secondaryKeyExprs = secondaryIndex.getKeyFieldNames();
+ ITypeTraits[] typeTraits = new ITypeTraits[numKeys];
+ IBinaryComparatorFactory[] comparatorFactories = new IBinaryComparatorFactory[numKeys];
+ for (i = 0; i < secondaryKeys.size(); ++i) {
+ Pair<IAType, Boolean> keyPairType = Index.getNonNullableKeyFieldType(secondaryKeyExprs.get(i)
+ .toString(), recType);
+ IAType keyType = keyPairType.first;
+ comparatorFactories[i] = AqlBinaryComparatorFactoryProvider.INSTANCE.getBinaryComparatorFactory(
+ keyType, true);
+ typeTraits[i] = AqlTypeTraitProvider.INSTANCE.getTypeTrait(keyType);
+ }
+ List<String> partitioningKeys = DatasetUtils.getPartitioningKeys(dataset);
+ for (String partitioningKey : partitioningKeys) {
+ IAType keyType = recType.getFieldType(partitioningKey);
+ comparatorFactories[i] = AqlBinaryComparatorFactoryProvider.INSTANCE.getBinaryComparatorFactory(
+ keyType, true);
+ typeTraits[i] = AqlTypeTraitProvider.INSTANCE.getTypeTrait(keyType);
+ ++i;
+ }
+
+ IAsterixApplicationContextInfo appContext = (IAsterixApplicationContextInfo) context.getAppContext();
+ Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitsAndConstraint = splitProviderAndPartitionConstraintsForInternalOrFeedDataset(
+ dataverseName, datasetName, indexName);
+ TreeIndexInsertUpdateDeleteOperatorDescriptor btreeInsert = new TreeIndexInsertUpdateDeleteOperatorDescriptor(
+ spec, recordDesc, appContext.getStorageManagerInterface(), appContext.getIndexRegistryProvider(),
+ splitsAndConstraint.first, typeTraits, comparatorFactories, fieldPermutation, indexOp,
+ new BTreeDataflowHelperFactory(), filterFactory, NoOpOperationCallbackProvider.INSTANCE, jobTxnId);
+ return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(btreeInsert, splitsAndConstraint.second);
+ } catch (MetadataException e) {
+ throw new AlgebricksException(e);
+ }
}
- private Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getRTreeDmlRuntime(String datasetName,
- String indexName, IOperatorSchema propagatedSchema, List<LogicalVariable> primaryKeys,
+ private Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getRTreeDmlRuntime(String dataverseName,
+ String datasetName, String indexName, IOperatorSchema propagatedSchema, List<LogicalVariable> primaryKeys,
List<LogicalVariable> secondaryKeys, AsterixTupleFilterFactory filterFactory, RecordDescriptor recordDesc,
JobGenContext context, JobSpecification spec, IndexOp indexOp) throws AlgebricksException {
- Dataset dataset = metadata.findDataset(datasetName);
- String itemTypeName = dataset.getItemTypeName();
- IAType itemType = metadata.findType(itemTypeName);
- if (itemType.getTypeTag() != ATypeTag.RECORD) {
- throw new AlgebricksException("Only record types can be indexed.");
- }
- ARecordType recType = (ARecordType) itemType;
- Index secondaryIndex = metadata.getIndex(dataset.getDataverseName(), dataset.getDatasetName(), indexName);
- List<String> secondaryKeyExprs = secondaryIndex.getKeyFieldNames();
- Pair<IAType, Boolean> keyPairType = Index.getNonNullableKeyFieldType(secondaryKeyExprs.get(0), recType);
- IAType spatialType = keyPairType.first;
- int dimension = NonTaggedFormatUtil.getNumDimensions(spatialType.getTypeTag());
- int numSecondaryKeys = dimension * 2;
- int numPrimaryKeys = primaryKeys.size();
- int numKeys = numSecondaryKeys + numPrimaryKeys;
- ITypeTraits[] typeTraits = new ITypeTraits[numKeys];
- IBinaryComparatorFactory[] comparatorFactories = new IBinaryComparatorFactory[numKeys];
- int[] fieldPermutation = new int[numKeys];
- int i = 0;
+ try {
+ Dataset dataset = MetadataManager.INSTANCE.getDataset(mdTxnCtx, dataverseName, datasetName);
+ String itemTypeName = dataset.getItemTypeName();
+ IAType itemType = MetadataManager.INSTANCE.getDatatype(mdTxnCtx, dataverseName, itemTypeName).getDatatype();
+ if (itemType.getTypeTag() != ATypeTag.RECORD) {
+ throw new AlgebricksException("Only record types can be indexed.");
+ }
+ ARecordType recType = (ARecordType) itemType;
+ Index secondaryIndex = MetadataManager.INSTANCE.getIndex(mdTxnCtx, dataset.getDataverseName(),
+ dataset.getDatasetName(), indexName);
+ List<String> secondaryKeyExprs = secondaryIndex.getKeyFieldNames();
+ Pair<IAType, Boolean> keyPairType = Index.getNonNullableKeyFieldType(secondaryKeyExprs.get(0), recType);
+ IAType spatialType = keyPairType.first;
+ int dimension = NonTaggedFormatUtil.getNumDimensions(spatialType.getTypeTag());
+ int numSecondaryKeys = dimension * 2;
+ int numPrimaryKeys = primaryKeys.size();
+ int numKeys = numSecondaryKeys + numPrimaryKeys;
+ ITypeTraits[] typeTraits = new ITypeTraits[numKeys];
+ IBinaryComparatorFactory[] comparatorFactories = new IBinaryComparatorFactory[numKeys];
+ int[] fieldPermutation = new int[numKeys];
+ int i = 0;
- for (LogicalVariable varKey : secondaryKeys) {
- int idx = propagatedSchema.findVariable(varKey);
- fieldPermutation[i] = idx;
- i++;
- }
- for (LogicalVariable varKey : primaryKeys) {
- int idx = propagatedSchema.findVariable(varKey);
- fieldPermutation[i] = idx;
- i++;
- }
- IAType nestedKeyType = NonTaggedFormatUtil.getNestedSpatialType(spatialType.getTypeTag());
- IPrimitiveValueProviderFactory[] valueProviderFactories = new IPrimitiveValueProviderFactory[numSecondaryKeys];
- for (i = 0; i < numSecondaryKeys; i++) {
- comparatorFactories[i] = AqlBinaryComparatorFactoryProvider.INSTANCE.getBinaryComparatorFactory(
- nestedKeyType, true);
- typeTraits[i] = AqlTypeTraitProvider.INSTANCE.getTypeTrait(nestedKeyType);
- valueProviderFactories[i] = AqlPrimitiveValueProviderFactory.INSTANCE;
- }
- List<String> partitioningKeys = DatasetUtils.getPartitioningKeys(dataset);
- for (String partitioningKey : partitioningKeys) {
- IAType keyType = recType.getFieldType(partitioningKey);
- comparatorFactories[i] = AqlBinaryComparatorFactoryProvider.INSTANCE.getBinaryComparatorFactory(keyType,
- true);
- typeTraits[i] = AqlTypeTraitProvider.INSTANCE.getTypeTrait(keyType);
- ++i;
- }
+ for (LogicalVariable varKey : secondaryKeys) {
+ int idx = propagatedSchema.findVariable(varKey);
+ fieldPermutation[i] = idx;
+ i++;
+ }
+ for (LogicalVariable varKey : primaryKeys) {
+ int idx = propagatedSchema.findVariable(varKey);
+ fieldPermutation[i] = idx;
+ i++;
+ }
+ IAType nestedKeyType = NonTaggedFormatUtil.getNestedSpatialType(spatialType.getTypeTag());
+ IPrimitiveValueProviderFactory[] valueProviderFactories = new IPrimitiveValueProviderFactory[numSecondaryKeys];
+ for (i = 0; i < numSecondaryKeys; i++) {
+ comparatorFactories[i] = AqlBinaryComparatorFactoryProvider.INSTANCE.getBinaryComparatorFactory(
+ nestedKeyType, true);
+ typeTraits[i] = AqlTypeTraitProvider.INSTANCE.getTypeTrait(nestedKeyType);
+ valueProviderFactories[i] = AqlPrimitiveValueProviderFactory.INSTANCE;
+ }
+ List<String> partitioningKeys = DatasetUtils.getPartitioningKeys(dataset);
+ for (String partitioningKey : partitioningKeys) {
+ IAType keyType = recType.getFieldType(partitioningKey);
+ comparatorFactories[i] = AqlBinaryComparatorFactoryProvider.INSTANCE.getBinaryComparatorFactory(
+ keyType, true);
+ typeTraits[i] = AqlTypeTraitProvider.INSTANCE.getTypeTrait(keyType);
+ ++i;
+ }
- IAsterixApplicationContextInfo appContext = (IAsterixApplicationContextInfo) context.getAppContext();
- Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitsAndConstraint = metadata
- .splitProviderAndPartitionConstraintsForInternalOrFeedDataset(datasetName, indexName);
- TreeIndexInsertUpdateDeleteOperatorDescriptor rtreeUpdate = new TreeIndexInsertUpdateDeleteOperatorDescriptor(
- spec, recordDesc, appContext.getStorageManagerInterface(), appContext.getIndexRegistryProvider(),
- splitsAndConstraint.first, typeTraits, comparatorFactories, fieldPermutation, indexOp,
- new RTreeDataflowHelperFactory(valueProviderFactories), filterFactory,
- NoOpOperationCallbackProvider.INSTANCE, txnId);
- return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(rtreeUpdate, splitsAndConstraint.second);
+ IAsterixApplicationContextInfo appContext = (IAsterixApplicationContextInfo) context.getAppContext();
+ Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitsAndConstraint = splitProviderAndPartitionConstraintsForInternalOrFeedDataset(
+ dataverseName, datasetName, indexName);
+ TreeIndexInsertUpdateDeleteOperatorDescriptor rtreeUpdate = new TreeIndexInsertUpdateDeleteOperatorDescriptor(
+ spec, recordDesc, appContext.getStorageManagerInterface(), appContext.getIndexRegistryProvider(),
+ splitsAndConstraint.first, typeTraits, comparatorFactories, fieldPermutation, indexOp,
+ new RTreeDataflowHelperFactory(valueProviderFactories), filterFactory,
+ NoOpOperationCallbackProvider.INSTANCE, jobTxnId);
+ return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(rtreeUpdate, splitsAndConstraint.second);
+ } catch (MetadataException me) {
+ throw new AlgebricksException(me);
+ }
}
- public long getTxnId() {
- return txnId;
+ public long getJobTxnId() {
+ return jobTxnId;
}
public static ITreeIndexFrameFactory createBTreeNSMInteriorFrameFactory(ITypeTraits[] typeTraits) {
@@ -760,4 +935,150 @@
public IFunctionInfo lookupFunction(FunctionIdentifier fid) {
return AsterixBuiltinFunctions.lookupFunction(fid);
}
+
+ public Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitProviderAndPartitionConstraintsForInternalOrFeedDataset(
+ String dataverseName, String datasetName, String targetIdxName) throws AlgebricksException {
+ FileSplit[] splits = splitsForInternalOrFeedDataset(mdTxnCtx, dataverseName, datasetName, targetIdxName);
+ IFileSplitProvider splitProvider = new ConstantFileSplitProvider(splits);
+ String[] loc = new String[splits.length];
+ for (int p = 0; p < splits.length; p++) {
+ loc[p] = splits[p].getNodeName();
+ }
+ AlgebricksPartitionConstraint pc = new AlgebricksAbsolutePartitionConstraint(loc);
+ return new Pair<IFileSplitProvider, AlgebricksPartitionConstraint>(splitProvider, pc);
+ }
+
+ private FileSplit[] splitsForInternalOrFeedDataset(MetadataTransactionContext mdTxnCtx, String dataverseName,
+ String datasetName, String targetIdxName) throws AlgebricksException {
+
+ try {
+ File relPathFile = new File(getRelativePath(dataverseName, datasetName + "_idx_" + targetIdxName));
+ Dataset dataset = MetadataManager.INSTANCE.getDataset(mdTxnCtx, dataverseName, datasetName);
+ if (dataset.getDatasetType() != DatasetType.INTERNAL & dataset.getDatasetType() != DatasetType.FEED) {
+ throw new AlgebricksException("Not an internal or feed dataset");
+ }
+ InternalDatasetDetails datasetDetails = (InternalDatasetDetails) dataset.getDatasetDetails();
+ List<String> nodeGroup = MetadataManager.INSTANCE.getNodegroup(mdTxnCtx, datasetDetails.getNodeGroupName())
+ .getNodeNames();
+ if (nodeGroup == null) {
+ throw new AlgebricksException("Couldn't find node group " + datasetDetails.getNodeGroupName());
+ }
+
+ List<FileSplit> splitArray = new ArrayList<FileSplit>();
+ for (String nd : nodeGroup) {
+ String[] nodeStores = stores.get(nd);
+ if (nodeStores == null) {
+ LOGGER.warning("Node " + nd + " has no stores.");
+ throw new AlgebricksException("Node " + nd + " has no stores.");
+ } else {
+ for (int j = 0; j < nodeStores.length; j++) {
+ File f = new File(nodeStores[j] + File.separator + relPathFile);
+ splitArray.add(new FileSplit(nd, new FileReference(f)));
+ }
+ }
+ }
+ FileSplit[] splits = new FileSplit[splitArray.size()];
+ int i = 0;
+ for (FileSplit fs : splitArray) {
+ splits[i++] = fs;
+ }
+ return splits;
+ } catch (MetadataException me) {
+ throw new AlgebricksException(me);
+ }
+ }
+
+ private static Map<String, String> initializeAdapterFactoryMapping() {
+ Map<String, String> adapterFactoryMapping = new HashMap<String, String>();
+ adapterFactoryMapping.put("edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter",
+ "edu.uci.ics.asterix.external.adapter.factory.NCFileSystemAdapterFactory");
+ adapterFactoryMapping.put("edu.uci.ics.asterix.external.dataset.adapter.HDFSAdapter",
+ "edu.uci.ics.asterix.external.adapter.factory.HDFSAdapterFactory");
+ adapterFactoryMapping.put("edu.uci.ics.asterix.external.dataset.adapter.PullBasedTwitterAdapter",
+ "edu.uci.ics.asterix.external.dataset.adapter.PullBasedTwitterAdapterFactory");
+ adapterFactoryMapping.put("edu.uci.ics.asterix.external.dataset.adapter.RSSFeedAdapter",
+ "edu.uci.ics.asterix.external.dataset.adapter..RSSFeedAdapterFactory");
+ adapterFactoryMapping.put("edu.uci.ics.asterix.external.dataset.adapter.CNNFeedAdapter",
+ "edu.uci.ics.asterix.external.dataset.adapter.CNNFeedAdapterFactory");
+ return adapterFactoryMapping;
+ }
+
+ public DatasourceAdapter getAdapter(MetadataTransactionContext mdTxnCtx, String dataverseName, String adapterName)
+ throws MetadataException {
+ DatasourceAdapter adapter = null;
+ // search in default namespace (built-in adapter)
+ adapter = MetadataManager.INSTANCE.getAdapter(mdTxnCtx, MetadataConstants.METADATA_DATAVERSE_NAME, adapterName);
+
+ // search in dataverse (user-defined adapter)
+ if (adapter == null) {
+ adapter = MetadataManager.INSTANCE.getAdapter(mdTxnCtx, dataverseName, adapterName);
+ }
+ return adapter;
+ }
+
+ private static String getRelativePath(String dataverseName, String fileName) {
+ return dataverseName + File.separator + fileName;
+ }
+
+ public Pair<IFileSplitProvider, IFileSplitProvider> getInvertedIndexFileSplitProviders(
+ IFileSplitProvider splitProvider) {
+ int numSplits = splitProvider.getFileSplits().length;
+ FileSplit[] btreeSplits = new FileSplit[numSplits];
+ FileSplit[] invListsSplits = new FileSplit[numSplits];
+ for (int i = 0; i < numSplits; i++) {
+ String nodeName = splitProvider.getFileSplits()[i].getNodeName();
+ String path = splitProvider.getFileSplits()[i].getLocalFile().getFile().getPath();
+ btreeSplits[i] = new FileSplit(nodeName, path + "_$btree");
+ invListsSplits[i] = new FileSplit(nodeName, path + "_$invlists");
+ }
+ return new Pair<IFileSplitProvider, IFileSplitProvider>(new ConstantFileSplitProvider(btreeSplits),
+ new ConstantFileSplitProvider(invListsSplits));
+ }
+
+ public Dataset findDataset(String dataverse, String dataset) throws AlgebricksException {
+ try {
+ return MetadataManager.INSTANCE.getDataset(mdTxnCtx, dataverse, dataset);
+ } catch (MetadataException e) {
+ throw new AlgebricksException(e);
+ }
+ }
+
+ public IAType findType(String dataverse, String typeName) {
+ Datatype type;
+ try {
+ type = MetadataManager.INSTANCE.getDatatype(mdTxnCtx, dataverse, typeName);
+ } catch (Exception e) {
+ throw new IllegalStateException();
+ }
+ if (type == null) {
+ throw new IllegalStateException();
+ }
+ return type.getDatatype();
+ }
+
+ public List<Index> getDatasetIndexes(String dataverseName, String datasetName) throws AlgebricksException {
+ try {
+ return MetadataManager.INSTANCE.getDatasetIndexes(mdTxnCtx, dataverseName, datasetName);
+ } catch (MetadataException e) {
+ throw new AlgebricksException(e);
+ }
+ }
+
+ public AlgebricksPartitionConstraint getClusterLocations() {
+ ArrayList<String> locs = new ArrayList<String>();
+ for (String k : stores.keySet()) {
+ String[] nodeStores = stores.get(k);
+ for (int j = 0; j < nodeStores.length; j++) {
+ locs.add(k);
+ }
+ }
+ String[] cluster = new String[locs.size()];
+ cluster = locs.toArray(cluster);
+ return new AlgebricksAbsolutePartitionConstraint(cluster);
+ }
+
+ public IDataFormat getFormat() {
+ return FormatUtils.getDefaultFormat();
+ }
+
}
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/AsterixBuiltinArtifactMap.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/AsterixBuiltinArtifactMap.java
deleted file mode 100644
index cc48d1e..0000000
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/AsterixBuiltinArtifactMap.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.metadata.entities;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import edu.uci.ics.asterix.metadata.bootstrap.MetadataConstants;
-import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
-
-public class AsterixBuiltinArtifactMap {
-
- public enum ARTIFACT_KIND {
- DATASET,
- DATAVERSE,
- FUNCTION,
- NODEGROUP
- }
-
- public static final String ARTIFACT_TYPE_DATASET = "DATASET";
- public static final String ARTIFACT_TYPE_DATAVERSE = "DATAVERSE";
- public static final String ARTIFACT_TYPE_FUNCTION = "FUNCTION";
- public static final String ARTIFACT_TYPE_NODEGROUP = "NODEGROUP";
-
- public static final String DATASET_DATASETS = "Dataset";
- public static final String DATASET_INDEX = "Index";
- public static final String DATASET_NODEGROUP = "NodeGroup";
-
- public static final String DATAVERSE_METADATA = "Metadata";
-
- public static final String NODEGROUP_DEFAULT = MetadataConstants.METADATA_DEFAULT_NODEGROUP_NAME;
-
- private static final Map<ARTIFACT_KIND, Set<String>> builtinArtifactMap = new HashMap<ARTIFACT_KIND, Set<String>>();
-
- static {
- Set<String> datasets = new HashSet<String>();
- datasets.add(DATASET_DATASETS);
- datasets.add(DATASET_INDEX);
- datasets.add(DATASET_NODEGROUP);
- builtinArtifactMap.put(ARTIFACT_KIND.DATASET, datasets);
-
- Set<String> dataverses = new HashSet<String>();
- dataverses.add(DATAVERSE_METADATA);
- builtinArtifactMap.put(ARTIFACT_KIND.DATAVERSE, dataverses);
-
- Set<String> nodeGroups = new HashSet<String>();
- nodeGroups.add(NODEGROUP_DEFAULT);
- builtinArtifactMap.put(ARTIFACT_KIND.NODEGROUP, nodeGroups);
-
- }
-
- public static boolean isSystemProtectedArtifact(ARTIFACT_KIND kind, Object artifactIdentifier) {
- switch (kind) {
- case NODEGROUP:
- case DATASET:
- case DATAVERSE:
- return builtinArtifactMap.get(kind).contains((String) artifactIdentifier);
-
- case FUNCTION:
- return AsterixBuiltinFunctions.isBuiltinCompilerFunction((FunctionIdentifier) artifactIdentifier);
- default:
- return false;
- }
- }
-}
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Dataset.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Dataset.java
index d383955..976bd87 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Dataset.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Dataset.java
@@ -77,4 +77,22 @@
public Object dropFromCache(MetadataCache cache) {
return cache.dropDataset(this);
}
+
+ @Override
+ public boolean equals(Object other) {
+ if (this == other) {
+ return true;
+ }
+ if (!(other instanceof Dataset)) {
+ return false;
+ }
+ Dataset otherDataset = (Dataset) other;
+ if (!otherDataset.dataverseName.equals(dataverseName)) {
+ return false;
+ }
+ if (!otherDataset.datasetName.equals(datasetName)) {
+ return false;
+ }
+ return true;
+ }
}
\ No newline at end of file
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/DatasourceAdapter.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/DatasourceAdapter.java
new file mode 100644
index 0000000..2955a08
--- /dev/null
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/DatasourceAdapter.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.metadata.entities;
+
+import edu.uci.ics.asterix.external.dataset.adapter.AdapterIdentifier;
+import edu.uci.ics.asterix.metadata.MetadataCache;
+import edu.uci.ics.asterix.metadata.api.IMetadataEntity;
+
+public class DatasourceAdapter implements IMetadataEntity {
+
+ public enum AdapterType {
+ INTERNAL,
+ EXTERNAL
+ }
+
+ private final AdapterIdentifier adapterIdentifier;
+ private final String classname;
+ private final AdapterType type;
+
+ public DatasourceAdapter(AdapterIdentifier adapterIdentifier, String classname, AdapterType type) {
+ this.adapterIdentifier = adapterIdentifier;
+ this.classname = classname;
+ this.type = type;
+ }
+
+ @Override
+ public Object addToCache(MetadataCache cache) {
+ return cache.addAdapterIfNotExists(this);
+ }
+
+ @Override
+ public Object dropFromCache(MetadataCache cache) {
+ return cache.dropAdapter(this);
+ }
+
+ public AdapterIdentifier getAdapterIdentifier() {
+ return adapterIdentifier;
+ }
+
+ public String getClassname() {
+ return classname;
+ }
+
+ public AdapterType getType() {
+ return type;
+ }
+
+}
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/ExternalDatasetDetails.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/ExternalDatasetDetails.java
index 08121ca..07da617 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/ExternalDatasetDetails.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/ExternalDatasetDetails.java
@@ -18,7 +18,6 @@
import java.io.IOException;
import java.util.Map;
-import edu.uci.ics.asterix.builders.IAOrderedListBuilder;
import edu.uci.ics.asterix.builders.IARecordBuilder;
import edu.uci.ics.asterix.builders.OrderedListBuilder;
import edu.uci.ics.asterix.builders.RecordBuilder;
@@ -42,7 +41,7 @@
private final Map<String, String> properties;
private final static ARecordType externalRecordType = MetadataRecordTypes.EXTERNAL_DETAILS_RECORDTYPE;
- private final static ARecordType propertyRecordType = MetadataRecordTypes.ADAPTER_PROPERTIES_RECORDTYPE;
+ private final static ARecordType propertyRecordType = MetadataRecordTypes.DATASOURCE_ADAPTER_PROPERTIES_RECORDTYPE;
public ExternalDatasetDetails(String adapter, Map<String, String> properties) {
this.properties = properties;
@@ -65,7 +64,7 @@
@Override
public void writeDatasetDetailsRecordType(DataOutput out) throws HyracksDataException {
IARecordBuilder externalRecordBuilder = new RecordBuilder();
- IAOrderedListBuilder listBuilder = new OrderedListBuilder();
+ OrderedListBuilder listBuilder = new OrderedListBuilder();
ArrayBackedValueStorage fieldValue = new ArrayBackedValueStorage();
ArrayBackedValueStorage itemValue = new ArrayBackedValueStorage();
externalRecordBuilder.reset(externalRecordType);
@@ -77,7 +76,7 @@
fieldValue.reset();
aString.setValue(this.getAdapter());
stringSerde.serialize(aString, fieldValue.getDataOutput());
- externalRecordBuilder.addField(MetadataRecordTypes.EXTERNAL_DETAILS_ARECORD_ADAPTER_FIELD_INDEX, fieldValue);
+ externalRecordBuilder.addField(MetadataRecordTypes.EXTERNAL_DETAILS_ARECORD_DATASOURCE_ADAPTER_FIELD_INDEX, fieldValue);
// write field 1
listBuilder.reset((AOrderedListType) externalRecordType.getFieldTypes()[1]);
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/FeedDatasetDetails.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/FeedDatasetDetails.java
index d9f1f38..367066b 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/FeedDatasetDetails.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/FeedDatasetDetails.java
@@ -19,11 +19,11 @@
import java.util.List;
import java.util.Map;
-import edu.uci.ics.asterix.builders.IAOrderedListBuilder;
import edu.uci.ics.asterix.builders.IARecordBuilder;
import edu.uci.ics.asterix.builders.OrderedListBuilder;
import edu.uci.ics.asterix.builders.RecordBuilder;
import edu.uci.ics.asterix.common.config.DatasetConfig.DatasetType;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.metadata.bootstrap.MetadataRecordTypes;
import edu.uci.ics.asterix.om.base.AMutableString;
@@ -34,12 +34,17 @@
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+/**
+ * Provides functionality for writing parameters for a FEED dataset into the
+ * Metadata. Since FEED dataset is a special kind of INTERNAL dataset, this
+ * class extends InternalDatasetDetails.
+ */
public class FeedDatasetDetails extends InternalDatasetDetails {
private static final long serialVersionUID = 1L;
- private final String adapter;
+ private final String adapterFactory;
private final Map<String, String> properties;
- private String functionIdentifier;
+ private final FunctionSignature signature;
private FeedState feedState;
public enum FeedState {
@@ -53,12 +58,12 @@
}
public FeedDatasetDetails(FileStructure fileStructure, PartitioningStrategy partitioningStrategy,
- List<String> partitioningKey, List<String> primaryKey, String groupName, String adapter,
- Map<String, String> properties, String functionIdentifier, String feedState) {
+ List<String> partitioningKey, List<String> primaryKey, String groupName, String adapterFactory,
+ Map<String, String> properties, FunctionSignature signature, String feedState) {
super(fileStructure, partitioningStrategy, partitioningKey, primaryKey, groupName);
this.properties = properties;
- this.adapter = adapter;
- this.functionIdentifier = functionIdentifier;
+ this.adapterFactory = adapterFactory;
+ this.signature = signature;
this.feedState = feedState.equals(FeedState.ACTIVE.toString()) ? FeedState.ACTIVE : FeedState.INACTIVE;
}
@@ -70,7 +75,7 @@
@Override
public void writeDatasetDetailsRecordType(DataOutput out) throws HyracksDataException {
IARecordBuilder feedRecordBuilder = new RecordBuilder();
- IAOrderedListBuilder listBuilder = new OrderedListBuilder();
+ OrderedListBuilder listBuilder = new OrderedListBuilder();
ArrayBackedValueStorage fieldValue = new ArrayBackedValueStorage();
ArrayBackedValueStorage itemValue = new ArrayBackedValueStorage();
feedRecordBuilder.reset(MetadataRecordTypes.FEED_DETAILS_RECORDTYPE);
@@ -100,7 +105,7 @@
}
fieldValue.reset();
listBuilder.write(fieldValue.getDataOutput(), true);
- feedRecordBuilder.addField(MetadataRecordTypes.FEEDL_DETAILS_ARECORD_PARTITIONKEY_FIELD_INDEX, fieldValue);
+ feedRecordBuilder.addField(MetadataRecordTypes.FEED_DETAILS_ARECORD_PARTITIONKEY_FIELD_INDEX, fieldValue);
// write field 3
listBuilder.reset((AOrderedListType) MetadataRecordTypes.FEED_DETAILS_RECORDTYPE.getFieldTypes()[3]);
@@ -122,9 +127,9 @@
// write field 5
fieldValue.reset();
- aString.setValue(getAdapter());
+ aString.setValue(getAdapterFactory());
stringSerde.serialize(aString, fieldValue.getDataOutput());
- feedRecordBuilder.addField(MetadataRecordTypes.FEED_DETAILS_ARECORD_ADAPTER_FIELD_INDEX, fieldValue);
+ feedRecordBuilder.addField(MetadataRecordTypes.FEED_DETAILS_ARECORD_DATASOURCE_ADAPTER_FIELD_INDEX, fieldValue);
// write field 6
listBuilder.reset((AOrderedListType) MetadataRecordTypes.FEED_DETAILS_RECORDTYPE.getFieldTypes()[6]);
@@ -141,8 +146,8 @@
// write field 7
fieldValue.reset();
- if (getFunctionIdentifier() != null) {
- aString.setValue(getFunctionIdentifier());
+ if (signature != null) {
+ aString.setValue(signature.toString());
stringSerde.serialize(aString, fieldValue.getDataOutput());
feedRecordBuilder.addField(MetadataRecordTypes.FEED_DETAILS_ARECORD_FUNCTION_FIELD_INDEX, fieldValue);
}
@@ -164,7 +169,7 @@
public void writePropertyTypeRecord(String name, String value, DataOutput out) throws HyracksDataException {
IARecordBuilder propertyRecordBuilder = new RecordBuilder();
ArrayBackedValueStorage fieldValue = new ArrayBackedValueStorage();
- propertyRecordBuilder.reset(MetadataRecordTypes.ADAPTER_PROPERTIES_RECORDTYPE);
+ propertyRecordBuilder.reset(MetadataRecordTypes.DATASOURCE_ADAPTER_PROPERTIES_RECORDTYPE);
AMutableString aString = new AMutableString("");
ISerializerDeserializer<AString> stringSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.ASTRING);
@@ -196,20 +201,16 @@
this.feedState = feedState;
}
- public String getAdapter() {
- return adapter;
+ public String getAdapterFactory() {
+ return adapterFactory;
}
public Map<String, String> getProperties() {
return properties;
}
- public String getFunctionIdentifier() {
- return functionIdentifier;
- }
-
- public void setFunctionIdentifier(String functionIdentifier) {
- this.functionIdentifier = functionIdentifier;
+ public FunctionSignature getFunction() {
+ return signature;
}
}
\ No newline at end of file
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Function.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Function.java
index d89bb11..b3e5076 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Function.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Function.java
@@ -7,63 +7,73 @@
public class Function implements IMetadataEntity {
- private String dataverseName;
- private String functionName;
- private int arity;
- private List<String> params;
- private String functionBody;
+ public static final String LANGUAGE_AQL = "AQL";
+ public static final String LANGUAGE_JAVA = "JAVA";
- public Function(String dataverseName, String functionName, int arity,
- List<String> params,
- String functionBody) {
- this.dataverseName = dataverseName;
- this.functionName = functionName;
- this.arity = arity;
- this.params = params;
- this.functionBody = functionBody;
- }
+ public static final String RETURNTYPE_VOID = "VOID";
+ public static final String NOT_APPLICABLE = "N/A";
- public String getDataverseName() {
- return dataverseName;
- }
+ private final String dataverse;
+ private final String name;
+ private final int arity;
+ private final List<String> params;
+ private final String body;
+ private final String returnType;
+ private final String language;
+ private final String kind;
- public void setDataverseName(String dataverseName) {
- this.dataverseName = dataverseName;
- }
+ public Function(String dataverseName, String functionName, int arity, List<String> params, String returnType,
+ String functionBody, String language, String functionKind) {
+ this.dataverse = dataverseName;
+ this.name = functionName;
+ this.params = params;
+ this.body = functionBody;
+ this.returnType = returnType == null ? RETURNTYPE_VOID : returnType;
+ this.language = language;
+ this.kind = functionKind;
+ this.arity = arity;
+ }
- public String getFunctionName() {
- return functionName;
- }
+ public String getDataverseName() {
+ return dataverse;
+ }
- public int getFunctionArity() {
- return arity;
- }
+ public String getName() {
+ return name;
+ }
- public List<String> getParams() {
- return params;
- }
+ public List<String> getParams() {
+ return params;
+ }
- public void setParams(List<String> params) {
- this.params = params;
- }
+ public String getFunctionBody() {
+ return body;
+ }
- public String getFunctionBody() {
- return functionBody;
- }
+ public String getReturnType() {
+ return returnType;
+ }
- public void setFunctionBody(String functionBody) {
- this.functionBody = functionBody;
- }
+ public String getLanguage() {
+ return language;
+ }
- @Override
- public Object addToCache(MetadataCache cache) {
- return cache.addFunctionIfNotExists(this);
- }
+ public int getArity() {
+ return arity;
+ }
- @Override
- public Object dropFromCache(MetadataCache cache) {
- return cache.dropFunction(this);
- }
+ public String getKind() {
+ return kind;
+ }
+
+ @Override
+ public Object addToCache(MetadataCache cache) {
+ return cache.addFunctionIfNotExists(this);
+ }
+
+ @Override
+ public Object dropFromCache(MetadataCache cache) {
+ return cache.dropFunction(this);
+ }
}
-
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Index.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Index.java
index 7c6d9ed..4265630 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Index.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Index.java
@@ -123,4 +123,27 @@
}
throw new AlgebricksException("Could not find field " + expr + " in the schema.");
}
+
+ @Override
+ public int hashCode() {
+ return indexName.hashCode() ^ datasetName.hashCode() ^ dataverseName.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (!(other instanceof Index)) {
+ return false;
+ }
+ Index otherIndex = (Index) other;
+ if (!indexName.equals(otherIndex.getIndexName())) {
+ return false;
+ }
+ if (!datasetName.equals(otherIndex.getDatasetName())) {
+ return false;
+ }
+ if (!dataverseName.equals(otherIndex.getDataverseName())) {
+ return false;
+ }
+ return true;
+ }
}
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/InternalDatasetDetails.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/InternalDatasetDetails.java
index 61616c5..51d154a 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/InternalDatasetDetails.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/InternalDatasetDetails.java
@@ -18,7 +18,6 @@
import java.io.IOException;
import java.util.List;
-import edu.uci.ics.asterix.builders.IAOrderedListBuilder;
import edu.uci.ics.asterix.builders.IARecordBuilder;
import edu.uci.ics.asterix.builders.OrderedListBuilder;
import edu.uci.ics.asterix.builders.RecordBuilder;
@@ -90,7 +89,7 @@
public void writeDatasetDetailsRecordType(DataOutput out) throws HyracksDataException {
IARecordBuilder internalRecordBuilder = new RecordBuilder();
- IAOrderedListBuilder listBuilder = new OrderedListBuilder();
+ OrderedListBuilder listBuilder = new OrderedListBuilder();
ArrayBackedValueStorage fieldValue = new ArrayBackedValueStorage();
ArrayBackedValueStorage itemValue = new ArrayBackedValueStorage();
internalRecordBuilder.reset(MetadataRecordTypes.INTERNAL_DETAILS_RECORDTYPE);
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/DatasetTupleTranslator.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/DatasetTupleTranslator.java
index fbec4b1..3cc6f2f 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/DatasetTupleTranslator.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/DatasetTupleTranslator.java
@@ -27,9 +27,8 @@
import java.util.Map;
import edu.uci.ics.asterix.builders.IARecordBuilder;
-import edu.uci.ics.asterix.builders.RecordBuilder;
-import edu.uci.ics.asterix.common.config.DatasetConfig;
import edu.uci.ics.asterix.common.config.DatasetConfig.DatasetType;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.metadata.IDatasetDetails;
import edu.uci.ics.asterix.metadata.bootstrap.MetadataPrimaryIndexes;
@@ -40,15 +39,14 @@
import edu.uci.ics.asterix.metadata.entities.InternalDatasetDetails;
import edu.uci.ics.asterix.metadata.entities.InternalDatasetDetails.FileStructure;
import edu.uci.ics.asterix.metadata.entities.InternalDatasetDetails.PartitioningStrategy;
+import edu.uci.ics.asterix.om.base.ANull;
import edu.uci.ics.asterix.om.base.AOrderedList;
import edu.uci.ics.asterix.om.base.ARecord;
import edu.uci.ics.asterix.om.base.AString;
import edu.uci.ics.asterix.om.base.IACursor;
import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
import edu.uci.ics.hyracks.dataflow.common.data.accessors.ITupleReference;
-import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
/**
* Translates a Dataset metadata entity to an ITupleReference and vice versa.
@@ -62,9 +60,6 @@
// Payload field containing serialized Dataset.
public static final int DATASET_PAYLOAD_TUPLE_FIELD_INDEX = 2;
- private FileSplit[] splits;
- private List<String> partitioningKey;
- private List<String> primaryKey;
@SuppressWarnings("unchecked")
private ISerializerDeserializer<ARecord> recordSerDes = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(MetadataRecordTypes.DATASET_RECORDTYPE);
@@ -94,7 +89,71 @@
DatasetType datasetType = DatasetType.valueOf(((AString) datasetRecord.getValueByPos(3)).getStringValue());
IDatasetDetails datasetDetails = null;
switch (datasetType) {
- case FEED:
+ case FEED: {
+ ARecord datasetDetailsRecord = (ARecord) datasetRecord
+ .getValueByPos(MetadataRecordTypes.DATASET_ARECORD_FEEDDETAILS_FIELD_INDEX);
+ FileStructure fileStructure = FileStructure.valueOf(((AString) datasetDetailsRecord
+ .getValueByPos(MetadataRecordTypes.FEED_DETAILS_ARECORD_FILESTRUCTURE_FIELD_INDEX))
+ .getStringValue());
+ PartitioningStrategy partitioningStrategy = PartitioningStrategy
+ .valueOf(((AString) datasetDetailsRecord
+ .getValueByPos(MetadataRecordTypes.FEED_DETAILS_ARECORD_PARTITIONSTRATEGY_FIELD_INDEX))
+ .getStringValue());
+ IACursor cursor = ((AOrderedList) datasetDetailsRecord
+ .getValueByPos(MetadataRecordTypes.FEED_DETAILS_ARECORD_PARTITIONKEY_FIELD_INDEX)).getCursor();
+ List<String> partitioningKey = new ArrayList<String>();
+ while (cursor.next())
+ partitioningKey.add(((AString) cursor.get()).getStringValue());
+ String groupName = ((AString) datasetDetailsRecord
+ .getValueByPos(MetadataRecordTypes.FEED_DETAILS_ARECORD_GROUPNAME_FIELD_INDEX))
+ .getStringValue();
+ String adapter = ((AString) datasetDetailsRecord
+ .getValueByPos(MetadataRecordTypes.FEED_DETAILS_ARECORD_DATASOURCE_ADAPTER_FIELD_INDEX))
+ .getStringValue();
+ cursor = ((AOrderedList) datasetDetailsRecord
+ .getValueByPos(MetadataRecordTypes.FEED_DETAILS_ARECORD_PROPERTIES_FIELD_INDEX)).getCursor();
+ Map<String, String> properties = new HashMap<String, String>();
+ String key;
+ String value;
+ while (cursor.next()) {
+ ARecord field = (ARecord) cursor.get();
+ key = ((AString) field
+ .getValueByPos(MetadataRecordTypes.DATASOURCE_ADAPTER_PROPERTIES_ARECORD_NAME_FIELD_INDEX))
+ .getStringValue();
+ value = ((AString) field
+ .getValueByPos(MetadataRecordTypes.DATASOURCE_ADAPTER_PROPERTIES_ARECORD_VALUE_FIELD_INDEX))
+ .getStringValue();
+ properties.put(key, value);
+ }
+
+ Object o = datasetDetailsRecord
+ .getValueByPos(MetadataRecordTypes.FEED_DETAILS_ARECORD_FUNCTION_FIELD_INDEX);
+ FunctionSignature signature = null;
+ if (!(o instanceof ANull)) {
+ String functionIdentifier = ((AString) o).getStringValue();
+ String[] qnameComponents = functionIdentifier.split("\\.");
+ String functionDataverse;
+ String functionName;
+ if (qnameComponents.length == 2) {
+ functionDataverse = qnameComponents[0];
+ functionName = qnameComponents[1];
+ } else {
+ functionDataverse = dataverseName;
+ functionName = qnameComponents[0];
+ }
+
+ String[] nameComponents = functionName.split("@");
+ signature = new FunctionSignature(functionDataverse, nameComponents[0],
+ Integer.parseInt(nameComponents[1]));
+ }
+
+ String feedState = ((AString) datasetDetailsRecord
+ .getValueByPos(MetadataRecordTypes.FEED_DETAILS_ARECORD_STATE_FIELD_INDEX)).getStringValue();
+
+ datasetDetails = new FeedDatasetDetails(fileStructure, partitioningStrategy, partitioningKey,
+ partitioningKey, groupName, adapter, properties, signature, feedState);
+ break;
+ }
case INTERNAL: {
ARecord datasetDetailsRecord = (ARecord) datasetRecord
.getValueByPos(MetadataRecordTypes.DATASET_ARECORD_INTERNALDETAILS_FIELD_INDEX);
@@ -115,41 +174,9 @@
.getValueByPos(MetadataRecordTypes.INTERNAL_DETAILS_ARECORD_GROUPNAME_FIELD_INDEX))
.getStringValue();
- if (datasetType == DatasetConfig.DatasetType.INTERNAL) {
- datasetDetails = new InternalDatasetDetails(fileStructure, partitioningStrategy, partitioningKey,
- partitioningKey, groupName);
- } else {
- String adapter = ((AString) datasetDetailsRecord
- .getValueByPos(MetadataRecordTypes.FEED_DETAILS_ARECORD_ADAPTER_FIELD_INDEX))
- .getStringValue();
- cursor = ((AOrderedList) datasetDetailsRecord
- .getValueByPos(MetadataRecordTypes.FEED_DETAILS_ARECORD_PROPERTIES_FIELD_INDEX))
- .getCursor();
- Map<String, String> properties = new HashMap<String, String>();
- String key;
- String value;
- while (cursor.next()) {
- ARecord field = (ARecord) cursor.get();
- key = ((AString) field
- .getValueByPos(MetadataRecordTypes.ADAPTER_PROPERTIES_ARECORD_NAME_FIELD_INDEX))
- .getStringValue();
- value = ((AString) field
- .getValueByPos(MetadataRecordTypes.ADAPTER_PROPERTIES_ARECORD_VALUE_FIELD_INDEX))
- .getStringValue();
- properties.put(key, value);
- }
+ datasetDetails = new InternalDatasetDetails(fileStructure, partitioningStrategy, partitioningKey,
+ partitioningKey, groupName);
- String functionIdentifier = ((AString) datasetDetailsRecord
- .getValueByPos(MetadataRecordTypes.FEED_DETAILS_ARECORD_FUNCTION_FIELD_INDEX))
- .getStringValue();
-
- String feedState = ((AString) datasetDetailsRecord
- .getValueByPos(MetadataRecordTypes.FEED_DETAILS_ARECORD_STATE_FIELD_INDEX))
- .getStringValue();
-
- datasetDetails = new FeedDatasetDetails(fileStructure, partitioningStrategy, partitioningKey,
- partitioningKey, groupName, adapter, properties, functionIdentifier, feedState);
- }
break;
}
@@ -157,7 +184,7 @@
ARecord datasetDetailsRecord = (ARecord) datasetRecord
.getValueByPos(MetadataRecordTypes.DATASET_ARECORD_EXTERNALDETAILS_FIELD_INDEX);
String adapter = ((AString) datasetDetailsRecord
- .getValueByPos(MetadataRecordTypes.EXTERNAL_DETAILS_ARECORD_ADAPTER_FIELD_INDEX))
+ .getValueByPos(MetadataRecordTypes.EXTERNAL_DETAILS_ARECORD_DATASOURCE_ADAPTER_FIELD_INDEX))
.getStringValue();
IACursor cursor = ((AOrderedList) datasetDetailsRecord
.getValueByPos(MetadataRecordTypes.EXTERNAL_DETAILS_ARECORD_PROPERTIES_FIELD_INDEX))
@@ -168,10 +195,10 @@
while (cursor.next()) {
ARecord field = (ARecord) cursor.get();
key = ((AString) field
- .getValueByPos(MetadataRecordTypes.ADAPTER_PROPERTIES_ARECORD_NAME_FIELD_INDEX))
+ .getValueByPos(MetadataRecordTypes.DATASOURCE_ADAPTER_PROPERTIES_ARECORD_NAME_FIELD_INDEX))
.getStringValue();
value = ((AString) field
- .getValueByPos(MetadataRecordTypes.ADAPTER_PROPERTIES_ARECORD_VALUE_FIELD_INDEX))
+ .getValueByPos(MetadataRecordTypes.DATASOURCE_ADAPTER_PROPERTIES_ARECORD_VALUE_FIELD_INDEX))
.getStringValue();
properties.put(key, value);
}
@@ -255,23 +282,4 @@
}
- public void writePropertyTypeRecord(String name, String value, DataOutput out) throws IOException {
- IARecordBuilder propertyRecordBuilder = new RecordBuilder();
- ArrayBackedValueStorage fieldValue = new ArrayBackedValueStorage();
- propertyRecordBuilder.reset(MetadataRecordTypes.ADAPTER_PROPERTIES_RECORDTYPE);
-
- // write field 0
- fieldValue.reset();
- aString.setValue(name);
- stringSerde.serialize(aString, fieldValue.getDataOutput());
- propertyRecordBuilder.addField(MetadataRecordTypes.ADAPTER_PROPERTIES_ARECORD_NAME_FIELD_INDEX, fieldValue);
-
- // write field 1
- fieldValue.reset();
- aString.setValue(value);
- stringSerde.serialize(aString, fieldValue.getDataOutput());
- propertyRecordBuilder.addField(MetadataRecordTypes.ADAPTER_PROPERTIES_ARECORD_VALUE_FIELD_INDEX, fieldValue);
-
- propertyRecordBuilder.write(out, true);
- }
}
\ No newline at end of file
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/DatasourceAdapterTupleTranslator.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/DatasourceAdapterTupleTranslator.java
new file mode 100644
index 0000000..6353e99
--- /dev/null
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/DatasourceAdapterTupleTranslator.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.metadata.entitytupletranslators;
+
+import java.io.ByteArrayInputStream;
+import java.io.DataInput;
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.util.Calendar;
+
+import edu.uci.ics.asterix.external.dataset.adapter.AdapterIdentifier;
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.metadata.MetadataException;
+import edu.uci.ics.asterix.metadata.bootstrap.MetadataPrimaryIndexes;
+import edu.uci.ics.asterix.metadata.bootstrap.MetadataRecordTypes;
+import edu.uci.ics.asterix.metadata.entities.DatasourceAdapter;
+import edu.uci.ics.asterix.metadata.entities.DatasourceAdapter.AdapterType;
+import edu.uci.ics.asterix.om.base.ARecord;
+import edu.uci.ics.asterix.om.base.AString;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.ITupleReference;
+
+public class DatasourceAdapterTupleTranslator extends AbstractTupleTranslator<DatasourceAdapter> {
+
+ // Field indexes of serialized Adapter in a tuple.
+ // First key field.
+ public static final int ADAPTER_DATAVERSENAME_TUPLE_FIELD_INDEX = 0;
+ // Second key field.
+ public static final int ADAPTER_NAME_TUPLE_FIELD_INDEX = 1;
+
+ // Payload field containing serialized Adapter.
+ public static final int ADAPTER_PAYLOAD_TUPLE_FIELD_INDEX = 2;
+
+ @SuppressWarnings("unchecked")
+ private ISerializerDeserializer<ARecord> recordSerDes = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(MetadataRecordTypes.DATASOURCE_ADAPTER_RECORDTYPE);
+
+ public DatasourceAdapterTupleTranslator(boolean getTuple) {
+ super(getTuple, MetadataPrimaryIndexes.DATASOURCE_ADAPTER_DATASET.getFieldCount());
+ }
+
+ @Override
+ public DatasourceAdapter getMetadataEntytiFromTuple(ITupleReference tuple) throws MetadataException, IOException {
+ byte[] serRecord = tuple.getFieldData(ADAPTER_PAYLOAD_TUPLE_FIELD_INDEX);
+ int recordStartOffset = tuple.getFieldStart(ADAPTER_PAYLOAD_TUPLE_FIELD_INDEX);
+ int recordLength = tuple.getFieldLength(ADAPTER_PAYLOAD_TUPLE_FIELD_INDEX);
+ ByteArrayInputStream stream = new ByteArrayInputStream(serRecord, recordStartOffset, recordLength);
+ DataInput in = new DataInputStream(stream);
+ ARecord adapterRecord = (ARecord) recordSerDes.deserialize(in);
+ return createAdapterFromARecord(adapterRecord);
+ }
+
+ private DatasourceAdapter createAdapterFromARecord(ARecord adapterRecord) {
+ String dataverseName = ((AString) adapterRecord
+ .getValueByPos(MetadataRecordTypes.DATASOURCE_ADAPTER_ARECORD_DATAVERSENAME_FIELD_INDEX)).getStringValue();
+ String adapterName = ((AString) adapterRecord
+ .getValueByPos(MetadataRecordTypes.DATASOURCE_ADAPTER_ARECORD_NAME_FIELD_INDEX)).getStringValue();
+ String classname = ((AString) adapterRecord
+ .getValueByPos(MetadataRecordTypes.DATASOURCE_ADAPTER_ARECORD_CLASSNAME_FIELD_INDEX)).getStringValue();
+ AdapterType adapterType = AdapterType.valueOf(((AString) adapterRecord
+ .getValueByPos(MetadataRecordTypes.DATASOURCE_ADAPTER_ARECORD_TYPE_FIELD_INDEX)).getStringValue());
+
+ return new DatasourceAdapter(new AdapterIdentifier(dataverseName, adapterName), classname, adapterType);
+ }
+
+ @Override
+ public ITupleReference getTupleFromMetadataEntity(DatasourceAdapter adapter) throws IOException {
+ // write the key in the first 2 fields of the tuple
+ tupleBuilder.reset();
+ aString.setValue(adapter.getAdapterIdentifier().getNamespace());
+ stringSerde.serialize(aString, tupleBuilder.getDataOutput());
+ tupleBuilder.addFieldEndOffset();
+ aString.setValue(adapter.getAdapterIdentifier().getAdapterName());
+ stringSerde.serialize(aString, tupleBuilder.getDataOutput());
+ tupleBuilder.addFieldEndOffset();
+
+ // write the pay-load in the third field of the tuple
+
+ recordBuilder.reset(MetadataRecordTypes.DATASOURCE_ADAPTER_RECORDTYPE);
+
+ // write field 0
+ fieldValue.reset();
+ aString.setValue(adapter.getAdapterIdentifier().getNamespace());
+ stringSerde.serialize(aString, fieldValue.getDataOutput());
+ recordBuilder.addField(MetadataRecordTypes.DATASOURCE_ADAPTER_ARECORD_DATAVERSENAME_FIELD_INDEX, fieldValue);
+
+ // write field 1
+ fieldValue.reset();
+ aString.setValue(adapter.getAdapterIdentifier().getAdapterName());
+ stringSerde.serialize(aString, fieldValue.getDataOutput());
+ recordBuilder.addField(MetadataRecordTypes.DATASOURCE_ADAPTER_ARECORD_NAME_FIELD_INDEX, fieldValue);
+
+ // write field 2
+ fieldValue.reset();
+ aString.setValue(adapter.getClassname());
+ stringSerde.serialize(aString, fieldValue.getDataOutput());
+ recordBuilder.addField(MetadataRecordTypes.DATASOURCE_ADAPTER_ARECORD_CLASSNAME_FIELD_INDEX, fieldValue);
+
+ // write field 3
+ fieldValue.reset();
+ aString.setValue(adapter.getType().name());
+ stringSerde.serialize(aString, fieldValue.getDataOutput());
+ recordBuilder.addField(MetadataRecordTypes.DATASOURCE_ADAPTER_ARECORD_TYPE_FIELD_INDEX, fieldValue);
+
+ // write field 4
+ fieldValue.reset();
+ aString.setValue(Calendar.getInstance().getTime().toString());
+ stringSerde.serialize(aString, fieldValue.getDataOutput());
+ recordBuilder.addField(MetadataRecordTypes.DATASOURCE_ADAPTER_ARECORD_TIMESTAMP_FIELD_INDEX, fieldValue);
+
+ // write record
+ recordBuilder.write(tupleBuilder.getDataOutput(), true);
+ tupleBuilder.addFieldEndOffset();
+
+ tuple.reset(tupleBuilder.getFieldEndOffsets(), tupleBuilder.getByteArray());
+ return tuple;
+ }
+
+}
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/DatatypeTupleTranslator.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/DatatypeTupleTranslator.java
index b39a1bf..d37fbc6 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/DatatypeTupleTranslator.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/DatatypeTupleTranslator.java
@@ -25,7 +25,6 @@
import java.util.Calendar;
import java.util.List;
-import edu.uci.ics.asterix.builders.IAOrderedListBuilder;
import edu.uci.ics.asterix.builders.IARecordBuilder;
import edu.uci.ics.asterix.builders.OrderedListBuilder;
import edu.uci.ics.asterix.builders.RecordBuilder;
@@ -49,7 +48,6 @@
import edu.uci.ics.asterix.om.types.AbstractCollectionType;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
@@ -322,7 +320,7 @@
private void writeUnionType(Datatype instance, DataOutput dataOutput) throws HyracksDataException {
List<IAType> unionList = ((AUnionType) instance.getDatatype()).getUnionList();
- IAOrderedListBuilder listBuilder = new OrderedListBuilder();
+ OrderedListBuilder listBuilder = new OrderedListBuilder();
listBuilder.reset(new AOrderedListType(BuiltinType.ASTRING, null));
ArrayBackedValueStorage itemValue = new ArrayBackedValueStorage();
String typeName = null;
@@ -358,7 +356,7 @@
IARecordBuilder fieldRecordBuilder = new RecordBuilder();
ARecordType recType = (ARecordType) instance.getDatatype();
- IAOrderedListBuilder listBuilder = new OrderedListBuilder();
+ OrderedListBuilder listBuilder = new OrderedListBuilder();
listBuilder.reset(new AOrderedListType(MetadataRecordTypes.FIELD_RECORDTYPE, null));
String fieldTypeName = null;
for (int i = 0; i < recType.getFieldNames().length; i++) {
@@ -415,30 +413,22 @@
private String handleNestedDerivedType(String typeName, String suggestedTypeName, IAType nestedType,
Datatype topLevelType) throws Exception {
MetadataNode mn = MetadataNode.INSTANCE;
- if (typeName == null) {
- typeName = suggestedTypeName;
- metadataNode.addDatatype(txnId, new Datatype(topLevelType.getDataverseName(), typeName, nestedType, true));
- try {
- mn.insertIntoDatatypeSecondaryIndex(txnId, topLevelType.getDataverseName(), typeName,
- topLevelType.getDatatypeName());
- } catch (BTreeDuplicateKeyException e) {
- // The key may have been inserted by a previous DDL statement or
- // by a previous nested type.
- }
- return typeName;
- }
- Datatype dt = mn.getDatatype(txnId, topLevelType.getDataverseName(), typeName);
- if (dt == null) {
- throw new AlgebricksException("There is no datatype with this name " + typeName + ".");
- }
try {
+ if (typeName == null) {
+ typeName = suggestedTypeName;
+ metadataNode.addDatatype(txnId, new Datatype(topLevelType.getDataverseName(), typeName, nestedType,
+ true));
+
+ }
mn.insertIntoDatatypeSecondaryIndex(txnId, topLevelType.getDataverseName(), typeName,
topLevelType.getDatatypeName());
+
} catch (BTreeDuplicateKeyException e) {
// The key may have been inserted by a previous DDL statement or by
// a previous nested type.
}
return typeName;
+
}
private boolean isDerivedType(ATypeTag tag) {
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/FunctionTupleTranslator.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/FunctionTupleTranslator.java
index cdf43fb..8296a22 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/FunctionTupleTranslator.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/FunctionTupleTranslator.java
@@ -22,7 +22,6 @@
import java.util.ArrayList;
import java.util.List;
-import edu.uci.ics.asterix.builders.IAOrderedListBuilder;
import edu.uci.ics.asterix.builders.OrderedListBuilder;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.metadata.bootstrap.MetadataPrimaryIndexes;
@@ -39,149 +38,151 @@
/**
* Translates a Function metadata entity to an ITupleReference and vice versa.
- *
*/
public class FunctionTupleTranslator extends AbstractTupleTranslator<Function> {
- // Field indexes of serialized Function in a tuple.
- // First key field.
- public static final int FUNCTION_DATAVERSENAME_TUPLE_FIELD_INDEX = 0;
- // Second key field.
- public static final int FUNCTION_FUNCTIONNAME_TUPLE_FIELD_INDEX = 1;
- // Thirdy key field.
- public static final int FUNCTION_FUNCTIONARITY_TUPLE_FIELD_INDEX = 2;
+ // Field indexes of serialized Function in a tuple.
+ // First key field.
+ public static final int FUNCTION_DATAVERSENAME_TUPLE_FIELD_INDEX = 0;
+ // Second key field.
+ public static final int FUNCTION_FUNCTIONNAME_TUPLE_FIELD_INDEX = 1;
+ // Third key field.
+ public static final int FUNCTION_FUNCTIONARITY_TUPLE_FIELD_INDEX = 2;
- // Payload field containing serialized Function.
- public static final int FUNCTION_PAYLOAD_TUPLE_FIELD_INDEX = 3;
+
+ // Payload field containing serialized Function.
+ public static final int FUNCTION_PAYLOAD_TUPLE_FIELD_INDEX = 3;
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ARecord> recordSerDes = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(MetadataRecordTypes.FUNCTION_RECORDTYPE);
+ @SuppressWarnings("unchecked")
+ private ISerializerDeserializer<ARecord> recordSerDes = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(MetadataRecordTypes.FUNCTION_RECORDTYPE);
- public FunctionTupleTranslator(boolean getTuple) {
- super(getTuple, MetadataPrimaryIndexes.FUNCTION_DATASET.getFieldCount());
- }
+ public FunctionTupleTranslator(boolean getTuple) {
+ super(getTuple, MetadataPrimaryIndexes.FUNCTION_DATASET.getFieldCount());
+ }
- @Override
- public Function getMetadataEntytiFromTuple(ITupleReference frameTuple)
- throws IOException {
- byte[] serRecord = frameTuple
- .getFieldData(FUNCTION_PAYLOAD_TUPLE_FIELD_INDEX);
- int recordStartOffset = frameTuple
- .getFieldStart(FUNCTION_PAYLOAD_TUPLE_FIELD_INDEX);
- int recordLength = frameTuple
- .getFieldLength(FUNCTION_PAYLOAD_TUPLE_FIELD_INDEX);
- ByteArrayInputStream stream = new ByteArrayInputStream(serRecord,
- recordStartOffset, recordLength);
- DataInput in = new DataInputStream(stream);
- ARecord functionRecord = (ARecord) recordSerDes.deserialize(in);
- return createFunctionFromARecord(functionRecord);
- }
+ @Override
+ public Function getMetadataEntytiFromTuple(ITupleReference frameTuple) throws IOException {
+ byte[] serRecord = frameTuple.getFieldData(FUNCTION_PAYLOAD_TUPLE_FIELD_INDEX);
+ int recordStartOffset = frameTuple.getFieldStart(FUNCTION_PAYLOAD_TUPLE_FIELD_INDEX);
+ int recordLength = frameTuple.getFieldLength(FUNCTION_PAYLOAD_TUPLE_FIELD_INDEX);
+ ByteArrayInputStream stream = new ByteArrayInputStream(serRecord, recordStartOffset, recordLength);
+ DataInput in = new DataInputStream(stream);
+ ARecord functionRecord = (ARecord) recordSerDes.deserialize(in);
+ return createFunctionFromARecord(functionRecord);
+ }
- private Function createFunctionFromARecord(ARecord functionRecord) {
- String dataverseName = ((AString) functionRecord
- .getValueByPos(MetadataRecordTypes.FUNCTION_ARECORD_DATAVERSENAME_FIELD_INDEX))
- .getStringValue();
- String functionName = ((AString) functionRecord
- .getValueByPos(MetadataRecordTypes.FUNCTION_ARECORD_FUNCTIONNAME_FIELD_INDEX))
- .getStringValue();
- String arity = ((AString) functionRecord
- .getValueByPos(MetadataRecordTypes.FUNCTION_ARECORD_FUNCTIONARITY_FIELD_INDEX))
- .getStringValue();
+ private Function createFunctionFromARecord(ARecord functionRecord) {
+ String dataverseName = ((AString) functionRecord
+ .getValueByPos(MetadataRecordTypes.FUNCTION_ARECORD_DATAVERSENAME_FIELD_INDEX)).getStringValue();
+ String functionName = ((AString) functionRecord
+ .getValueByPos(MetadataRecordTypes.FUNCTION_ARECORD_FUNCTIONNAME_FIELD_INDEX)).getStringValue();
+ String arity = ((AString) functionRecord
+ .getValueByPos(MetadataRecordTypes.FUNCTION_ARECORD_FUNCTION_ARITY_FIELD_INDEX)).getStringValue();
- IACursor cursor = ((AOrderedList) functionRecord
- .getValueByPos(MetadataRecordTypes.FUNCTION_ARECORD_FUNCTION_PARAM_LIST_FIELD_INDEX))
- .getCursor();
- List<String> params = new ArrayList<String>();
- while (cursor.next()) {
- params.add(((AString) cursor.get()).getStringValue());
- }
+ IACursor cursor = ((AOrderedList) functionRecord
+ .getValueByPos(MetadataRecordTypes.FUNCTION_ARECORD_FUNCTION_PARAM_LIST_FIELD_INDEX)).getCursor();
+ List<String> params = new ArrayList<String>();
+ while (cursor.next()) {
+ params.add(((AString) cursor.get()).getStringValue());
+ }
- String functionBody = ((AString) functionRecord
- .getValueByPos(MetadataRecordTypes.FUNCTION_ARECORD_FUNCTION_BODY_FIELD_INDEX))
- .getStringValue();
+ String returnType = ((AString) functionRecord
+ .getValueByPos(MetadataRecordTypes.FUNCTION_ARECORD_FUNCTION_RETURN_TYPE_FIELD_INDEX)).getStringValue();
- return new Function(dataverseName, functionName,
- Integer.parseInt(arity), params, functionBody);
+ String definition = ((AString) functionRecord
+ .getValueByPos(MetadataRecordTypes.FUNCTION_ARECORD_FUNCTION_DEFINITION_FIELD_INDEX)).getStringValue();
- }
+ String language = ((AString) functionRecord
+ .getValueByPos(MetadataRecordTypes.FUNCTION_ARECORD_FUNCTION_LANGUAGE_FIELD_INDEX)).getStringValue();
- @Override
- public ITupleReference getTupleFromMetadataEntity(Function function)
- throws IOException {
- // write the key in the first 3 fields of the tuple
- tupleBuilder.reset();
- aString.setValue(function.getDataverseName());
- stringSerde.serialize(aString, tupleBuilder.getDataOutput());
- tupleBuilder.addFieldEndOffset();
- aString.setValue(function.getFunctionName());
- stringSerde.serialize(aString, tupleBuilder.getDataOutput());
- tupleBuilder.addFieldEndOffset();
- aString.setValue("" + function.getFunctionArity());
- stringSerde.serialize(aString, tupleBuilder.getDataOutput());
- tupleBuilder.addFieldEndOffset();
+ String functionKind = ((AString) functionRecord
+ .getValueByPos(MetadataRecordTypes.FUNCTION_ARECORD_FUNCTION_KIND_FIELD_INDEX)).getStringValue();
+ return new Function(dataverseName, functionName, Integer.parseInt(arity), params, returnType, definition,
+ language, functionKind);
- // write the pay-load in the fourth field of the tuple
+ }
- recordBuilder.reset(MetadataRecordTypes.FUNCTION_RECORDTYPE);
+ @Override
+ public ITupleReference getTupleFromMetadataEntity(Function function) throws IOException {
+ // write the key in the first 2 fields of the tuple
+ tupleBuilder.reset();
+ aString.setValue(function.getDataverseName());
+ stringSerde.serialize(aString, tupleBuilder.getDataOutput());
+ tupleBuilder.addFieldEndOffset();
+ aString.setValue(function.getName());
+ stringSerde.serialize(aString, tupleBuilder.getDataOutput());
+ tupleBuilder.addFieldEndOffset();
+ aString.setValue(function.getArity() + "");
+ stringSerde.serialize(aString, tupleBuilder.getDataOutput());
+ tupleBuilder.addFieldEndOffset();
- // write field 0
- fieldValue.reset();
- aString.setValue(function.getDataverseName());
- stringSerde.serialize(aString, fieldValue.getDataOutput());
- recordBuilder.addField(
- MetadataRecordTypes.FUNCTION_ARECORD_DATAVERSENAME_FIELD_INDEX,
- fieldValue);
+ // write the pay-load in the fourth field of the tuple
- // write field 1
- fieldValue.reset();
- aString.setValue(function.getFunctionName());
- stringSerde.serialize(aString, fieldValue.getDataOutput());
- recordBuilder.addField(
- MetadataRecordTypes.FUNCTION_ARECORD_FUNCTIONNAME_FIELD_INDEX,
- fieldValue);
+ recordBuilder.reset(MetadataRecordTypes.FUNCTION_RECORDTYPE);
- // write field 2
- fieldValue.reset();
- aString.setValue("" + function.getFunctionArity());
- stringSerde.serialize(aString, fieldValue.getDataOutput());
- recordBuilder.addField(
- MetadataRecordTypes.FUNCTION_ARECORD_FUNCTIONARITY_FIELD_INDEX,
- fieldValue);
+ // write field 0
+ fieldValue.reset();
+ aString.setValue(function.getDataverseName());
+ stringSerde.serialize(aString, fieldValue.getDataOutput());
+ recordBuilder.addField(MetadataRecordTypes.FUNCTION_ARECORD_DATAVERSENAME_FIELD_INDEX, fieldValue);
- // write field 3
- IAOrderedListBuilder listBuilder = new OrderedListBuilder();
- ArrayBackedValueStorage itemValue = new ArrayBackedValueStorage();
- listBuilder
- .reset((AOrderedListType) MetadataRecordTypes.FUNCTION_RECORDTYPE
- .getFieldTypes()[MetadataRecordTypes.FUNCTION_ARECORD_FUNCTION_PARAM_LIST_FIELD_INDEX]);
- for (String param : function.getParams()) {
- itemValue.reset();
- aString.setValue(param);
- stringSerde.serialize(aString, itemValue.getDataOutput());
- listBuilder.addItem(itemValue);
- }
- fieldValue.reset();
- listBuilder.write(fieldValue.getDataOutput(), true);
- recordBuilder
- .addField(
- MetadataRecordTypes.FUNCTION_ARECORD_FUNCTION_PARAM_LIST_FIELD_INDEX,
- fieldValue);
+ // write field 1
+ fieldValue.reset();
+ aString.setValue(function.getName());
+ stringSerde.serialize(aString, fieldValue.getDataOutput());
+ recordBuilder.addField(MetadataRecordTypes.FUNCTION_ARECORD_FUNCTIONNAME_FIELD_INDEX, fieldValue);
- // write field 4
- fieldValue.reset();
- aString.setValue(function.getFunctionBody());
- stringSerde.serialize(aString, fieldValue.getDataOutput());
- recordBuilder.addField(
- MetadataRecordTypes.FUNCTION_ARECORD_FUNCTION_BODY_FIELD_INDEX,
- fieldValue);
+ // write field 2
+ fieldValue.reset();
+ aString.setValue(function.getArity() + "");
+ stringSerde.serialize(aString, fieldValue.getDataOutput());
+ recordBuilder.addField(MetadataRecordTypes.FUNCTION_ARECORD_FUNCTION_ARITY_FIELD_INDEX, fieldValue);
- // write record
- recordBuilder.write(tupleBuilder.getDataOutput(), true);
- tupleBuilder.addFieldEndOffset();
+ // write field 3
+ OrderedListBuilder listBuilder = new OrderedListBuilder();
+ ArrayBackedValueStorage itemValue = new ArrayBackedValueStorage();
+ listBuilder
+ .reset((AOrderedListType) MetadataRecordTypes.FUNCTION_RECORDTYPE.getFieldTypes()[MetadataRecordTypes.FUNCTION_ARECORD_FUNCTION_PARAM_LIST_FIELD_INDEX]);
+ for (String param : function.getParams()) {
+ itemValue.reset();
+ aString.setValue(param);
+ stringSerde.serialize(aString, itemValue.getDataOutput());
+ listBuilder.addItem(itemValue);
+ }
+ fieldValue.reset();
+ listBuilder.write(fieldValue.getDataOutput(), true);
+ recordBuilder.addField(MetadataRecordTypes.FUNCTION_ARECORD_FUNCTION_PARAM_LIST_FIELD_INDEX, fieldValue);
- tuple.reset(tupleBuilder.getFieldEndOffsets(),
- tupleBuilder.getByteArray());
- return tuple;
- }
+ // write field 4
+ fieldValue.reset();
+ aString.setValue(function.getReturnType());
+ stringSerde.serialize(aString, fieldValue.getDataOutput());
+ recordBuilder.addField(MetadataRecordTypes.FUNCTION_ARECORD_FUNCTION_RETURN_TYPE_FIELD_INDEX, fieldValue);
+
+ // write field 5
+ fieldValue.reset();
+ aString.setValue(function.getFunctionBody());
+ stringSerde.serialize(aString, fieldValue.getDataOutput());
+ recordBuilder.addField(MetadataRecordTypes.FUNCTION_ARECORD_FUNCTION_DEFINITION_FIELD_INDEX, fieldValue);
+
+ // write field 6
+ fieldValue.reset();
+ aString.setValue(function.getLanguage());
+ stringSerde.serialize(aString, fieldValue.getDataOutput());
+ recordBuilder.addField(MetadataRecordTypes.FUNCTION_ARECORD_FUNCTION_LANGUAGE_FIELD_INDEX, fieldValue);
+
+ // write field 7
+ fieldValue.reset();
+ aString.setValue(function.getKind());
+ stringSerde.serialize(aString, fieldValue.getDataOutput());
+ recordBuilder.addField(MetadataRecordTypes.FUNCTION_ARECORD_FUNCTION_KIND_FIELD_INDEX, fieldValue);
+
+ // write record
+ recordBuilder.write(tupleBuilder.getDataOutput(), true);
+ tupleBuilder.addFieldEndOffset();
+
+ tuple.reset(tupleBuilder.getFieldEndOffsets(), tupleBuilder.getByteArray());
+ return tuple;
+ }
}
\ No newline at end of file
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/IndexTupleTranslator.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/IndexTupleTranslator.java
index 7f723cb..d71480f 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/IndexTupleTranslator.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/IndexTupleTranslator.java
@@ -23,7 +23,6 @@
import java.util.Calendar;
import java.util.List;
-import edu.uci.ics.asterix.builders.IAOrderedListBuilder;
import edu.uci.ics.asterix.builders.OrderedListBuilder;
import edu.uci.ics.asterix.common.config.DatasetConfig.IndexType;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
@@ -58,7 +57,7 @@
// Field name of open field.
public static final String GRAM_LENGTH_FIELD_NAME = "GramLength";
- private IAOrderedListBuilder listBuilder = new OrderedListBuilder();
+ private OrderedListBuilder listBuilder = new OrderedListBuilder();
private ArrayBackedValueStorage nameValue = new ArrayBackedValueStorage();
private ArrayBackedValueStorage itemValue = new ArrayBackedValueStorage();
private List<String> searchKey;
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/NodeGroupTupleTranslator.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/NodeGroupTupleTranslator.java
index 8c7645b..da66d4b 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/NodeGroupTupleTranslator.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/NodeGroupTupleTranslator.java
@@ -23,7 +23,6 @@
import java.util.Calendar;
import java.util.List;
-import edu.uci.ics.asterix.builders.IAUnorderedListBuilder;
import edu.uci.ics.asterix.builders.UnorderedListBuilder;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.metadata.bootstrap.MetadataPrimaryIndexes;
@@ -49,7 +48,7 @@
// Payload field containing serialized NodeGroup.
public static final int NODEGROUP_PAYLOAD_TUPLE_FIELD_INDEX = 1;
- private IAUnorderedListBuilder listBuilder = new UnorderedListBuilder();
+ private UnorderedListBuilder listBuilder = new UnorderedListBuilder();
private ArrayBackedValueStorage itemValue = new ArrayBackedValueStorage();
private List<String> nodeNames;
@SuppressWarnings("unchecked")
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/functions/MetadataBuiltinFunctions.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/functions/MetadataBuiltinFunctions.java
index edb3808..60f2e6d 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/functions/MetadataBuiltinFunctions.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/functions/MetadataBuiltinFunctions.java
@@ -1,6 +1,5 @@
package edu.uci.ics.asterix.metadata.functions;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
import edu.uci.ics.asterix.metadata.entities.Dataset;
import edu.uci.ics.asterix.om.base.AString;
@@ -11,6 +10,7 @@
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalExpressionTag;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
@@ -51,14 +51,21 @@
return BuiltinType.ANY;
}
AsterixConstantValue acv = (AsterixConstantValue) ((ConstantExpression) a1).getValue();
- String datasetName = ((AString) acv.getObject()).getStringValue();
- AqlCompiledMetadataDeclarations metadata = ((AqlMetadataProvider) mp).getMetadataDeclarations();
- Dataset dataset = metadata.findDataset(datasetName);
+ String datasetArg = ((AString) acv.getObject()).getStringValue();
+ AqlMetadataProvider metadata = ((AqlMetadataProvider) mp);
+ Pair<String, String> datasetInfo = getDatasetInfo(metadata, datasetArg);
+ String dataverseName = datasetInfo.first;
+ String datasetName = datasetInfo.second;
+ if (dataverseName == null) {
+ throw new AlgebricksException("Unspecified dataverse!");
+ }
+ Dataset dataset = metadata.findDataset(dataverseName, datasetName);
if (dataset == null) {
- throw new AlgebricksException("Could not find dataset " + datasetName);
+ throw new AlgebricksException("Could not find dataset " + datasetName + " in dataverse "
+ + dataverseName);
}
String tn = dataset.getItemTypeName();
- IAType t2 = metadata.findType(tn);
+ IAType t2 = metadata.findType(dataverseName, tn);
if (t2 == null) {
throw new AlgebricksException("No type for dataset " + datasetName);
}
@@ -87,14 +94,21 @@
return BuiltinType.ANY;
}
AsterixConstantValue acv = (AsterixConstantValue) ((ConstantExpression) a1).getValue();
- String datasetName = ((AString) acv.getObject()).getStringValue();
- AqlCompiledMetadataDeclarations metadata = ((AqlMetadataProvider) mp).getMetadataDeclarations();
- Dataset dataset = metadata.findDataset(datasetName);
+ String datasetArg = ((AString) acv.getObject()).getStringValue();
+ AqlMetadataProvider metadata = ((AqlMetadataProvider) mp);
+ Pair<String, String> datasetInfo = getDatasetInfo(metadata, datasetArg);
+ String dataverseName = datasetInfo.first;
+ String datasetName = datasetInfo.second;
+ if (dataverseName == null) {
+ throw new AlgebricksException("Unspecified dataverse!");
+ }
+ Dataset dataset = metadata.findDataset(dataverseName, datasetName);
if (dataset == null) {
- throw new AlgebricksException("Could not find dataset " + datasetName);
+ throw new AlgebricksException("Could not find dataset " + datasetName + " in dataverse "
+ + dataverseName);
}
String tn = dataset.getItemTypeName();
- IAType t2 = metadata.findType(tn);
+ IAType t2 = metadata.findType(dataverseName, tn);
if (t2 == null) {
throw new AlgebricksException("No type for dataset " + datasetName);
}
@@ -102,4 +116,19 @@
}
});
}
+
+ private static Pair<String, String> getDatasetInfo(AqlMetadataProvider metadata, String datasetArg) {
+ String[] datasetNameComponents = datasetArg.split("\\.");
+ String dataverseName;
+ String datasetName;
+ if (datasetNameComponents.length == 1) {
+ dataverseName = metadata.getDefaultDataverse() == null ? null : metadata.getDefaultDataverse()
+ .getDataverseName();
+ datasetName = datasetNameComponents[0];
+ } else {
+ dataverseName = datasetNameComponents[0];
+ datasetName = datasetNameComponents[1];
+ }
+ return new Pair(dataverseName, datasetName);
+ }
}
diff --git a/asterix-om/pom.xml b/asterix-om/pom.xml
index fc9acd8..a14f3c2 100644
--- a/asterix-om/pom.xml
+++ b/asterix-om/pom.xml
@@ -33,7 +33,7 @@
<dependency>
<groupId>edu.uci.ics.hyracks</groupId>
<artifactId>hyracks-storage-am-invertedindex</artifactId>
- <version>0.2.1-SNAPSHOT</version>
+ <version>0.2.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>edu.uci.ics.asterix</groupId>
@@ -44,12 +44,12 @@
<dependency>
<groupId>edu.uci.ics.hyracks</groupId>
<artifactId>hyracks-algebricks-compiler</artifactId>
- <version>0.2.1-SNAPSHOT</version>
+ <version>0.2.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>edu.uci.ics.hyracks</groupId>
<artifactId>hyracks-storage-am-rtree</artifactId>
- <version>0.2.1-SNAPSHOT</version>
+ <version>0.2.2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/AbstractListBuilder.java b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/AbstractListBuilder.java
new file mode 100644
index 0000000..6fa2d3e
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/AbstractListBuilder.java
@@ -0,0 +1,110 @@
+package edu.uci.ics.asterix.builders;
+
+import java.io.DataOutput;
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.SerializerDeserializerUtil;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.AbstractCollectionType;
+import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.data.std.api.IValueReference;
+import edu.uci.ics.hyracks.data.std.util.GrowableArray;
+import edu.uci.ics.hyracks.storage.am.common.ophelpers.IntArrayList;
+
+public abstract class AbstractListBuilder implements IAsterixListBuilder {
+
+ protected static final byte serNullTypeTag = ATypeTag.NULL.serialize();
+
+ protected final GrowableArray outputStorage;
+ protected final DataOutputStream outputStream;
+ protected final IntArrayList offsets;
+ protected int metadataInfoSize;
+ protected byte[] offsetArray;
+ protected int offsetPosition;
+ protected int headerSize;
+ protected ATypeTag itemTypeTag;
+ protected final ATypeTag listType;
+
+ protected boolean fixedSize = false;
+ protected int numberOfItems;
+
+ public AbstractListBuilder(ATypeTag listType) {
+ this.outputStorage = new GrowableArray();
+ this.outputStream = (DataOutputStream) outputStorage.getDataOutput();
+ this.offsets = new IntArrayList(10, 10);
+ this.metadataInfoSize = 0;
+ this.offsetArray = null;
+ this.offsetPosition = 0;
+ this.listType = listType;
+ }
+
+ @Override
+ public void reset(AbstractCollectionType listType) {
+ this.outputStorage.reset();
+ this.offsetArray = null;
+ this.offsets.clear();
+ this.offsetPosition = 0;
+ this.numberOfItems = 0;
+ if (listType == null || listType.getItemType() == null) {
+ this.itemTypeTag = ATypeTag.ANY;
+ fixedSize = false;
+ } else {
+ this.itemTypeTag = listType.getItemType().getTypeTag();
+ fixedSize = NonTaggedFormatUtil.isFixedSizedCollection(listType.getItemType());
+ }
+ headerSize = 2;
+ metadataInfoSize = 8;
+ // 8 = 4 (# of items) + 4 (the size of the list)
+ }
+
+ @Override
+ public void addItem(IValueReference item) throws HyracksDataException {
+ try {
+ if (!fixedSize)
+ this.offsets.add((short) outputStorage.getLength());
+ if (itemTypeTag == ATypeTag.ANY
+ || (itemTypeTag == ATypeTag.NULL && item.getByteArray()[0] == serNullTypeTag)) {
+ this.numberOfItems++;
+ this.outputStream.write(item.getByteArray(), item.getStartOffset(), item.getLength());
+ } else if (item.getByteArray()[0] != serNullTypeTag) {
+ this.numberOfItems++;
+ this.outputStream.write(item.getByteArray(), item.getStartOffset() + 1, item.getLength() - 1);
+ }
+ } catch (IOException e) {
+ throw new HyracksDataException(e);
+ }
+ }
+
+ @Override
+ public void write(DataOutput out, boolean writeTypeTag) throws HyracksDataException {
+ try {
+ if (!fixedSize)
+ metadataInfoSize += offsets.size() * 4;
+ if (offsetArray == null || offsetArray.length < metadataInfoSize)
+ offsetArray = new byte[metadataInfoSize];
+
+ SerializerDeserializerUtil.writeIntToByteArray(offsetArray,
+ headerSize + metadataInfoSize + outputStorage.getLength(), offsetPosition);
+ SerializerDeserializerUtil.writeIntToByteArray(offsetArray, this.numberOfItems, offsetPosition + 4);
+
+ if (!fixedSize) {
+ offsetPosition += 8;
+ for (int i = 0; i < offsets.size(); i++) {
+ SerializerDeserializerUtil.writeIntToByteArray(offsetArray, offsets.get(i) + metadataInfoSize
+ + headerSize, offsetPosition);
+ offsetPosition += 4;
+ }
+ }
+ if (writeTypeTag) {
+ out.writeByte(listType.serialize());
+ }
+ out.writeByte(itemTypeTag.serialize());
+ out.write(offsetArray, 0, metadataInfoSize);
+ out.write(outputStorage.getByteArray(), 0, outputStorage.getLength());
+ } catch (IOException e) {
+ throw new HyracksDataException(e);
+ }
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IAOrderedListBuilder.java b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IAOrderedListBuilder.java
deleted file mode 100644
index 0ca40a5..0000000
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IAOrderedListBuilder.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package edu.uci.ics.asterix.builders;
-
-import java.io.DataOutput;
-
-import edu.uci.ics.asterix.om.types.AOrderedListType;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.data.std.api.IValueReference;
-
-public interface IAOrderedListBuilder {
-
- /**
- * @param orderedlistType
- * - the type of the list.
- */
- public void reset(AOrderedListType orderedlistType) throws HyracksDataException;
-
- /**
- * @param item
- * - the item to be added to the list.
- */
- public void addItem(IValueReference item) throws HyracksDataException;
-
- /**
- * @param out
- * - Stream to write data to.
- */
- public void write(DataOutput out, boolean writeTypeTag) throws HyracksDataException;
-}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IAUnorderedListBuilder.java b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IAUnorderedListBuilder.java
deleted file mode 100644
index 50d2038..0000000
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IAUnorderedListBuilder.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package edu.uci.ics.asterix.builders;
-
-import java.io.DataOutput;
-
-import edu.uci.ics.asterix.om.types.AUnorderedListType;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.data.std.api.IValueReference;
-
-public interface IAUnorderedListBuilder {
-
- /**
- * @param unorderedlistType
- * - the type of the list.
- */
- public void reset(AUnorderedListType unorderedlistType) throws HyracksDataException;
-
- /**
- * @param item
- * - the item to be added to the list.
- */
- public void addItem(IValueReference item) throws HyracksDataException;
-
- /**
- * @param out
- * - Stream to write data to.
- */
- public void write(DataOutput out, boolean writeTypeTag) throws HyracksDataException;
-
-}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IAsterixListBuilder.java b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IAsterixListBuilder.java
new file mode 100644
index 0000000..7bab046
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IAsterixListBuilder.java
@@ -0,0 +1,29 @@
+package edu.uci.ics.asterix.builders;
+
+import java.io.DataOutput;
+
+import edu.uci.ics.asterix.om.types.AbstractCollectionType;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.data.std.api.IValueReference;
+
+public interface IAsterixListBuilder {
+ /**
+ * @param listType
+ * Type of the list: AUnorderedListType or AOrderedListType.
+ */
+ public void reset(AbstractCollectionType listType) throws HyracksDataException;
+
+ /**
+ * @param item
+ * Item to be added to the list.
+ */
+ public void addItem(IValueReference item) throws HyracksDataException;
+
+ /**
+ * @param out
+ * Stream to serialize the list into.
+ * @param writeTypeTag
+ * Whether to write the list's type tag before the list data.
+ */
+ public void write(DataOutput out, boolean writeTypeTag) throws HyracksDataException;
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/OrderedListBuilder.java b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/OrderedListBuilder.java
index 18cec15..1fdd7df 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/OrderedListBuilder.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/OrderedListBuilder.java
@@ -1,100 +1,21 @@
package edu.uci.ics.asterix.builders;
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutput;
import java.io.IOException;
-import java.util.ArrayList;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.SerializerDeserializerUtil;
-import edu.uci.ics.asterix.om.types.AOrderedListType;
import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.data.std.api.IValueReference;
+import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.IToken;
-public class OrderedListBuilder implements IAOrderedListBuilder {
-
- private ByteArrayOutputStream outputStream;
- private ArrayList<Short> offsets;
- private int metadataInfoSize;
- private byte[] offsetArray;
- private int offsetPosition;
- private int headerSize;
- private ATypeTag itemTypeTag;
- private byte serNullTypeTag = ATypeTag.NULL.serialize();
- private final static byte ORDEREDLIST_TYPE_TAG = ATypeTag.ORDEREDLIST.serialize();
-
- private boolean fixedSize = false;
- private int numberOfItems;
+public class OrderedListBuilder extends AbstractListBuilder {
public OrderedListBuilder() {
- this.outputStream = new ByteArrayOutputStream();
- this.offsets = new ArrayList<Short>();
- this.metadataInfoSize = 0;
- this.offsetArray = null;
- this.offsetPosition = 0;
+ super(ATypeTag.ORDEREDLIST);
}
- @Override
- public void reset(AOrderedListType orderedlistType) throws HyracksDataException {
- this.outputStream.reset();
- this.offsetArray = null;
- this.offsets.clear();
- this.offsetPosition = 0;
- this.numberOfItems = 0;
- if (orderedlistType == null || orderedlistType.getItemType() == null) {
- this.itemTypeTag = ATypeTag.ANY;
- fixedSize = false;
- } else {
- this.itemTypeTag = orderedlistType.getItemType().getTypeTag();
- fixedSize = NonTaggedFormatUtil.isFixedSizedCollection(orderedlistType.getItemType());
+ public void addItem(IToken token) throws IOException {
+ if (!fixedSize) {
+ offsets.add((short) outputStorage.getLength());
}
- headerSize = 2;
- metadataInfoSize = 8;
- // 8 = 4 (# of items) + 4 (the size of the list)
- }
-
- @Override
- public void addItem(IValueReference item) throws HyracksDataException {
- if (!fixedSize)
- this.offsets.add((short) outputStream.size());
- if (itemTypeTag == ATypeTag.ANY) {
- this.numberOfItems++;
- this.outputStream.write(item.getByteArray(), item.getStartOffset(), item.getLength());
- } else if (item.getByteArray()[0] != serNullTypeTag) {
- this.numberOfItems++;
- this.outputStream.write(item.getByteArray(), item.getStartOffset() + 1, item.getLength() - 1);
- }
- }
-
- @Override
- public void write(DataOutput out, boolean writeTypeTag) throws HyracksDataException {
- try {
- if (!fixedSize)
- metadataInfoSize += offsets.size() * 4;
- if (offsetArray == null || offsetArray.length < metadataInfoSize)
- offsetArray = new byte[metadataInfoSize];
-
- SerializerDeserializerUtil.writeIntToByteArray(offsetArray,
- headerSize + metadataInfoSize + outputStream.size(), offsetPosition);
- SerializerDeserializerUtil.writeIntToByteArray(offsetArray, this.numberOfItems, offsetPosition + 4);
-
- if (!fixedSize) {
- offsetPosition += 8;
- for (int i = 0; i < offsets.size(); i++) {
- SerializerDeserializerUtil.writeIntToByteArray(offsetArray, offsets.get(i) + metadataInfoSize
- + headerSize, offsetPosition);
- offsetPosition += 4;
- }
- }
- if (writeTypeTag) {
- out.writeByte(ORDEREDLIST_TYPE_TAG);
- }
- out.writeByte(itemTypeTag.serialize());
- out.write(offsetArray, 0, metadataInfoSize);
- out.write(outputStream.toByteArray(), 0, outputStream.size());
- } catch (IOException e) {
- throw new HyracksDataException(e);
- }
+ numberOfItems++;
+ token.serializeToken(outputStorage);
}
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/UnorderedListBuilder.java b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/UnorderedListBuilder.java
index e8dbc29..d1c33a4 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/UnorderedListBuilder.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/UnorderedListBuilder.java
@@ -1,103 +1,10 @@
package edu.uci.ics.asterix.builders;
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.ArrayList;
-
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.SerializerDeserializerUtil;
import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.AUnorderedListType;
-import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.data.std.api.IValueReference;
-public class UnorderedListBuilder implements IAUnorderedListBuilder {
-
- /**
- *
- */
- private ByteArrayOutputStream outputStream;
- private ArrayList<Short> offsets;
- private int metadataInfoSize;
- private byte[] offsetArray;
- private int offsetPosition;
- private int headerSize;
- private ATypeTag itemTypeTag;
- private byte serNullTypeTag = ATypeTag.NULL.serialize();
- private final static byte UNORDEREDLIST_TYPE_TAG = ATypeTag.UNORDEREDLIST.serialize();
-
- private boolean fixedSize = false;
- private int numberOfItems;
+public class UnorderedListBuilder extends AbstractListBuilder {
public UnorderedListBuilder() {
- this.outputStream = new ByteArrayOutputStream();
- this.offsets = new ArrayList<Short>();
- this.metadataInfoSize = 0;
- this.offsetArray = null;
- this.offsetPosition = 0;
- }
-
- @Override
- public void reset(AUnorderedListType unorderedlistType) throws HyracksDataException {
- this.outputStream.reset();
- this.offsetArray = null;
- this.offsets.clear();
- this.offsetPosition = 0;
- this.numberOfItems = 0;
- if (unorderedlistType == null || unorderedlistType.getItemType() == null) {
- this.itemTypeTag = ATypeTag.ANY;
- fixedSize = false;
- } else {
- this.itemTypeTag = unorderedlistType.getItemType().getTypeTag();
- fixedSize = NonTaggedFormatUtil.isFixedSizedCollection(unorderedlistType.getItemType());
- }
- headerSize = 2;
- metadataInfoSize = 8;
- // 8 = 4 (# of items) + 4 (the size of the list)
- }
-
- @Override
- public void addItem(IValueReference item) throws HyracksDataException {
- if (!fixedSize)
- this.offsets.add((short) outputStream.size());
- if (itemTypeTag == ATypeTag.ANY) {
- this.numberOfItems++;
- this.outputStream.write(item.getByteArray(), item.getStartOffset(), item.getLength());
- } else if (item.getByteArray()[0] != serNullTypeTag) {
- this.numberOfItems++;
- this.outputStream.write(item.getByteArray(), item.getStartOffset() + 1, item.getLength() - 1);
- }
- }
-
- @Override
- public void write(DataOutput out, boolean writeTypeTag) throws HyracksDataException {
- try {
- if (!fixedSize)
- metadataInfoSize += offsets.size() * 4;
- if (offsetArray == null || offsetArray.length < metadataInfoSize)
- offsetArray = new byte[metadataInfoSize];
-
- SerializerDeserializerUtil.writeIntToByteArray(offsetArray,
- headerSize + metadataInfoSize + outputStream.size(), offsetPosition);
- SerializerDeserializerUtil.writeIntToByteArray(offsetArray, this.numberOfItems, offsetPosition + 4);
-
- if (!fixedSize) {
- offsetPosition += 8;
- for (int i = 0; i < offsets.size(); i++) {
- SerializerDeserializerUtil.writeIntToByteArray(offsetArray, offsets.get(i) + metadataInfoSize
- + headerSize, offsetPosition);
- offsetPosition += 4;
- }
- }
- if (writeTypeTag) {
- out.writeByte(UNORDEREDLIST_TYPE_TAG);
- }
- out.writeByte(itemTypeTag.serialize());
- out.write(offsetArray, 0, metadataInfoSize);
- out.write(outputStream.toByteArray(), 0, outputStream.size());
- } catch (IOException e) {
- throw new HyracksDataException(e);
- }
+ super(ATypeTag.UNORDEREDLIST);
}
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/common/AListElementToken.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/common/AListElementToken.java
index cb6838e..df3b43e 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/common/AListElementToken.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/common/AListElementToken.java
@@ -1,8 +1,8 @@
package edu.uci.ics.asterix.dataflow.data.common;
-import java.io.DataOutput;
import java.io.IOException;
+import edu.uci.ics.hyracks.data.std.util.GrowableArray;
import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.IToken;
public class AListElementToken implements IToken {
@@ -44,14 +44,13 @@
}
@Override
- public void serializeToken(DataOutput dos) throws IOException {
- dos.writeByte(typeTag);
- dos.write(data, start, length);
+ public void serializeToken(GrowableArray out) throws IOException {
+ out.getDataOutput().writeByte(typeTag);
+ out.getDataOutput().write(data, start, length);
}
@Override
- public void serializeTokenCount(DataOutput dos) throws IOException {
+ public void serializeTokenCount(GrowableArray out) throws IOException {
throw new UnsupportedOperationException("Token count not implemented.");
}
-
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ABooleanPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ABooleanPrinter.java
index 60ee1fe..33866df 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ABooleanPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ABooleanPrinter.java
@@ -8,7 +8,6 @@
public class ABooleanPrinter implements IPrinter {
- private static final long serialVersionUID = 1L;
public static final ABooleanPrinter INSTANCE = new ABooleanPrinter();
@Override
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ACirclePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ACirclePrinter.java
index 812d93b..e2da96e 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ACirclePrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ACirclePrinter.java
@@ -8,7 +8,6 @@
public class ACirclePrinter implements IPrinter {
- private static final long serialVersionUID = 1L;
public static final ACirclePrinter INSTANCE = new ACirclePrinter();
@Override
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADatePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADatePrinter.java
index 24aa144..918e286 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADatePrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADatePrinter.java
@@ -9,11 +9,10 @@
public class ADatePrinter implements IPrinter {
- private static final long serialVersionUID = 1L;
private static long CHRONON_OF_DAY = 24 * 60 * 60 * 1000;
public static final ADatePrinter INSTANCE = new ADatePrinter();
private static final GregorianCalendarSystem gCalInstance = GregorianCalendarSystem.getInstance();
-
+
@Override
public void init() {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADateTimePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADateTimePrinter.java
index d856a20..96df767 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADateTimePrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADateTimePrinter.java
@@ -9,7 +9,6 @@
public class ADateTimePrinter implements IPrinter {
- private static final long serialVersionUID = 1L;
public static final ADateTimePrinter INSTANCE = new ADateTimePrinter();
private static final GregorianCalendarSystem gCalInstance = GregorianCalendarSystem.getInstance();
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADoublePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADoublePrinter.java
index 3a255c6..ae50d0e 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADoublePrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADoublePrinter.java
@@ -8,7 +8,6 @@
public class ADoublePrinter implements IPrinter {
- private static final long serialVersionUID = 1L;
public static final ADoublePrinter INSTANCE = new ADoublePrinter();
@Override
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AFloatPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AFloatPrinter.java
index 27d2e2c..96c9ee9 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AFloatPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AFloatPrinter.java
@@ -8,7 +8,6 @@
public class AFloatPrinter implements IPrinter {
- private static final long serialVersionUID = 1L;
public static final AFloatPrinter INSTANCE = new AFloatPrinter();
@Override
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt16Printer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt16Printer.java
index 8961013..1687fb1 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt16Printer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt16Printer.java
@@ -13,8 +13,6 @@
public class AInt16Printer implements IPrinter {
- private static final long serialVersionUID = 1L;
-
private static final String SUFFIX_STRING = "i16";
private static byte[] _suffix;
private static int _suffix_count;
@@ -23,6 +21,7 @@
DataOutput dout = new DataOutputStream(interm);
try {
dout.writeUTF(SUFFIX_STRING);
+ interm.close();
} catch (IOException e) {
e.printStackTrace();
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt32Printer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt32Printer.java
index a5c3245..b20db34 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt32Printer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt32Printer.java
@@ -10,7 +10,6 @@
public class AInt32Printer implements IPrinter {
- private static final long serialVersionUID = 1L;
public static final AInt32Printer INSTANCE = new AInt32Printer();
@Override
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt64Printer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt64Printer.java
index 318828e..312802a 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt64Printer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt64Printer.java
@@ -13,8 +13,6 @@
public class AInt64Printer implements IPrinter {
- private static final long serialVersionUID = 1L;
-
private static final String SUFFIX_STRING = "i64";
private static byte[] _suffix;
private static int _suffix_count;
@@ -23,6 +21,7 @@
DataOutput dout = new DataOutputStream(interm);
try {
dout.writeUTF(SUFFIX_STRING);
+ interm.close();
} catch (IOException e) {
e.printStackTrace();
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt8Printer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt8Printer.java
index bd4139d..a5a421d 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt8Printer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt8Printer.java
@@ -13,8 +13,6 @@
public class AInt8Printer implements IPrinter {
- private static final long serialVersionUID = 1L;
-
private static final String SUFFIX_STRING = "i8";
private static byte[] _suffix;
private static int _suffix_count;
@@ -23,6 +21,7 @@
DataOutput dout = new DataOutputStream(interm);
try {
dout.writeUTF(SUFFIX_STRING);
+ interm.close();
} catch (IOException e) {
e.printStackTrace();
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ALinePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ALinePrinter.java
index f99727a..40f405c 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ALinePrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ALinePrinter.java
@@ -8,7 +8,6 @@
public class ALinePrinter implements IPrinter {
- private static final long serialVersionUID = 1L;
public static final ALinePrinter INSTANCE = new ALinePrinter();
@Override
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ANullPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ANullPrinter.java
index 6abc0e1..daea967 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ANullPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ANullPrinter.java
@@ -5,11 +5,8 @@
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
-
-
public class ANullPrinter implements IPrinter {
- private static final long serialVersionUID = 1L;
public static final ANullPrinter INSTANCE = new ANullPrinter();
@Override
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AObjectPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AObjectPrinter.java
index 258653c..478ad2c 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AObjectPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AObjectPrinter.java
@@ -10,7 +10,6 @@
public class AObjectPrinter implements IPrinter {
- private static final long serialVersionUID = 1L;
public static final AObjectPrinter INSTANCE = new AObjectPrinter();
private IPrinter recordPrinter = new ARecordPrinterFactory(null).createPrinter();
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AOrderedlistPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AOrderedlistPrinterFactory.java
index 9edb640..7d04ebc 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AOrderedlistPrinterFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AOrderedlistPrinterFactory.java
@@ -2,22 +2,21 @@
import java.io.PrintStream;
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
-import edu.uci.ics.asterix.formats.nontagged.AqlPrinterFactoryProvider;
+import edu.uci.ics.asterix.om.pointables.PointableAllocator;
+import edu.uci.ics.asterix.om.pointables.base.DefaultOpenFieldType;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.printer.APrintVisitor;
import edu.uci.ics.asterix.om.types.AOrderedListType;
import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
public class AOrderedlistPrinterFactory implements IPrinterFactory {
private static final long serialVersionUID = 1L;
-
private AOrderedListType orderedlistType;
public AOrderedlistPrinterFactory(AOrderedListType orderedlistType) {
@@ -27,81 +26,29 @@
@Override
public IPrinter createPrinter() {
+ PointableAllocator allocator = new PointableAllocator();
+ final IAType inputType = orderedlistType == null ? DefaultOpenFieldType
+ .getDefaultOpenFieldType(ATypeTag.ORDEREDLIST) : orderedlistType;
+ final IVisitablePointable listAccessor = allocator.allocateListValue(inputType);
+ final APrintVisitor printVisitor = new APrintVisitor();
+ final Pair<PrintStream, ATypeTag> arg = new Pair<PrintStream, ATypeTag>(null, null);
+
return new IPrinter() {
- private IPrinter itemPrinter;
- private IAType itemType;
- private ATypeTag itemTag;
- private boolean typedItemList = false;
-
- // private int itemLength;
- // private int numberOfitems;
- // private int itemOffset;
-
@Override
public void init() throws AlgebricksException {
-
- if (orderedlistType != null && orderedlistType.getItemType() != null) {
- itemType = orderedlistType.getItemType();
- if (itemType.getTypeTag() == ATypeTag.ANY) {
- this.typedItemList = false;
- this.itemPrinter = AObjectPrinterFactory.INSTANCE.createPrinter();
- } else {
- this.typedItemList = true;
- itemPrinter = AqlPrinterFactoryProvider.INSTANCE.getPrinterFactory(itemType).createPrinter();
- itemTag = orderedlistType.getItemType().getTypeTag();
- }
- } else {
- this.typedItemList = false;
- this.itemPrinter = AObjectPrinterFactory.INSTANCE.createPrinter();
- }
- itemPrinter.init();
-
+ arg.second = inputType.getTypeTag();
}
@Override
- public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
- ps.print("[ ");
- int numberOfitems = AInt32SerializerDeserializer.getInt(b, s + 6);
- int itemOffset;
- if (typedItemList) {
- switch (itemTag) {
- case STRING:
- case RECORD:
- case ORDEREDLIST:
- case UNORDEREDLIST:
- case ANY:
- itemOffset = s + 10 + (numberOfitems * 4);
- break;
- default:
- itemOffset = s + 10;
- }
- } else
- itemOffset = s + 10 + (numberOfitems * 4);
- int itemLength = 0;
+ public void print(byte[] b, int start, int l, PrintStream ps) throws AlgebricksException {
try {
- if (typedItemList) {
- for (int i = 0; i < numberOfitems; i++) {
- itemLength = NonTaggedFormatUtil.getFieldValueLength(b, itemOffset, itemTag, false);
- itemPrinter.print(b, itemOffset - 1, itemLength, ps);
- itemOffset += itemLength;
- if (i + 1 < numberOfitems)
- ps.print(", ");
- }
- } else {
- for (int i = 0; i < numberOfitems; i++) {
- itemTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(b[itemOffset]);
- itemLength = NonTaggedFormatUtil.getFieldValueLength(b, itemOffset, itemTag, true) + 1;
- itemPrinter.print(b, itemOffset, itemLength, ps);
- itemOffset += itemLength;
- if (i + 1 < numberOfitems)
- ps.print(", ");
- }
- }
- } catch (AsterixException e) {
- throw new AlgebricksException(e);
+ listAccessor.set(b, start, l);
+ arg.first = ps;
+ listAccessor.accept(printVisitor, arg);
+ } catch (Exception ioe) {
+ throw new AlgebricksException(ioe);
}
- ps.print(" ]");
}
};
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/APoint3DPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/APoint3DPrinter.java
index 699cb77..7394dc5 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/APoint3DPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/APoint3DPrinter.java
@@ -8,7 +8,6 @@
public class APoint3DPrinter implements IPrinter {
- private static final long serialVersionUID = 1L;
public static final APoint3DPrinter INSTANCE = new APoint3DPrinter();
@Override
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/APointPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/APointPrinter.java
index 50fbb0b..7c50905 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/APointPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/APointPrinter.java
@@ -8,7 +8,6 @@
public class APointPrinter implements IPrinter {
- private static final long serialVersionUID = 1L;
public static final APointPrinter INSTANCE = new APointPrinter();
@Override
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/APolygonPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/APolygonPrinter.java
index 794dae7..bc1e553 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/APolygonPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/APolygonPrinter.java
@@ -9,7 +9,6 @@
public class APolygonPrinter implements IPrinter {
- private static final long serialVersionUID = 1L;
public static final APolygonPrinter INSTANCE = new APolygonPrinter();
@Override
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ARecordPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ARecordPrinterFactory.java
index fafe320..e4b2676 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ARecordPrinterFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ARecordPrinterFactory.java
@@ -2,23 +2,21 @@
import java.io.PrintStream;
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
-import edu.uci.ics.asterix.formats.nontagged.AqlPrinterFactoryProvider;
+import edu.uci.ics.asterix.om.pointables.PointableAllocator;
+import edu.uci.ics.asterix.om.pointables.base.DefaultOpenFieldType;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.printer.APrintVisitor;
import edu.uci.ics.asterix.om.types.ARecordType;
import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.AUnionType;
-import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
public class ARecordPrinterFactory implements IPrinterFactory {
private static final long serialVersionUID = 1L;
-
private final ARecordType recType;
public ARecordPrinterFactory(ARecordType recType) {
@@ -28,137 +26,29 @@
@Override
public IPrinter createPrinter() {
- return new IPrinter() {
+ PointableAllocator allocator = new PointableAllocator();
+ final IAType inputType = recType == null ? DefaultOpenFieldType.getDefaultOpenFieldType(ATypeTag.RECORD)
+ : recType;
+ final IVisitablePointable recAccessor = allocator.allocateRecordValue(inputType);
+ final APrintVisitor printVisitor = new APrintVisitor();
+ final Pair<PrintStream, ATypeTag> arg = new Pair<PrintStream, ATypeTag>(null, null);
- private IPrinter[] fieldPrinters;
- private IAType[] fieldTypes;
- private int[] fieldOffsets;
- private int numberOfSchemaFields, numberOfOpenFields, openPartOffset, fieldOffset, offsetArrayOffset,
- fieldValueLength, nullBitMapOffset, recordOffset;
- private boolean isExpanded, hasNullableFields;
- private ATypeTag tag;
+ return new IPrinter() {
@Override
public void init() throws AlgebricksException {
-
- numberOfSchemaFields = 0;
- if (recType != null) {
- numberOfSchemaFields = recType.getFieldNames().length;
- fieldPrinters = new IPrinter[numberOfSchemaFields];
- fieldTypes = new IAType[numberOfSchemaFields];
- fieldOffsets = new int[numberOfSchemaFields];
- for (int i = 0; i < numberOfSchemaFields; i++) {
- fieldTypes[i] = recType.getFieldTypes()[i];
- if (fieldTypes[i].getTypeTag() == ATypeTag.UNION
- && NonTaggedFormatUtil.isOptionalField((AUnionType) fieldTypes[i]))
- fieldPrinters[i] = (AqlPrinterFactoryProvider.INSTANCE
- .getPrinterFactory(((AUnionType) fieldTypes[i]).getUnionList().get(
- NonTaggedFormatUtil.OPTIONAL_TYPE_INDEX_IN_UNION_LIST))).createPrinter();
- else
- fieldPrinters[i] = (AqlPrinterFactoryProvider.INSTANCE.getPrinterFactory(fieldTypes[i]))
- .createPrinter();
- fieldPrinters[i].init();
- }
- }
+ arg.second = inputType.getTypeTag();
}
@Override
public void print(byte[] b, int start, int l, PrintStream ps) throws AlgebricksException {
- ps.print("{ ");
- isExpanded = false;
- openPartOffset = 0;
- int s = start;
- recordOffset = s;
- if (recType == null) {
- openPartOffset = s + AInt32SerializerDeserializer.getInt(b, s + 6);
- s += 8;
- isExpanded = true;
- } else {
- if (recType.isOpen()) {
- isExpanded = b[s + 5] == 1 ? true : false;
- if (isExpanded) {
- openPartOffset = s + AInt32SerializerDeserializer.getInt(b, s + 6);
- s += 10;
- } else
- s += 6;
- } else
- s += 5;
- }
try {
- if (numberOfSchemaFields > 0) {
- s += 4;
- nullBitMapOffset = 0;
- hasNullableFields = NonTaggedFormatUtil.hasNullableField(recType);
- if (hasNullableFields) {
- nullBitMapOffset = s;
- offsetArrayOffset = s
- + (this.numberOfSchemaFields % 8 == 0 ? numberOfSchemaFields / 8
- : numberOfSchemaFields / 8 + 1);
- } else {
- offsetArrayOffset = s;
- }
- for (int i = 0; i < numberOfSchemaFields; i++) {
- fieldOffsets[i] = AInt32SerializerDeserializer.getInt(b, offsetArrayOffset) + recordOffset;
- offsetArrayOffset += 4;
- }
- for (int fieldNumber = 0; fieldNumber < numberOfSchemaFields; fieldNumber++) {
- if (fieldNumber != 0) {
- ps.print(", ");
- }
- ps.print("\"");
- ps.print(recType.getFieldNames()[fieldNumber]);
- ps.print("\": ");
- if (hasNullableFields) {
- byte b1 = b[nullBitMapOffset + fieldNumber / 8];
- int p = 1 << (7 - (fieldNumber % 8));
- if ((b1 & p) == 0) {
- ps.print("null");
- continue;
- }
- }
- if (fieldTypes[fieldNumber].getTypeTag() == ATypeTag.UNION) {
- if (NonTaggedFormatUtil.isOptionalField((AUnionType) fieldTypes[fieldNumber])) {
- tag = ((AUnionType) fieldTypes[fieldNumber]).getUnionList()
- .get(NonTaggedFormatUtil.OPTIONAL_TYPE_INDEX_IN_UNION_LIST).getTypeTag();
- fieldValueLength = NonTaggedFormatUtil.getFieldValueLength(b,
- fieldOffsets[fieldNumber], tag, false);
- fieldPrinters[fieldNumber].print(b, fieldOffsets[fieldNumber] - 1,
- fieldValueLength, ps);
- }
- } else {
- tag = fieldTypes[fieldNumber].getTypeTag();
- fieldValueLength = NonTaggedFormatUtil.getFieldValueLength(b,
- fieldOffsets[fieldNumber], tag, false);
- fieldPrinters[fieldNumber]
- .print(b, fieldOffsets[fieldNumber] - 1, fieldValueLength, ps);
- }
- }
- if (isExpanded)
- ps.print(", ");
- }
- if (isExpanded) {
- numberOfOpenFields = AInt32SerializerDeserializer.getInt(b, openPartOffset);
- fieldOffset = openPartOffset + 4 + (8 * numberOfOpenFields);
- for (int i = 0; i < numberOfOpenFields; i++) {
- // we print the field name
- fieldValueLength = NonTaggedFormatUtil.getFieldValueLength(b, fieldOffset, ATypeTag.STRING,
- false);
- AStringPrinter.INSTANCE.print(b, fieldOffset - 1, fieldValueLength, ps);
- fieldOffset += fieldValueLength;
- ps.print(": ");
- // now we print the value
- tag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(b[fieldOffset]);
- fieldValueLength = NonTaggedFormatUtil.getFieldValueLength(b, fieldOffset, tag, true) + 1;
- AObjectPrinter.INSTANCE.print(b, fieldOffset, fieldValueLength, ps);
- fieldOffset += fieldValueLength;
- if (i + 1 < numberOfOpenFields)
- ps.print(", ");
- }
- }
- } catch (AsterixException e) {
- throw new AlgebricksException(e);
+ recAccessor.set(b, start, l);
+ arg.first = ps;
+ recAccessor.accept(printVisitor, arg);
+ } catch (Exception ioe) {
+ throw new AlgebricksException(ioe);
}
- ps.print(" }");
}
};
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ARectanglePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ARectanglePrinter.java
index 17caa53..0618f28 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ARectanglePrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ARectanglePrinter.java
@@ -8,7 +8,6 @@
public class ARectanglePrinter implements IPrinter {
- private static final long serialVersionUID = 1L;
public static final ARectanglePrinter INSTANCE = new ARectanglePrinter();
@Override
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AStringPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AStringPrinter.java
index 6f5b629..d491777 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AStringPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AStringPrinter.java
@@ -9,7 +9,6 @@
public class AStringPrinter implements IPrinter {
- private static final long serialVersionUID = 1L;
public static final AStringPrinter INSTANCE = new AStringPrinter();
@Override
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ATimePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ATimePrinter.java
index 72a6e37..b77ee64 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ATimePrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ATimePrinter.java
@@ -9,10 +9,9 @@
public class ATimePrinter implements IPrinter {
- private static final long serialVersionUID = 1L;
public static final ATimePrinter INSTANCE = new ATimePrinter();
private static final GregorianCalendarSystem gCalInstance = GregorianCalendarSystem.getInstance();
-
+
@Override
public void init() {
@@ -21,7 +20,7 @@
@Override
public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
int time = AInt32SerializerDeserializer.getInt(b, s + 1);
-
+
ps.print("time(\"");
ps.append(String.format("%02d", gCalInstance.getHourOfDay(time))).append(":")
.append(String.format("%02d", gCalInstance.getMinOfHour(time))).append(":")
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AUnorderedlistPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AUnorderedlistPrinterFactory.java
index 59af365..f779919 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AUnorderedlistPrinterFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AUnorderedlistPrinterFactory.java
@@ -2,22 +2,21 @@
import java.io.PrintStream;
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
-import edu.uci.ics.asterix.formats.nontagged.AqlPrinterFactoryProvider;
+import edu.uci.ics.asterix.om.pointables.PointableAllocator;
+import edu.uci.ics.asterix.om.pointables.base.DefaultOpenFieldType;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.printer.APrintVisitor;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.AUnorderedListType;
-import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
public class AUnorderedlistPrinterFactory implements IPrinterFactory {
private static final long serialVersionUID = 1L;
-
private AUnorderedListType unorderedlistType;
public AUnorderedlistPrinterFactory(AUnorderedListType unorderedlistType) {
@@ -27,77 +26,29 @@
@Override
public IPrinter createPrinter() {
- return new IPrinter() {
+ PointableAllocator allocator = new PointableAllocator();
+ final IAType inputType = unorderedlistType == null ? DefaultOpenFieldType
+ .getDefaultOpenFieldType(ATypeTag.UNORDEREDLIST) : unorderedlistType;
+ final IVisitablePointable listAccessor = allocator.allocateListValue(inputType);
+ final APrintVisitor printVisitor = new APrintVisitor();
+ final Pair<PrintStream, ATypeTag> arg = new Pair<PrintStream, ATypeTag>(null, null);
- private IPrinter itemPrinter;
- private IAType itemType;
- private ATypeTag itemTag;
- private boolean typedItemList = false;
+ return new IPrinter() {
@Override
public void init() throws AlgebricksException {
-
- if (unorderedlistType != null && unorderedlistType.getItemType() != null) {
- itemType = unorderedlistType.getItemType();
- if (itemType.getTypeTag() == ATypeTag.ANY) {
- this.typedItemList = false;
- this.itemPrinter = AObjectPrinterFactory.INSTANCE.createPrinter();
- } else {
- this.typedItemList = true;
- itemPrinter = AqlPrinterFactoryProvider.INSTANCE.getPrinterFactory(itemType).createPrinter();
- itemTag = unorderedlistType.getItemType().getTypeTag();
- }
- } else {
- this.typedItemList = false;
- this.itemPrinter = AObjectPrinterFactory.INSTANCE.createPrinter();
- }
- itemPrinter.init();
+ arg.second = inputType.getTypeTag();
}
@Override
- public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
- ps.print("{{ ");
- int numberOfitems = AInt32SerializerDeserializer.getInt(b, s + 6);
- int itemOffset;
- if (typedItemList) {
- switch (itemTag) {
- case STRING:
- case RECORD:
- case ORDEREDLIST:
- case UNORDEREDLIST:
- case ANY:
- itemOffset = s + 10 + (numberOfitems * 4);
- break;
- default:
- itemOffset = s + 10;
- }
- } else
- itemOffset = s + 10 + (numberOfitems * 4);
- int itemLength;
-
+ public void print(byte[] b, int start, int l, PrintStream ps) throws AlgebricksException {
try {
- if (typedItemList) {
- for (int i = 0; i < numberOfitems; i++) {
- itemLength = NonTaggedFormatUtil.getFieldValueLength(b, itemOffset, itemTag, false);
- itemPrinter.print(b, itemOffset - 1, itemLength, ps);
- itemOffset += itemLength;
- if (i + 1 < numberOfitems)
- ps.print(", ");
- }
- } else {
- for (int i = 0; i < numberOfitems; i++) {
- itemTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(b[itemOffset]);
- itemLength = NonTaggedFormatUtil.getFieldValueLength(b, itemOffset, itemTag, true) + 1;
- itemPrinter.print(b, itemOffset, itemLength, ps);
- itemOffset += itemLength;
- if (i + 1 < numberOfitems)
- ps.print(", ");
- }
- }
- } catch (AsterixException e) {
- throw new AlgebricksException(e);
+ listAccessor.set(b, start, l);
+ arg.first = ps;
+ listAccessor.accept(printVisitor, arg);
+ } catch (Exception ioe) {
+ throw new AlgebricksException(ioe);
}
- ps.print(" }}");
}
};
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AOrderedListSerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AOrderedListSerializerDeserializer.java
index c68f82a..4d115d7 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AOrderedListSerializerDeserializer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AOrderedListSerializerDeserializer.java
@@ -5,7 +5,6 @@
import java.io.IOException;
import java.util.ArrayList;
-import edu.uci.ics.asterix.builders.IAOrderedListBuilder;
import edu.uci.ics.asterix.builders.OrderedListBuilder;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
@@ -26,9 +25,9 @@
public static final AOrderedListSerializerDeserializer SCHEMALESS_INSTANCE = new AOrderedListSerializerDeserializer();
private IAType itemType;
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
private ISerializerDeserializer serializer;
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
private ISerializerDeserializer deserializer;
private AOrderedListType orderedlistType;
@@ -91,7 +90,7 @@
@Override
public void serialize(AOrderedList instance, DataOutput out) throws HyracksDataException {
// TODO: schemaless ordered list serializer
- IAOrderedListBuilder listBuilder = new OrderedListBuilder();
+ OrderedListBuilder listBuilder = new OrderedListBuilder();
listBuilder.reset(orderedlistType);
ArrayBackedValueStorage itemValue = new ArrayBackedValueStorage();
for (int i = 0; i < instance.size(); i++) {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ARectangleSerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ARectangleSerializerDeserializer.java
index f285a08..c926da4 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ARectangleSerializerDeserializer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ARectangleSerializerDeserializer.java
@@ -86,11 +86,14 @@
Double.parseDouble(points[0].split(",")[1]));
aRectanglePoint2.setValue(Double.parseDouble(points[1].split(",")[0]),
Double.parseDouble(points[1].split(",")[1]));
- if (aRectanglePoint1.getX() > aRectanglePoint2.getX() || aRectanglePoint1.getY() > aRectanglePoint2.getY()) {
+ if (aRectanglePoint1.getX() > aRectanglePoint2.getX() && aRectanglePoint1.getY() > aRectanglePoint2.getY()) {
+ aRectangle.setValue(aRectanglePoint2, aRectanglePoint1);
+ } else if (aRectanglePoint1.getX() < aRectanglePoint2.getX() && aRectanglePoint1.getY() < aRectanglePoint2.getY()) {
+ aRectangle.setValue(aRectanglePoint1, aRectanglePoint2);
+ } else {
throw new IllegalArgumentException(
- "The low point in the rectangle cannot be larger than the high point");
+ "Rectangle arugment must be either (bottom left point, top right point) or (top right point, bottom left point)");
}
- aRectangle.setValue(aRectanglePoint1, aRectanglePoint2);
rectangleSerde.serialize(aRectangle, out);
} catch (HyracksDataException e) {
throw new HyracksDataException(rectangle + " can not be an instance of rectangle");
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AUnorderedListSerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AUnorderedListSerializerDeserializer.java
index f295900..f85188f 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AUnorderedListSerializerDeserializer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AUnorderedListSerializerDeserializer.java
@@ -5,7 +5,6 @@
import java.io.IOException;
import java.util.ArrayList;
-import edu.uci.ics.asterix.builders.IAUnorderedListBuilder;
import edu.uci.ics.asterix.builders.UnorderedListBuilder;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
@@ -91,7 +90,7 @@
@Override
public void serialize(AUnorderedList instance, DataOutput out) throws HyracksDataException {
// TODO: schemaless ordered list serializer
- IAUnorderedListBuilder listBuilder = new UnorderedListBuilder();
+ UnorderedListBuilder listBuilder = new UnorderedListBuilder();
ArrayBackedValueStorage itemValue = new ArrayBackedValueStorage();
listBuilder.reset(unorderedlistType);
IACursor cursor = instance.getCursor();
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
index ede7b99..d2945a7 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
@@ -2,10 +2,11 @@
import java.io.Serializable;
+import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.ADateOrTimeAscBinaryComparatorFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.ADateTimeAscBinaryComparatorFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.AObjectAscBinaryComparatorFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.AObjectDescBinaryComparatorFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.BooleanBinaryComparatorFactory;
-import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.LongBinaryComparatorFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.RectangleBinaryComparatorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.IAType;
@@ -14,17 +15,26 @@
import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory;
import edu.uci.ics.hyracks.data.std.accessors.PointableBinaryComparatorFactory;
+import edu.uci.ics.hyracks.data.std.primitive.BytePointable;
import edu.uci.ics.hyracks.data.std.primitive.DoublePointable;
import edu.uci.ics.hyracks.data.std.primitive.FloatPointable;
import edu.uci.ics.hyracks.data.std.primitive.IntegerPointable;
+import edu.uci.ics.hyracks.data.std.primitive.LongPointable;
+import edu.uci.ics.hyracks.data.std.primitive.ShortPointable;
import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
public class AqlBinaryComparatorFactoryProvider implements IBinaryComparatorFactoryProvider, Serializable {
private static final long serialVersionUID = 1L;
public static final AqlBinaryComparatorFactoryProvider INSTANCE = new AqlBinaryComparatorFactoryProvider();
+ public static final PointableBinaryComparatorFactory BYTE_POINTABLE_INSTANCE = new PointableBinaryComparatorFactory(
+ BytePointable.FACTORY);
+ public static final PointableBinaryComparatorFactory SHORT_POINTABLE_INSTANCE = new PointableBinaryComparatorFactory(
+ ShortPointable.FACTORY);
public static final PointableBinaryComparatorFactory INTEGER_POINTABLE_INSTANCE = new PointableBinaryComparatorFactory(
IntegerPointable.FACTORY);
+ public static final PointableBinaryComparatorFactory LONG_POINTABLE_INSTANCE = new PointableBinaryComparatorFactory(
+ LongPointable.FACTORY);
public static final PointableBinaryComparatorFactory FLOAT_POINTABLE_INSTANCE = new PointableBinaryComparatorFactory(
FloatPointable.FACTORY);
public static final PointableBinaryComparatorFactory DOUBLE_POINTABLE_INSTANCE = new PointableBinaryComparatorFactory(
@@ -57,7 +67,11 @@
return anyBinaryComparatorFactory(ascending);
}
IAType aqlType = (IAType) type;
- switch (aqlType.getTypeTag()) {
+ return getBinaryComparatorFactory(aqlType.getTypeTag(), ascending);
+ }
+
+ public IBinaryComparatorFactory getBinaryComparatorFactory(ATypeTag type, boolean ascending) {
+ switch (type) {
case ANY:
case UNION: { // we could do smth better for nullable fields
return anyBinaryComparatorFactory(ascending);
@@ -82,11 +96,17 @@
case BOOLEAN: {
return addOffset(BooleanBinaryComparatorFactory.INSTANCE, ascending);
}
+ case INT8: {
+ return addOffset(BYTE_POINTABLE_INSTANCE, ascending);
+ }
+ case INT16: {
+ return addOffset(SHORT_POINTABLE_INSTANCE, ascending);
+ }
case INT32: {
return addOffset(INTEGER_POINTABLE_INSTANCE, ascending);
}
case INT64: {
- return addOffset(LongBinaryComparatorFactory.INSTANCE, ascending);
+ return addOffset(LONG_POINTABLE_INSTANCE, ascending);
}
case FLOAT: {
return addOffset(FLOAT_POINTABLE_INSTANCE, ascending);
@@ -100,9 +120,15 @@
case RECTANGLE: {
return addOffset(RectangleBinaryComparatorFactory.INSTANCE, ascending);
}
+ case DATE:
+ case TIME: {
+ return addOffset(ADateOrTimeAscBinaryComparatorFactory.INSTANCE, ascending);
+ }
+ case DATETIME: {
+ return addOffset(ADateTimeAscBinaryComparatorFactory.INSTANCE, ascending);
+ }
default: {
- throw new NotImplementedException("No binary comparator factory implemented for type "
- + aqlType.getTypeTag() + " .");
+ throw new NotImplementedException("No binary comparator factory implemented for type " + type + " .");
}
}
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryTokenizerFactoryProvider.java b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryTokenizerFactoryProvider.java
index 859b0f2..9dfe7df 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryTokenizerFactoryProvider.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryTokenizerFactoryProvider.java
@@ -1,9 +1,9 @@
package edu.uci.ics.asterix.formats.nontagged;
-import edu.uci.ics.asterix.dataflow.data.common.IBinaryTokenizerFactoryProvider;
import edu.uci.ics.asterix.dataflow.data.common.AListElementTokenFactory;
import edu.uci.ics.asterix.dataflow.data.common.AOrderedListBinaryTokenizerFactory;
import edu.uci.ics.asterix.dataflow.data.common.AUnorderedListBinaryTokenizerFactory;
+import edu.uci.ics.asterix.dataflow.data.common.IBinaryTokenizerFactoryProvider;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.DelimitedUTF8StringBinaryTokenizerFactory;
import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.HashedUTF8WordTokenFactory;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlSerializerDeserializerProvider.java b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlSerializerDeserializerProvider.java
index 1f51d22..29e33fd 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlSerializerDeserializerProvider.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlSerializerDeserializerProvider.java
@@ -49,7 +49,7 @@
private AqlSerializerDeserializerProvider() {
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
@Override
public ISerializerDeserializer getSerializerDeserializer(Object typeInfo) {
IAType aqlType = (IAType) typeInfo;
@@ -64,7 +64,7 @@
}
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
public ISerializerDeserializer getNonTaggedSerializerDeserializer(IAType aqlType) {
switch (aqlType.getTypeTag()) {
case CIRCLE: {
@@ -143,7 +143,7 @@
}
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
private ISerializerDeserializer addTag(final ISerializerDeserializer nonTaggedSerde, final ATypeTag typeTag) {
return new ISerializerDeserializer<IAObject>() {
@@ -152,6 +152,7 @@
@Override
public IAObject deserialize(DataInput in) throws HyracksDataException {
try {
+ //deserialize the tag to move the input cursor forward
SerializerDeserializerUtil.deserializeTag(in);
} catch (IOException e) {
throw new HyracksDataException(e);
@@ -159,6 +160,7 @@
return (IAObject) nonTaggedSerde.deserialize(in);
}
+ @SuppressWarnings("unchecked")
@Override
public void serialize(IAObject instance, DataOutput out) throws HyracksDataException {
SerializerDeserializerUtil.serializeTag(instance, out);
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AbstractFunctionDescriptor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AbstractFunctionDescriptor.java
new file mode 100644
index 0000000..919d8c9
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AbstractFunctionDescriptor.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.om.functions;
+
+import edu.uci.ics.asterix.common.functions.FunctionDescriptorTag;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunctionFactory;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyRunningAggregateFunctionFactory;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopySerializableAggregateFunctionFactory;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyUnnestingFunctionFactory;
+
+public abstract class AbstractFunctionDescriptor implements IFunctionDescriptor {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public abstract FunctionIdentifier getIdentifier();
+
+ @Override
+ public abstract FunctionDescriptorTag getFunctionDescriptorTag();
+
+ @Override
+ public ICopyEvaluatorFactory createEvaluatorFactory(ICopyEvaluatorFactory[] args) throws AlgebricksException {
+ throw new NotImplementedException("Not Implemented");
+ }
+
+ @Override
+ public ICopyRunningAggregateFunctionFactory createRunningAggregateFunctionFactory(ICopyEvaluatorFactory[] args)
+ throws AlgebricksException {
+ throw new NotImplementedException("Not Implemented");
+ }
+
+ @Override
+ public ICopySerializableAggregateFunctionFactory createSerializableAggregateFunctionFactory(
+ ICopyEvaluatorFactory[] args) throws AlgebricksException {
+ throw new NotImplementedException("Not Implemented");
+ }
+
+ @Override
+ public ICopyUnnestingFunctionFactory createUnnestingFunctionFactory(ICopyEvaluatorFactory[] args)
+ throws AlgebricksException {
+ throw new NotImplementedException("Not Implemented");
+ }
+
+ @Override
+ public ICopyAggregateFunctionFactory createAggregateFunctionFactory(ICopyEvaluatorFactory[] args)
+ throws AlgebricksException {
+ throw new NotImplementedException("Not Implemented");
+ }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java
index df39a2d..12a49f3 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java
@@ -63,6 +63,7 @@
import edu.uci.ics.asterix.om.typecomputer.impl.OptionalATimeTypeComputer;
import edu.uci.ics.asterix.om.typecomputer.impl.OrderedListConstructorResultType;
import edu.uci.ics.asterix.om.typecomputer.impl.OrderedListOfAInt32TypeComputer;
+import edu.uci.ics.asterix.om.typecomputer.impl.OrderedListOfAPointTypeComputer;
import edu.uci.ics.asterix.om.typecomputer.impl.OrderedListOfAStringTypeComputer;
import edu.uci.ics.asterix.om.typecomputer.impl.OrderedListOfAnyTypeComputer;
import edu.uci.ics.asterix.om.typecomputer.impl.QuadStringStringOrNullTypeComputer;
@@ -98,7 +99,7 @@
SI
}
- private final static Map<FunctionIdentifier, IFunctionInfo> asterixFunctionIdToInfo = new HashMap<FunctionIdentifier, IFunctionInfo>();
+ private static final FunctionInfoRepository finfoRepo = new FunctionInfoRepository();
// it is supposed to be an identity mapping
private final static Map<IFunctionInfo, IFunctionInfo> builtinFunctionsSet = new HashMap<IFunctionInfo, IFunctionInfo>();
@@ -231,16 +232,19 @@
public final static FunctionIdentifier LIKE = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "like", 2);
public final static FunctionIdentifier CONTAINS = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "contains",
2);
- private final static FunctionIdentifier STARTS_WITH = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
+ public final static FunctionIdentifier STARTS_WITH = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
"starts-with", 2);
- private final static FunctionIdentifier ENDS_WITH = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
+ public final static FunctionIdentifier ENDS_WITH = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
"ends-with", 2);
public final static FunctionIdentifier AVG = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-avg", 1);
public final static FunctionIdentifier COUNT = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-count", 1);
public final static FunctionIdentifier SUM = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-sum", 1);
+ public final static FunctionIdentifier LOCAL_SUM = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-local-sum", 1);
public final static FunctionIdentifier MAX = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-max", 1);
+ public final static FunctionIdentifier LOCAL_MAX = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-local-max", 1);
public final static FunctionIdentifier MIN = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-min", 1);
+ public final static FunctionIdentifier LOCAL_MIN = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-local-min", 1);
public final static FunctionIdentifier GLOBAL_AVG = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
"agg-global-avg", 1);
public final static FunctionIdentifier LOCAL_AVG = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
@@ -264,6 +268,8 @@
"count-serial", 1);
public final static FunctionIdentifier SERIAL_SUM = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
"sum-serial", 1);
+ public final static FunctionIdentifier SERIAL_LOCAL_SUM = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
+ "local-sum-serial", 1);
public final static FunctionIdentifier SERIAL_GLOBAL_AVG = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
"global-avg-serial", 1);
public final static FunctionIdentifier SERIAL_LOCAL_AVG = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
@@ -484,6 +490,12 @@
public final static FunctionIdentifier ADJUST_DATETIME_FOR_TIMEZONE = new FunctionIdentifier(
FunctionConstants.ASTERIX_NS, "adjust-datetime-for-timezone", 2);
+ public final static FunctionIdentifier GET_POINT_X_COORDINATE_ACCESSOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "get-x", 1);
+ public final static FunctionIdentifier GET_POINT_Y_COORDINATE_ACCESSOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "get-y", 1);
+ public final static FunctionIdentifier GET_CIRCLE_RADIUS_ACCESSOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "get-radius", 1);
+ public final static FunctionIdentifier GET_CIRCLE_CENTER_ACCESSOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "get-center", 1);
+ public final static FunctionIdentifier GET_POINTS_LINE_RECTANGLE_POLYGON_ACCESSOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "get-points", 1);
+
public static final FunctionIdentifier EQ = AlgebricksBuiltinFunctions.EQ;
public static final FunctionIdentifier LE = AlgebricksBuiltinFunctions.LE;
public static final FunctionIdentifier GE = AlgebricksBuiltinFunctions.GE;
@@ -497,18 +509,15 @@
public static final FunctionIdentifier IS_NULL = AlgebricksBuiltinFunctions.IS_NULL;
public static IFunctionInfo getAsterixFunctionInfo(FunctionIdentifier fid) {
- IFunctionInfo finfo = asterixFunctionIdToInfo.get(fid);
+ IFunctionInfo finfo = finfoRepo.get(fid);;
if (finfo == null) {
finfo = new AsterixFunctionInfo(fid);
- // if (fid.isBuiltin()) {
- asterixFunctionIdToInfo.put(fid, finfo);
- // }
}
return finfo;
}
public static AsterixFunctionInfo lookupFunction(FunctionIdentifier fid) {
- return (AsterixFunctionInfo) asterixFunctionIdToInfo.get(fid);
+ return (AsterixFunctionInfo) finfoRepo.get(fid);
}
static {
@@ -528,7 +537,7 @@
// and then, Asterix builtin functions
add(ANY_COLLECTION_MEMBER, NonTaggedCollectionMemberResultType.INSTANCE);
- add(AVG, OptionalADoubleTypeComputer.INSTANCE);
+ addPrivateFunction(AVG, OptionalADoubleTypeComputer.INSTANCE);
add(BOOLEAN_CONSTRUCTOR, UnaryBooleanOrNullFunctionTypeComputer.INSTANCE);
add(CARET, NonTaggedNumericAddSubMulDivTypeComputer.INSTANCE);
add(CIRCLE_CONSTRUCTOR, OptionalACircleTypeComputer.INSTANCE);
@@ -550,7 +559,7 @@
}
});
add(CONTAINS, ABooleanTypeComputer.INSTANCE);
- add(COUNT, AInt32TypeComputer.INSTANCE);
+ addPrivateFunction(COUNT, AInt32TypeComputer.INSTANCE);
add(COUNTHASHED_GRAM_TOKENS, OrderedListOfAInt32TypeComputer.INSTANCE);
add(COUNTHASHED_WORD_TOKENS, OrderedListOfAInt32TypeComputer.INSTANCE);
add(CREATE_CIRCLE, ACircleTypeComputer.INSTANCE);
@@ -585,7 +594,7 @@
add(GET_HANDLE, null); // TODO
add(GET_ITEM, NonTaggedGetItemResultType.INSTANCE);
add(GET_DATA, null); // TODO
- add(GLOBAL_AVG, OptionalADoubleTypeComputer.INSTANCE);
+ addPrivateFunction(GLOBAL_AVG, OptionalADoubleTypeComputer.INSTANCE);
add(GRAM_TOKENS, OrderedListOfAStringTypeComputer.INSTANCE);
add(GLOBAL_AVG, OptionalADoubleTypeComputer.INSTANCE);
add(HASHED_GRAM_TOKENS, OrderedListOfAInt32TypeComputer.INSTANCE);
@@ -606,11 +615,13 @@
add(LIKE, BinaryBooleanOrNullFunctionTypeComputer.INSTANCE);
add(LINE_CONSTRUCTOR, OptionalALineTypeComputer.INSTANCE);
add(LISTIFY, OrderedListConstructorResultType.INSTANCE);
- add(LOCAL_AVG, NonTaggedLocalAvgTypeComputer.INSTANCE);
+ addPrivateFunction(LOCAL_AVG, NonTaggedLocalAvgTypeComputer.INSTANCE);
add(MAKE_FIELD_INDEX_HANDLE, null); // TODO
add(MAKE_FIELD_NAME_HANDLE, null); // TODO
add(MAX, NonTaggedSumTypeComputer.INSTANCE);
+ add(LOCAL_MAX, NonTaggedSumTypeComputer.INSTANCE);
add(MIN, NonTaggedSumTypeComputer.INSTANCE);
+ add(LOCAL_MIN, NonTaggedSumTypeComputer.INSTANCE);
add(NON_EMPTY_STREAM, ABooleanTypeComputer.INSTANCE);
add(NULL_CONSTRUCTOR, ANullTypeComputer.INSTANCE);
add(NUMERIC_UNARY_MINUS, NonTaggedUnaryMinusTypeComputer.INSTANCE);
@@ -620,7 +631,6 @@
add(NUMERIC_MOD, NonTaggedNumericAddSubMulDivTypeComputer.INSTANCE);
add(NUMERIC_IDIV, AInt32TypeComputer.INSTANCE);
- // Xiaoyu Ma Add for new functions
add(NUMERIC_ABS, NonTaggedNumericUnaryFunctionTypeComputer.INSTANCE);
add(NUMERIC_CEILING, NonTaggedNumericUnaryFunctionTypeComputer.INSTANCE);
add(NUMERIC_FLOOR, NonTaggedNumericUnaryFunctionTypeComputer.INSTANCE);
@@ -630,7 +640,7 @@
add(STRING_TO_CODEPOINT, OrderedListOfAInt32TypeComputer.INSTANCE);
add(CODEPOINT_TO_STRING, AStringTypeComputer.INSTANCE);
- add(STRING_CONCAT, AStringTypeComputer.INSTANCE);
+ add(STRING_CONCAT, OptionalAStringTypeComputer.INSTANCE);
add(SUBSTRING2, Substring2TypeComputer.INSTANCE);
add(STRING_LENGTH, UnaryStringInt32OrNullTypeComputer.INSTANCE);
add(STRING_LOWERCASE, UnaryStringOrNullTypeComputer.INSTANCE);
@@ -667,6 +677,7 @@
add(SERIAL_GLOBAL_AVG, OptionalADoubleTypeComputer.INSTANCE);
add(SERIAL_LOCAL_AVG, NonTaggedLocalAvgTypeComputer.INSTANCE);
add(SERIAL_SUM, NonTaggedSumTypeComputer.INSTANCE);
+ add(SERIAL_LOCAL_SUM, NonTaggedSumTypeComputer.INSTANCE);
add(SIMILARITY_JACCARD, AFloatTypeComputer.INSTANCE);
add(SIMILARITY_JACCARD_CHECK, OrderedListOfAnyTypeComputer.INSTANCE);
add(SIMILARITY_JACCARD_SORTED, AFloatTypeComputer.INSTANCE);
@@ -677,6 +688,11 @@
add(SPATIAL_CELL, ARectangleTypeComputer.INSTANCE);
add(SPATIAL_DISTANCE, ADoubleTypeComputer.INSTANCE);
add(SPATIAL_INTERSECT, ABooleanTypeComputer.INSTANCE);
+ add(GET_POINT_X_COORDINATE_ACCESSOR, ADoubleTypeComputer.INSTANCE);
+ add(GET_POINT_Y_COORDINATE_ACCESSOR, ADoubleTypeComputer.INSTANCE);
+ add(GET_CIRCLE_RADIUS_ACCESSOR, ADoubleTypeComputer.INSTANCE);
+ add(GET_CIRCLE_CENTER_ACCESSOR, APointTypeComputer.INSTANCE);
+ add(GET_POINTS_LINE_RECTANGLE_POLYGON_ACCESSOR, OrderedListOfAPointTypeComputer.INSTANCE);
add(STARTS_WITH, ABooleanTypeComputer.INSTANCE);
add(STRING_CONSTRUCTOR, OptionalAStringTypeComputer.INSTANCE);
add(SUBSET_COLLECTION, new IResultTypeComputer() {
@@ -717,7 +733,8 @@
}
});
add(SUBSTRING, SubstringTypeComputer.INSTANCE);
- add(SUM, NonTaggedSumTypeComputer.INSTANCE);
+ addPrivateFunction(SUM, NonTaggedSumTypeComputer.INSTANCE);
+ add(LOCAL_SUM, NonTaggedSumTypeComputer.INSTANCE);
add(SWITCH_CASE, NonTaggedSwitchCaseComputer.INSTANCE);
add(REG_EXP, ABooleanTypeComputer.INSTANCE);
add(INJECT_FAILURE, InjectFailureTypeComputer.INSTANCE);
@@ -818,15 +835,17 @@
addGlobalAgg(COUNT, SUM);
addAgg(MAX);
- addLocalAgg(MAX, MAX);
+ addAgg(LOCAL_MAX);
+ addLocalAgg(MAX, LOCAL_MAX);
addGlobalAgg(MAX, MAX);
addAgg(MIN);
- addLocalAgg(MIN, MIN);
+ addLocalAgg(MIN, LOCAL_MIN);
addGlobalAgg(MIN, MIN);
addAgg(SUM);
- addLocalAgg(SUM, SUM);
+ addAgg(LOCAL_SUM);
+ addLocalAgg(SUM, LOCAL_SUM);
addGlobalAgg(SUM, SUM);
addAgg(LISTIFY);
@@ -835,6 +854,7 @@
addSerialAgg(AVG, SERIAL_AVG);
addSerialAgg(COUNT, SERIAL_COUNT);
addSerialAgg(SUM, SERIAL_SUM);
+ addSerialAgg(LOCAL_SUM, SERIAL_LOCAL_SUM);
addSerialAgg(LOCAL_AVG, SERIAL_LOCAL_AVG);
addSerialAgg(GLOBAL_AVG, SERIAL_GLOBAL_AVG);
@@ -849,7 +869,8 @@
addGlobalAgg(SERIAL_AVG, SERIAL_GLOBAL_AVG);
addAgg(SERIAL_SUM);
- addLocalAgg(SERIAL_SUM, SERIAL_SUM);
+ addAgg(SERIAL_LOCAL_SUM);
+ addLocalAgg(SERIAL_SUM, SERIAL_LOCAL_SUM);
addGlobalAgg(SERIAL_SUM, SERIAL_SUM);
}
@@ -964,7 +985,14 @@
IFunctionInfo functionInfo = getAsterixFunctionInfo(fi);
builtinFunctionsSet.put(functionInfo, functionInfo);
funTypeComputer.put(functionInfo, typeComputer);
- asterixFunctionIdToInfo.put(fi, functionInfo);
+ finfoRepo.put(fi);
+ }
+
+ private static IFunctionInfo addPrivateFunction(FunctionIdentifier fi, IResultTypeComputer typeComputer) {
+ IFunctionInfo functionInfo = getAsterixFunctionInfo(fi);
+ builtinFunctionsSet.put(functionInfo, functionInfo);
+ funTypeComputer.put(functionInfo, typeComputer);
+ return functionInfo;
}
private static void addAgg(FunctionIdentifier fi) {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixExternalFunctionInfo.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixExternalFunctionInfo.java
new file mode 100644
index 0000000..a6a5bd8
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixExternalFunctionInfo.java
@@ -0,0 +1,73 @@
+package edu.uci.ics.asterix.om.functions;
+
+import java.util.List;
+
+import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression.FunctionKind;
+
+public class AsterixExternalFunctionInfo extends AsterixFunctionInfo implements IExternalFunctionInfo {
+
+ private final IResultTypeComputer rtc;
+ private final List<IAType> argumentTypes;
+ private final String body;
+ private final String language;
+ private final FunctionKind kind;
+ private final IAType returnType;
+
+ public AsterixExternalFunctionInfo(){
+ super();
+ rtc = null;
+ argumentTypes= null;
+ body = null;
+ language=null;
+ kind = null;
+ returnType = null;
+
+ }
+
+ public AsterixExternalFunctionInfo(String namespace, AsterixFunction asterixFunction, FunctionKind kind,
+ List<IAType> argumentTypes, IAType returnType, IResultTypeComputer rtc, String body, String language) {
+ super(namespace, asterixFunction);
+ this.rtc = rtc;
+ this.argumentTypes = argumentTypes;
+ this.body = body;
+ this.language = language;
+ this.kind = kind;
+ this.returnType = returnType;
+ }
+
+ public IResultTypeComputer getResultTypeComputer() {
+ return rtc;
+ }
+
+ public List<IAType> getArgumenTypes() {
+ return argumentTypes;
+ }
+
+ @Override
+ public String getFunctionBody() {
+ return body;
+ }
+
+ @Override
+ public List<IAType> getParamList() {
+ return argumentTypes;
+ }
+
+ @Override
+ public String getLanguage() {
+ return language;
+ }
+
+ @Override
+ public FunctionKind getKind() {
+ return kind;
+ }
+
+ @Override
+ public IAType getReturnType() {
+ return returnType;
+ }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixFunction.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixFunction.java
index 23d5d58..e58681c 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixFunction.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixFunction.java
@@ -14,26 +14,21 @@
*/
package edu.uci.ics.asterix.om.functions;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import java.io.Serializable;
-public class AsterixFunction {
+public class AsterixFunction implements Serializable {
- private final String functionName;
+ private final String name;
private final int arity;
public final static int VARARGS = -1;
- public AsterixFunction(String functionName, int arity) {
- this.functionName = functionName;
+ public AsterixFunction(String name, int arity) throws IllegalArgumentException {
+ this.name = name;
this.arity = arity;
}
-
- public AsterixFunction(FunctionIdentifier fid) {
- this.functionName = fid.getName();
- this.arity = fid.getArity();
- }
- public String getFunctionName() {
- return functionName;
+ public String getName() {
+ return name;
}
public int getArity() {
@@ -41,7 +36,7 @@
}
public String toString() {
- return functionName + "@" + arity;
+ return name;
}
@Override
@@ -54,8 +49,7 @@
if (!(o instanceof AsterixFunction)) {
return false;
}
- if (functionName.equals(((AsterixFunction) o).getFunctionName())
- && (arity == ((AsterixFunction) o).getArity() || arity == VARARGS)) {
+ if (name.equals(((AsterixFunction) o).getName()) || arity == VARARGS) {
return true;
}
return false;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixFunctionIdentifier.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixFunctionIdentifier.java
new file mode 100644
index 0000000..35cace1
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixFunctionIdentifier.java
@@ -0,0 +1,31 @@
+package edu.uci.ics.asterix.om.functions;
+
+
+public class AsterixFunctionIdentifier {
+
+ private final String dataverse;
+ private final AsterixFunction asterixFunction;
+
+ public AsterixFunctionIdentifier(String dataverse, AsterixFunction asterixFunction) {
+ this.dataverse = dataverse;
+ this.asterixFunction = asterixFunction;
+ }
+
+ public AsterixFunctionIdentifier(String dataverse, String name, int arity) {
+ this.dataverse = dataverse;
+ this.asterixFunction = new AsterixFunction(name, arity);
+ }
+
+ public String toString() {
+ return dataverse + ":" + asterixFunction;
+ }
+
+ public String getDataverse() {
+ return dataverse;
+ }
+
+ public AsterixFunction getAsterixFunction() {
+ return asterixFunction;
+ }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixFunctionInfo.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixFunctionInfo.java
index 61e47c0..b8b1c61 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixFunctionInfo.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixFunctionInfo.java
@@ -14,6 +14,7 @@
*/
package edu.uci.ics.asterix.om.functions;
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.IFunctionInfo;
@@ -22,14 +23,23 @@
private final FunctionIdentifier functionIdentifier;
public AsterixFunctionInfo(String namespace, AsterixFunction asterixFunction) {
- this.functionIdentifier = new FunctionIdentifier(namespace, asterixFunction.getFunctionName(),
+ this.functionIdentifier = new FunctionIdentifier(namespace, asterixFunction.getName(),
asterixFunction.getArity());
}
+ public AsterixFunctionInfo() {
+ functionIdentifier = null;
+ }
+
public AsterixFunctionInfo(FunctionIdentifier functionIdentifier) {
this.functionIdentifier = functionIdentifier;
}
+ public AsterixFunctionInfo(FunctionSignature functionSignature) {
+ this.functionIdentifier = new FunctionIdentifier(functionSignature.getNamespace(), functionSignature.getName(),
+ functionSignature.getArity());
+ }
+
@Override
public FunctionIdentifier getFunctionIdentifier() {
return functionIdentifier;
@@ -51,8 +61,7 @@
@Override
public String toString() {
- return this.functionIdentifier.getNamespace() + ":" + this.functionIdentifier.getName() + "@"
- + this.functionIdentifier.getArity();
+ return this.functionIdentifier.getNamespace() + ":" + this.functionIdentifier.getName();
}
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/FunctionInfoRepository.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/FunctionInfoRepository.java
new file mode 100644
index 0000000..c95f256
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/FunctionInfoRepository.java
@@ -0,0 +1,36 @@
+package edu.uci.ics.asterix.om.functions;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import edu.uci.ics.asterix.common.functions.FunctionSignature;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.IFunctionInfo;
+
+public class FunctionInfoRepository {
+ private final Map<FunctionSignature, IFunctionInfo> functionMap;
+
+ public FunctionInfoRepository() {
+ functionMap = new ConcurrentHashMap<FunctionSignature, IFunctionInfo>();
+ }
+
+ public IFunctionInfo get(String namespace, String name, int arity) {
+ FunctionSignature fname = new FunctionSignature(namespace, name, arity);
+ return functionMap.get(fname);
+ }
+
+ public IFunctionInfo get(FunctionIdentifier fid) {
+ return get(fid.getNamespace(), fid.getName(), fid.getArity());
+ }
+
+ public void put(String namespace, String name, int arity) {
+ FunctionSignature functionSignature = new FunctionSignature(namespace, name, arity);
+ functionMap.put(functionSignature, new AsterixFunctionInfo(new FunctionIdentifier(namespace, name, arity)));
+ }
+
+ public void put(FunctionIdentifier fid) {
+ FunctionSignature functionSignature = new FunctionSignature(fid.getNamespace(), fid.getName(), fid.getArity());
+ functionMap.put(functionSignature, new AsterixFunctionInfo(fid));
+ }
+}
+
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/IExternalFunctionInfo.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/IExternalFunctionInfo.java
new file mode 100644
index 0000000..846c825
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/IExternalFunctionInfo.java
@@ -0,0 +1,25 @@
+package edu.uci.ics.asterix.om.functions;
+
+import java.io.Serializable;
+import java.util.List;
+
+import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression.FunctionKind;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.IFunctionInfo;
+
+public interface IExternalFunctionInfo extends IFunctionInfo, Serializable {
+
+ public IResultTypeComputer getResultTypeComputer();
+
+ public IAType getReturnType();
+
+ public String getFunctionBody();
+
+ public List<IAType> getParamList();
+
+ public String getLanguage();
+
+ public FunctionKind getKind();
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/IFunctionDescriptor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/IFunctionDescriptor.java
index 2fb5447..c372dec 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/IFunctionDescriptor.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/IFunctionDescriptor.java
@@ -1,12 +1,47 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package edu.uci.ics.asterix.om.functions;
import java.io.Serializable;
import edu.uci.ics.asterix.common.functions.FunctionDescriptorTag;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunctionFactory;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyRunningAggregateFunctionFactory;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopySerializableAggregateFunctionFactory;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyUnnestingFunctionFactory;
public interface IFunctionDescriptor extends Serializable {
public FunctionIdentifier getIdentifier();
public FunctionDescriptorTag getFunctionDescriptorTag();
+
+ public ICopyEvaluatorFactory createEvaluatorFactory(ICopyEvaluatorFactory[] args) throws AlgebricksException;
+
+ public ICopyRunningAggregateFunctionFactory createRunningAggregateFunctionFactory(final ICopyEvaluatorFactory[] args)
+ throws AlgebricksException;
+
+ public ICopySerializableAggregateFunctionFactory createSerializableAggregateFunctionFactory(
+ final ICopyEvaluatorFactory[] args) throws AlgebricksException;
+
+ public ICopyUnnestingFunctionFactory createUnnestingFunctionFactory(final ICopyEvaluatorFactory[] args)
+ throws AlgebricksException;
+
+ public ICopyAggregateFunctionFactory createAggregateFunctionFactory(final ICopyEvaluatorFactory[] args)
+ throws AlgebricksException;
+
}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/AFlatValuePointable.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/AFlatValuePointable.java
new file mode 100644
index 0000000..445e2a2
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/AFlatValuePointable.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.pointables;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.visitor.IVisitablePointableVisitor;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.util.container.IObjectFactory;
+import edu.uci.ics.hyracks.data.std.api.IValueReference;
+
+/**
+ * This class represents a flat field, e.g., int field, string field, and
+ * so on, based on a binary representation.
+ */
+public class AFlatValuePointable extends AbstractVisitablePointable {
+
+ /**
+ * DO NOT allow to create AFlatValuePointable object arbitrarily, force to
+ * use object pool based allocator. The factory is not public so that it
+ * cannot called in other places than PointableAllocator.
+ */
+ static IObjectFactory<IVisitablePointable, IAType> FACTORY = new IObjectFactory<IVisitablePointable, IAType>() {
+ public AFlatValuePointable create(IAType type) {
+ return new AFlatValuePointable();
+ }
+ };
+
+ /**
+ * private constructor, to prevent arbitrary creation
+ */
+ private AFlatValuePointable() {
+
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof IValueReference))
+ return false;
+
+ // get right raw data
+ IValueReference ivf = (IValueReference) o;
+ byte[] odata = ivf.getByteArray();
+ int ostart = ivf.getStartOffset();
+ int olen = ivf.getLength();
+
+ // get left raw data
+ byte[] data = getByteArray();
+ int start = getStartOffset();
+ int len = getLength();
+
+ // bytes length should be equal
+ if (len != olen)
+ return false;
+
+ // check each byte
+ for (int i = 0; i < len; i++) {
+ if (data[start + i] != odata[ostart + i])
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public <R, T> R accept(IVisitablePointableVisitor<R, T> vistor, T tag) throws AsterixException {
+ return vistor.visit(this, tag);
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/AListPointable.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/AListPointable.java
new file mode 100644
index 0000000..ab32b6b
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/AListPointable.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.pointables;
+
+import java.io.DataOutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.visitor.IVisitablePointableVisitor;
+import edu.uci.ics.asterix.om.types.AOrderedListType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.AbstractCollectionType;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
+import edu.uci.ics.asterix.om.util.ResettableByteArrayOutputStream;
+import edu.uci.ics.asterix.om.util.container.IObjectFactory;
+
+/**
+ * This class interprets the binary data representation of a list, one can
+ * call getItems and getItemTags to get pointable objects for items and item
+ * type tags.
+ */
+public class AListPointable extends AbstractVisitablePointable {
+
+ /**
+ * DO NOT allow to create AListPointable object arbitrarily, force to use
+ * object pool based allocator, in order to have object reuse.
+ */
+ static IObjectFactory<IVisitablePointable, IAType> FACTORY = new IObjectFactory<IVisitablePointable, IAType>() {
+ public IVisitablePointable create(IAType type) {
+ return new AListPointable((AbstractCollectionType) type);
+ }
+ };
+
+ private final List<IVisitablePointable> items = new ArrayList<IVisitablePointable>();
+ private final List<IVisitablePointable> itemTags = new ArrayList<IVisitablePointable>();
+ private final PointableAllocator allocator = new PointableAllocator();
+
+ private final ResettableByteArrayOutputStream dataBos = new ResettableByteArrayOutputStream();
+ private final DataOutputStream dataDos = new DataOutputStream(dataBos);
+
+ private IAType itemType;
+ private ATypeTag itemTag;
+ private boolean typedItemList = false;
+ private boolean ordered = false;
+
+ /**
+ * private constructor, to prevent constructing it arbitrarily
+ *
+ * @param inputType
+ */
+ private AListPointable(AbstractCollectionType inputType) {
+ if (inputType instanceof AOrderedListType) {
+ ordered = true;
+ }
+ if (inputType != null && inputType.getItemType() != null) {
+ itemType = inputType.getItemType();
+ if (itemType.getTypeTag() == ATypeTag.ANY) {
+ typedItemList = false;
+ } else {
+ typedItemList = true;
+ itemTag = inputType.getItemType().getTypeTag();
+ }
+ } else {
+ this.typedItemList = false;
+ }
+ }
+
+ private void reset() {
+ allocator.reset();
+ items.clear();
+ itemTags.clear();
+ dataBos.reset();
+ }
+
+ @Override
+ public void set(byte[] b, int s, int len) {
+ reset();
+
+ int numberOfitems = AInt32SerializerDeserializer.getInt(b, s + 6);
+ int itemOffset;
+ if (typedItemList) {
+ switch (itemTag) {
+ case STRING:
+ case RECORD:
+ case ORDEREDLIST:
+ case UNORDEREDLIST:
+ case ANY:
+ itemOffset = s + 10 + (numberOfitems * 4);
+ break;
+ default:
+ itemOffset = s + 10;
+ }
+ } else {
+ itemOffset = s + 10 + (numberOfitems * 4);
+ }
+ int itemLength = 0;
+ try {
+ if (typedItemList) {
+ for (int i = 0; i < numberOfitems; i++) {
+ itemLength = NonTaggedFormatUtil.getFieldValueLength(b, itemOffset, itemTag, false);
+ IVisitablePointable tag = allocator.allocateEmpty();
+ IVisitablePointable item = allocator.allocateFieldValue(itemType);
+
+ // set item type tag
+ int start = dataBos.size();
+ dataDos.writeByte(itemTag.serialize());
+ int end = dataBos.size();
+ tag.set(dataBos.getByteArray(), start, end - start);
+ itemTags.add(tag);
+
+ // set item value
+ start = dataBos.size();
+ dataDos.writeByte(itemTag.serialize());
+ dataDos.write(b, itemOffset, itemLength);
+ end = dataBos.size();
+ item.set(dataBos.getByteArray(), start, end - start);
+ itemOffset += itemLength;
+ items.add(item);
+ }
+ } else {
+ for (int i = 0; i < numberOfitems; i++) {
+ itemTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(b[itemOffset]);
+ itemLength = NonTaggedFormatUtil.getFieldValueLength(b, itemOffset, itemTag, true) + 1;
+ IVisitablePointable tag = allocator.allocateEmpty();
+ IVisitablePointable item = allocator.allocateFieldValue(itemTag);
+
+ // set item type tag
+ int start = dataBos.size();
+ dataDos.writeByte(itemTag.serialize());
+ int end = dataBos.size();
+ tag.set(dataBos.getByteArray(), start, end - start);
+ itemTags.add(tag);
+
+ // open part field already include the type tag
+ item.set(b, itemOffset, itemLength);
+ itemOffset += itemLength;
+ items.add(item);
+ }
+ }
+ } catch (Exception e) {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ @Override
+ public <R, T> R accept(IVisitablePointableVisitor<R, T> vistor, T tag) throws AsterixException {
+ return vistor.visit(this, tag);
+ }
+
+ public List<IVisitablePointable> getItems() {
+ return items;
+ }
+
+ public List<IVisitablePointable> getItemTags() {
+ return itemTags;
+ }
+
+ public boolean ordered() {
+ return ordered;
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/ARecordPointable.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/ARecordPointable.java
new file mode 100644
index 0000000..7e097af
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/ARecordPointable.java
@@ -0,0 +1,285 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.pointables;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.dataflow.data.nontagged.AqlNullWriterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.visitor.IVisitablePointableVisitor;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.AUnionType;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
+import edu.uci.ics.asterix.om.util.ResettableByteArrayOutputStream;
+import edu.uci.ics.asterix.om.util.container.IObjectFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.INullWriter;
+
+/**
+ * This class interprets the binary data representation of a record. One can
+ * call getFieldNames, getFieldTypeTags and getFieldValues to get pointable
+ * objects for field names, field type tags, and field values.
+ *
+ */
+public class ARecordPointable extends AbstractVisitablePointable {
+
+ /**
+ * DO NOT allow to create ARecordPointable object arbitrarily, force to use
+ * object pool based allocator, in order to have object reuse
+ */
+ static IObjectFactory<IVisitablePointable, IAType> FACTORY = new IObjectFactory<IVisitablePointable, IAType>() {
+ public IVisitablePointable create(IAType type) {
+ return new ARecordPointable((ARecordType) type);
+ }
+ };
+
+ // access results: field names, field types, and field values
+ private final List<IVisitablePointable> fieldNames = new ArrayList<IVisitablePointable>();
+ private final List<IVisitablePointable> fieldTypeTags = new ArrayList<IVisitablePointable>();
+ private final List<IVisitablePointable> fieldValues = new ArrayList<IVisitablePointable>();
+
+ // pointable allocator
+ private final PointableAllocator allocator = new PointableAllocator();
+
+ private final ResettableByteArrayOutputStream typeBos = new ResettableByteArrayOutputStream();
+ private final DataOutputStream typeDos = new DataOutputStream(typeBos);
+
+ private final ResettableByteArrayOutputStream dataBos = new ResettableByteArrayOutputStream();
+ private final DataOutputStream dataDos = new DataOutputStream(dataBos);
+
+ private final ARecordType inputRecType;
+
+ private final int numberOfSchemaFields;
+ private final int[] fieldOffsets;
+ private final IVisitablePointable nullReference = AFlatValuePointable.FACTORY.create(null);
+
+ private int closedPartTypeInfoSize = 0;
+ private int offsetArrayOffset;
+ private ATypeTag typeTag;
+
+ /**
+ * private constructor, to prevent constructing it arbitrarily
+ *
+ * @param inputType
+ */
+ private ARecordPointable(ARecordType inputType) {
+ this.inputRecType = inputType;
+ IAType[] fieldTypes = inputType.getFieldTypes();
+ String[] fieldNameStrs = inputType.getFieldNames();
+ numberOfSchemaFields = fieldTypes.length;
+
+ // initialize the buffer for closed parts(fieldName bytes+ type bytes) +
+ // constant(null bytes)
+ typeBos.reset();
+ try {
+ for (int i = 0; i < numberOfSchemaFields; i++) {
+ ATypeTag ftypeTag = fieldTypes[i].getTypeTag();
+
+ if (fieldTypes[i].getTypeTag() == ATypeTag.UNION
+ && NonTaggedFormatUtil.isOptionalField((AUnionType) fieldTypes[i]))
+ // optional field: add the embedded non-null type tag
+ ftypeTag = ((AUnionType) fieldTypes[i]).getUnionList()
+ .get(NonTaggedFormatUtil.OPTIONAL_TYPE_INDEX_IN_UNION_LIST).getTypeTag();
+
+ // add type tag Reference
+ int tagStart = typeBos.size();
+ typeDos.writeByte(ftypeTag.serialize());
+ int tagEnd = typeBos.size();
+ IVisitablePointable typeTagReference = AFlatValuePointable.FACTORY.create(null);
+ typeTagReference.set(typeBos.getByteArray(), tagStart, tagEnd - tagStart);
+ fieldTypeTags.add(typeTagReference);
+
+ // add type name Reference (including a astring type tag)
+ int nameStart = typeBos.size();
+ typeDos.writeByte(ATypeTag.STRING.serialize());
+ typeDos.writeUTF(fieldNameStrs[i]);
+ int nameEnd = typeBos.size();
+ IVisitablePointable typeNameReference = AFlatValuePointable.FACTORY.create(null);
+ typeNameReference.set(typeBos.getByteArray(), nameStart, nameEnd - nameStart);
+ fieldNames.add(typeNameReference);
+ }
+
+ // initialize a constant: null value bytes reference
+ int nullFieldStart = typeBos.size();
+ INullWriter nullWriter = AqlNullWriterFactory.INSTANCE.createNullWriter();
+ nullWriter.writeNull(typeDos);
+ int nullFieldEnd = typeBos.size();
+ nullReference.set(typeBos.getByteArray(), nullFieldStart, nullFieldEnd - nullFieldStart);
+ } catch (IOException e) {
+ throw new IllegalStateException(e);
+ }
+ closedPartTypeInfoSize = typeBos.size();
+ fieldOffsets = new int[numberOfSchemaFields];
+ }
+
+ private void reset() {
+ typeBos.reset(closedPartTypeInfoSize);
+ dataBos.reset(0);
+ // reset the allocator
+ allocator.reset();
+
+ // clean up the returned containers
+ for (int i = fieldNames.size() - 1; i >= numberOfSchemaFields; i--)
+ fieldNames.remove(i);
+ for (int i = fieldTypeTags.size() - 1; i >= numberOfSchemaFields; i--)
+ fieldTypeTags.remove(i);
+ fieldValues.clear();
+ }
+
+ @Override
+ public void set(byte[] b, int start, int len) {
+ // clear the previous states
+ reset();
+ super.set(b, start, len);
+
+ boolean isExpanded = false;
+ int openPartOffset = 0;
+ int s = start;
+ int recordOffset = s;
+ if (inputRecType == null) {
+ openPartOffset = s + AInt32SerializerDeserializer.getInt(b, s + 6);
+ s += 8;
+ isExpanded = true;
+ } else {
+ if (inputRecType.isOpen()) {
+ isExpanded = b[s + 5] == 1 ? true : false;
+ if (isExpanded) {
+ openPartOffset = s + AInt32SerializerDeserializer.getInt(b, s + 6);
+ s += 10;
+ } else {
+ s += 6;
+ }
+ } else {
+ s += 5;
+ }
+ }
+ try {
+ if (numberOfSchemaFields > 0) {
+ s += 4;
+ int nullBitMapOffset = 0;
+ boolean hasNullableFields = NonTaggedFormatUtil.hasNullableField(inputRecType);
+ if (hasNullableFields) {
+ nullBitMapOffset = s;
+ offsetArrayOffset = s
+ + (this.numberOfSchemaFields % 8 == 0 ? numberOfSchemaFields / 8
+ : numberOfSchemaFields / 8 + 1);
+ } else {
+ offsetArrayOffset = s;
+ }
+ for (int i = 0; i < numberOfSchemaFields; i++) {
+ fieldOffsets[i] = AInt32SerializerDeserializer.getInt(b, offsetArrayOffset) + recordOffset;
+ offsetArrayOffset += 4;
+ }
+ for (int fieldNumber = 0; fieldNumber < numberOfSchemaFields; fieldNumber++) {
+ if (hasNullableFields) {
+ byte b1 = b[nullBitMapOffset + fieldNumber / 8];
+ int p = 1 << (7 - (fieldNumber % 8));
+ if ((b1 & p) == 0) {
+ // set null value (including type tag inside)
+ fieldValues.add(nullReference);
+ continue;
+ }
+ }
+ IAType[] fieldTypes = inputRecType.getFieldTypes();
+ int fieldValueLength = 0;
+
+ IAType fieldType = fieldTypes[fieldNumber];
+ if (fieldTypes[fieldNumber].getTypeTag() == ATypeTag.UNION) {
+ if (NonTaggedFormatUtil.isOptionalField((AUnionType) fieldTypes[fieldNumber])) {
+ fieldType = ((AUnionType) fieldTypes[fieldNumber]).getUnionList().get(
+ NonTaggedFormatUtil.OPTIONAL_TYPE_INDEX_IN_UNION_LIST);
+ typeTag = fieldType.getTypeTag();
+ fieldValueLength = NonTaggedFormatUtil.getFieldValueLength(b, fieldOffsets[fieldNumber],
+ typeTag, false);
+ }
+ } else {
+ typeTag = fieldTypes[fieldNumber].getTypeTag();
+ fieldValueLength = NonTaggedFormatUtil.getFieldValueLength(b, fieldOffsets[fieldNumber],
+ typeTag, false);
+ }
+ // set field value (including the type tag)
+ int fstart = dataBos.size();
+ dataDos.writeByte(typeTag.serialize());
+ dataDos.write(b, fieldOffsets[fieldNumber], fieldValueLength);
+ int fend = dataBos.size();
+ IVisitablePointable fieldValue = allocator.allocateFieldValue(fieldType);
+ fieldValue.set(dataBos.getByteArray(), fstart, fend - fstart);
+ fieldValues.add(fieldValue);
+ }
+ }
+ if (isExpanded) {
+ int numberOfOpenFields = AInt32SerializerDeserializer.getInt(b, openPartOffset);
+ int fieldOffset = openPartOffset + 4 + (8 * numberOfOpenFields);
+ for (int i = 0; i < numberOfOpenFields; i++) {
+ // set the field name (including a type tag, which is
+ // astring)
+ int fieldValueLength = NonTaggedFormatUtil.getFieldValueLength(b, fieldOffset, ATypeTag.STRING,
+ false);
+ int fnstart = dataBos.size();
+ dataDos.writeByte(ATypeTag.STRING.serialize());
+ dataDos.write(b, fieldOffset, fieldValueLength);
+ int fnend = dataBos.size();
+ IVisitablePointable fieldName = allocator.allocateEmpty();
+ fieldName.set(dataBos.getByteArray(), fnstart, fnend - fnstart);
+ fieldNames.add(fieldName);
+ fieldOffset += fieldValueLength;
+
+ // set the field type tag
+ IVisitablePointable fieldTypeTag = allocator.allocateEmpty();
+ fieldTypeTag.set(b, fieldOffset, 1);
+ fieldTypeTags.add(fieldTypeTag);
+ typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(b[fieldOffset]);
+
+ // set the field value (already including type tag)
+ fieldValueLength = NonTaggedFormatUtil.getFieldValueLength(b, fieldOffset, typeTag, true) + 1;
+
+ // allocate
+ IVisitablePointable fieldValueAccessor = allocator.allocateFieldValue(typeTag);
+ fieldValueAccessor.set(b, fieldOffset, fieldValueLength);
+ fieldValues.add(fieldValueAccessor);
+ fieldOffset += fieldValueLength;
+ }
+ }
+ } catch (Exception e) {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ public List<IVisitablePointable> getFieldNames() {
+ return fieldNames;
+ }
+
+ public List<IVisitablePointable> getFieldTypeTags() {
+ return fieldTypeTags;
+ }
+
+ public List<IVisitablePointable> getFieldValues() {
+ return fieldValues;
+ }
+
+ @Override
+ public <R, T> R accept(IVisitablePointableVisitor<R, T> vistor, T tag) throws AsterixException {
+ return vistor.visit(this, tag);
+ }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/AbstractVisitablePointable.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/AbstractVisitablePointable.java
new file mode 100644
index 0000000..943a967
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/AbstractVisitablePointable.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.pointables;
+
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.hyracks.data.std.api.IValueReference;
+
+/**
+ * This class implements several "routine" methods in IVisitablePointable
+ * interface, so that subclasses do not need to repeat the same code.
+ */
+public abstract class AbstractVisitablePointable implements IVisitablePointable {
+
+ private byte[] data;
+ private int start = -1;
+ private int len = -1;
+
+ @Override
+ public byte[] getByteArray() {
+ return data;
+ }
+
+ @Override
+ public int getLength() {
+ return len;
+ }
+
+ @Override
+ public int getStartOffset() {
+ return start;
+ }
+
+ @Override
+ public void set(byte[] b, int start, int len) {
+ this.data = b;
+ this.start = start;
+ this.len = len;
+ }
+
+ @Override
+ public void set(IValueReference ivf) {
+ set(ivf.getByteArray(), ivf.getStartOffset(), ivf.getLength());
+ }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/PointableAllocator.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/PointableAllocator.java
new file mode 100644
index 0000000..5ad2ccb
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/PointableAllocator.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.pointables;
+
+import edu.uci.ics.asterix.om.pointables.base.DefaultOpenFieldType;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.util.container.IObjectPool;
+import edu.uci.ics.asterix.om.util.container.ListObjectPool;
+
+/**
+ * This class is the ONLY place to create IVisitablePointable object instances,
+ * to enforce use of an object pool.
+ */
+public class PointableAllocator {
+
+ private IObjectPool<IVisitablePointable, IAType> flatValueAllocator = new ListObjectPool<IVisitablePointable, IAType>(
+ AFlatValuePointable.FACTORY);
+ private IObjectPool<IVisitablePointable, IAType> recordValueAllocator = new ListObjectPool<IVisitablePointable, IAType>(
+ ARecordPointable.FACTORY);
+ private IObjectPool<IVisitablePointable, IAType> listValueAllocator = new ListObjectPool<IVisitablePointable, IAType>(
+ AListPointable.FACTORY);
+
+ public IVisitablePointable allocateEmpty() {
+ return flatValueAllocator.allocate(null);
+ }
+
+ /**
+ * allocate closed part value pointable
+ *
+ * @param type
+ * @return the pointable object
+ */
+ public IVisitablePointable allocateFieldValue(IAType type) {
+ if (type == null)
+ return flatValueAllocator.allocate(null);
+ else if (type.getTypeTag().equals(ATypeTag.RECORD))
+ return recordValueAllocator.allocate(type);
+ else if (type.getTypeTag().equals(ATypeTag.UNORDEREDLIST) || type.getTypeTag().equals(ATypeTag.ORDEREDLIST))
+ return listValueAllocator.allocate(type);
+ else
+ return flatValueAllocator.allocate(null);
+ }
+
+ /**
+ * allocate open part value pointable
+ *
+ * @param typeTag
+ * @return the pointable object
+ */
+ public IVisitablePointable allocateFieldValue(ATypeTag typeTag) {
+ if (typeTag == null)
+ return flatValueAllocator.allocate(null);
+ else if (typeTag.equals(ATypeTag.RECORD))
+ return recordValueAllocator.allocate(DefaultOpenFieldType.NESTED_OPEN_RECORD_TYPE);
+ else if (typeTag.equals(ATypeTag.UNORDEREDLIST))
+ return listValueAllocator.allocate(DefaultOpenFieldType.NESTED_OPEN_AUNORDERED_LIST_TYPE);
+ else if (typeTag.equals(ATypeTag.ORDEREDLIST))
+ return listValueAllocator.allocate(DefaultOpenFieldType.NESTED_OPEN_AORDERED_LIST_TYPE);
+ else
+ return flatValueAllocator.allocate(null);
+ }
+
+ public IVisitablePointable allocateListValue(IAType type) {
+ return listValueAllocator.allocate(type);
+ }
+
+ public IVisitablePointable allocateRecordValue(IAType type) {
+ return recordValueAllocator.allocate(type);
+ }
+
+ public void reset() {
+ flatValueAllocator.reset();
+ recordValueAllocator.reset();
+ listValueAllocator.reset();
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/base/DefaultOpenFieldType.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/base/DefaultOpenFieldType.java
new file mode 100644
index 0000000..9184616
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/base/DefaultOpenFieldType.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.pointables.base;
+
+import edu.uci.ics.asterix.om.types.AOrderedListType;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.AUnorderedListType;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.IAType;
+
+/**
+ * This class serves as the repository for the default record type and list type
+ * fields in the open part, e.g., a "record" (nested) field in the open part is
+ * always a fully open one, and a "list" field in the open part is always a list
+ * of "ANY".
+ *
+ */
+public class DefaultOpenFieldType {
+
+ // nested open field rec type
+ public static ARecordType NESTED_OPEN_RECORD_TYPE = new ARecordType("nested-open", new String[] {},
+ new IAType[] {}, true);
+
+ // nested open list type
+ public static AOrderedListType NESTED_OPEN_AORDERED_LIST_TYPE = new AOrderedListType(BuiltinType.ANY,
+ "nested-ordered-list");
+
+ // nested open list type
+ public static AUnorderedListType NESTED_OPEN_AUNORDERED_LIST_TYPE = new AUnorderedListType(BuiltinType.ANY,
+ "nested-unordered-list");
+
+ public static IAType getDefaultOpenFieldType(ATypeTag tag) {
+ if (tag.equals(ATypeTag.RECORD))
+ return NESTED_OPEN_RECORD_TYPE;
+ if (tag.equals(ATypeTag.ORDEREDLIST))
+ return NESTED_OPEN_AORDERED_LIST_TYPE;
+ if (tag.equals(ATypeTag.UNORDEREDLIST))
+ return NESTED_OPEN_AUNORDERED_LIST_TYPE;
+ else
+ return null;
+ }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/base/IVisitablePointable.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/base/IVisitablePointable.java
new file mode 100644
index 0000000..7456ee8
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/base/IVisitablePointable.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.pointables.base;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.pointables.visitor.IVisitablePointableVisitor;
+import edu.uci.ics.hyracks.data.std.api.IPointable;
+
+/**
+ * This interface extends IPointable with a visitor interface in order to ease
+ * programming for recursive record structures.
+ */
+public interface IVisitablePointable extends IPointable {
+
+ public <R, T> R accept(IVisitablePointableVisitor<R, T> vistor, T tag) throws AsterixException;
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/ACastVisitor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/ACastVisitor.java
new file mode 100644
index 0000000..9fccf4a
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/ACastVisitor.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.pointables.cast;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.pointables.AFlatValuePointable;
+import edu.uci.ics.asterix.om.pointables.AListPointable;
+import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.base.DefaultOpenFieldType;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.visitor.IVisitablePointableVisitor;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.AbstractCollectionType;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.algebricks.common.utils.Triple;
+
+/**
+ * This class is a IVisitablePointableVisitor implementation which recursively
+ * visit a given record, list or flat value of a given type, and cast it to a
+ * specified type. For example:
+ * A record { "hobby": {{"music", "coding"}}, "id": "001", "name":
+ * "Person Three"} which confirms to closed type ( id: string, name: string,
+ * hobby: {{string}}? ) can be casted to a open type (id: string )
+ * Since the open/closed part of a record has a completely different underlying
+ * memory/storage layout, the visitor will change the layout as specified at
+ * runtime.
+ */
+public class ACastVisitor implements IVisitablePointableVisitor<Void, Triple<IVisitablePointable, IAType, Boolean>> {
+
+ private final Map<IVisitablePointable, ARecordCaster> raccessorToCaster = new HashMap<IVisitablePointable, ARecordCaster>();
+ private final Map<IVisitablePointable, AListCaster> laccessorToCaster = new HashMap<IVisitablePointable, AListCaster>();
+
+ @Override
+ public Void visit(AListPointable accessor, Triple<IVisitablePointable, IAType, Boolean> arg)
+ throws AsterixException {
+ AListCaster caster = laccessorToCaster.get(accessor);
+ if (caster == null) {
+ caster = new AListCaster();
+ laccessorToCaster.put(accessor, caster);
+ }
+ try {
+ if (arg.second.getTypeTag().equals(ATypeTag.ANY)) {
+ arg.second = DefaultOpenFieldType.NESTED_OPEN_AUNORDERED_LIST_TYPE;
+ }
+ caster.castList(accessor, arg.first, (AbstractCollectionType) arg.second, this);
+ } catch (Exception e) {
+ throw new AsterixException(e);
+ }
+ return null;
+ }
+
+ @Override
+ public Void visit(ARecordPointable accessor, Triple<IVisitablePointable, IAType, Boolean> arg)
+ throws AsterixException {
+ ARecordCaster caster = raccessorToCaster.get(accessor);
+ if (caster == null) {
+ caster = new ARecordCaster();
+ raccessorToCaster.put(accessor, caster);
+ }
+ try {
+ if (arg.second.getTypeTag().equals(ATypeTag.ANY)) {
+ arg.second = DefaultOpenFieldType.NESTED_OPEN_RECORD_TYPE;
+ }
+ caster.castRecord(accessor, arg.first, (ARecordType) arg.second, this);
+ } catch (Exception e) {
+ throw new AsterixException(e);
+ }
+ return null;
+ }
+
+ @Override
+ public Void visit(AFlatValuePointable accessor, Triple<IVisitablePointable, IAType, Boolean> arg) {
+ // set the pointer for result
+ arg.first.set(accessor);
+ return null;
+ }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/AListCaster.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/AListCaster.java
new file mode 100644
index 0000000..c65b3eb
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/AListCaster.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.pointables.cast;
+
+import java.io.DataOutput;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.util.List;
+
+import edu.uci.ics.asterix.builders.OrderedListBuilder;
+import edu.uci.ics.asterix.builders.UnorderedListBuilder;
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.pointables.AListPointable;
+import edu.uci.ics.asterix.om.pointables.PointableAllocator;
+import edu.uci.ics.asterix.om.pointables.base.DefaultOpenFieldType;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.types.AOrderedListType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.AUnorderedListType;
+import edu.uci.ics.asterix.om.types.AbstractCollectionType;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.util.ResettableByteArrayOutputStream;
+import edu.uci.ics.hyracks.algebricks.common.utils.Triple;
+
+/**
+ * This class is to do the runtime type cast for a list. It is ONLY visible to
+ * ACastVisitor.
+ */
+class AListCaster {
+ // pointable allocator
+ private final PointableAllocator allocator = new PointableAllocator();
+
+ // for storing the cast result
+ private final IVisitablePointable itemTempReference = allocator.allocateEmpty();
+ private final Triple<IVisitablePointable, IAType, Boolean> itemVisitorArg = new Triple<IVisitablePointable, IAType, Boolean>(
+ itemTempReference, null, null);
+
+ private final UnorderedListBuilder unOrderedListBuilder = new UnorderedListBuilder();
+ private final OrderedListBuilder orderedListBuilder = new OrderedListBuilder();
+
+ private final ResettableByteArrayOutputStream dataBos = new ResettableByteArrayOutputStream();
+ private final DataOutput dataDos = new DataOutputStream(dataBos);
+ private IAType reqItemType;
+
+ public AListCaster() {
+
+ }
+
+ public void castList(AListPointable listAccessor, IVisitablePointable resultAccessor,
+ AbstractCollectionType reqType, ACastVisitor visitor) throws IOException, AsterixException {
+ if (reqType.getTypeTag().equals(ATypeTag.UNORDEREDLIST)) {
+ unOrderedListBuilder.reset((AUnorderedListType) reqType);
+ reqItemType = reqType.getItemType();
+ }
+ if (reqType.getTypeTag().equals(ATypeTag.ORDEREDLIST)) {
+ orderedListBuilder.reset((AOrderedListType) reqType);
+ reqItemType = reqType.getItemType();
+ }
+ dataBos.reset();
+
+ List<IVisitablePointable> itemTags = listAccessor.getItemTags();
+ List<IVisitablePointable> items = listAccessor.getItems();
+
+ int start = dataBos.size();
+ for (int i = 0; i < items.size(); i++) {
+ IVisitablePointable itemTypeTag = itemTags.get(i);
+ IVisitablePointable item = items.get(i);
+ ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(itemTypeTag.getByteArray()[itemTypeTag
+ .getStartOffset()]);
+ if (reqItemType == null || reqItemType.getTypeTag().equals(ATypeTag.ANY)) {
+ itemVisitorArg.second = DefaultOpenFieldType.getDefaultOpenFieldType(typeTag);
+ item.accept(visitor, itemVisitorArg);
+ } else {
+ if (typeTag != reqItemType.getTypeTag())
+ throw new AsterixException("mismatched item type");
+ itemVisitorArg.second = reqItemType;
+ item.accept(visitor, itemVisitorArg);
+ }
+ if (reqType.getTypeTag().equals(ATypeTag.ORDEREDLIST)) {
+ orderedListBuilder.addItem(itemVisitorArg.first);
+ }
+ if (reqType.getTypeTag().equals(ATypeTag.UNORDEREDLIST)) {
+ unOrderedListBuilder.addItem(itemVisitorArg.first);
+ }
+ }
+ if (reqType.getTypeTag().equals(ATypeTag.ORDEREDLIST)) {
+ orderedListBuilder.write(dataDos, true);
+ }
+ if (reqType.getTypeTag().equals(ATypeTag.UNORDEREDLIST)) {
+ unOrderedListBuilder.write(dataDos, true);
+ }
+ int end = dataBos.size();
+ resultAccessor.set(dataBos.getByteArray(), start, end - start);
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/ARecordCaster.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/ARecordCaster.java
new file mode 100644
index 0000000..fbad7a7
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/ARecordCaster.java
@@ -0,0 +1,318 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.pointables.cast;
+
+import java.io.DataOutput;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import edu.uci.ics.asterix.builders.RecordBuilder;
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.dataflow.data.nontagged.AqlNullWriterFactory;
+import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.PointableAllocator;
+import edu.uci.ics.asterix.om.pointables.base.DefaultOpenFieldType;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.AUnionType;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
+import edu.uci.ics.asterix.om.util.ResettableByteArrayOutputStream;
+import edu.uci.ics.hyracks.algebricks.common.utils.Triple;
+import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
+import edu.uci.ics.hyracks.api.dataflow.value.INullWriter;
+import edu.uci.ics.hyracks.data.std.accessors.PointableBinaryComparatorFactory;
+import edu.uci.ics.hyracks.data.std.api.IValueReference;
+import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
+
+/**
+ * This class is to do the runtime type cast for a record. It is ONLY visible to
+ * ACastVisitor.
+ */
+class ARecordCaster {
+
+ // pointable allocator
+ private final PointableAllocator allocator = new PointableAllocator();
+
+ private final List<IVisitablePointable> reqFieldNames = new ArrayList<IVisitablePointable>();
+ private final List<IVisitablePointable> reqFieldTypeTags = new ArrayList<IVisitablePointable>();
+ private ARecordType cachedReqType = null;
+
+ private final ResettableByteArrayOutputStream bos = new ResettableByteArrayOutputStream();
+ private final DataOutputStream dos = new DataOutputStream(bos);
+
+ private final RecordBuilder recBuilder = new RecordBuilder();
+ private final IVisitablePointable nullReference = allocator.allocateEmpty();
+ private final IVisitablePointable nullTypeTag = allocator.allocateEmpty();
+
+ private final IBinaryComparator fieldNameComparator = PointableBinaryComparatorFactory.of(
+ UTF8StringPointable.FACTORY).createBinaryComparator();
+
+ private final ByteArrayAccessibleOutputStream outputBos = new ByteArrayAccessibleOutputStream();
+ private final DataOutputStream outputDos = new DataOutputStream(outputBos);
+
+ private final IVisitablePointable fieldTempReference = allocator.allocateEmpty();
+ private final Triple<IVisitablePointable, IAType, Boolean> nestedVisitorArg = new Triple<IVisitablePointable, IAType, Boolean>(
+ fieldTempReference, null, null);
+
+ private int numInputFields = 0;
+
+ // describe closed fields in the required type
+ private int[] fieldPermutation;
+ private boolean[] optionalFields;
+
+ // describe fields (open or not) in the input records
+ private boolean[] openFields;
+ private int[] fieldNamesSortedIndex;
+ private int[] reqFieldNamesSortedIndex;
+
+ public ARecordCaster() {
+ try {
+ bos.reset();
+ int start = bos.size();
+ INullWriter nullWriter = AqlNullWriterFactory.INSTANCE.createNullWriter();
+ nullWriter.writeNull(dos);
+ int end = bos.size();
+ nullReference.set(bos.getByteArray(), start, end - start);
+ start = bos.size();
+ dos.write(ATypeTag.NULL.serialize());
+ end = bos.size();
+ nullTypeTag.set(bos.getByteArray(), start, end);
+ } catch (IOException e) {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ public void castRecord(ARecordPointable recordAccessor, IVisitablePointable resultAccessor, ARecordType reqType,
+ ACastVisitor visitor) throws IOException, AsterixException {
+ List<IVisitablePointable> fieldNames = recordAccessor.getFieldNames();
+ List<IVisitablePointable> fieldTypeTags = recordAccessor.getFieldTypeTags();
+ List<IVisitablePointable> fieldValues = recordAccessor.getFieldValues();
+ numInputFields = fieldNames.size();
+
+ if (openFields == null || numInputFields > openFields.length) {
+ openFields = new boolean[numInputFields];
+ fieldNamesSortedIndex = new int[numInputFields];
+ }
+ if (cachedReqType == null || !reqType.equals(cachedReqType)) {
+ loadRequiredType(reqType);
+ }
+
+ // clear the previous states
+ reset();
+ matchClosedPart(fieldNames, fieldTypeTags, fieldValues);
+ writeOutput(fieldNames, fieldTypeTags, fieldValues, outputDos, visitor);
+ resultAccessor.set(outputBos.getByteArray(), 0, outputBos.size());
+ }
+
+ private void reset() {
+ for (int i = 0; i < numInputFields; i++)
+ openFields[i] = true;
+ for (int i = 0; i < fieldPermutation.length; i++)
+ fieldPermutation[i] = -1;
+ for (int i = 0; i < numInputFields; i++)
+ fieldNamesSortedIndex[i] = i;
+ outputBos.reset();
+ }
+
+ private void loadRequiredType(ARecordType reqType) throws IOException {
+ reqFieldNames.clear();
+ reqFieldTypeTags.clear();
+
+ cachedReqType = reqType;
+ int numSchemaFields = reqType.getFieldTypes().length;
+ IAType[] fieldTypes = reqType.getFieldTypes();
+ String[] fieldNames = reqType.getFieldNames();
+ fieldPermutation = new int[numSchemaFields];
+ optionalFields = new boolean[numSchemaFields];
+ for (int i = 0; i < optionalFields.length; i++)
+ optionalFields[i] = false;
+
+ bos.reset(nullReference.getStartOffset() + nullReference.getLength());
+ for (int i = 0; i < numSchemaFields; i++) {
+ ATypeTag ftypeTag = fieldTypes[i].getTypeTag();
+ String fname = fieldNames[i];
+
+ // add type tag pointable
+ if (fieldTypes[i].getTypeTag() == ATypeTag.UNION
+ && NonTaggedFormatUtil.isOptionalField((AUnionType) fieldTypes[i])) {
+ // optional field: add the embedded non-null type tag
+ ftypeTag = ((AUnionType) fieldTypes[i]).getUnionList()
+ .get(NonTaggedFormatUtil.OPTIONAL_TYPE_INDEX_IN_UNION_LIST).getTypeTag();
+ optionalFields[i] = true;
+ }
+ int tagStart = bos.size();
+ dos.writeByte(ftypeTag.serialize());
+ int tagEnd = bos.size();
+ IVisitablePointable typeTagPointable = allocator.allocateEmpty();
+ typeTagPointable.set(bos.getByteArray(), tagStart, tagEnd - tagStart);
+ reqFieldTypeTags.add(typeTagPointable);
+
+ // add type name pointable (including a string type tag)
+ int nameStart = bos.size();
+ dos.write(ATypeTag.STRING.serialize());
+ dos.writeUTF(fname);
+ int nameEnd = bos.size();
+ IVisitablePointable typeNamePointable = allocator.allocateEmpty();
+ typeNamePointable.set(bos.getByteArray(), nameStart, nameEnd - nameStart);
+ reqFieldNames.add(typeNamePointable);
+ }
+
+ reqFieldNamesSortedIndex = new int[reqFieldNames.size()];
+ for (int i = 0; i < reqFieldNamesSortedIndex.length; i++)
+ reqFieldNamesSortedIndex[i] = i;
+ // sort the field name index
+ quickSort(reqFieldNamesSortedIndex, reqFieldNames, 0, reqFieldNamesSortedIndex.length - 1);
+ }
+
+ private void matchClosedPart(List<IVisitablePointable> fieldNames, List<IVisitablePointable> fieldTypeTags,
+ List<IVisitablePointable> fieldValues) {
+ // sort-merge based match
+ quickSort(fieldNamesSortedIndex, fieldNames, 0, numInputFields - 1);
+ int fnStart = 0;
+ int reqFnStart = 0;
+ while (fnStart < numInputFields && reqFnStart < reqFieldNames.size()) {
+ int fnPos = fieldNamesSortedIndex[fnStart];
+ int reqFnPos = reqFieldNamesSortedIndex[reqFnStart];
+ int c = compare(fieldNames.get(fnPos), reqFieldNames.get(reqFnPos));
+ if (c == 0) {
+ IVisitablePointable fieldTypeTag = fieldTypeTags.get(fnPos);
+ IVisitablePointable reqFieldTypeTag = reqFieldTypeTags.get(reqFnPos);
+ if (fieldTypeTag.equals(reqFieldTypeTag) || (
+ // match the null type of optional field
+ optionalFields[reqFnPos] && fieldTypeTag.equals(nullTypeTag))) {
+ fieldPermutation[reqFnPos] = fnPos;
+ openFields[fnPos] = false;
+ }
+ fnStart++;
+ reqFnStart++;
+ }
+ if (c > 0)
+ reqFnStart++;
+ if (c < 0)
+ fnStart++;
+ }
+
+ // check unmatched fields in the input type
+ for (int i = 0; i < openFields.length; i++) {
+ if (openFields[i] == true && !cachedReqType.isOpen())
+ throw new IllegalStateException("type mismatch: including extra closed fields");
+ }
+
+ // check unmatched fields in the required type
+ for (int i = 0; i < fieldPermutation.length; i++) {
+ if (fieldPermutation[i] < 0) {
+ IAType t = cachedReqType.getFieldTypes()[i];
+ if (!(t.getTypeTag() == ATypeTag.UNION && NonTaggedFormatUtil.isOptionalField((AUnionType) t))) {
+ // no matched field in the input for a required closed field
+ throw new IllegalStateException("type mismatch: miss a required closed field");
+ }
+ }
+ }
+ }
+
+ private void writeOutput(List<IVisitablePointable> fieldNames, List<IVisitablePointable> fieldTypeTags,
+ List<IVisitablePointable> fieldValues, DataOutput output, ACastVisitor visitor) throws IOException,
+ AsterixException {
+ // reset the states of the record builder
+ recBuilder.reset(cachedReqType);
+ recBuilder.init();
+
+ // write the closed part
+ for (int i = 0; i < fieldPermutation.length; i++) {
+ int pos = fieldPermutation[i];
+ IVisitablePointable field;
+ if (pos >= 0) {
+ field = fieldValues.get(pos);
+ } else {
+ field = nullReference;
+ }
+ IAType fType = cachedReqType.getFieldTypes()[i];
+ nestedVisitorArg.second = fType;
+
+ // recursively casting, the result of casting can always be thought
+ // as flat
+ if (optionalFields[i]) {
+ nestedVisitorArg.second = ((AUnionType) fType).getUnionList().get(
+ NonTaggedFormatUtil.OPTIONAL_TYPE_INDEX_IN_UNION_LIST);
+ }
+ field.accept(visitor, nestedVisitorArg);
+ recBuilder.addField(i, nestedVisitorArg.first);
+ }
+
+ // write the open part
+ for (int i = 0; i < numInputFields; i++) {
+ if (openFields[i]) {
+ IVisitablePointable name = fieldNames.get(i);
+ IVisitablePointable field = fieldValues.get(i);
+ IVisitablePointable fieldTypeTag = fieldTypeTags.get(i);
+
+ ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER
+ .deserialize(fieldTypeTag.getByteArray()[fieldTypeTag.getStartOffset()]);
+ nestedVisitorArg.second = DefaultOpenFieldType.getDefaultOpenFieldType(typeTag);
+ field.accept(visitor, nestedVisitorArg);
+ recBuilder.addField(name, nestedVisitorArg.first);
+ }
+ }
+ recBuilder.write(output, true);
+ }
+
+ private void quickSort(int[] index, List<IVisitablePointable> names, int start, int end) {
+ if (end <= start)
+ return;
+ int i = partition(index, names, start, end);
+ quickSort(index, names, start, i - 1);
+ quickSort(index, names, i + 1, end);
+ }
+
+ private int partition(int[] index, List<IVisitablePointable> names, int left, int right) {
+ int i = left - 1;
+ int j = right;
+ while (true) {
+ // grow from the left
+ while (compare(names.get(index[++i]), names.get(index[right])) < 0)
+ ;
+ // lower from the right
+ while (compare(names.get(index[right]), names.get(index[--j])) < 0)
+ if (j == left)
+ break;
+ if (i >= j)
+ break;
+ // swap i and j
+ swap(index, i, j);
+ }
+ // swap i and right
+ swap(index, i, right); // swap with partition element
+ return i;
+ }
+
+ private void swap(int[] array, int i, int j) {
+ int temp = array[i];
+ array[i] = array[j];
+ array[j] = temp;
+ }
+
+ private int compare(IValueReference a, IValueReference b) {
+ // start+1 and len-1 due to the type tag
+ return fieldNameComparator.compare(a.getByteArray(), a.getStartOffset() + 1, a.getLength() - 1,
+ b.getByteArray(), b.getStartOffset() + 1, b.getLength() - 1);
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/AListPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/AListPrinter.java
new file mode 100644
index 0000000..283c916
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/AListPrinter.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.pointables.printer;
+
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.List;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.pointables.AListPointable;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
+
+/**
+ * This class is to print the content of a list. It is ONLY visible to
+ * APrintVisitor.
+ */
+class AListPrinter {
+ private static String LEFT_PAREN = "{{ ";
+ private static String RIGHT_PAREN = " }}";
+ private static String LEFT_PAREN_ORDERED = "[ ";
+ private static String RIGHT_PAREN_ORDERED = " ]";
+ private static String COMMA = ", ";
+
+ private final Pair<PrintStream, ATypeTag> itemVisitorArg = new Pair<PrintStream, ATypeTag>(null, null);
+ private String leftParen = LEFT_PAREN;
+ private String rightParen = RIGHT_PAREN;
+
+ public AListPrinter(boolean ordered) {
+ if (ordered) {
+ leftParen = LEFT_PAREN_ORDERED;
+ rightParen = RIGHT_PAREN_ORDERED;
+ }
+ }
+
+ public void printList(AListPointable listAccessor, PrintStream ps, APrintVisitor visitor) throws IOException,
+ AsterixException {
+ List<IVisitablePointable> itemTags = listAccessor.getItemTags();
+ List<IVisitablePointable> items = listAccessor.getItems();
+ itemVisitorArg.first = ps;
+
+ // print the beginning part
+ ps.print(leftParen);
+
+ // print item 0 to n-2
+ for (int i = 0; i < items.size() - 1; i++) {
+ printItem(visitor, itemTags, items, i);
+ // print the comma
+ ps.print(COMMA);
+ }
+
+ // print item n-1
+ if (items.size() > 0) {
+ printItem(visitor, itemTags, items, items.size() - 1);
+ }
+
+ // print the end part
+ ps.print(rightParen);
+ }
+
+ private void printItem(APrintVisitor visitor, List<IVisitablePointable> itemTags, List<IVisitablePointable> items,
+ int i) throws AsterixException {
+ IVisitablePointable itemTypeTag = itemTags.get(i);
+ IVisitablePointable item = items.get(i);
+ ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(itemTypeTag.getByteArray()[itemTypeTag
+ .getStartOffset()]);
+ itemVisitorArg.second = item.getLength() <= 1 ? ATypeTag.NULL : typeTag;
+ item.accept(visitor, itemVisitorArg);
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/APrintVisitor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/APrintVisitor.java
new file mode 100644
index 0000000..3664804
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/APrintVisitor.java
@@ -0,0 +1,185 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.pointables.printer;
+
+import java.io.PrintStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ABooleanPrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ACirclePrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ADatePrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ADateTimePrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ADoublePrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ADurationPrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.AFloatPrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.AInt16Printer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.AInt32Printer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.AInt64Printer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.AInt8Printer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ALinePrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ANullPrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.APoint3DPrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.APointPrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.APolygonPrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ARectanglePrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.AStringPrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ATimePrinter;
+import edu.uci.ics.asterix.om.pointables.AFlatValuePointable;
+import edu.uci.ics.asterix.om.pointables.AListPointable;
+import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.visitor.IVisitablePointableVisitor;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
+
+/**
+ * This class is a IVisitablePointableVisitor implementation which recursively
+ * visit a given record, list or flat value of a given type, and print it to a
+ * PrintStream in adm format.
+ */
+public class APrintVisitor implements IVisitablePointableVisitor<Void, Pair<PrintStream, ATypeTag>> {
+
+ private final Map<IVisitablePointable, ARecordPrinter> raccessorToPrinter = new HashMap<IVisitablePointable, ARecordPrinter>();
+ private final Map<IVisitablePointable, AListPrinter> laccessorToPrinter = new HashMap<IVisitablePointable, AListPrinter>();
+
+ @Override
+ public Void visit(AListPointable accessor, Pair<PrintStream, ATypeTag> arg) throws AsterixException {
+ AListPrinter printer = laccessorToPrinter.get(accessor);
+ if (printer == null) {
+ printer = new AListPrinter(accessor.ordered());
+ laccessorToPrinter.put(accessor, printer);
+ }
+ try {
+ printer.printList(accessor, arg.first, this);
+ } catch (Exception e) {
+ throw new AsterixException(e);
+ }
+ return null;
+ }
+
+ @Override
+ public Void visit(ARecordPointable accessor, Pair<PrintStream, ATypeTag> arg) throws AsterixException {
+ ARecordPrinter printer = raccessorToPrinter.get(accessor);
+ if (printer == null) {
+ printer = new ARecordPrinter();
+ raccessorToPrinter.put(accessor, printer);
+ }
+ try {
+ printer.printRecord(accessor, arg.first, this);
+ } catch (Exception e) {
+ throw new AsterixException(e);
+ }
+ return null;
+ }
+
+ @Override
+ public Void visit(AFlatValuePointable accessor, Pair<PrintStream, ATypeTag> arg) {
+ try {
+ byte[] b = accessor.getByteArray();
+ int s = accessor.getStartOffset();
+ int l = accessor.getLength();
+ PrintStream ps = arg.first;
+ ATypeTag typeTag = arg.second;
+ switch (typeTag) {
+ case INT8: {
+ AInt8Printer.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ case INT16: {
+ AInt16Printer.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ case INT32: {
+ AInt32Printer.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ case INT64: {
+ AInt64Printer.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ case NULL: {
+ ANullPrinter.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ case BOOLEAN: {
+ ABooleanPrinter.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ case FLOAT: {
+ AFloatPrinter.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ case DOUBLE: {
+ ADoublePrinter.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ case DATE: {
+ ADatePrinter.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ case TIME: {
+ ATimePrinter.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ case DATETIME: {
+ ADateTimePrinter.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ case DURATION: {
+ ADurationPrinter.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ case POINT: {
+ APointPrinter.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ case POINT3D: {
+ APoint3DPrinter.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ case LINE: {
+ ALinePrinter.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ case POLYGON: {
+ APolygonPrinter.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ case CIRCLE: {
+ ACirclePrinter.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ case RECTANGLE: {
+ ARectanglePrinter.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ case STRING: {
+ AStringPrinter.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ default: {
+ throw new NotImplementedException("No printer for type " + typeTag);
+ }
+ }
+ return null;
+ } catch (Exception e) {
+ throw new IllegalStateException(e);
+ }
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/ARecordPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/ARecordPrinter.java
new file mode 100644
index 0000000..55f9447
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/ARecordPrinter.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.pointables.printer;
+
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.List;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
+
+/**
+ * This class is to print the content of a record. It is ONLY visible to
+ * APrintVisitor.
+ */
+class ARecordPrinter {
+ private static String LEFT_PAREN = "{ ";
+ private static String RIGHT_PAREN = " }";
+ private static String COMMA = ", ";
+ private static String COLON = ": ";
+
+ private final Pair<PrintStream, ATypeTag> nameVisitorArg = new Pair<PrintStream, ATypeTag>(null, ATypeTag.STRING);
+ private final Pair<PrintStream, ATypeTag> itemVisitorArg = new Pair<PrintStream, ATypeTag>(null, null);
+
+ public ARecordPrinter() {
+
+ }
+
+ public void printRecord(ARecordPointable recordAccessor, PrintStream ps, APrintVisitor visitor) throws IOException,
+ AsterixException {
+ List<IVisitablePointable> fieldNames = recordAccessor.getFieldNames();
+ List<IVisitablePointable> fieldTags = recordAccessor.getFieldTypeTags();
+ List<IVisitablePointable> fieldValues = recordAccessor.getFieldValues();
+
+ nameVisitorArg.first = ps;
+ itemVisitorArg.first = ps;
+
+ // print the beginning part
+ ps.print(LEFT_PAREN);
+
+ // print field 0 to n-2
+ for (int i = 0; i < fieldNames.size() - 1; i++) {
+ printField(ps, visitor, fieldNames, fieldTags, fieldValues, i);
+ // print the comma
+ ps.print(COMMA);
+ }
+
+ // print field n-1
+ if (fieldValues.size() > 0) {
+ printField(ps, visitor, fieldNames, fieldTags, fieldValues, fieldValues.size() - 1);
+ }
+
+ // print the end part
+ ps.print(RIGHT_PAREN);
+ }
+
+ private void printField(PrintStream ps, APrintVisitor visitor, List<IVisitablePointable> fieldNames,
+ List<IVisitablePointable> fieldTags, List<IVisitablePointable> fieldValues, int i) throws AsterixException {
+ IVisitablePointable itemTypeTag = fieldTags.get(i);
+ IVisitablePointable item = fieldValues.get(i);
+ ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(itemTypeTag.getByteArray()[itemTypeTag
+ .getStartOffset()]);
+ itemVisitorArg.second = item.getLength() <= 1 ? ATypeTag.NULL : typeTag;
+
+ // print field name
+ fieldNames.get(i).accept(visitor, nameVisitorArg);
+ ps.print(COLON);
+ // print field value
+ item.accept(visitor, itemVisitorArg);
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/visitor/IVisitablePointableVisitor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/visitor/IVisitablePointableVisitor.java
new file mode 100644
index 0000000..bcb4b34
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/visitor/IVisitablePointableVisitor.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.pointables.visitor;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.pointables.AFlatValuePointable;
+import edu.uci.ics.asterix.om.pointables.AListPointable;
+import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+
+/**
+ * This interface is a visitor for all the three different IVisitablePointable
+ * (Note that right now we have three pointable implementations for type
+ * casting) implementations.
+ */
+public interface IVisitablePointableVisitor<R, T> {
+
+ public R visit(AListPointable accessor, T arg) throws AsterixException;
+
+ public R visit(ARecordPointable accessor, T arg) throws AsterixException;
+
+ public R visit(AFlatValuePointable accessor, T arg) throws AsterixException;
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractBinaryStringTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractBinaryStringTypeComputer.java
index 0615de4..3ada236 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractBinaryStringTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractBinaryStringTypeComputer.java
@@ -2,16 +2,12 @@
import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.AUnionType;
-import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.om.types.TypeHelper;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
/**
*
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractQuadStringTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractQuadStringTypeComputer.java
index 0baf221..1c6cb4d 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractQuadStringTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractQuadStringTypeComputer.java
@@ -3,12 +3,12 @@
import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
/**
*
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractTripleStringTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractTripleStringTypeComputer.java
index 429f1f0..a8a2413 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractTripleStringTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractTripleStringTypeComputer.java
@@ -3,12 +3,11 @@
import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
/**
*
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/FieldAccessByIndexResultType.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/FieldAccessByIndexResultType.java
index dbe338d..d4b11fa 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/FieldAccessByIndexResultType.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/FieldAccessByIndexResultType.java
@@ -38,6 +38,9 @@
}
IAType type0 = (IAType) obj;
ARecordType t0 = NonTaggedFieldAccessByNameResultType.getRecordTypeFromType(type0, expression);
+ if (t0 == null) {
+ return BuiltinType.ANY;
+ }
ILogicalExpression arg1 = f.getArguments().get(1).getValue();
if (arg1.getExpressionTag() != LogicalExpressionTag.CONSTANT) {
return BuiltinType.ANY;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedCollectionMemberResultType.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedCollectionMemberResultType.java
index 7caf99b..2a39d83 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedCollectionMemberResultType.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedCollectionMemberResultType.java
@@ -1,8 +1,5 @@
package edu.uci.ics.asterix.om.typecomputer.impl;
-import java.util.ArrayList;
-import java.util.List;
-
import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.AUnionType;
@@ -28,18 +25,13 @@
IMetadataProvider<?, ?> metadataProvider) throws AlgebricksException {
AbstractFunctionCallExpression f = (AbstractFunctionCallExpression) expression;
IAType type = (IAType) env.getType(f.getArguments().get(0).getValue());
- if (type.getTypeTag() == ATypeTag.UNION && NonTaggedFormatUtil.isOptionalField((AUnionType) type))
+ if (type.getTypeTag() == ATypeTag.UNION && NonTaggedFormatUtil.isOptionalField((AUnionType) type)) {
type = ((AUnionType) type).getUnionList().get(NonTaggedFormatUtil.OPTIONAL_TYPE_INDEX_IN_UNION_LIST);
- if (type.getTypeTag() == ATypeTag.ANY)
- return BuiltinType.ANY;
- else {
- if (((AbstractCollectionType) type).getItemType().getTypeTag() == ATypeTag.NULL)
- return BuiltinType.ANULL;
- List<IAType> unionList = new ArrayList<IAType>();
- unionList.add(BuiltinType.ANULL);
- unionList.add(((AbstractCollectionType) type).getItemType());
- return new AUnionType(unionList, "CollectionMemberResult");
}
+ if (type.getTypeTag() == ATypeTag.ANY) {
+ return BuiltinType.ANY;
+ }
+ return ((AbstractCollectionType) type).getItemType();
}
}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedFieldAccessByNameResultType.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedFieldAccessByNameResultType.java
index 4b8b32a9..db9d932 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedFieldAccessByNameResultType.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedFieldAccessByNameResultType.java
@@ -2,6 +2,7 @@
import edu.uci.ics.asterix.om.base.AString;
import edu.uci.ics.asterix.om.constants.AsterixConstantValue;
+import edu.uci.ics.asterix.om.pointables.base.DefaultOpenFieldType;
import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
import edu.uci.ics.asterix.om.types.ARecordType;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -9,7 +10,6 @@
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalExpressionTag;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
@@ -36,6 +36,9 @@
}
IAType type0 = (IAType) obj;
ARecordType t0 = getRecordTypeFromType(type0, expression);
+ if (t0 == null) {
+ return BuiltinType.ANY;
+ }
AbstractLogicalExpression arg1 = (AbstractLogicalExpression) f.getArguments().get(1).getValue();
if (arg1.getExpressionTag() != LogicalExpressionTag.CONSTANT) {
@@ -58,7 +61,7 @@
return (ARecordType) type0;
}
case ANY: {
- throw new NotImplementedException();
+ return DefaultOpenFieldType.NESTED_OPEN_RECORD_TYPE;
}
case UNION: {
AUnionType u = (AUnionType) type0;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericRoundHalfToEven2TypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericRoundHalfToEven2TypeComputer.java
index da90a06..fc65d43 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericRoundHalfToEven2TypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericRoundHalfToEven2TypeComputer.java
@@ -5,20 +5,21 @@
*/
package edu.uci.ics.asterix.om.typecomputer.impl;
+import java.util.ArrayList;
+import java.util.List;
+
import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.AUnionType;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
-import java.util.ArrayList;
-import java.util.List;
public class NonTaggedNumericRoundHalfToEven2TypeComputer implements IResultTypeComputer {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericUnaryFunctionTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericUnaryFunctionTypeComputer.java
index 454104b..bff0c0b 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericUnaryFunctionTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericUnaryFunctionTypeComputer.java
@@ -5,20 +5,21 @@
*/
package edu.uci.ics.asterix.om.typecomputer.impl;
+import java.util.ArrayList;
+import java.util.List;
+
import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.AUnionType;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
-import java.util.ArrayList;
-import java.util.List;
public class NonTaggedNumericUnaryFunctionTypeComputer implements IResultTypeComputer {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/OrderedListOfAPointTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/OrderedListOfAPointTypeComputer.java
new file mode 100644
index 0000000..f5ffeef
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/OrderedListOfAPointTypeComputer.java
@@ -0,0 +1,24 @@
+package edu.uci.ics.asterix.om.typecomputer.impl;
+
+import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
+import edu.uci.ics.asterix.om.types.AOrderedListType;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
+import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
+
+public class OrderedListOfAPointTypeComputer implements IResultTypeComputer {
+
+ public static final OrderedListOfAPointTypeComputer INSTANCE = new OrderedListOfAPointTypeComputer();
+
+ private OrderedListOfAPointTypeComputer() {
+ }
+
+ @Override
+ public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env,
+ IMetadataProvider<?, ?> metadataProvider) throws AlgebricksException {
+ return new AOrderedListType(BuiltinType.APOINT, null);
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/Substring2TypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/Substring2TypeComputer.java
index c5d224c..89fae39 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/Substring2TypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/Substring2TypeComputer.java
@@ -6,11 +6,11 @@
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
public class Substring2TypeComputer implements IResultTypeComputer {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/SubstringTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/SubstringTypeComputer.java
index b016de8..ebf34aa 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/SubstringTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/SubstringTypeComputer.java
@@ -6,11 +6,11 @@
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
public class SubstringTypeComputer implements IResultTypeComputer {
public static final SubstringTypeComputer INSTANCE = new SubstringTypeComputer();
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/UnaryStringInt32OrNullTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/UnaryStringInt32OrNullTypeComputer.java
index bcd45a7..2d3018d 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/UnaryStringInt32OrNullTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/UnaryStringInt32OrNullTypeComputer.java
@@ -9,13 +9,12 @@
import edu.uci.ics.asterix.om.types.AUnionType;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.om.types.TypeHelper;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
/**
*
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/UnaryStringOrNullTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/UnaryStringOrNullTypeComputer.java
index d26a43f..981bb7c 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/UnaryStringOrNullTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/UnaryStringOrNullTypeComputer.java
@@ -6,12 +6,11 @@
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.om.types.TypeHelper;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
/**
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ATypeTag.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ATypeTag.java
index 1076885..e69fbcd 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ATypeTag.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ATypeTag.java
@@ -23,7 +23,7 @@
FLOAT(11),
DOUBLE(12),
STRING(13),
- NULL(14),
+ NULL(14),
BOOLEAN(15),
DATETIME(16),
DATE(17),
@@ -42,8 +42,9 @@
LINE(30),
POLYGON(31),
CIRCLE(32),
+ INTERVAL(34),
RECTANGLE(33),
- INTERVAL(34);
+ SYSTEM_NULL(34);
private byte value;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/TypeSignature.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/TypeSignature.java
new file mode 100644
index 0000000..dc7c6fe
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/TypeSignature.java
@@ -0,0 +1,42 @@
+package edu.uci.ics.asterix.om.types;
+
+import java.io.Serializable;
+
+public class TypeSignature implements Serializable {
+
+ private final String dataverse;
+ private final String name;
+ private final String alias;
+
+ public TypeSignature(String namespace, String name) {
+ this.dataverse = namespace;
+ this.name = name;
+ this.alias = dataverse + "@" + name;
+ }
+
+ public boolean equals(Object o) {
+ if (!(o instanceof TypeSignature)) {
+ return false;
+ } else {
+ TypeSignature f = ((TypeSignature) o);
+ return dataverse.equals(f.getNamespace()) && name.equals(f.getName());
+ }
+ }
+
+ public String toString() {
+ return alias;
+ }
+
+ public int hashCode() {
+ return alias.hashCode();
+ }
+
+ public String getNamespace() {
+ return dataverse;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/AsterixRuntimeUtil.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/AsterixRuntimeUtil.java
new file mode 100644
index 0000000..76f3301
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/AsterixRuntimeUtil.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2009-2011 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.om.util;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import edu.uci.ics.asterix.common.api.AsterixAppContextInfoImpl;
+
+/**
+ * Utility class for obtaining information on the set of Hyracks NodeController
+ * processes that are running on a given host.
+ */
+public class AsterixRuntimeUtil {
+
+ public static Set<String> getNodeControllersOnIP(String ipAddress)
+ throws Exception {
+ Map<String, Set<String>> nodeControllerInfo = getNodeControllerMap();
+ Set<String> nodeControllersAtLocation = nodeControllerInfo
+ .get(ipAddress);
+ return nodeControllersAtLocation;
+ }
+
+ public static List<String> getAllNodeControllers() throws Exception {
+ Collection<Set<String>> nodeControllersCollection = getNodeControllerMap()
+ .values();
+ List<String> nodeControllers = new ArrayList<String>();
+ for (Set<String> ncCollection : nodeControllersCollection) {
+ nodeControllers.addAll(ncCollection);
+ }
+ return nodeControllers;
+ }
+
+ public static Map<String, Set<String>> getNodeControllerMap()
+ throws Exception {
+ Map<String, Set<String>> map = new HashMap<String, Set<String>>();
+ AsterixAppContextInfoImpl.getInstance().getCCApplicationContext()
+ .getCCContext().getIPAddressNodeMap(map);
+ return map;
+ }
+
+ public static String getIPAddress(String hostname)
+ throws UnknownHostException {
+ String address = InetAddress.getByName(hostname).getHostAddress();
+ if (address.equals("127.0.1.1")) {
+ address = "127.0.0.1";
+ }
+ return address;
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/NonTaggedFormatUtil.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/NonTaggedFormatUtil.java
index 8283559..a8c0485 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/NonTaggedFormatUtil.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/NonTaggedFormatUtil.java
@@ -139,6 +139,7 @@
case LINE:
case POLYGON:
case CIRCLE:
+ case RECTANGLE:
return 2;
case POINT3D:
return 3;
@@ -153,6 +154,7 @@
case LINE:
case POLYGON:
case CIRCLE:
+ case RECTANGLE:
return BuiltinType.ADOUBLE;
default:
throw new NotImplementedException(typeTag + " is not a supported spatial data type.");
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/ResettableByteArrayOutputStream.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/ResettableByteArrayOutputStream.java
new file mode 100644
index 0000000..e47d417
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/ResettableByteArrayOutputStream.java
@@ -0,0 +1,15 @@
+package edu.uci.ics.asterix.om.util;
+
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
+
+/**
+ * This class extends ByteArrayAccessibleOutputStream to allow reset to a given
+ * size.
+ *
+ */
+public class ResettableByteArrayOutputStream extends ByteArrayAccessibleOutputStream {
+
+ public void reset(int size) {
+ count = size;
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/container/IObjectFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/container/IObjectFactory.java
new file mode 100644
index 0000000..bf11b76
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/container/IObjectFactory.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.util.container;
+
+/**
+ * A factory interface to create objects.
+ */
+public interface IObjectFactory<E, T> {
+
+ /**
+ * create an element of type E
+ *
+ * @param arg
+ * @return an E element
+ */
+ public E create(T arg);
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/container/IObjectPool.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/container/IObjectPool.java
new file mode 100644
index 0000000..4969cd5
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/container/IObjectPool.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.util.container;
+
+/**
+ * A reusable object pool interface.
+ */
+public interface IObjectPool<E, T> {
+
+ /**
+ * Give client an E instance
+ *
+ * @param arg
+ * the argument to create E
+ * @return an E instance
+ */
+ public E allocate(T arg);
+
+ /**
+ * Mark all instances in the pool as unused
+ */
+ public void reset();
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/container/ListObjectPool.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/container/ListObjectPool.java
new file mode 100644
index 0000000..8d9057c
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/container/ListObjectPool.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.util.container;
+
+import java.util.ArrayList;
+import java.util.BitSet;
+import java.util.List;
+
+/**
+ * Object pool backed by a list.
+ *
+ * The argument for creating E instances could be different. This class also
+ * considers arguments in object reusing, e.g., it reuses an E instances ONLY
+ * when the construction argument is "equal".
+ */
+public class ListObjectPool<E, T> implements IObjectPool<E, T> {
+
+ private IObjectFactory<E, T> factory;
+
+ /**
+ * cache of objects
+ */
+ private List<E> pool = new ArrayList<E>();
+
+ /**
+ * args that are used to create each element in the pool
+ */
+ private List<T> args = new ArrayList<T>();
+
+ /**
+ * bits indicating which element is in use
+ */
+ private BitSet usedBits = new BitSet();
+
+ public ListObjectPool(IObjectFactory<E, T> factory) {
+ this.factory = factory;
+ }
+
+ @Override
+ public E allocate(T arg) {
+ int freeSlot = -1;
+ while (freeSlot + 1 < pool.size()) {
+ freeSlot = usedBits.nextClearBit(freeSlot + 1);
+ if (freeSlot >= pool.size())
+ break;
+
+ // the two cases where an element in the pool is a match
+ if ((arg == null && args.get(freeSlot) == null)
+ || (arg != null && args.get(freeSlot) != null && arg.equals(args.get(freeSlot)))) {
+ // the element is not used and the arg is the same as
+ // input arg
+ usedBits.set(freeSlot);
+ return pool.get(freeSlot);
+ }
+ }
+
+ // if we do not find a reusable object, allocate a new one
+ E element = factory.create(arg);
+ pool.add(element);
+ args.add(arg);
+ usedBits.set(pool.size() - 1);
+ return element;
+ }
+
+ @Override
+ public void reset() {
+ usedBits.clear();
+ }
+}
diff --git a/asterix-runtime/pom.xml b/asterix-runtime/pom.xml
index da3d5d0..cd9d908 100644
--- a/asterix-runtime/pom.xml
+++ b/asterix-runtime/pom.xml
@@ -57,7 +57,7 @@
<dependency>
<groupId>edu.uci.ics.hyracks</groupId>
<artifactId>hyracks-storage-am-btree</artifactId>
- <version>0.2.1-SNAPSHOT</version>
+ <version>0.2.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>edu.uci.ics.asterix</groupId>
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/base/AbstractAggregateFunctionDynamicDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/base/AbstractAggregateFunctionDynamicDescriptor.java
index 07d8141..09325e4 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/base/AbstractAggregateFunctionDynamicDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/base/AbstractAggregateFunctionDynamicDescriptor.java
@@ -1,12 +1,14 @@
package edu.uci.ics.asterix.runtime.aggregates.base;
import edu.uci.ics.asterix.common.functions.FunctionDescriptorTag;
-import edu.uci.ics.asterix.runtime.base.IAggregateFunctionDynamicDescriptor;
+import edu.uci.ics.asterix.om.functions.AbstractFunctionDescriptor;
-public abstract class AbstractAggregateFunctionDynamicDescriptor implements IAggregateFunctionDynamicDescriptor {
+public abstract class AbstractAggregateFunctionDynamicDescriptor extends AbstractFunctionDescriptor {
private static final long serialVersionUID = 1L;
public FunctionDescriptorTag getFunctionDescriptorTag() {
return FunctionDescriptorTag.AGGREGATE;
}
+
+
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/base/AbstractSerializableAggregateFunctionDynamicDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/base/AbstractSerializableAggregateFunctionDynamicDescriptor.java
index 0634868..abde117 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/base/AbstractSerializableAggregateFunctionDynamicDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/base/AbstractSerializableAggregateFunctionDynamicDescriptor.java
@@ -1,10 +1,9 @@
package edu.uci.ics.asterix.runtime.aggregates.base;
import edu.uci.ics.asterix.common.functions.FunctionDescriptorTag;
-import edu.uci.ics.asterix.runtime.base.ISerializableAggregateFunctionDynamicDescriptor;
+import edu.uci.ics.asterix.om.functions.AbstractFunctionDescriptor;
-public abstract class AbstractSerializableAggregateFunctionDynamicDescriptor implements
- ISerializableAggregateFunctionDynamicDescriptor {
+public abstract class AbstractSerializableAggregateFunctionDynamicDescriptor extends AbstractFunctionDescriptor {
private static final long serialVersionUID = 1L;
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/base/SingleFieldFrameTupleReference.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/base/SingleFieldFrameTupleReference.java
new file mode 100644
index 0000000..c0c08fd
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/base/SingleFieldFrameTupleReference.java
@@ -0,0 +1,47 @@
+package edu.uci.ics.asterix.runtime.aggregates.base;
+
+import edu.uci.ics.hyracks.api.comm.IFrameTupleAccessor;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class SingleFieldFrameTupleReference implements IFrameTupleReference {
+
+ private byte[] fieldData;
+ private int start;
+ private int length;
+
+ public void reset(byte[] fieldData, int start, int length) {
+ this.fieldData = fieldData;
+ this.start = start;
+ this.length = length;
+ }
+
+ @Override
+ public int getFieldCount() {
+ return 1;
+ }
+
+ @Override
+ public byte[] getFieldData(int fIdx) {
+ return fieldData;
+ }
+
+ @Override
+ public int getFieldStart(int fIdx) {
+ return start;
+ }
+
+ @Override
+ public int getFieldLength(int fIdx) {
+ return length;
+ }
+
+ @Override
+ public IFrameTupleAccessor getFrameTupleAccessor() {
+ return null;
+ }
+
+ @Override
+ public int getTupleIndex() {
+ return 0;
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/collections/ListifyAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/collections/ListifyAggregateDescriptor.java
index 8ddcb3f..a24b893 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/collections/ListifyAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/collections/ListifyAggregateDescriptor.java
@@ -1,6 +1,6 @@
package edu.uci.ics.asterix.runtime.aggregates.collections;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.AOrderedListType;
@@ -13,7 +13,6 @@
public class ListifyAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "listify", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new ListifyAggregateDescriptor();
@@ -28,7 +27,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.LISTIFY;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/collections/ListifyAggregateFunctionEvalFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/collections/ListifyAggregateFunctionEvalFactory.java
index d057c88..5c928e1 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/collections/ListifyAggregateFunctionEvalFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/collections/ListifyAggregateFunctionEvalFactory.java
@@ -10,7 +10,6 @@
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunctionFactory;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
@@ -38,11 +37,7 @@
@Override
public void init() throws AlgebricksException {
- try {
- builder.reset(orderedlistType);
- } catch (HyracksDataException e) {
- throw new AlgebricksException(e);
- }
+ builder.reset(orderedlistType);
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/AbstractScalarAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/AbstractScalarAggregateDescriptor.java
new file mode 100644
index 0000000..3de05f8
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/AbstractScalarAggregateDescriptor.java
@@ -0,0 +1,46 @@
+package edu.uci.ics.asterix.runtime.aggregates.scalar;
+
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
+import edu.uci.ics.asterix.om.functions.FunctionManagerHolder;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionManager;
+import edu.uci.ics.asterix.runtime.aggregates.base.AbstractAggregateFunctionDynamicDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import edu.uci.ics.asterix.runtime.unnestingfunctions.std.ScanCollectionDescriptor.ScanCollectionUnnestingFunctionFactory;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunctionFactory;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.algebricks.runtime.evaluators.ColumnAccessEvalFactory;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+
+public abstract class AbstractScalarAggregateDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
+ return new ICopyEvaluatorFactory() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public ICopyEvaluator createEvaluator(IDataOutputProvider output) throws AlgebricksException {
+ // The aggregate function will get a SingleFieldFrameTupleReference that points to the result of the ScanCollection.
+ // The list-item will always reside in the first field (column) of the SingleFieldFrameTupleReference.
+ ICopyEvaluatorFactory[] aggFuncArgs = new ICopyEvaluatorFactory[1];
+ aggFuncArgs[0] = new ColumnAccessEvalFactory(0);
+ // Create aggregate function from this scalar version.
+ FunctionIdentifier fid = AsterixBuiltinFunctions.getAggregateFunction(getIdentifier());
+ IFunctionManager mgr = FunctionManagerHolder.getFunctionManager();
+ IFunctionDescriptor fd = mgr.lookupFunction(fid);
+ AbstractAggregateFunctionDynamicDescriptor aggFuncDesc = (AbstractAggregateFunctionDynamicDescriptor) fd;
+ ICopyAggregateFunctionFactory aggFuncFactory = aggFuncDesc.createAggregateFunctionFactory(aggFuncArgs);
+ // Use ScanCollection to iterate over list items.
+ ScanCollectionUnnestingFunctionFactory scanCollectionFactory = new ScanCollectionUnnestingFunctionFactory(
+ args[0]);
+ return new GenericScalarAggregateFunction(aggFuncFactory.createAggregateFunction(output),
+ scanCollectionFactory);
+ }
+ };
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/GenericScalarAggregateFunction.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/GenericScalarAggregateFunction.java
new file mode 100644
index 0000000..195b391
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/GenericScalarAggregateFunction.java
@@ -0,0 +1,42 @@
+package edu.uci.ics.asterix.runtime.aggregates.scalar;
+
+import edu.uci.ics.asterix.runtime.aggregates.base.SingleFieldFrameTupleReference;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunction;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyUnnestingFunction;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyUnnestingFunctionFactory;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+/**
+ * Implements scalar aggregates by iterating over a collection with the ScanCollection unnesting function,
+ * and applying the corresponding ICopyAggregateFunction to each collection-item.
+ */
+public class GenericScalarAggregateFunction implements ICopyEvaluator {
+
+ private final ArrayBackedValueStorage listItemOut = new ArrayBackedValueStorage();
+ private final ICopyAggregateFunction aggFunc;
+ private final ICopyUnnestingFunction scanCollection;
+
+ private final SingleFieldFrameTupleReference itemTuple = new SingleFieldFrameTupleReference();
+
+ public GenericScalarAggregateFunction(ICopyAggregateFunction aggFunc,
+ ICopyUnnestingFunctionFactory scanCollectionFactory) throws AlgebricksException {
+ this.aggFunc = aggFunc;
+ this.scanCollection = scanCollectionFactory.createUnnestingFunction(listItemOut);
+ listItemOut.reset();
+ }
+
+ @Override
+ public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
+ scanCollection.init(tuple);
+ aggFunc.init();
+ while (scanCollection.step()) {
+ itemTuple.reset(listItemOut.getByteArray(), 0, listItemOut.getLength());
+ aggFunc.step(itemTuple);
+ listItemOut.reset();
+ }
+ aggFunc.finish();
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarAvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarAvgAggregateDescriptor.java
new file mode 100644
index 0000000..ae2a485
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarAvgAggregateDescriptor.java
@@ -0,0 +1,22 @@
+package edu.uci.ics.asterix.runtime.aggregates.scalar;
+
+import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+
+public class ScalarAvgAggregateDescriptor extends AbstractScalarAggregateDescriptor {
+
+ private static final long serialVersionUID = 1L;
+ public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "avg", 1);
+ public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+ public IFunctionDescriptor createFunctionDescriptor() {
+ return new ScalarAvgAggregateDescriptor();
+ }
+ };
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return FID;
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarCountAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarCountAggregateDescriptor.java
new file mode 100644
index 0000000..6f3baa6
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarCountAggregateDescriptor.java
@@ -0,0 +1,22 @@
+package edu.uci.ics.asterix.runtime.aggregates.scalar;
+
+import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+
+public class ScalarCountAggregateDescriptor extends AbstractScalarAggregateDescriptor {
+
+ private static final long serialVersionUID = 1L;
+ public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "count", 1);
+ public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+ public IFunctionDescriptor createFunctionDescriptor() {
+ return new ScalarCountAggregateDescriptor();
+ }
+ };
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return FID;
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarMaxAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarMaxAggregateDescriptor.java
new file mode 100644
index 0000000..a71eb3c
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarMaxAggregateDescriptor.java
@@ -0,0 +1,22 @@
+package edu.uci.ics.asterix.runtime.aggregates.scalar;
+
+import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+
+public class ScalarMaxAggregateDescriptor extends AbstractScalarAggregateDescriptor {
+
+ private static final long serialVersionUID = 1L;
+ public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "max", 1);
+ public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+ public IFunctionDescriptor createFunctionDescriptor() {
+ return new ScalarMaxAggregateDescriptor();
+ }
+ };
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return FID;
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarMinAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarMinAggregateDescriptor.java
new file mode 100644
index 0000000..4beae60
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarMinAggregateDescriptor.java
@@ -0,0 +1,22 @@
+package edu.uci.ics.asterix.runtime.aggregates.scalar;
+
+import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+
+public class ScalarMinAggregateDescriptor extends AbstractScalarAggregateDescriptor {
+
+ private static final long serialVersionUID = 1L;
+ public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "min", 1);
+ public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+ public IFunctionDescriptor createFunctionDescriptor() {
+ return new ScalarMinAggregateDescriptor();
+ }
+ };
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return FID;
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarSumAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarSumAggregateDescriptor.java
new file mode 100644
index 0000000..f3d9d1a
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarSumAggregateDescriptor.java
@@ -0,0 +1,22 @@
+package edu.uci.ics.asterix.runtime.aggregates.scalar;
+
+import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+
+public class ScalarSumAggregateDescriptor extends AbstractScalarAggregateDescriptor {
+
+ private static final long serialVersionUID = 1L;
+ public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "sum", 1);
+ public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+ public IFunctionDescriptor createFunctionDescriptor() {
+ return new ScalarSumAggregateDescriptor();
+ }
+ };
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return FID;
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableAvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableAvgAggregateDescriptor.java
index 057c274..6917f0b 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableAvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableAvgAggregateDescriptor.java
@@ -4,7 +4,6 @@
import java.io.IOException;
import edu.uci.ics.asterix.common.config.GlobalConfig;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
@@ -15,6 +14,7 @@
import edu.uci.ics.asterix.om.base.ADouble;
import edu.uci.ics.asterix.om.base.AMutableDouble;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -35,7 +35,6 @@
public class SerializableAvgAggregateDescriptor extends AbstractSerializableAggregateFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "avg-serial", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SerializableAvgAggregateDescriptor();
@@ -44,12 +43,12 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SERIAL_AVG;
}
@Override
- public ICopySerializableAggregateFunctionFactory createAggregateFunctionFactory(ICopyEvaluatorFactory[] args)
- throws AlgebricksException {
+ public ICopySerializableAggregateFunctionFactory createSerializableAggregateFunctionFactory(
+ ICopyEvaluatorFactory[] args) throws AlgebricksException {
final ICopyEvaluatorFactory[] evals = args;
return new ICopySerializableAggregateFunctionFactory() {
@@ -89,8 +88,8 @@
boolean metNull = BufferSerDeUtil.getBoolean(state, start + 16);
if (inputVal.getLength() > 0) {
++count;
- ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(inputVal.getByteArray()[0]);
+ ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(inputVal
+ .getByteArray()[0]);
switch (typeTag) {
case INT8: {
byte val = AInt8SerializerDeserializer.getByte(inputVal.getByteArray(), 1);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableCountAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableCountAggregateDescriptor.java
index 98e86d2..b232d6d 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableCountAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableCountAggregateDescriptor.java
@@ -3,30 +3,33 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AInt32;
import edu.uci.ics.asterix.om.base.AMutableInt32;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.runtime.aggregates.base.AbstractSerializableAggregateFunctionDynamicDescriptor;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopySerializableAggregateFunction;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopySerializableAggregateFunctionFactory;
import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
/**
- * NULLs are also counted.
+ * count(NULL) returns NULL.
*/
public class SerializableCountAggregateDescriptor extends AbstractSerializableAggregateFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "count-serial",
- 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SerializableCountAggregateDescriptor();
@@ -35,12 +38,12 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SERIAL_COUNT;
}
@Override
- public ICopySerializableAggregateFunctionFactory createAggregateFunctionFactory(final ICopyEvaluatorFactory[] args)
- throws AlgebricksException {
+ public ICopySerializableAggregateFunctionFactory createSerializableAggregateFunctionFactory(
+ final ICopyEvaluatorFactory[] args) throws AlgebricksException {
return new ICopySerializableAggregateFunctionFactory() {
private static final long serialVersionUID = 1L;
@@ -52,10 +55,16 @@
@SuppressWarnings("unchecked")
private ISerializerDeserializer<AInt32> int32Serde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.AINT32);
+ @SuppressWarnings("unchecked")
+ private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ANULL);
+ private ArrayBackedValueStorage inputVal = new ArrayBackedValueStorage();
+ private ICopyEvaluator eval = args[0].createEvaluator(inputVal);
@Override
public void init(DataOutput state) throws AlgebricksException {
try {
+ state.writeBoolean(false);
state.writeInt(0);
} catch (IOException e) {
throw new AlgebricksException(e);
@@ -65,17 +74,32 @@
@Override
public void step(IFrameTupleReference tuple, byte[] state, int start, int len)
throws AlgebricksException {
- int cnt = BufferSerDeUtil.getInt(state, start);
- cnt++;
- BufferSerDeUtil.writeInt(cnt, state, start);
+ boolean metNull = BufferSerDeUtil.getBoolean(state, start);
+ int cnt = BufferSerDeUtil.getInt(state, start + 1);
+ inputVal.reset();
+ eval.evaluate(tuple);
+ ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER
+ .deserialize(inputVal.getByteArray()[0]);
+ if (typeTag == ATypeTag.NULL) {
+ metNull = true;
+ } else {
+ cnt++;
+ }
+ BufferSerDeUtil.writeBoolean(metNull, state, start);
+ BufferSerDeUtil.writeInt(cnt, state, start + 1);
}
@Override
public void finish(byte[] state, int start, int len, DataOutput out) throws AlgebricksException {
- int cnt = BufferSerDeUtil.getInt(state, start);
+ boolean metNull = BufferSerDeUtil.getBoolean(state, start);
+ int cnt = BufferSerDeUtil.getInt(state, start + 1);
try {
- result.setValue(cnt);
- int32Serde.serialize(result, out);
+ if (metNull) {
+ nullSerde.serialize(ANull.NULL, out);
+ } else {
+ result.setValue(cnt);
+ int32Serde.serialize(result, out);
+ }
} catch (IOException e) {
throw new AlgebricksException(e);
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableGlobalAvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableGlobalAvgAggregateDescriptor.java
index 31d9345..89081ab 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableGlobalAvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableGlobalAvgAggregateDescriptor.java
@@ -6,8 +6,6 @@
import java.util.ArrayList;
import java.util.List;
-import edu.uci.ics.asterix.common.config.GlobalConfig;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ARecordSerializerDeserializer;
@@ -17,6 +15,7 @@
import edu.uci.ics.asterix.om.base.AMutableDouble;
import edu.uci.ics.asterix.om.base.AMutableInt64;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ARecordType;
@@ -42,10 +41,6 @@
public class SerializableGlobalAvgAggregateDescriptor extends AbstractSerializableAggregateFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "global-avg-serial", 1);
- private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
- private final static byte SER_RECORD_TYPE_TAG = ATypeTag.RECORD.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SerializableGlobalAvgAggregateDescriptor();
@@ -54,12 +49,12 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SERIAL_GLOBAL_AVG;
}
@Override
- public ICopySerializableAggregateFunctionFactory createAggregateFunctionFactory(ICopyEvaluatorFactory[] args)
- throws AlgebricksException {
+ public ICopySerializableAggregateFunctionFactory createSerializableAggregateFunctionFactory(
+ ICopyEvaluatorFactory[] args) throws AlgebricksException {
final ICopyEvaluatorFactory[] evals = args;
List<IAType> unionList = new ArrayList<IAType>();
unionList.add(BuiltinType.ANULL);
@@ -119,11 +114,24 @@
inputVal.reset();
eval.evaluate(tuple);
byte[] serBytes = inputVal.getByteArray();
- if (serBytes[0] == SER_NULL_TYPE_TAG)
- metNull = true;
- if (serBytes[0] != SER_RECORD_TYPE_TAG) {
- throw new AlgebricksException("Global-Avg is not defined for values of type "
- + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serBytes[0]));
+ ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serBytes[0]);
+ switch (typeTag) {
+ case NULL: {
+ metNull = true;
+ break;
+ }
+ case SYSTEM_NULL: {
+ // Ignore and return.
+ return;
+ }
+ case RECORD: {
+ // Expected.
+ break;
+ }
+ default: {
+ throw new AlgebricksException("Global-Avg is not defined for values of type "
+ + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serBytes[0]));
+ }
}
int offset1 = ARecordSerializerDeserializer.getFieldOffsetById(serBytes, 0, 1, true);
if (offset1 == 0) // the sum is null
@@ -146,19 +154,15 @@
long globalCount = BufferSerDeUtil.getLong(state, start + 8);
boolean metNull = BufferSerDeUtil.getBoolean(state, start + 16);
- if (globalCount == 0) {
- GlobalConfig.ASTERIX_LOGGER.fine("AVG aggregate ran over empty input.");
- } else {
- try {
- if (metNull)
- nullSerde.serialize(ANull.NULL, result);
- else {
- aDouble.setValue(globalSum / globalCount);
- doubleSerde.serialize(aDouble, result);
- }
- } catch (IOException e) {
- throw new AlgebricksException(e);
+ try {
+ if (globalCount == 0 || metNull)
+ nullSerde.serialize(ANull.NULL, result);
+ else {
+ aDouble.setValue(globalSum / globalCount);
+ doubleSerde.serialize(aDouble, result);
}
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
}
}
@@ -170,28 +174,24 @@
boolean metNull = BufferSerDeUtil.getBoolean(state, start + 16);
if (recordEval == null)
- recordEval = new ClosedRecordConstructorEval(recType,
- new ICopyEvaluator[] { evalSum, evalCount }, avgBytes, result);
+ recordEval = new ClosedRecordConstructorEval(recType, new ICopyEvaluator[] { evalSum,
+ evalCount }, avgBytes, result);
- if (globalCount == 0) {
- GlobalConfig.ASTERIX_LOGGER.fine("AVG aggregate ran over empty input.");
- } else {
- try {
- if (metNull) {
- sumBytes.reset();
- nullSerde.serialize(ANull.NULL, sumBytesOutput);
- } else {
- sumBytes.reset();
- aDouble.setValue(globalSum);
- doubleSerde.serialize(aDouble, sumBytesOutput);
- }
- countBytes.reset();
- aInt64.setValue(globalCount);
- longSerde.serialize(aInt64, countBytesOutput);
- recordEval.evaluate(null);
- } catch (IOException e) {
- throw new AlgebricksException(e);
+ try {
+ if (globalCount == 0 || metNull) {
+ sumBytes.reset();
+ nullSerde.serialize(ANull.NULL, sumBytesOutput);
+ } else {
+ sumBytes.reset();
+ aDouble.setValue(globalSum);
+ doubleSerde.serialize(aDouble, sumBytesOutput);
}
+ countBytes.reset();
+ aInt64.setValue(globalCount);
+ longSerde.serialize(aInt64, countBytesOutput);
+ recordEval.evaluate(null);
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
}
}
};
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableLocalAvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableLocalAvgAggregateDescriptor.java
index c12a9a6..41047f7 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableLocalAvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableLocalAvgAggregateDescriptor.java
@@ -6,8 +6,6 @@
import java.util.ArrayList;
import java.util.List;
-import edu.uci.ics.asterix.common.config.GlobalConfig;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
@@ -20,6 +18,7 @@
import edu.uci.ics.asterix.om.base.AMutableDouble;
import edu.uci.ics.asterix.om.base.AMutableInt64;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ARecordType;
@@ -46,8 +45,6 @@
public class SerializableLocalAvgAggregateDescriptor extends AbstractSerializableAggregateFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "local-avg-serial", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SerializableLocalAvgAggregateDescriptor();
@@ -56,12 +53,12 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SERIAL_LOCAL_AVG;
}
@Override
- public ICopySerializableAggregateFunctionFactory createAggregateFunctionFactory(ICopyEvaluatorFactory[] args)
- throws AlgebricksException {
+ public ICopySerializableAggregateFunctionFactory createSerializableAggregateFunctionFactory(
+ ICopyEvaluatorFactory[] args) throws AlgebricksException {
final ICopyEvaluatorFactory[] evals = args;
List<IAType> unionList = new ArrayList<IAType>();
unionList.add(BuiltinType.ANULL);
@@ -104,7 +101,7 @@
try {
state.writeDouble(0.0);
state.writeLong(0);
- state.writeBoolean(false);
+ state.writeByte(ATypeTag.SYSTEM_NULL.serialize());
} catch (IOException e) {
throw new AlgebricksException(e);
}
@@ -117,87 +114,90 @@
eval.evaluate(tuple);
double sum = BufferSerDeUtil.getDouble(state, start);
long count = BufferSerDeUtil.getLong(state, start + 8);
- boolean metNull = BufferSerDeUtil.getBoolean(state, start + 16);
- if (inputVal.getLength() > 0) {
- ++count;
- ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(inputVal.getByteArray()[0]);
- switch (typeTag) {
- case INT8: {
- byte val = AInt8SerializerDeserializer.getByte(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case INT16: {
- short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case INT32: {
- int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case INT64: {
- long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case FLOAT: {
- float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case DOUBLE: {
- double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case NULL: {
- metNull = true;
- break;
- }
- default: {
- throw new NotImplementedException("Cannot compute AVG for values of type "
- + typeTag);
- }
+ ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER
+ .deserialize(inputVal.getByteArray()[0]);
+ ATypeTag aggType = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(state[start + 16]);
+ if (typeTag == ATypeTag.NULL || aggType == ATypeTag.NULL) {
+ aggType = ATypeTag.NULL;
+ return;
+ } else if (aggType == ATypeTag.SYSTEM_NULL) {
+ aggType = typeTag;
+ } else if (typeTag != ATypeTag.SYSTEM_NULL && typeTag != aggType) {
+ throw new AlgebricksException("Unexpected type " + typeTag
+ + " in aggregation input stream. Expected type " + aggType + ".");
+ }
+ ++count;
+ switch (typeTag) {
+ case INT8: {
+ byte val = AInt8SerializerDeserializer.getByte(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
}
- inputVal.reset();
+ case INT16: {
+ short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case INT32: {
+ int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case INT64: {
+ long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case FLOAT: {
+ float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case DOUBLE: {
+ double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case NULL: {
+ break;
+ }
+ default: {
+ throw new NotImplementedException("Cannot compute AVG for values of type " + typeTag);
+ }
}
BufferSerDeUtil.writeDouble(sum, state, start);
BufferSerDeUtil.writeLong(count, state, start + 8);
- BufferSerDeUtil.writeBoolean(metNull, state, start + 16);
+ state[start + 16] = aggType.serialize();
}
@Override
public void finish(byte[] state, int start, int len, DataOutput result) throws AlgebricksException {
double sum = BufferSerDeUtil.getDouble(state, start);
long count = BufferSerDeUtil.getLong(state, start + 8);
- boolean metNull = BufferSerDeUtil.getBoolean(state, start + 16);
- if (recordEval == null)
- recordEval = new ClosedRecordConstructorEval(recType,
- new ICopyEvaluator[] { evalSum, evalCount }, avgBytes, result);
- if (count == 0) {
- if (GlobalConfig.DEBUG) {
- GlobalConfig.ASTERIX_LOGGER.finest("AVG aggregate ran over empty input.");
+ ATypeTag aggType = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(state[start + 16]);
+ if (recordEval == null) {
+ recordEval = new ClosedRecordConstructorEval(recType, new ICopyEvaluator[] { evalSum,
+ evalCount }, avgBytes, result);
+ }
+ try {
+ if (count == 0) {
+ result.writeByte(ATypeTag.SYSTEM_NULL.serialize());
+ return;
}
- } else {
- try {
- if (metNull) {
- sumBytes.reset();
- nullSerde.serialize(ANull.NULL, sumBytesOutput);
- } else {
- sumBytes.reset();
- aDouble.setValue(sum);
- doubleSerde.serialize(aDouble, sumBytesOutput);
- }
- countBytes.reset();
- aInt64.setValue(count);
- int64Serde.serialize(aInt64, countBytesOutput);
- recordEval.evaluate(null);
- } catch (IOException e) {
- throw new AlgebricksException(e);
+ if (aggType == ATypeTag.NULL) {
+ sumBytes.reset();
+ nullSerde.serialize(ANull.NULL, sumBytesOutput);
+ } else {
+ sumBytes.reset();
+ aDouble.setValue(sum);
+ doubleSerde.serialize(aDouble, sumBytesOutput);
}
+ countBytes.reset();
+ aInt64.setValue(count);
+ int64Serde.serialize(aInt64, countBytesOutput);
+ recordEval.evaluate(null);
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableLocalSumAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableLocalSumAggregateDescriptor.java
new file mode 100644
index 0000000..6badf0f
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableLocalSumAggregateDescriptor.java
@@ -0,0 +1,41 @@
+package edu.uci.ics.asterix.runtime.aggregates.serializable.std;
+
+import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.runtime.aggregates.base.AbstractSerializableAggregateFunctionDynamicDescriptor;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopySerializableAggregateFunction;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopySerializableAggregateFunctionFactory;
+
+public class SerializableLocalSumAggregateDescriptor extends AbstractSerializableAggregateFunctionDynamicDescriptor {
+
+ private static final long serialVersionUID = 1L;
+ private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
+ "local-sum-serial", 1);
+ public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+ public IFunctionDescriptor createFunctionDescriptor() {
+ return new SerializableLocalSumAggregateDescriptor();
+ }
+ };
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return FID;
+ }
+
+ @Override
+ public ICopySerializableAggregateFunctionFactory createSerializableAggregateFunctionFactory(
+ final ICopyEvaluatorFactory[] args) throws AlgebricksException {
+ return new ICopySerializableAggregateFunctionFactory() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public ICopySerializableAggregateFunction createAggregateFunction() throws AlgebricksException {
+ return new SerializableSumAggregateFunction(args, true);
+ }
+ };
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateDescriptor.java
index 2b53d89..a26c48a 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateDescriptor.java
@@ -1,45 +1,18 @@
package edu.uci.ics.asterix.runtime.aggregates.serializable.std;
-import java.io.DataOutput;
-import java.io.IOException;
-
-import edu.uci.ics.asterix.common.config.GlobalConfig;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt8SerializerDeserializer;
-import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
-import edu.uci.ics.asterix.om.base.AMutableDouble;
-import edu.uci.ics.asterix.om.base.AMutableFloat;
-import edu.uci.ics.asterix.om.base.AMutableInt16;
-import edu.uci.ics.asterix.om.base.AMutableInt32;
-import edu.uci.ics.asterix.om.base.AMutableInt64;
-import edu.uci.ics.asterix.om.base.AMutableInt8;
-import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.BuiltinType;
-import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.runtime.aggregates.base.AbstractSerializableAggregateFunctionDynamicDescriptor;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
-import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopySerializableAggregateFunction;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopySerializableAggregateFunctionFactory;
-import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
public class SerializableSumAggregateDescriptor extends AbstractSerializableAggregateFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "sum-serial", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SerializableSumAggregateDescriptor();
@@ -48,189 +21,19 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SERIAL_SUM;
}
@Override
- public ICopySerializableAggregateFunctionFactory createAggregateFunctionFactory(final ICopyEvaluatorFactory[] args)
- throws AlgebricksException {
+ public ICopySerializableAggregateFunctionFactory createSerializableAggregateFunctionFactory(
+ final ICopyEvaluatorFactory[] args) throws AlgebricksException {
return new ICopySerializableAggregateFunctionFactory() {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
@Override
public ICopySerializableAggregateFunction createAggregateFunction() throws AlgebricksException {
-
- return new ICopySerializableAggregateFunction() {
-
- private ArrayBackedValueStorage inputVal = new ArrayBackedValueStorage();
- private ICopyEvaluator eval = args[0].createEvaluator(inputVal);
- private AMutableDouble aDouble = new AMutableDouble(0);
- private AMutableFloat aFloat = new AMutableFloat(0);
- private AMutableInt64 aInt64 = new AMutableInt64(0);
- private AMutableInt32 aInt32 = new AMutableInt32(0);
- private AMutableInt16 aInt16 = new AMutableInt16((short) 0);
- private AMutableInt8 aInt8 = new AMutableInt8((byte) 0);
- @SuppressWarnings("rawtypes")
- private ISerializerDeserializer serde;
-
- @Override
- public void init(DataOutput state) throws AlgebricksException {
- try {
- state.writeBoolean(false);
- state.writeBoolean(false);
- state.writeBoolean(false);
- state.writeBoolean(false);
- state.writeBoolean(false);
- state.writeBoolean(false);
- state.writeBoolean(false);
- state.writeDouble(0.0);
- } catch (IOException e) {
- throw new AlgebricksException(e);
- }
- }
-
- @Override
- public void step(IFrameTupleReference tuple, byte[] state, int start, int len)
- throws AlgebricksException {
- int pos = start;
- boolean metInt8s = BufferSerDeUtil.getBoolean(state, pos++);
- boolean metInt16s = BufferSerDeUtil.getBoolean(state, pos++);
- boolean metInt32s = BufferSerDeUtil.getBoolean(state, pos++);
- boolean metInt64s = BufferSerDeUtil.getBoolean(state, pos++);
- boolean metFloats = BufferSerDeUtil.getBoolean(state, pos++);
- boolean metDoubles = BufferSerDeUtil.getBoolean(state, pos++);
- boolean metNull = BufferSerDeUtil.getBoolean(state, pos++);
- double sum = BufferSerDeUtil.getDouble(state, pos);
-
- inputVal.reset();
- eval.evaluate(tuple);
- if (inputVal.getLength() > 0) {
- ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(inputVal
- .getByteArray()[0]);
- switch (typeTag) {
- case INT8: {
- metInt8s = true;
- byte val = AInt8SerializerDeserializer.getByte(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case INT16: {
- metInt16s = true;
- short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case INT32: {
- metInt32s = true;
- int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case INT64: {
- metInt64s = true;
- long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case FLOAT: {
- metFloats = true;
- float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case DOUBLE: {
- metDoubles = true;
- double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case NULL: {
- metNull = true;
- break;
- }
- default: {
- throw new NotImplementedException("Cannot compute SUM for values of type "
- + typeTag);
- }
- }
- }
-
- pos = start;
- BufferSerDeUtil.writeBoolean(metInt8s, state, pos++);
- BufferSerDeUtil.writeBoolean(metInt16s, state, pos++);
- BufferSerDeUtil.writeBoolean(metInt32s, state, pos++);
- BufferSerDeUtil.writeBoolean(metInt64s, state, pos++);
- BufferSerDeUtil.writeBoolean(metFloats, state, pos++);
- BufferSerDeUtil.writeBoolean(metDoubles, state, pos++);
- BufferSerDeUtil.writeBoolean(metNull, state, pos++);
- BufferSerDeUtil.writeDouble(sum, state, pos);
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void finish(byte[] state, int start, int len, DataOutput out) throws AlgebricksException {
- int pos = start;
- boolean metInt8s = BufferSerDeUtil.getBoolean(state, pos++);
- boolean metInt16s = BufferSerDeUtil.getBoolean(state, pos++);
- boolean metInt32s = BufferSerDeUtil.getBoolean(state, pos++);
- boolean metInt64s = BufferSerDeUtil.getBoolean(state, pos++);
- boolean metFloats = BufferSerDeUtil.getBoolean(state, pos++);
- boolean metDoubles = BufferSerDeUtil.getBoolean(state, pos++);
- boolean metNull = BufferSerDeUtil.getBoolean(state, pos++);
- double sum = BufferSerDeUtil.getDouble(state, pos);
- try {
- if (metNull) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
- serde.serialize(ANull.NULL, out);
- } else if (metDoubles) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ADOUBLE);
- aDouble.setValue(sum);
- serde.serialize(aDouble, out);
- } else if (metFloats) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AFLOAT);
- aFloat.setValue((float) sum);
- serde.serialize(aFloat, out);
- } else if (metInt64s) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT64);
- aInt64.setValue((long) sum);
- serde.serialize(aInt64, out);
- } else if (metInt32s) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT32);
- aInt32.setValue((int) sum);
- serde.serialize(aInt32, out);
- } else if (metInt16s) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT16);
- aInt16.setValue((short) sum);
- serde.serialize(aInt16, out);
- } else if (metInt8s) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT8);
- aInt8.setValue((byte) sum);
- serde.serialize(aInt8, out);
- } else {
- GlobalConfig.ASTERIX_LOGGER.fine("SUM aggregate ran over empty input.");
- }
-
- } catch (IOException e) {
- throw new AlgebricksException(e);
- }
-
- }
-
- @Override
- public void finishPartial(byte[] state, int start, int len, DataOutput out)
- throws AlgebricksException {
- finish(state, start, len, out);
- }
- };
+ return new SerializableSumAggregateFunction(args, false);
}
};
}
-
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateFunction.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateFunction.java
new file mode 100644
index 0000000..c027716
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateFunction.java
@@ -0,0 +1,198 @@
+package edu.uci.ics.asterix.runtime.aggregates.serializable.std;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt8SerializerDeserializer;
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.AMutableDouble;
+import edu.uci.ics.asterix.om.base.AMutableFloat;
+import edu.uci.ics.asterix.om.base.AMutableInt16;
+import edu.uci.ics.asterix.om.base.AMutableInt32;
+import edu.uci.ics.asterix.om.base.AMutableInt64;
+import edu.uci.ics.asterix.om.base.AMutableInt8;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopySerializableAggregateFunction;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class SerializableSumAggregateFunction implements ICopySerializableAggregateFunction {
+ private ArrayBackedValueStorage inputVal = new ArrayBackedValueStorage();
+ private ICopyEvaluator eval;
+ private AMutableDouble aDouble = new AMutableDouble(0);
+ private AMutableFloat aFloat = new AMutableFloat(0);
+ private AMutableInt64 aInt64 = new AMutableInt64(0);
+ private AMutableInt32 aInt32 = new AMutableInt32(0);
+ private AMutableInt16 aInt16 = new AMutableInt16((short) 0);
+ private AMutableInt8 aInt8 = new AMutableInt8((byte) 0);
+ @SuppressWarnings("rawtypes")
+ private ISerializerDeserializer serde;
+ private final boolean isLocalAgg;
+
+ public SerializableSumAggregateFunction(ICopyEvaluatorFactory[] args, boolean isLocalAgg)
+ throws AlgebricksException {
+ eval = args[0].createEvaluator(inputVal);
+ this.isLocalAgg = isLocalAgg;
+ }
+
+ @Override
+ public void init(DataOutput state) throws AlgebricksException {
+ try {
+ state.writeByte(ATypeTag.SYSTEM_NULL.serialize());
+ state.writeDouble(0.0);
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
+ }
+ }
+
+ @Override
+ public void step(IFrameTupleReference tuple, byte[] state, int start, int len) throws AlgebricksException {
+ ATypeTag aggType = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(state[start]);
+ double sum = BufferSerDeUtil.getDouble(state, start + 1);
+ inputVal.reset();
+ eval.evaluate(tuple);
+ ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(inputVal.getByteArray()[0]);
+ if (typeTag == ATypeTag.NULL || aggType == ATypeTag.NULL) {
+ aggType = ATypeTag.NULL;
+ return;
+ } else if (aggType == ATypeTag.SYSTEM_NULL) {
+ aggType = typeTag;
+ } else if (typeTag != ATypeTag.SYSTEM_NULL && typeTag != aggType) {
+ throw new AlgebricksException("Unexpected type " + typeTag
+ + " in aggregation input stream. Expected type " + aggType + ".");
+ }
+ switch (typeTag) {
+ case INT8: {
+ byte val = AInt8SerializerDeserializer.getByte(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case INT16: {
+ short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case INT32: {
+ int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case INT64: {
+ long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case FLOAT: {
+ float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case DOUBLE: {
+ double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case NULL: {
+ aggType = typeTag;
+ break;
+ }
+ case SYSTEM_NULL: {
+ // For global aggregates simply ignore system null here,
+ // but if all input value are system null, then we should return
+ // null in finish().
+ if (isLocalAgg) {
+ throw new AlgebricksException("Type SYSTEM_NULL encountered in local aggregate.");
+ }
+ break;
+ }
+ default: {
+ throw new NotImplementedException("Cannot compute SUM for values of type " + typeTag + ".");
+ }
+ }
+ state[start] = aggType.serialize();
+ BufferSerDeUtil.writeDouble(sum, state, start + 1);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void finish(byte[] state, int start, int len, DataOutput out) throws AlgebricksException {
+ ATypeTag aggType = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(state[start]);
+ double sum = BufferSerDeUtil.getDouble(state, start + 1);
+ try {
+ switch (aggType) {
+ case INT8: {
+ serde = AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AINT8);
+ aInt8.setValue((byte) sum);
+ serde.serialize(aInt8, out);
+ break;
+ }
+ case INT16: {
+ serde = AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AINT16);
+ aInt16.setValue((short) sum);
+ serde.serialize(aInt16, out);
+ break;
+ }
+ case INT32: {
+ serde = AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AINT32);
+ aInt32.setValue((int) sum);
+ serde.serialize(aInt32, out);
+ break;
+ }
+ case INT64: {
+ serde = AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AINT64);
+ aInt64.setValue((long) sum);
+ serde.serialize(aInt64, out);
+ break;
+ }
+ case FLOAT: {
+ serde = AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AFLOAT);
+ aFloat.setValue((float) sum);
+ serde.serialize(aFloat, out);
+ break;
+ }
+ case DOUBLE: {
+ serde = AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ADOUBLE);
+ aDouble.setValue(sum);
+ serde.serialize(aDouble, out);
+ break;
+ }
+ case NULL: {
+ serde = AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ANULL);
+ serde.serialize(ANull.NULL, out);
+ break;
+ }
+ case SYSTEM_NULL: {
+ // Empty stream. For local agg return system null. For global agg return null.
+ if (isLocalAgg) {
+ out.writeByte(ATypeTag.SYSTEM_NULL.serialize());
+ } else {
+ serde = AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ANULL);
+ serde.serialize(ANull.NULL, out);
+ }
+ break;
+ }
+ }
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
+ }
+
+ }
+
+ @Override
+ public void finishPartial(byte[] state, int start, int len, DataOutput out) throws AlgebricksException {
+ finish(state, start, len, out);
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/AvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/AvgAggregateDescriptor.java
index c82f1f0..4fe5e35 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/AvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/AvgAggregateDescriptor.java
@@ -7,7 +7,6 @@
import java.util.List;
import edu.uci.ics.asterix.common.config.GlobalConfig;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
@@ -20,6 +19,7 @@
import edu.uci.ics.asterix.om.base.AMutableDouble;
import edu.uci.ics.asterix.om.base.AMutableInt32;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ARecordType;
@@ -47,7 +47,6 @@
public class AvgAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-avg", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new AvgAggregateDescriptor();
@@ -56,7 +55,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.AVG;
}
@Override
@@ -79,9 +78,10 @@
private DataOutput out = provider.getDataOutput();
private ArrayBackedValueStorage inputVal = new ArrayBackedValueStorage();
- private ICopyEvaluator eval = args[0].createEvaluator(inputVal);
+ private ICopyEvaluator eval = args[0].createEvaluator(inputVal);
private double sum;
private int count;
+ private ATypeTag aggType;
private AMutableDouble aDouble = new AMutableDouble(0);
private AMutableInt32 aInt32 = new AMutableInt32(0);
@@ -104,10 +104,10 @@
@SuppressWarnings("unchecked")
private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.ANULL);
- private boolean metNull;
@Override
public void init() throws AlgebricksException {
+ aggType = ATypeTag.SYSTEM_NULL;
sum = 0.0;
count = 0;
}
@@ -115,70 +115,72 @@
@Override
public void step(IFrameTupleReference tuple) throws AlgebricksException {
inputVal.reset();
- eval.evaluate(tuple);
- if (inputVal.getLength() > 0) {
+ eval.evaluate(tuple);
+ ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER
+ .deserialize(inputVal.getByteArray()[0]);
+ if (typeTag == ATypeTag.NULL || aggType == ATypeTag.NULL) {
+ aggType = ATypeTag.NULL;
+ return;
+ } else if (aggType == ATypeTag.SYSTEM_NULL) {
+ aggType = typeTag;
+ } else if (typeTag != ATypeTag.SYSTEM_NULL && typeTag != aggType) {
+ throw new AlgebricksException("Unexpected type " + typeTag
+ + " in aggregation input stream. Expected type " + aggType + ".");
+ }
+ if (typeTag != ATypeTag.SYSTEM_NULL) {
++count;
- ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(inputVal
- .getByteArray()[0]);
- switch (typeTag) {
- case INT8: {
- byte val = AInt8SerializerDeserializer.getByte(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case INT16: {
- short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case INT32: {
- int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case INT64: {
- long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case FLOAT: {
- float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case DOUBLE: {
- double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case NULL: {
- metNull = true;
- break;
- }
- default: {
- throw new NotImplementedException("Cannot compute AVG for values of type "
- + typeTag);
- }
+ }
+ switch (typeTag) {
+ case INT8: {
+ byte val = AInt8SerializerDeserializer.getByte(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
}
- inputVal.reset();
+ case INT16: {
+ short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case INT32: {
+ int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case INT64: {
+ long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case FLOAT: {
+ float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case DOUBLE: {
+ double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case NULL: {
+ break;
+ }
+ default: {
+ throw new NotImplementedException("Cannot compute AVG for values of type " + typeTag);
+ }
}
}
@Override
public void finish() throws AlgebricksException {
- if (count == 0) {
- GlobalConfig.ASTERIX_LOGGER.fine("AVG aggregate ran over empty input.");
- } else {
- try {
- if (metNull)
- nullSerde.serialize(ANull.NULL, out);
- else {
- aDouble.setValue(sum / count);
- doubleSerde.serialize(aDouble, out);
- }
- } catch (IOException e) {
- throw new AlgebricksException(e);
+ try {
+ if (count == 0 || aggType == ATypeTag.NULL) {
+ nullSerde.serialize(ANull.NULL, out);
+ } else {
+ aDouble.setValue(sum / count);
+ doubleSerde.serialize(aDouble, out);
}
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
}
}
@@ -190,7 +192,7 @@
}
} else {
try {
- if (metNull) {
+ if (aggType == ATypeTag.NULL) {
sumBytes.reset();
nullSerde.serialize(ANull.NULL, sumBytesOutput);
} else {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/CountAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/CountAggregateDescriptor.java
index 615f543..9c2c995 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/CountAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/CountAggregateDescriptor.java
@@ -1,24 +1,15 @@
package edu.uci.ics.asterix.runtime.aggregates.std;
-import java.io.DataOutput;
-import java.io.IOException;
-
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
-import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
-import edu.uci.ics.asterix.om.base.AInt32;
-import edu.uci.ics.asterix.om.base.AMutableInt32;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
-import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.runtime.aggregates.base.AbstractAggregateFunctionDynamicDescriptor;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunction;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunctionFactory;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
/**
* NULLs are also counted.
@@ -26,7 +17,6 @@
public class CountAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-count", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new CountAggregateDescriptor();
@@ -35,7 +25,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.COUNT;
}
@Override
@@ -46,44 +36,10 @@
private static final long serialVersionUID = 1L;
@Override
- public ICopyAggregateFunction createAggregateFunction(IDataOutputProvider provider) throws AlgebricksException {
-
- final DataOutput out = provider.getDataOutput();
-
- return new ICopyAggregateFunction() {
- private AMutableInt32 result = new AMutableInt32(-1);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<AInt32> int32Serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT32);
- private int cnt;
-
- @Override
- public void init() {
- cnt = 0;
- }
-
- @Override
- public void step(IFrameTupleReference tuple) throws AlgebricksException {
- cnt++;
- }
-
- @Override
- public void finish() throws AlgebricksException {
- try {
- result.setValue(cnt);
- int32Serde.serialize(result, out);
- } catch (IOException e) {
- throw new AlgebricksException(e);
- }
- }
-
- @Override
- public void finishPartial() throws AlgebricksException {
- finish();
- }
- };
+ public ICopyAggregateFunction createAggregateFunction(IDataOutputProvider provider)
+ throws AlgebricksException {
+ return new CountAggregateFunction(args, provider);
}
};
}
-
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/CountAggregateFunction.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/CountAggregateFunction.java
new file mode 100644
index 0000000..e4d015b
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/CountAggregateFunction.java
@@ -0,0 +1,81 @@
+package edu.uci.ics.asterix.runtime.aggregates.std;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.AInt32;
+import edu.uci.ics.asterix.om.base.AMutableInt32;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunction;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+/**
+ * count(NULL) returns NULL.
+ */
+public class CountAggregateFunction implements ICopyAggregateFunction {
+ private AMutableInt32 result = new AMutableInt32(-1);
+ @SuppressWarnings("unchecked")
+ private ISerializerDeserializer<AInt32> int32Serde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.AINT32);
+ @SuppressWarnings("unchecked")
+ private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ANULL);
+ private ArrayBackedValueStorage inputVal = new ArrayBackedValueStorage();
+ private ICopyEvaluator eval;
+ private boolean metNull;
+ private int cnt;
+ private DataOutput out;
+
+ public CountAggregateFunction(ICopyEvaluatorFactory[] args, IDataOutputProvider output) throws AlgebricksException {
+ eval = args[0].createEvaluator(inputVal);
+ out = output.getDataOutput();
+ }
+
+ @Override
+ public void init() {
+ cnt = 0;
+ metNull = false;
+ }
+
+ @Override
+ public void step(IFrameTupleReference tuple) throws AlgebricksException {
+ inputVal.reset();
+ eval.evaluate(tuple);
+ ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(inputVal.getByteArray()[0]);
+ // Ignore SYSTEM_NULL.
+ if (typeTag == ATypeTag.NULL) {
+ metNull = true;
+ } else {
+ cnt++;
+ }
+ }
+
+ @Override
+ public void finish() throws AlgebricksException {
+ try {
+ if (metNull) {
+ nullSerde.serialize(ANull.NULL, out);
+ } else {
+ result.setValue(cnt);
+ int32Serde.serialize(result, out);
+ }
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
+ }
+ }
+
+ @Override
+ public void finishPartial() throws AlgebricksException {
+ finish();
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/GlobalAvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/GlobalAvgAggregateDescriptor.java
index 837b357..347f5e7 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/GlobalAvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/GlobalAvgAggregateDescriptor.java
@@ -6,7 +6,6 @@
import java.util.ArrayList;
import java.util.List;
-import edu.uci.ics.asterix.common.config.GlobalConfig;
import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
@@ -17,6 +16,7 @@
import edu.uci.ics.asterix.om.base.AMutableDouble;
import edu.uci.ics.asterix.om.base.AMutableInt32;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ARecordType;
@@ -43,10 +43,7 @@
public class GlobalAvgAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-global-avg",
- 1);
- private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
- private final static byte SER_RECORD_TYPE_TAG = ATypeTag.RECORD.serialize();
+
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new GlobalAvgAggregateDescriptor();
@@ -55,7 +52,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.GLOBAL_AVG;
}
@Override
@@ -117,18 +114,40 @@
inputVal.reset();
eval.evaluate(tuple);
byte[] serBytes = inputVal.getByteArray();
- if (serBytes[0] == SER_NULL_TYPE_TAG)
- metNull = true;
- if (serBytes[0] != SER_RECORD_TYPE_TAG) {
- throw new AlgebricksException("Global-Avg is not defined for values of type "
- + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serBytes[0]));
+ ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serBytes[0]);
+ switch (typeTag) {
+ case NULL: {
+ metNull = true;
+ break;
+ }
+ case SYSTEM_NULL: {
+ // Ignore and return.
+ return;
+ }
+ case RECORD: {
+ // Expected.
+ break;
+ }
+ default: {
+ throw new AlgebricksException("Global-Avg is not defined for values of type "
+ + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serBytes[0]));
+ }
}
- int offset1 = ARecordSerializerDeserializer.getFieldOffsetById(serBytes, 0, 1, false);
+
+ // The record length helps us determine whether the input record fields are nullable.
+ int recordLength = ARecordSerializerDeserializer.getRecordLength(serBytes, 1);
+ int nullBitmapSize = 1;
+ if (recordLength == 29) {
+ nullBitmapSize = 0;
+ }
+ int offset1 = ARecordSerializerDeserializer.getFieldOffsetById(serBytes, 0, nullBitmapSize,
+ false);
if (offset1 == 0) // the sum is null
metNull = true;
else
globalSum += ADoubleSerializerDeserializer.getDouble(serBytes, offset1);
- int offset2 = ARecordSerializerDeserializer.getFieldOffsetById(serBytes, 1, 1, false);
+ int offset2 = ARecordSerializerDeserializer.getFieldOffsetById(serBytes, 1, nullBitmapSize,
+ false);
if (offset2 != 0) // the count is not null
globalCount += AInt32SerializerDeserializer.getInt(serBytes, offset2);
@@ -136,43 +155,35 @@
@Override
public void finish() throws AlgebricksException {
- if (globalCount == 0) {
- GlobalConfig.ASTERIX_LOGGER.fine("AVG aggregate ran over empty input.");
- } else {
- try {
- if (metNull)
- nullSerde.serialize(ANull.NULL, out);
- else {
- aDouble.setValue(globalSum / globalCount);
- doubleSerde.serialize(aDouble, out);
- }
- } catch (IOException e) {
- throw new AlgebricksException(e);
+ try {
+ if (globalCount == 0 || metNull)
+ nullSerde.serialize(ANull.NULL, out);
+ else {
+ aDouble.setValue(globalSum / globalCount);
+ doubleSerde.serialize(aDouble, out);
}
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
}
}
@Override
public void finishPartial() throws AlgebricksException {
- if (globalCount == 0) {
- GlobalConfig.ASTERIX_LOGGER.fine("AVG aggregate ran over empty input.");
- } else {
- try {
- if (metNull) {
- sumBytes.reset();
- nullSerde.serialize(ANull.NULL, sumBytesOutput);
- } else {
- sumBytes.reset();
- aDouble.setValue(globalSum);
- doubleSerde.serialize(aDouble, sumBytesOutput);
- }
- countBytes.reset();
- aInt32.setValue(globalCount);
- intSerde.serialize(aInt32, countBytesOutput);
- recordEval.evaluate(null);
- } catch (IOException e) {
- throw new AlgebricksException(e);
+ try {
+ if (metNull || globalCount == 0) {
+ sumBytes.reset();
+ nullSerde.serialize(ANull.NULL, sumBytesOutput);
+ } else {
+ sumBytes.reset();
+ aDouble.setValue(globalSum);
+ doubleSerde.serialize(aDouble, sumBytesOutput);
}
+ countBytes.reset();
+ aInt32.setValue(globalCount);
+ intSerde.serialize(aInt32, countBytesOutput);
+ recordEval.evaluate(null);
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
}
}
};
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalAvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalAvgAggregateDescriptor.java
index d9173bd..de02246 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalAvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalAvgAggregateDescriptor.java
@@ -6,7 +6,6 @@
import java.util.ArrayList;
import java.util.List;
-import edu.uci.ics.asterix.common.config.GlobalConfig;
import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
@@ -20,6 +19,7 @@
import edu.uci.ics.asterix.om.base.AMutableDouble;
import edu.uci.ics.asterix.om.base.AMutableInt32;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ARecordType;
@@ -47,8 +47,6 @@
public class LocalAvgAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-local-avg",
- 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new LocalAvgAggregateDescriptor();
@@ -57,7 +55,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.LOCAL_AVG;
}
@Override
@@ -82,6 +80,7 @@
private DataOutput out = provider.getDataOutput();
private ArrayBackedValueStorage inputVal = new ArrayBackedValueStorage();
private ICopyEvaluator eval = args[0].createEvaluator(inputVal);
+ private ATypeTag aggType;
private double sum;
private int count;
@@ -105,90 +104,95 @@
.getSerializerDeserializer(BuiltinType.ANULL);
private AMutableDouble aDouble = new AMutableDouble(0);
private AMutableInt32 aInt32 = new AMutableInt32(0);
- private boolean metNull;
@Override
public void init() {
+ aggType = ATypeTag.SYSTEM_NULL;
sum = 0.0;
count = 0;
- metNull = false;
}
@Override
public void step(IFrameTupleReference tuple) throws AlgebricksException {
inputVal.reset();
eval.evaluate(tuple);
- if (inputVal.getLength() > 0) {
- ++count;
- ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(inputVal
- .getByteArray()[0]);
- switch (typeTag) {
- case INT8: {
- byte val = AInt8SerializerDeserializer.getByte(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case INT16: {
- short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case INT32: {
- int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case INT64: {
- long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case FLOAT: {
- float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case DOUBLE: {
- double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case NULL: {
- metNull = true;
- break;
- }
- default: {
- throw new NotImplementedException("Cannot compute LOCAL-AVG for values of type "
- + typeTag);
- }
- }
- inputVal.reset();
+ ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER
+ .deserialize(inputVal.getByteArray()[0]);
+ if (typeTag == ATypeTag.NULL || aggType == ATypeTag.NULL) {
+ aggType = ATypeTag.NULL;
+ return;
+ } else if (aggType == ATypeTag.SYSTEM_NULL) {
+ aggType = typeTag;
+ } else if (typeTag != ATypeTag.SYSTEM_NULL && typeTag != aggType) {
+ throw new AlgebricksException("Unexpected type " + typeTag
+ + " in aggregation input stream. Expected type " + aggType + ".");
}
+ if (typeTag != ATypeTag.SYSTEM_NULL) {
+ ++count;
+ }
+ switch (typeTag) {
+ case INT8: {
+ byte val = AInt8SerializerDeserializer.getByte(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case INT16: {
+ short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case INT32: {
+ int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case INT64: {
+ long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case FLOAT: {
+ float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case DOUBLE: {
+ double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case NULL: {
+ break;
+ }
+ default: {
+ throw new NotImplementedException("Cannot compute LOCAL-AVG for values of type "
+ + typeTag);
+ }
+ }
+ inputVal.reset();
}
@Override
public void finish() throws AlgebricksException {
- if (count == 0) {
- if (GlobalConfig.DEBUG) {
- GlobalConfig.ASTERIX_LOGGER.finest("AVG aggregate ran over empty input.");
+ try {
+ if (count == 0) {
+ out.writeByte(ATypeTag.SYSTEM_NULL.serialize());
+ return;
}
- } else {
- try {
- if (metNull) {
- sumBytes.reset();
- nullSerde.serialize(ANull.NULL, sumBytesOutput);
- } else {
- sumBytes.reset();
- aDouble.setValue(sum);
- doubleSerde.serialize(aDouble, sumBytesOutput);
- }
- countBytes.reset();
- aInt32.setValue(count);
- int32Serde.serialize(aInt32, countBytesOutput);
- recordEval.evaluate(null);
- } catch (IOException e) {
- throw new AlgebricksException(e);
+ if (aggType == ATypeTag.NULL) {
+ sumBytes.reset();
+ nullSerde.serialize(ANull.NULL, sumBytesOutput);
+ } else {
+ sumBytes.reset();
+ aDouble.setValue(sum);
+ doubleSerde.serialize(aDouble, sumBytesOutput);
}
+ countBytes.reset();
+ aInt32.setValue(count);
+ int32Serde.serialize(aInt32, countBytesOutput);
+ recordEval.evaluate(null);
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalMaxAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalMaxAggregateDescriptor.java
new file mode 100644
index 0000000..59287d5
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalMaxAggregateDescriptor.java
@@ -0,0 +1,43 @@
+package edu.uci.ics.asterix.runtime.aggregates.std;
+
+import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.runtime.aggregates.base.AbstractAggregateFunctionDynamicDescriptor;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunction;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunctionFactory;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+
+public class LocalMaxAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
+
+ private static final long serialVersionUID = 1L;
+ private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-local-max",
+ 1);
+ public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+ public IFunctionDescriptor createFunctionDescriptor() {
+ return new LocalMaxAggregateDescriptor();
+ }
+ };
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return FID;
+ }
+
+ @Override
+ public ICopyAggregateFunctionFactory createAggregateFunctionFactory(final ICopyEvaluatorFactory[] args)
+ throws AlgebricksException {
+ return new ICopyAggregateFunctionFactory() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public ICopyAggregateFunction createAggregateFunction(final IDataOutputProvider provider)
+ throws AlgebricksException {
+ return new MinMaxAggregateFunction(args, provider, false, true);
+ }
+ };
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalMinAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalMinAggregateDescriptor.java
new file mode 100644
index 0000000..ca32e2f
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalMinAggregateDescriptor.java
@@ -0,0 +1,43 @@
+package edu.uci.ics.asterix.runtime.aggregates.std;
+
+import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.runtime.aggregates.base.AbstractAggregateFunctionDynamicDescriptor;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunction;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunctionFactory;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+
+public class LocalMinAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
+
+ private static final long serialVersionUID = 1L;
+ private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-local-min",
+ 1);
+ public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+ public IFunctionDescriptor createFunctionDescriptor() {
+ return new LocalMinAggregateDescriptor();
+ }
+ };
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return FID;
+ }
+
+ @Override
+ public ICopyAggregateFunctionFactory createAggregateFunctionFactory(final ICopyEvaluatorFactory[] args)
+ throws AlgebricksException {
+ return new ICopyAggregateFunctionFactory() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public ICopyAggregateFunction createAggregateFunction(final IDataOutputProvider provider)
+ throws AlgebricksException {
+ return new MinMaxAggregateFunction(args, provider, true, true);
+ }
+ };
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalSumAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalSumAggregateDescriptor.java
new file mode 100644
index 0000000..c133e09
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalSumAggregateDescriptor.java
@@ -0,0 +1,43 @@
+package edu.uci.ics.asterix.runtime.aggregates.std;
+
+import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.runtime.aggregates.base.AbstractAggregateFunctionDynamicDescriptor;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunction;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunctionFactory;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+
+public class LocalSumAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
+
+ private static final long serialVersionUID = 1L;
+ private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-local-sum",
+ 1);
+ public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+ public IFunctionDescriptor createFunctionDescriptor() {
+ return new LocalSumAggregateDescriptor();
+ }
+ };
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return FID;
+ }
+
+ @Override
+ public ICopyAggregateFunctionFactory createAggregateFunctionFactory(final ICopyEvaluatorFactory[] args)
+ throws AlgebricksException {
+ return new ICopyAggregateFunctionFactory() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public ICopyAggregateFunction createAggregateFunction(final IDataOutputProvider provider)
+ throws AlgebricksException {
+ return new SumAggregateFunction(args, provider, true);
+ };
+ };
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MaxAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MaxAggregateDescriptor.java
index 3bc40b6..4084b42 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MaxAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MaxAggregateDescriptor.java
@@ -1,44 +1,19 @@
package edu.uci.ics.asterix.runtime.aggregates.std;
-import java.io.DataOutput;
-import java.io.IOException;
-
-import edu.uci.ics.asterix.common.config.GlobalConfig;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
-import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
-import edu.uci.ics.asterix.om.base.AMutableDouble;
-import edu.uci.ics.asterix.om.base.AMutableFloat;
-import edu.uci.ics.asterix.om.base.AMutableInt16;
-import edu.uci.ics.asterix.om.base.AMutableInt32;
-import edu.uci.ics.asterix.om.base.AMutableInt64;
-import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.BuiltinType;
-import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.runtime.aggregates.base.AbstractAggregateFunctionDynamicDescriptor;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunction;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunctionFactory;
-import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
-import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
public class MaxAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-max", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new MaxAggregateDescriptor();
@@ -47,10 +22,9 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.MAX;
}
- @SuppressWarnings("unchecked")
@Override
public ICopyAggregateFunctionFactory createAggregateFunctionFactory(final ICopyEvaluatorFactory[] args)
throws AlgebricksException {
@@ -60,152 +34,7 @@
@Override
public ICopyAggregateFunction createAggregateFunction(final IDataOutputProvider provider)
throws AlgebricksException {
-
- return new ICopyAggregateFunction() {
-
- private DataOutput out = provider.getDataOutput();
- private ArrayBackedValueStorage inputVal = new ArrayBackedValueStorage();
- private ICopyEvaluator eval = args[0].createEvaluator(inputVal);
- private boolean metInt8s, metInt16s, metInt32s, metInt64s, metFloats, metDoubles, metNull;
-
- private short shortVal = Short.MIN_VALUE;
- private int intVal = Integer.MIN_VALUE;
- private long longVal = Long.MIN_VALUE;
- private float floatVal = Float.MIN_VALUE;
- private double doubleVal = Double.MIN_VALUE;
-
- private AMutableDouble aDouble = new AMutableDouble(0);
- private AMutableFloat aFloat = new AMutableFloat(0);
- private AMutableInt64 aInt64 = new AMutableInt64(0);
- private AMutableInt32 aInt32 = new AMutableInt32(0);
- private AMutableInt16 aInt16 = new AMutableInt16((short) 0);
- @SuppressWarnings("rawtypes")
- private ISerializerDeserializer serde;
-
- @Override
- public void init() {
- shortVal = Short.MIN_VALUE;
- intVal = Integer.MIN_VALUE;
- longVal = Long.MIN_VALUE;
- floatVal = Float.MIN_VALUE;
- doubleVal = Double.MIN_VALUE;
-
- metInt8s = false;
- metInt16s = false;
- metInt32s = false;
- metInt64s = false;
- metFloats = false;
- metDoubles = false;
- metNull = false;
- }
-
- @Override
- public void step(IFrameTupleReference tuple) throws AlgebricksException {
- inputVal.reset();
- eval.evaluate(tuple);
- if (inputVal.getLength() > 0) {
- ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(inputVal
- .getByteArray()[0]);
- switch (typeTag) {
- case INT8: {
- metInt8s = true;
- throw new NotImplementedException("no implementation for int8's comparator");
- }
- case INT16: {
- metInt16s = true;
- short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
- if (val > shortVal)
- shortVal = val;
- throw new NotImplementedException("no implementation for int16's comparator");
- }
- case INT32: {
- metInt32s = true;
- int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
- if (val > intVal)
- intVal = val;
- break;
- }
- case INT64: {
- metInt64s = true;
- long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
- if (val > longVal)
- longVal = val;
- break;
- }
- case FLOAT: {
- metFloats = true;
- float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
- if (val > floatVal)
- floatVal = val;
- break;
- }
- case DOUBLE: {
- metDoubles = true;
- double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
- if (val > doubleVal)
- doubleVal = val;
- break;
- }
- case NULL: {
- metNull = true;
- break;
- }
- default: {
- throw new NotImplementedException("Cannot compute SUM for values of type "
- + typeTag);
- }
- }
- }
- }
-
- @Override
- public void finish() throws AlgebricksException {
- try {
- if (metNull) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
- serde.serialize(ANull.NULL, out);
- } else if (metDoubles) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ADOUBLE);
- aDouble.setValue(doubleVal);
- serde.serialize(aDouble, out);
- } else if (metFloats) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AFLOAT);
- aFloat.setValue(floatVal);
- serde.serialize(aFloat, out);
- } else if (metInt64s) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT64);
- aInt64.setValue(longVal);
- serde.serialize(aInt64, out);
- } else if (metInt32s) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT32);
- aInt32.setValue(intVal);
- serde.serialize(aInt32, out);
- } else if (metInt16s) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT16);
- aInt16.setValue(shortVal);
- serde.serialize(aInt16, out);
- } else if (metInt8s) {
- throw new NotImplementedException("no implementation for int8's comparator");
- } else {
- GlobalConfig.ASTERIX_LOGGER.fine("SUM aggregate ran over empty input.");
- }
- } catch (IOException e) {
- throw new AlgebricksException(e);
- }
-
- }
-
- @Override
- public void finishPartial() throws AlgebricksException {
- finish();
- }
- };
+ return new MinMaxAggregateFunction(args, provider, false, false);
}
};
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MinAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MinAggregateDescriptor.java
index 6a88a0d..001386d 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MinAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MinAggregateDescriptor.java
@@ -1,44 +1,19 @@
package edu.uci.ics.asterix.runtime.aggregates.std;
-import java.io.DataOutput;
-import java.io.IOException;
-
-import edu.uci.ics.asterix.common.config.GlobalConfig;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
-import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
-import edu.uci.ics.asterix.om.base.AMutableDouble;
-import edu.uci.ics.asterix.om.base.AMutableFloat;
-import edu.uci.ics.asterix.om.base.AMutableInt16;
-import edu.uci.ics.asterix.om.base.AMutableInt32;
-import edu.uci.ics.asterix.om.base.AMutableInt64;
-import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.BuiltinType;
-import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.runtime.aggregates.base.AbstractAggregateFunctionDynamicDescriptor;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunction;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunctionFactory;
-import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
-import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
public class MinAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-min", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new MinAggregateDescriptor();
@@ -47,10 +22,9 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.MIN;
}
- @SuppressWarnings("unchecked")
@Override
public ICopyAggregateFunctionFactory createAggregateFunctionFactory(final ICopyEvaluatorFactory[] args)
throws AlgebricksException {
@@ -60,154 +34,8 @@
@Override
public ICopyAggregateFunction createAggregateFunction(final IDataOutputProvider provider)
throws AlgebricksException {
-
- return new ICopyAggregateFunction() {
-
- private DataOutput out = provider.getDataOutput();
- private ArrayBackedValueStorage inputVal = new ArrayBackedValueStorage();
- private ICopyEvaluator eval = args[0].createEvaluator(inputVal);
- private boolean metInt8s, metInt16s, metInt32s, metInt64s, metFloats, metDoubles, metNull;
-
- private short shortVal = Short.MAX_VALUE;
- private int intVal = Integer.MAX_VALUE;
- private long longVal = Long.MAX_VALUE;
- private float floatVal = Float.MAX_VALUE;
- private double doubleVal = Double.MAX_VALUE;
-
- private AMutableDouble aDouble = new AMutableDouble(0);
- private AMutableFloat aFloat = new AMutableFloat(0);
- private AMutableInt64 aInt64 = new AMutableInt64(0);
- private AMutableInt32 aInt32 = new AMutableInt32(0);
- private AMutableInt16 aInt16 = new AMutableInt16((short) 0);
- @SuppressWarnings("rawtypes")
- private ISerializerDeserializer serde;
-
- @Override
- public void init() {
- shortVal = Short.MAX_VALUE;
- intVal = Integer.MAX_VALUE;
- longVal = Long.MAX_VALUE;
- floatVal = Float.MAX_VALUE;
- doubleVal = Double.MAX_VALUE;
-
- metInt8s = false;
- metInt16s = false;
- metInt32s = false;
- metInt64s = false;
- metFloats = false;
- metDoubles = false;
- metNull = false;
- }
-
- @Override
- public void step(IFrameTupleReference tuple) throws AlgebricksException {
- inputVal.reset();
- eval.evaluate(tuple);
- if (inputVal.getLength() > 0) {
- ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(inputVal
- .getByteArray()[0]);
- switch (typeTag) {
- case INT8: {
- metInt8s = true;
- throw new NotImplementedException("no implementation for int8's comparator");
- }
- case INT16: {
- metInt16s = true;
- short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
- if (val < shortVal)
- shortVal = val;
- throw new NotImplementedException("no implementation for int16's comparator");
- }
- case INT32: {
- metInt32s = true;
- int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
- if (val < intVal)
- intVal = val;
- break;
- }
- case INT64: {
- metInt64s = true;
- long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
- if (val < longVal)
- longVal = val;
- break;
- }
- case FLOAT: {
- metFloats = true;
- float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
- if (val < floatVal)
- floatVal = val;
- break;
- }
- case DOUBLE: {
- metDoubles = true;
- double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
- if (val < doubleVal)
- doubleVal = val;
- break;
- }
- case NULL: {
- metNull = true;
- break;
- }
- default: {
- throw new NotImplementedException("Cannot compute SUM for values of type "
- + typeTag);
- }
- }
- }
- }
-
- @Override
- public void finish() throws AlgebricksException {
- try {
- if (metNull) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
- serde.serialize(ANull.NULL, out);
- } else if (metDoubles) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ADOUBLE);
- aDouble.setValue(doubleVal);
- serde.serialize(aDouble, out);
- } else if (metFloats) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AFLOAT);
- aFloat.setValue(floatVal);
- serde.serialize(aFloat, out);
- } else if (metInt64s) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT64);
- aInt64.setValue(longVal);
- serde.serialize(aInt64, out);
- } else if (metInt32s) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT32);
- aInt32.setValue(intVal);
- serde.serialize(aInt32, out);
- } else if (metInt16s) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT16);
- aInt16.setValue(shortVal);
- serde.serialize(aInt16, out);
- } else if (metInt8s) {
- throw new NotImplementedException("no implementation for int8's comparator");
- } else {
- GlobalConfig.ASTERIX_LOGGER.fine("SUM aggregate ran over empty input.");
- }
- } catch (IOException e) {
- throw new AlgebricksException(e);
- }
-
- }
-
- @Override
- public void finishPartial() throws AlgebricksException {
- finish();
- }
- };
+ return new MinMaxAggregateFunction(args, provider, true, false);
}
};
}
-
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MinMaxAggregateFunction.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MinMaxAggregateFunction.java
new file mode 100644
index 0000000..bc3508f
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MinMaxAggregateFunction.java
@@ -0,0 +1,106 @@
+package edu.uci.ics.asterix.runtime.aggregates.std;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.formats.nontagged.AqlBinaryComparatorFactoryProvider;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunction;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
+import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class MinMaxAggregateFunction implements ICopyAggregateFunction {
+ private ArrayBackedValueStorage inputVal = new ArrayBackedValueStorage();
+ private ArrayBackedValueStorage outputVal = new ArrayBackedValueStorage();
+ private DataOutput out;
+ private ICopyEvaluator eval;
+ private ATypeTag aggType;
+ private IBinaryComparator cmp;
+ private final boolean isMin;
+ private final boolean isLocalAgg;
+
+ public MinMaxAggregateFunction(ICopyEvaluatorFactory[] args, IDataOutputProvider provider, boolean isMin,
+ boolean isLocalAgg) throws AlgebricksException {
+ out = provider.getDataOutput();
+ eval = args[0].createEvaluator(inputVal);
+ this.isMin = isMin;
+ this.isLocalAgg = isLocalAgg;
+ }
+
+ @Override
+ public void init() {
+ aggType = ATypeTag.SYSTEM_NULL;
+ outputVal.reset();
+ }
+
+ @Override
+ public void step(IFrameTupleReference tuple) throws AlgebricksException {
+ inputVal.reset();
+ eval.evaluate(tuple);
+ ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(inputVal.getByteArray()[0]);
+ if (typeTag == ATypeTag.NULL || aggType == ATypeTag.NULL) {
+ aggType = ATypeTag.NULL;
+ return;
+ }
+ if (aggType == ATypeTag.SYSTEM_NULL) {
+ if (typeTag == ATypeTag.SYSTEM_NULL) {
+ // Ignore.
+ return;
+ }
+ // First value encountered. Set type, comparator, and initial value.
+ aggType = typeTag;
+ // Set comparator.
+ IBinaryComparatorFactory cmpFactory = AqlBinaryComparatorFactoryProvider.INSTANCE
+ .getBinaryComparatorFactory(aggType, isMin);
+ cmp = cmpFactory.createBinaryComparator();
+ // Initialize min value.
+ outputVal.assign(inputVal);
+ } else if (typeTag != ATypeTag.SYSTEM_NULL && typeTag != aggType) {
+ throw new AlgebricksException("Unexpected type " + typeTag + " in aggregation input stream. Expected type "
+ + aggType + ".");
+ }
+ if (cmp.compare(inputVal.getByteArray(), inputVal.getStartOffset(), inputVal.getLength(),
+ outputVal.getByteArray(), outputVal.getStartOffset(), outputVal.getLength()) < 0) {
+ outputVal.assign(inputVal);
+ }
+ }
+
+ @Override
+ public void finish() throws AlgebricksException {
+ try {
+ switch (aggType) {
+ case NULL: {
+ out.writeByte(ATypeTag.NULL.serialize());
+ break;
+ }
+ case SYSTEM_NULL: {
+ // Empty stream. For local agg return system null. For global agg return null.
+ if (isLocalAgg) {
+ out.writeByte(ATypeTag.SYSTEM_NULL.serialize());
+ } else {
+ out.writeByte(ATypeTag.NULL.serialize());
+ }
+ break;
+ }
+ default: {
+ out.write(outputVal.getByteArray(), outputVal.getStartOffset(), outputVal.getLength());
+ break;
+ }
+ }
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
+ }
+ }
+
+ @Override
+ public void finishPartial() throws AlgebricksException {
+ finish();
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/SumAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/SumAggregateDescriptor.java
index fa611e2..bb60ab4 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/SumAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/SumAggregateDescriptor.java
@@ -1,46 +1,19 @@
package edu.uci.ics.asterix.runtime.aggregates.std;
-import java.io.DataOutput;
-import java.io.IOException;
-
-import edu.uci.ics.asterix.common.config.GlobalConfig;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt8SerializerDeserializer;
-import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
-import edu.uci.ics.asterix.om.base.AMutableDouble;
-import edu.uci.ics.asterix.om.base.AMutableFloat;
-import edu.uci.ics.asterix.om.base.AMutableInt16;
-import edu.uci.ics.asterix.om.base.AMutableInt32;
-import edu.uci.ics.asterix.om.base.AMutableInt64;
-import edu.uci.ics.asterix.om.base.AMutableInt8;
-import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.BuiltinType;
-import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.runtime.aggregates.base.AbstractAggregateFunctionDynamicDescriptor;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunction;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunctionFactory;
-import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
-import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
public class SumAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-sum", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SumAggregateDescriptor();
@@ -49,10 +22,9 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SUM;
}
- @SuppressWarnings("unchecked")
@Override
public ICopyAggregateFunctionFactory createAggregateFunctionFactory(final ICopyEvaluatorFactory[] args)
throws AlgebricksException {
@@ -62,145 +34,8 @@
@Override
public ICopyAggregateFunction createAggregateFunction(final IDataOutputProvider provider)
throws AlgebricksException {
-
- return new ICopyAggregateFunction() {
-
- private DataOutput out = provider.getDataOutput();
- private ArrayBackedValueStorage inputVal = new ArrayBackedValueStorage();
- private ICopyEvaluator eval = args[0].createEvaluator(inputVal);
- private boolean metInt8s, metInt16s, metInt32s, metInt64s, metFloats, metDoubles, metNull;
- private double sum;
- private AMutableDouble aDouble = new AMutableDouble(0);
- private AMutableFloat aFloat = new AMutableFloat(0);
- private AMutableInt64 aInt64 = new AMutableInt64(0);
- private AMutableInt32 aInt32 = new AMutableInt32(0);
- private AMutableInt16 aInt16 = new AMutableInt16((short) 0);
- private AMutableInt8 aInt8 = new AMutableInt8((byte) 0);
- @SuppressWarnings("rawtypes")
- private ISerializerDeserializer serde;
-
- @Override
- public void init() {
- metInt8s = false;
- metInt16s = false;
- metInt32s = false;
- metInt64s = false;
- metFloats = false;
- metDoubles = false;
- metNull = false;
- sum = 0.0;
- }
-
- @Override
- public void step(IFrameTupleReference tuple) throws AlgebricksException {
- inputVal.reset();
- eval.evaluate(tuple);
- if (inputVal.getLength() > 0) {
- ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(inputVal
- .getByteArray()[0]);
- switch (typeTag) {
- case INT8: {
- metInt8s = true;
- byte val = AInt8SerializerDeserializer.getByte(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case INT16: {
- metInt16s = true;
- short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case INT32: {
- metInt32s = true;
- int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case INT64: {
- metInt64s = true;
- long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case FLOAT: {
- metFloats = true;
- float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case DOUBLE: {
- metDoubles = true;
- double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
- sum += val;
- break;
- }
- case NULL: {
- metNull = true;
- break;
- }
- default: {
- throw new NotImplementedException("Cannot compute SUM for values of type "
- + typeTag);
- }
- }
- }
- }
-
- @Override
- public void finish() throws AlgebricksException {
- try {
- if (metNull) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
- serde.serialize(ANull.NULL, out);
- } else if (metDoubles) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ADOUBLE);
- aDouble.setValue(sum);
- serde.serialize(aDouble, out);
- } else if (metFloats) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AFLOAT);
- aFloat.setValue((float) sum);
- serde.serialize(aFloat, out);
- } else if (metInt64s) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT64);
- aInt64.setValue((long) sum);
- serde.serialize(aInt64, out);
- } else if (metInt32s) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT32);
- aInt32.setValue((int) sum);
- serde.serialize(aInt32, out);
- } else if (metInt16s) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT16);
- aInt16.setValue((short) sum);
- serde.serialize(aInt16, out);
- } else if (metInt8s) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT8);
- aInt8.setValue((byte) sum);
- serde.serialize(aInt8, out);
- } else {
- GlobalConfig.ASTERIX_LOGGER.fine("SUM aggregate ran over empty input.");
- }
-
- } catch (IOException e) {
- throw new AlgebricksException(e);
- }
-
- }
-
- @Override
- public void finishPartial() throws AlgebricksException {
- finish();
- }
- };
- }
+ return new SumAggregateFunction(args, provider, false);
+ };
};
}
-
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/SumAggregateFunction.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/SumAggregateFunction.java
new file mode 100644
index 0000000..d0e82ce
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/SumAggregateFunction.java
@@ -0,0 +1,192 @@
+package edu.uci.ics.asterix.runtime.aggregates.std;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt8SerializerDeserializer;
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.AMutableDouble;
+import edu.uci.ics.asterix.om.base.AMutableFloat;
+import edu.uci.ics.asterix.om.base.AMutableInt16;
+import edu.uci.ics.asterix.om.base.AMutableInt32;
+import edu.uci.ics.asterix.om.base.AMutableInt64;
+import edu.uci.ics.asterix.om.base.AMutableInt8;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunction;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class SumAggregateFunction implements ICopyAggregateFunction {
+ private DataOutput out;
+ private ArrayBackedValueStorage inputVal = new ArrayBackedValueStorage();
+ private ICopyEvaluator eval;
+ private double sum;
+ private ATypeTag aggType;
+ private AMutableDouble aDouble = new AMutableDouble(0);
+ private AMutableFloat aFloat = new AMutableFloat(0);
+ private AMutableInt64 aInt64 = new AMutableInt64(0);
+ private AMutableInt32 aInt32 = new AMutableInt32(0);
+ private AMutableInt16 aInt16 = new AMutableInt16((short) 0);
+ private AMutableInt8 aInt8 = new AMutableInt8((byte) 0);
+ @SuppressWarnings("rawtypes")
+ private ISerializerDeserializer serde;
+
+ private final boolean isLocalAgg;
+
+ public SumAggregateFunction(ICopyEvaluatorFactory[] args, IDataOutputProvider provider, boolean isLocalAgg)
+ throws AlgebricksException {
+ out = provider.getDataOutput();
+ eval = args[0].createEvaluator(inputVal);
+ this.isLocalAgg = isLocalAgg;
+ }
+
+ @Override
+ public void init() {
+ aggType = ATypeTag.SYSTEM_NULL;
+ sum = 0.0;
+ }
+
+ @Override
+ public void step(IFrameTupleReference tuple) throws AlgebricksException {
+ inputVal.reset();
+ eval.evaluate(tuple);
+ ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(inputVal.getByteArray()[0]);
+ if (typeTag == ATypeTag.NULL || aggType == ATypeTag.NULL) {
+ aggType = ATypeTag.NULL;
+ return;
+ } else if (aggType == ATypeTag.SYSTEM_NULL) {
+ aggType = typeTag;
+ } else if (typeTag != ATypeTag.SYSTEM_NULL && typeTag != aggType) {
+ throw new AlgebricksException("Unexpected type " + typeTag
+ + " in aggregation input stream. Expected type " + aggType + ".");
+ }
+ switch (typeTag) {
+ case INT8: {
+ byte val = AInt8SerializerDeserializer.getByte(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case INT16: {
+ short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case INT32: {
+ int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case INT64: {
+ long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case FLOAT: {
+ float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case DOUBLE: {
+ double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
+ sum += val;
+ break;
+ }
+ case NULL: {
+ break;
+ }
+ case SYSTEM_NULL: {
+ // For global aggregates simply ignore system null here,
+ // but if all input value are system null, then we should return
+ // null in finish().
+ if (isLocalAgg) {
+ throw new AlgebricksException("Type SYSTEM_NULL encountered in local aggregate.");
+ }
+ break;
+ }
+ default: {
+ throw new NotImplementedException("Cannot compute SUM for values of type " + typeTag + ".");
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void finish() throws AlgebricksException {
+ try {
+ switch (aggType) {
+ case INT8: {
+ serde = AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AINT8);
+ aInt8.setValue((byte) sum);
+ serde.serialize(aInt8, out);
+ break;
+ }
+ case INT16: {
+ serde = AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AINT16);
+ aInt16.setValue((short) sum);
+ serde.serialize(aInt16, out);
+ break;
+ }
+ case INT32: {
+ serde = AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AINT32);
+ aInt32.setValue((int) sum);
+ serde.serialize(aInt32, out);
+ break;
+ }
+ case INT64: {
+ serde = AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AINT64);
+ aInt64.setValue((long) sum);
+ serde.serialize(aInt64, out);
+ break;
+ }
+ case FLOAT: {
+ serde = AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AFLOAT);
+ aFloat.setValue((float) sum);
+ serde.serialize(aFloat, out);
+ break;
+ }
+ case DOUBLE: {
+ serde = AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ADOUBLE);
+ aDouble.setValue(sum);
+ serde.serialize(aDouble, out);
+ break;
+ }
+ case NULL: {
+ serde = AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ANULL);
+ serde.serialize(ANull.NULL, out);
+ break;
+ }
+ case SYSTEM_NULL: {
+ // Empty stream. For local agg return system null. For global agg return null.
+ if (isLocalAgg) {
+ out.writeByte(ATypeTag.SYSTEM_NULL.serialize());
+ } else {
+ serde = AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ANULL);
+ serde.serialize(ANull.NULL, out);
+ }
+ break;
+ }
+ }
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
+ }
+ }
+
+ @Override
+ public void finishPartial() throws AlgebricksException {
+ finish();
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/stream/EmptyStreamAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/stream/EmptyStreamAggregateDescriptor.java
new file mode 100644
index 0000000..587a113
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/stream/EmptyStreamAggregateDescriptor.java
@@ -0,0 +1,89 @@
+package edu.uci.ics.asterix.runtime.aggregates.stream;
+
+import java.io.DataOutput;
+
+import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.ABoolean;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.runtime.aggregates.base.AbstractAggregateFunctionDynamicDescriptor;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunction;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunctionFactory;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class EmptyStreamAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
+
+ private static final long serialVersionUID = 1L;
+
+ public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
+ "empty-stream", 0);
+ public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+ public IFunctionDescriptor createFunctionDescriptor() {
+ return new EmptyStreamAggregateDescriptor();
+ }
+ };
+
+ @Override
+ public ICopyAggregateFunctionFactory createAggregateFunctionFactory(ICopyEvaluatorFactory[] args)
+ throws AlgebricksException {
+ return new ICopyAggregateFunctionFactory() {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public ICopyAggregateFunction createAggregateFunction(final IDataOutputProvider provider)
+ throws AlgebricksException {
+
+ return new ICopyAggregateFunction() {
+
+ private DataOutput out = provider.getDataOutput();
+ @SuppressWarnings("rawtypes")
+ private ISerializerDeserializer serde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ABOOLEAN);
+
+ boolean res = true;
+
+ @Override
+ public void init() throws AlgebricksException {
+ res = true;
+ }
+
+ @Override
+ public void step(IFrameTupleReference tuple) throws AlgebricksException {
+ res = false;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void finish() throws AlgebricksException {
+ ABoolean b = res ? ABoolean.TRUE : ABoolean.FALSE;
+ try {
+ serde.serialize(b, out);
+ } catch (HyracksDataException e) {
+ throw new AlgebricksException(e);
+ }
+ }
+
+ @Override
+ public void finishPartial() throws AlgebricksException {
+ finish();
+ }
+ };
+ }
+ };
+ }
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return FID;
+ }
+
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/stream/NonEmptyStreamAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/stream/NonEmptyStreamAggregateDescriptor.java
index 1a45f7d..f7ddff0 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/stream/NonEmptyStreamAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/stream/NonEmptyStreamAggregateDescriptor.java
@@ -2,9 +2,9 @@
import java.io.DataOutput;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ABoolean;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -23,8 +23,6 @@
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "non-empty-stream", 0);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new NonEmptyStreamAggregateDescriptor();
@@ -83,7 +81,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.NON_EMPTY_STREAM;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/base/IAggregateFunctionDynamicDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/base/IAggregateFunctionDynamicDescriptor.java
deleted file mode 100644
index 95c604a..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/base/IAggregateFunctionDynamicDescriptor.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package edu.uci.ics.asterix.runtime.base;
-
-import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunctionFactory;
-import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-
-public interface IAggregateFunctionDynamicDescriptor extends IFunctionDescriptor {
- public ICopyAggregateFunctionFactory createAggregateFunctionFactory(final ICopyEvaluatorFactory[] args)
- throws AlgebricksException;
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/base/IRunningAggregateFunctionDynamicDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/base/IRunningAggregateFunctionDynamicDescriptor.java
deleted file mode 100644
index 7ab7261..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/base/IRunningAggregateFunctionDynamicDescriptor.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package edu.uci.ics.asterix.runtime.base;
-
-
-import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyRunningAggregateFunctionFactory;
-
-public interface IRunningAggregateFunctionDynamicDescriptor extends IFunctionDescriptor {
- public ICopyRunningAggregateFunctionFactory createRunningAggregateFunctionFactory(final ICopyEvaluatorFactory[] args)
- throws AlgebricksException;
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/base/IScalarFunctionDynamicDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/base/IScalarFunctionDynamicDescriptor.java
deleted file mode 100644
index 8e4353e..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/base/IScalarFunctionDynamicDescriptor.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package edu.uci.ics.asterix.runtime.base;
-
-
-import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-
-public interface IScalarFunctionDynamicDescriptor extends IFunctionDescriptor {
- public ICopyEvaluatorFactory createEvaluatorFactory(ICopyEvaluatorFactory[] args) throws AlgebricksException;
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/base/ISerializableAggregateFunctionDynamicDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/base/ISerializableAggregateFunctionDynamicDescriptor.java
deleted file mode 100644
index 810af16..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/base/ISerializableAggregateFunctionDynamicDescriptor.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package edu.uci.ics.asterix.runtime.base;
-
-import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.algebricks.runtime.base.ICopySerializableAggregateFunctionFactory;
-
-public interface ISerializableAggregateFunctionDynamicDescriptor extends IFunctionDescriptor {
- public ICopySerializableAggregateFunctionFactory createAggregateFunctionFactory(final ICopyEvaluatorFactory[] args)
- throws AlgebricksException;
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/base/IUnnestingFunctionDynamicDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/base/IUnnestingFunctionDynamicDescriptor.java
deleted file mode 100644
index 3f55539..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/base/IUnnestingFunctionDynamicDescriptor.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package edu.uci.ics.asterix.runtime.base;
-
-import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyUnnestingFunctionFactory;
-
-public interface IUnnestingFunctionDynamicDescriptor extends IFunctionDescriptor {
- public ICopyUnnestingFunctionFactory createUnnestingFunctionFactory(final ICopyEvaluatorFactory[] args)
- throws AlgebricksException;
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/CircleCenterAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/CircleCenterAccessor.java
new file mode 100644
index 0000000..577a1fb
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/CircleCenterAccessor.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2009-2011 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.runtime.evaluators.accessors;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.dataflow.data.nontagged.Coordinate;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ACircleSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.AMutablePoint;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.base.APoint;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class CircleCenterAccessor extends AbstractScalarFunctionDynamicDescriptor {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "get-center", 1);
+ private static final byte SER_CICLE_TAG = ATypeTag.CIRCLE.serialize();
+ private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+
+ public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+
+ @Override
+ public IFunctionDescriptor createFunctionDescriptor() {
+ return new CircleCenterAccessor();
+ }
+ };
+
+ @Override
+ public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
+ return new ICopyEvaluatorFactory() {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
+ return new ICopyEvaluator() {
+ private final DataOutput out = output.getDataOutput();
+ private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+ private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
+
+ @SuppressWarnings("unchecked")
+ private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ANULL);
+ private final AMutablePoint aPoint = new AMutablePoint(0, 0);
+ @SuppressWarnings("unchecked")
+ private final ISerializerDeserializer<APoint> pointSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.APOINT);
+
+ @Override
+ public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
+ argOut.reset();
+ eval.evaluate(tuple);
+ byte[] bytes = argOut.getByteArray();
+
+ try {
+ double cX;
+ double cY;
+ if (bytes[0] == SER_CICLE_TAG) {
+ cX = ADoubleSerializerDeserializer.getDouble(bytes,
+ ACircleSerializerDeserializer.getCenterPointCoordinateOffset(Coordinate.X));
+ cY = ADoubleSerializerDeserializer.getDouble(bytes,
+ ACircleSerializerDeserializer.getCenterPointCoordinateOffset(Coordinate.Y));
+ aPoint.setValue(cX, cY);
+ pointSerde.serialize(aPoint, out);
+ } else if (bytes[0] == SER_NULL_TYPE_TAG) {
+ nullSerde.serialize(ANull.NULL, out);
+ } else {
+ throw new AlgebricksException("get-center does not support the type: " + bytes[0]
+ + " It is only implemented for CIRCLE.");
+ }
+
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
+ }
+ }
+ };
+ }
+ };
+ }
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return FID;
+ }
+
+}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/CircleRadiusAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/CircleRadiusAccessor.java
new file mode 100644
index 0000000..ffaae9e
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/CircleRadiusAccessor.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2009-2011 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.runtime.evaluators.accessors;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ACircleSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.ADouble;
+import edu.uci.ics.asterix.om.base.AMutableDouble;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class CircleRadiusAccessor extends AbstractScalarFunctionDynamicDescriptor {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "get-radius", 1);
+ private static final byte SER_CICLE_TAG = ATypeTag.CIRCLE.serialize();
+ private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+
+ public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+
+ @Override
+ public IFunctionDescriptor createFunctionDescriptor() {
+ return new CircleRadiusAccessor();
+ }
+ };
+
+ @Override
+ public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
+ return new ICopyEvaluatorFactory() {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
+ return new ICopyEvaluator() {
+ private final DataOutput out = output.getDataOutput();
+ private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+ private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
+
+ @SuppressWarnings("unchecked")
+ private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ANULL);
+ private final AMutableDouble aDouble = new AMutableDouble(0);
+ @SuppressWarnings("unchecked")
+ private final ISerializerDeserializer<ADouble> doubleSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ADOUBLE);
+
+ @Override
+ public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
+ argOut.reset();
+ eval.evaluate(tuple);
+ byte[] bytes = argOut.getByteArray();
+
+ try {
+ double radius;
+ if (bytes[0] == SER_CICLE_TAG) {
+ radius = ADoubleSerializerDeserializer.getDouble(bytes,
+ ACircleSerializerDeserializer.getRadiusOffset());
+ aDouble.setValue(radius);
+ doubleSerde.serialize(aDouble, out);
+ } else if (bytes[0] == SER_NULL_TYPE_TAG) {
+ nullSerde.serialize(ANull.NULL, out);
+ } else {
+ throw new AlgebricksException("get-radius does not support the type: " + bytes[0]
+ + " It is only implemented for CIRCLE.");
+ }
+
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
+ }
+ }
+ };
+ }
+ };
+ }
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return FID;
+ }
+
+}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/LineRectanglePolygonAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/LineRectanglePolygonAccessor.java
new file mode 100644
index 0000000..d7f87df
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/LineRectanglePolygonAccessor.java
@@ -0,0 +1,181 @@
+/*
+ * Copyright 2009-2011 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.runtime.evaluators.accessors;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.builders.OrderedListBuilder;
+import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.dataflow.data.nontagged.Coordinate;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ALineSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APolygonSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ARectangleSerializerDeserializer;
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.AMutablePoint;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.base.APoint;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.om.types.AOrderedListType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class LineRectanglePolygonAccessor extends AbstractScalarFunctionDynamicDescriptor {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "get-points", 1);
+ private static final byte SER_LINE_TAG = ATypeTag.LINE.serialize();
+ private static final byte SER_RECTANGLE_TAG = ATypeTag.RECTANGLE.serialize();
+ private static final byte SER_POLYGON_TAG = ATypeTag.POLYGON.serialize();
+ private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+
+ public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+
+ @Override
+ public IFunctionDescriptor createFunctionDescriptor() {
+ return new LineRectanglePolygonAccessor();
+ }
+ };
+
+ @Override
+ public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
+ return new ICopyEvaluatorFactory() {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
+ return new ICopyEvaluator() {
+ private final DataOutput out = output.getDataOutput();
+ private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+ private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
+
+ private final OrderedListBuilder listBuilder = new OrderedListBuilder();
+ private final ArrayBackedValueStorage inputVal = new ArrayBackedValueStorage();
+ private final AOrderedListType pointListType = new AOrderedListType(BuiltinType.APOINT, null);
+
+ @SuppressWarnings("unchecked")
+ private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ANULL);
+ private final AMutablePoint aPoint = new AMutablePoint(0, 0);
+ @SuppressWarnings("unchecked")
+ private final ISerializerDeserializer<APoint> pointSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.APOINT);
+
+ @Override
+ public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
+ argOut.reset();
+ eval.evaluate(tuple);
+ byte[] bytes = argOut.getByteArray();
+
+ try {
+ if (bytes[0] == SER_LINE_TAG) {
+ listBuilder.reset(pointListType);
+
+ inputVal.reset();
+ double startX = ADoubleSerializerDeserializer.getDouble(bytes,
+ ALineSerializerDeserializer.getStartPointCoordinateOffset(Coordinate.X));
+ double startY = ADoubleSerializerDeserializer.getDouble(bytes,
+ ALineSerializerDeserializer.getStartPointCoordinateOffset(Coordinate.Y));
+ aPoint.setValue(startX, startY);
+ pointSerde.serialize(aPoint, inputVal.getDataOutput());
+ listBuilder.addItem(inputVal);
+
+ inputVal.reset();
+ double endX = ADoubleSerializerDeserializer.getDouble(bytes,
+ ALineSerializerDeserializer.getEndPointCoordinateOffset(Coordinate.X));
+ double endY = ADoubleSerializerDeserializer.getDouble(bytes,
+ ALineSerializerDeserializer.getEndPointCoordinateOffset(Coordinate.Y));
+ aPoint.setValue(endX, endY);
+ pointSerde.serialize(aPoint, inputVal.getDataOutput());
+ listBuilder.addItem(inputVal);
+ listBuilder.write(out, true);
+
+ } else if (bytes[0] == SER_RECTANGLE_TAG) {
+ listBuilder.reset(pointListType);
+
+ inputVal.reset();
+ double x1 = ADoubleSerializerDeserializer.getDouble(bytes,
+ ARectangleSerializerDeserializer.getBottomLeftCoordinateOffset(Coordinate.X));
+ double y1 = ADoubleSerializerDeserializer.getDouble(bytes,
+ ARectangleSerializerDeserializer.getBottomLeftCoordinateOffset(Coordinate.Y));
+ aPoint.setValue(x1, y1);
+ pointSerde.serialize(aPoint, inputVal.getDataOutput());
+ listBuilder.addItem(inputVal);
+
+ inputVal.reset();
+ double x2 = ADoubleSerializerDeserializer.getDouble(bytes,
+ ARectangleSerializerDeserializer.getUpperRightCoordinateOffset(Coordinate.X));
+ double y2 = ADoubleSerializerDeserializer.getDouble(bytes,
+ ARectangleSerializerDeserializer.getUpperRightCoordinateOffset(Coordinate.Y));
+ aPoint.setValue(x2, y2);
+ pointSerde.serialize(aPoint, inputVal.getDataOutput());
+ listBuilder.addItem(inputVal);
+ listBuilder.write(out, true);
+
+ } else if (bytes[0] == SER_POLYGON_TAG) {
+ int numOfPoints = AInt16SerializerDeserializer.getShort(bytes,
+ APolygonSerializerDeserializer.getNumberOfPointsOffset());
+
+ if (numOfPoints < 3) {
+ throw new HyracksDataException("Polygon must have at least 3 points.");
+ }
+ listBuilder.reset(pointListType);
+ for (int i = 0; i < numOfPoints; ++i) {
+ inputVal.reset();
+ double x = ADoubleSerializerDeserializer.getDouble(bytes,
+ APolygonSerializerDeserializer.getCoordinateOffset(i, Coordinate.X));
+ double y = ADoubleSerializerDeserializer.getDouble(bytes,
+ APolygonSerializerDeserializer.getCoordinateOffset(i, Coordinate.Y));
+ aPoint.setValue(x, y);
+ pointSerde.serialize(aPoint, inputVal.getDataOutput());
+ listBuilder.addItem(inputVal);
+ }
+ listBuilder.write(out, true);
+ } else if (bytes[0] == SER_NULL_TYPE_TAG) {
+ nullSerde.serialize(ANull.NULL, out);
+ } else {
+ throw new AlgebricksException("get-points does not support the type: " + bytes[0]
+ + " It is only implemented for LINE, RECTANGLE, or POLYGON.");
+ }
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
+ }
+ }
+ };
+ }
+ };
+ }
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return FID;
+ }
+
+}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointXCoordinateAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointXCoordinateAccessor.java
new file mode 100644
index 0000000..7fcfd20
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointXCoordinateAccessor.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2009-2011 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.runtime.evaluators.accessors;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.dataflow.data.nontagged.Coordinate;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APointSerializerDeserializer;
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.ADouble;
+import edu.uci.ics.asterix.om.base.AMutableDouble;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class PointXCoordinateAccessor extends AbstractScalarFunctionDynamicDescriptor {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "get-x", 1);
+ private static final byte SER_POINT_TAG = ATypeTag.POINT.serialize();
+ private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+
+ public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+
+ @Override
+ public IFunctionDescriptor createFunctionDescriptor() {
+ return new PointXCoordinateAccessor();
+ }
+ };
+
+ @Override
+ public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
+ return new ICopyEvaluatorFactory() {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
+ return new ICopyEvaluator() {
+ private final DataOutput out = output.getDataOutput();
+ private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+ private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
+
+ @SuppressWarnings("unchecked")
+ private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ANULL);
+ private final AMutableDouble aDouble = new AMutableDouble(0);
+ @SuppressWarnings("unchecked")
+ private final ISerializerDeserializer<ADouble> doubleSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ADOUBLE);
+
+ @Override
+ public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
+ argOut.reset();
+ eval.evaluate(tuple);
+ byte[] bytes = argOut.getByteArray();
+
+ try {
+ double x;
+ if (bytes[0] == SER_POINT_TAG) {
+ x = ADoubleSerializerDeserializer.getDouble(bytes,
+ APointSerializerDeserializer.getCoordinateOffset(Coordinate.X));
+ aDouble.setValue(x);
+ doubleSerde.serialize(aDouble, out);
+ } else if (bytes[0] == SER_NULL_TYPE_TAG) {
+ nullSerde.serialize(ANull.NULL, out);
+ } else {
+ throw new AlgebricksException("get-x does not support the type: " + bytes[0]
+ + " It is only implemented for POINT.");
+ }
+
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
+ }
+ }
+ };
+ }
+ };
+ }
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return FID;
+ }
+
+}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointYCoordinateAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointYCoordinateAccessor.java
new file mode 100644
index 0000000..1c47efa
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointYCoordinateAccessor.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2009-2011 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.runtime.evaluators.accessors;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.dataflow.data.nontagged.Coordinate;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APointSerializerDeserializer;
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.ADouble;
+import edu.uci.ics.asterix.om.base.AMutableDouble;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class PointYCoordinateAccessor extends AbstractScalarFunctionDynamicDescriptor {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "get-y", 1);
+ private static final byte SER_POINT_TAG = ATypeTag.POINT.serialize();
+ private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+
+ public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+
+ @Override
+ public IFunctionDescriptor createFunctionDescriptor() {
+ return new PointYCoordinateAccessor();
+ }
+ };
+
+ @Override
+ public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
+ return new ICopyEvaluatorFactory() {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
+ return new ICopyEvaluator() {
+ private final DataOutput out = output.getDataOutput();
+ private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+ private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
+
+ @SuppressWarnings("unchecked")
+ private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ANULL);
+ private final AMutableDouble aDouble = new AMutableDouble(0);
+ @SuppressWarnings("unchecked")
+ private final ISerializerDeserializer<ADouble> doubleSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ADOUBLE);
+
+ @Override
+ public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
+ argOut.reset();
+ eval.evaluate(tuple);
+ byte[] bytes = argOut.getByteArray();
+
+ try {
+ double y;
+ if (bytes[0] == SER_POINT_TAG) {
+ y = ADoubleSerializerDeserializer.getDouble(bytes,
+ APointSerializerDeserializer.getCoordinateOffset(Coordinate.Y));
+ aDouble.setValue(y);
+ doubleSerde.serialize(aDouble, out);
+ } else if (bytes[0] == SER_NULL_TYPE_TAG) {
+ nullSerde.serialize(ANull.NULL, out);
+ } else {
+ throw new AlgebricksException("get-y does not support the type: " + bytes[0]
+ + " It is only implemented for POINT.");
+ }
+
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
+ }
+ }
+ };
+ }
+ };
+ }
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return FID;
+ }
+
+}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/base/AbstractScalarFunctionDynamicDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/base/AbstractScalarFunctionDynamicDescriptor.java
index 06aa928..a2f00ff 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/base/AbstractScalarFunctionDynamicDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/base/AbstractScalarFunctionDynamicDescriptor.java
@@ -1,9 +1,9 @@
package edu.uci.ics.asterix.runtime.evaluators.base;
import edu.uci.ics.asterix.common.functions.FunctionDescriptorTag;
-import edu.uci.ics.asterix.runtime.base.IScalarFunctionDynamicDescriptor;
+import edu.uci.ics.asterix.om.functions.AbstractFunctionDescriptor;
-public abstract class AbstractScalarFunctionDynamicDescriptor implements IScalarFunctionDynamicDescriptor {
+public abstract class AbstractScalarFunctionDynamicDescriptor extends AbstractFunctionDescriptor {
private static final long serialVersionUID = 1L;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/AsterixListAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/AsterixListAccessor.java
new file mode 100644
index 0000000..58cbd07
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/AsterixListAccessor.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.runtime.evaluators.common;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AUnorderedListSerializerDeserializer;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
+
+/**
+ * Utility class for accessing serialized unordered and ordered lists.
+ */
+public class AsterixListAccessor {
+
+ protected byte[] listBytes;
+ protected int start;
+ protected ATypeTag listType;
+ protected ATypeTag itemType;
+ protected int size;
+
+ public ATypeTag getListType() {
+ return listType;
+ }
+
+ public ATypeTag getItemType() {
+ return itemType;
+ }
+
+ public boolean itemsAreSelfDescribing() {
+ return itemType == ATypeTag.ANY;
+ }
+
+ public void reset(byte[] listBytes, int start) throws AsterixException {
+ this.listBytes = listBytes;
+ this.start = start;
+ listType = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(listBytes[start]);
+ if (listType != ATypeTag.UNORDEREDLIST && listType != ATypeTag.ORDEREDLIST) {
+ throw new AsterixException("Unsupported type: " + listType);
+ }
+ itemType = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(listBytes[start + 1]);
+ if (listType == ATypeTag.UNORDEREDLIST) {
+ size = AUnorderedListSerializerDeserializer.getNumberOfItems(listBytes, start);
+ } else {
+ size = AOrderedListSerializerDeserializer.getNumberOfItems(listBytes, start);
+ }
+ }
+
+ public int size() {
+ return size;
+ }
+
+ public int getItemOffset(int itemIndex) throws AsterixException {
+ if (listType == ATypeTag.UNORDEREDLIST) {
+ return AUnorderedListSerializerDeserializer.getItemOffset(listBytes, start, itemIndex);
+ } else {
+ return AOrderedListSerializerDeserializer.getItemOffset(listBytes, start, itemIndex);
+ }
+ }
+
+ public int getItemLength(int itemOffset) throws AsterixException {
+ ATypeTag itemType = getItemType(itemOffset);
+ return NonTaggedFormatUtil.getFieldValueLength(listBytes, itemOffset, itemType, itemsAreSelfDescribing());
+ }
+
+ public ATypeTag getItemType(int itemOffset) throws AsterixException {
+ if (itemType == ATypeTag.ANY) {
+ return EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(listBytes[itemOffset]);
+ } else {
+ return itemType;
+ }
+ }
+
+ public void writeItem(int itemIndex, DataOutput dos) throws AsterixException, IOException {
+ int itemOffset = getItemOffset(itemIndex);
+ int itemLength = getItemLength(itemOffset);
+ if (itemsAreSelfDescribing()) {
+ ++itemLength;
+ } else {
+ dos.writeByte(itemType.serialize());
+ }
+ dos.write(listBytes, itemOffset, itemLength);
+ }
+
+ public byte[] getByteArray() {
+ return listBytes;
+ }
+
+ public int getStart() {
+ return start;
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/GramTokensEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/GramTokensEvaluator.java
index 188135c..261039a 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/GramTokensEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/GramTokensEvaluator.java
@@ -3,7 +3,6 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.builders.IAOrderedListBuilder;
import edu.uci.ics.asterix.builders.OrderedListBuilder;
import edu.uci.ics.asterix.om.types.AOrderedListType;
import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -16,8 +15,6 @@
import edu.uci.ics.hyracks.dataflow.common.data.marshalling.BooleanSerializerDeserializer;
import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.IBinaryTokenizer;
-import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.IToken;
-import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.IntArray;
import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.NGramUTF8StringBinaryTokenizer;
public class GramTokensEvaluator implements ICopyEvaluator {
@@ -25,20 +22,15 @@
// assuming type indicator in serde format
private final int typeIndicatorSize = 1;
- protected final DataOutput out;
- protected final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
- protected final ICopyEvaluator stringEval;
- protected final ICopyEvaluator gramLengthEval;
- protected final ICopyEvaluator prePostEval;
+ private final DataOutput out;
+ private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+ private final ICopyEvaluator stringEval;
+ private final ICopyEvaluator gramLengthEval;
+ private final ICopyEvaluator prePostEval;
private final NGramUTF8StringBinaryTokenizer tokenizer;
-
- protected final IntArray itemOffsets = new IntArray();
- protected final ArrayBackedValueStorage tokenBuffer = new ArrayBackedValueStorage();
-
- private IAOrderedListBuilder listBuilder = new OrderedListBuilder();
- private ArrayBackedValueStorage inputVal = new ArrayBackedValueStorage();
- private BuiltinType itemType;
+ private final OrderedListBuilder listBuilder = new OrderedListBuilder();
+ private final AOrderedListType listType;
public GramTokensEvaluator(ICopyEvaluatorFactory[] args, IDataOutputProvider output, IBinaryTokenizer tokenizer,
BuiltinType itemType) throws AlgebricksException {
@@ -47,7 +39,7 @@
gramLengthEval = args[1].createEvaluator(argOut);
prePostEval = args[2].createEvaluator(argOut);
this.tokenizer = (NGramUTF8StringBinaryTokenizer) tokenizer;
- this.itemType = itemType;
+ this.listType = new AOrderedListType(itemType, null);
}
@Override
@@ -65,16 +57,12 @@
boolean prePost = BooleanSerializerDeserializer.getBoolean(bytes, prePostOff + typeIndicatorSize);
tokenizer.setPrePost(prePost);
tokenizer.reset(bytes, 0, gramLengthOff);
- tokenBuffer.reset();
try {
- listBuilder.reset(new AOrderedListType(itemType, null));
+ listBuilder.reset(listType);
while (tokenizer.hasNext()) {
- inputVal.reset();
tokenizer.next();
- IToken token = tokenizer.getToken();
- token.serializeToken(inputVal.getDataOutput());
- listBuilder.addItem(inputVal);
+ listBuilder.addItem(tokenizer.getToken());
}
listBuilder.write(out, true);
} catch (IOException e) {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardCheckEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardCheckEvaluator.java
index 3f160d6..ab73df2 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardCheckEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardCheckEvaluator.java
@@ -2,7 +2,6 @@
import java.io.IOException;
-import edu.uci.ics.asterix.builders.IAOrderedListBuilder;
import edu.uci.ics.asterix.builders.OrderedListBuilder;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
@@ -24,7 +23,7 @@
protected final ICopyEvaluator jaccThreshEval;
protected float jaccThresh = -1f;
- protected IAOrderedListBuilder listBuilder;
+ protected OrderedListBuilder listBuilder;
protected ArrayBackedValueStorage inputVal;
@SuppressWarnings("unchecked")
protected final ISerializerDeserializer<ABoolean> booleanSerde = AqlSerializerDeserializerProvider.INSTANCE
@@ -68,18 +67,18 @@
BinaryEntry entry = hashMap.get(keyEntry);
if (entry != null) {
// Increment second value.
- int firstValInt = IntegerPointable.getInteger(buf, 0);
+ int firstValInt = IntegerPointable.getInteger(entry.buf, entry.off);
// Irrelevant for the intersection size.
if (firstValInt == 0) {
continue;
}
- int secondValInt = IntegerPointable.getInteger(buf, 4);
+ int secondValInt = IntegerPointable.getInteger(entry.buf, entry.off + 4);
// Subtract old min value.
intersectionSize -= (firstValInt < secondValInt) ? firstValInt : secondValInt;
secondValInt++;
// Add new min value.
intersectionSize += (firstValInt < secondValInt) ? firstValInt : secondValInt;
- IntegerPointable.setInteger(entry.buf, 0, secondValInt);
+ IntegerPointable.setInteger(entry.buf, entry.off + 4, secondValInt);
} else {
// Could not find element in other set. Increase min union size by 1.
minUnionSize++;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/WordTokensEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/WordTokensEvaluator.java
index f0f36f5..c316fb5 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/WordTokensEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/WordTokensEvaluator.java
@@ -3,7 +3,6 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.builders.IAOrderedListBuilder;
import edu.uci.ics.asterix.builders.OrderedListBuilder;
import edu.uci.ics.asterix.om.types.AOrderedListType;
import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -14,29 +13,22 @@
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.IBinaryTokenizer;
-import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.IToken;
-import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.IntArray;
public class WordTokensEvaluator implements ICopyEvaluator {
- protected final DataOutput out;
- protected final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
- protected final ICopyEvaluator stringEval;
+ private final DataOutput out;
+ private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+ private final ICopyEvaluator stringEval;
- protected final IBinaryTokenizer tokenizer;
-
- protected final IntArray itemOffsets = new IntArray();
- protected final ArrayBackedValueStorage tokenBuffer = new ArrayBackedValueStorage();
-
- private IAOrderedListBuilder listBuilder = new OrderedListBuilder();
- private ArrayBackedValueStorage inputVal = new ArrayBackedValueStorage();
- private BuiltinType itemType;
+ private final IBinaryTokenizer tokenizer;
+ private final OrderedListBuilder listBuilder = new OrderedListBuilder();
+ private final AOrderedListType listType;
public WordTokensEvaluator(ICopyEvaluatorFactory[] args, IDataOutputProvider output, IBinaryTokenizer tokenizer,
BuiltinType itemType) throws AlgebricksException {
out = output.getDataOutput();
stringEval = args[0].createEvaluator(argOut);
this.tokenizer = tokenizer;
- this.itemType = itemType;
+ this.listType = new AOrderedListType(itemType, null);
}
@Override
@@ -45,16 +37,11 @@
stringEval.evaluate(tuple);
byte[] bytes = argOut.getByteArray();
tokenizer.reset(bytes, 0, argOut.getLength());
- tokenBuffer.reset();
-
try {
- listBuilder.reset(new AOrderedListType(itemType, null));
+ listBuilder.reset(listType);
while (tokenizer.hasNext()) {
- inputVal.reset();
tokenizer.next();
- IToken token = tokenizer.getToken();
- token.serializeToken(inputVal.getDataOutput());
- listBuilder.addItem(inputVal);
+ listBuilder.addItem(tokenizer.getToken());
}
listBuilder.write(out, true);
} catch (IOException e) {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ABooleanConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ABooleanConstructorDescriptor.java
index 8b9f665..ab3c1e7 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ABooleanConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ABooleanConstructorDescriptor.java
@@ -17,11 +17,11 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlBinaryComparatorFactoryProvider;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ABoolean;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -40,7 +40,6 @@
public class ABooleanConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "boolean", 1);
private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -106,7 +105,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.BOOLEAN_CONSTRUCTOR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ACircleConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ACircleConstructorDescriptor.java
index 3d22c11..0c00337 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ACircleConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ACircleConstructorDescriptor.java
@@ -17,12 +17,12 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ACircle;
import edu.uci.ics.asterix.om.base.AMutableCircle;
import edu.uci.ics.asterix.om.base.AMutablePoint;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -40,7 +40,6 @@
public class ACircleConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "circle", 1);
private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -102,7 +101,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.CIRCLE_CONSTRUCTOR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateConstructorDescriptor.java
index 77e8b50..44fcf7c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateConstructorDescriptor.java
@@ -17,7 +17,6 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ADate;
import edu.uci.ics.asterix.om.base.AMutableDate;
@@ -25,6 +24,7 @@
import edu.uci.ics.asterix.om.base.temporal.ADateParserFactory;
import edu.uci.ics.asterix.om.base.temporal.ByteArrayCharSequenceAccessor;
import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -42,7 +42,6 @@
public class ADateConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "date", 1);
private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
@@ -117,7 +116,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.DATE_CONSTRUCTOR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateTimeConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateTimeConstructorDescriptor.java
index 3f91571..6a5783b 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateTimeConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateTimeConstructorDescriptor.java
@@ -17,7 +17,6 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ADateTime;
import edu.uci.ics.asterix.om.base.AMutableDateTime;
@@ -25,6 +24,7 @@
import edu.uci.ics.asterix.om.base.temporal.ADateParserFactory;
import edu.uci.ics.asterix.om.base.temporal.ATimeParserFactory;
import edu.uci.ics.asterix.om.base.temporal.ByteArrayCharSequenceAccessor;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -42,7 +42,6 @@
public class ADateTimeConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "datetime", 1);
private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
@@ -126,7 +125,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.DATETIME_CONSTRUCTOR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADoubleConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADoubleConstructorDescriptor.java
index 8a837e9..0689fd7 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADoubleConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADoubleConstructorDescriptor.java
@@ -17,12 +17,12 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlBinaryComparatorFactoryProvider;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ADouble;
import edu.uci.ics.asterix.om.base.AMutableDouble;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -41,7 +41,6 @@
public class ADoubleConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "double", 1);
private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -212,7 +211,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.DOUBLE_CONSTRUCTOR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADurationConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADurationConstructorDescriptor.java
index 7b48738..b2b3f4e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADurationConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADurationConstructorDescriptor.java
@@ -16,13 +16,13 @@
import java.io.DataOutput;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ADuration;
import edu.uci.ics.asterix.om.base.AMutableDuration;
import edu.uci.ics.asterix.om.base.ANull;
import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory;
import edu.uci.ics.asterix.om.base.temporal.ByteArrayCharSequenceAccessor;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -40,7 +40,6 @@
public class ADurationConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "duration", 1);
private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
@@ -107,7 +106,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.DURATION_CONSTRUCTOR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AFloatConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AFloatConstructorDescriptor.java
index df5ed8c..dde302c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AFloatConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AFloatConstructorDescriptor.java
@@ -17,12 +17,12 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlBinaryComparatorFactoryProvider;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AFloat;
import edu.uci.ics.asterix.om.base.AMutableFloat;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -41,7 +41,6 @@
public class AFloatConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "float", 1);
private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -215,6 +214,6 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.FLOAT_CONSTRUCTOR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt16ConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt16ConstructorDescriptor.java
index 41ac615..3cb9d46 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt16ConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt16ConstructorDescriptor.java
@@ -17,11 +17,11 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AInt16;
import edu.uci.ics.asterix.om.base.AMutableInt16;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -39,7 +39,6 @@
public class AInt16ConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "int16", 1);
private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -121,7 +120,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.INT16_CONSTRUCTOR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt32ConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt32ConstructorDescriptor.java
index 1327b30..0091bbb 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt32ConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt32ConstructorDescriptor.java
@@ -17,11 +17,11 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AInt32;
import edu.uci.ics.asterix.om.base.AMutableInt32;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -39,7 +39,6 @@
public class AInt32ConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "int32", 1);
private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -120,7 +119,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.INT32_CONSTRUCTOR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt64ConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt64ConstructorDescriptor.java
index e1e3734..6fa4925 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt64ConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt64ConstructorDescriptor.java
@@ -17,11 +17,11 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AInt64;
import edu.uci.ics.asterix.om.base.AMutableInt64;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -39,7 +39,6 @@
public class AInt64ConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "int64", 1);
private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -122,7 +121,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.INT64_CONSTRUCTOR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt8ConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt8ConstructorDescriptor.java
index 8721116..c14b4fa 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt8ConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt8ConstructorDescriptor.java
@@ -17,11 +17,11 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AInt8;
import edu.uci.ics.asterix.om.base.AMutableInt8;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -39,7 +39,6 @@
public class AInt8ConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "int8", 1);
private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -121,7 +120,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.INT8_CONSTRUCTOR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java
index 84e7295..f287141 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java
@@ -17,12 +17,12 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ALine;
import edu.uci.ics.asterix.om.base.AMutableLine;
import edu.uci.ics.asterix.om.base.AMutablePoint;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -40,7 +40,6 @@
public class ALineConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "line", 1);
private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -105,7 +104,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.LINE_CONSTRUCTOR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java
index 89ea420..df00c74 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java
@@ -17,10 +17,10 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlBinaryComparatorFactoryProvider;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -39,7 +39,6 @@
public class ANullConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "null", 1);
private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
@@ -93,7 +92,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.NULL_CONSTRUCTOR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java
index 4ae4725..3c9a8b4 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java
@@ -17,11 +17,11 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AMutablePoint3D;
import edu.uci.ics.asterix.om.base.ANull;
import edu.uci.ics.asterix.om.base.APoint3D;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -39,7 +39,6 @@
public class APoint3DConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "point3d", 1);
private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -101,7 +100,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.POINT3D_CONSTRUCTOR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java
index dc3234e..89c4baf 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java
@@ -17,11 +17,11 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AMutablePoint;
import edu.uci.ics.asterix.om.base.ANull;
import edu.uci.ics.asterix.om.base.APoint;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -39,7 +39,6 @@
public class APointConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "point", 1);
private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -97,7 +96,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.POINT_CONSTRUCTOR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java
index b856bff..e17a212 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java
@@ -17,10 +17,10 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APointSerializerDeserializer;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -38,7 +38,6 @@
public class APolygonConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "polygon", 1);
private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
private final static byte SER_POLYGON_TYPE_TAG = ATypeTag.POLYGON.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
@@ -98,7 +97,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.POLYGON_CONSTRUCTOR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java
index 9d2385f..598ff92 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java
@@ -17,12 +17,12 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AMutablePoint;
import edu.uci.ics.asterix.om.base.AMutableRectangle;
import edu.uci.ics.asterix.om.base.ANull;
import edu.uci.ics.asterix.om.base.ARectangle;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -40,7 +40,6 @@
public class ARectangleConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "rectangle", 1);
private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -88,11 +87,14 @@
commaIndex = s.indexOf(',', spaceIndex + 1);
aPoint[1].setValue(Double.parseDouble(s.substring(spaceIndex + 1, commaIndex)),
Double.parseDouble(s.substring(commaIndex + 1, s.length())));
- if (aPoint[0].getX() > aPoint[1].getX() || aPoint[0].getY() > aPoint[1].getY()) {
+ if (aPoint[0].getX() > aPoint[1].getX() && aPoint[0].getY() > aPoint[1].getY()) {
+ aRectangle.setValue(aPoint[1], aPoint[0]);
+ } else if (aPoint[0].getX() < aPoint[1].getX() && aPoint[0].getY() < aPoint[1].getY()) {
+ aRectangle.setValue(aPoint[0], aPoint[1]);
+ } else {
throw new IllegalArgumentException(
- "The low point in the rectangle cannot be larger than the high point");
+ "Rectangle arugment must be either (bottom left point, top right point) or (top right point, bottom left point)");
}
- aRectangle.setValue(aPoint[0], aPoint[1]);
rectangle2DSerde.serialize(aRectangle, out);
} else if (serString[0] == SER_NULL_TYPE_TAG)
nullSerde.serialize(ANull.NULL, out);
@@ -109,7 +111,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.RECTANGLE_CONSTRUCTOR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java
index 70b35e3..54ab21f 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java
@@ -17,9 +17,9 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -37,7 +37,6 @@
public class AStringConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "string", 1);
private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -87,7 +86,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.STRING_CONSTRUCTOR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java
index bba2266..caff78b 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java
@@ -17,7 +17,6 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AMutableTime;
import edu.uci.ics.asterix.om.base.ANull;
@@ -25,6 +24,7 @@
import edu.uci.ics.asterix.om.base.temporal.ATimeParserFactory;
import edu.uci.ics.asterix.om.base.temporal.ByteArrayCharSequenceAccessor;
import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -42,7 +42,6 @@
public class ATimeConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "time", 1);
private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
@@ -115,7 +114,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.TIME_CONSTRUCTOR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java
index 1a4b3e0..03a0ba8 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java
@@ -1,5 +1,10 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
+import java.io.DataOutput;
+import java.util.Arrays;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ABoolean;
import edu.uci.ics.asterix.om.base.AString;
@@ -12,10 +17,6 @@
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
-import java.io.DataOutput;
-import java.util.Arrays;
-import java.util.logging.Level;
-import java.util.logging.Logger;
public abstract class AbstractBinaryStringBoolEval implements ICopyEvaluator {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractNumericArithmeticEval.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractNumericArithmeticEval.java
index b2d420b..f585965 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractNumericArithmeticEval.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractNumericArithmeticEval.java
@@ -21,9 +21,9 @@
import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractQuadStringStringEval.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractQuadStringStringEval.java
index 1a59340..37a9d20 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractQuadStringStringEval.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractQuadStringStringEval.java
@@ -4,6 +4,11 @@
*/
package edu.uci.ics.asterix.runtime.evaluators.functions;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.regex.Pattern;
+
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AMutableString;
import edu.uci.ics.asterix.om.base.ANull;
@@ -17,10 +22,6 @@
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.regex.Pattern;
/**
* @author ilovesoup
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractTripleStringBoolEval.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractTripleStringBoolEval.java
index d8637ad..a0c963b 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractTripleStringBoolEval.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractTripleStringBoolEval.java
@@ -1,5 +1,9 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
+import java.io.DataOutput;
+import java.util.Arrays;
+import java.util.regex.Pattern;
+
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ABoolean;
import edu.uci.ics.asterix.om.base.AString;
@@ -12,9 +16,6 @@
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
-import java.io.DataOutput;
-import java.util.Arrays;
-import java.util.regex.Pattern;
/**
* @author Xiaoyu Ma
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractTripleStringStringEval.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractTripleStringStringEval.java
index 7179cbf..e38fe8a 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractTripleStringStringEval.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractTripleStringStringEval.java
@@ -1,5 +1,10 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.regex.Pattern;
+
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AMutableString;
import edu.uci.ics.asterix.om.base.ANull;
@@ -13,10 +18,6 @@
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.regex.Pattern;
/**
* @author Xiaoyu Ma
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AndDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AndDescriptor.java
index e9dab9d..b2fc6da 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AndDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AndDescriptor.java
@@ -4,13 +4,13 @@
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ABoolean;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.AlgebricksBuiltinFunctions;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
@@ -23,8 +23,6 @@
public class AndDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(AlgebricksBuiltinFunctions.ALGEBRICKS_NS,
- "and", FunctionIdentifier.VARARGS);
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -35,7 +33,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.AND;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java
index 175db39..e080a39 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java
@@ -4,11 +4,11 @@
import java.io.IOException;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AUnorderedListSerializerDeserializer;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -28,8 +28,6 @@
public class AnyCollectionMemberDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "any-collection-member", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new AnyCollectionMemberDescriptor();
@@ -43,7 +41,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.ANY_COLLECTION_MEMBER;
}
private static class AnyCollectionMemberEvalFactory implements ICopyEvaluatorFactory {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CastRecordDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CastRecordDescriptor.java
index 4182824..8bb4d49 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CastRecordDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CastRecordDescriptor.java
@@ -2,15 +2,15 @@
import java.io.DataOutput;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.om.pointables.PointableAllocator;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.cast.ACastVisitor;
import edu.uci.ics.asterix.om.types.ARecordType;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.asterix.runtime.pointables.PointableAllocator;
-import edu.uci.ics.asterix.runtime.pointables.base.IVisitablePointable;
-import edu.uci.ics.asterix.runtime.pointables.cast.ACastVisitor;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.common.utils.Triple;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
@@ -22,8 +22,6 @@
public class CastRecordDescriptor extends AbstractScalarFunctionDynamicDescriptor {
- protected static final FunctionIdentifier FID_CAST = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "cast-record", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new CastRecordDescriptor();
@@ -41,7 +39,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID_CAST;
+ return AsterixBuiltinFunctions.CAST_RECORD;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/ClosedRecordConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/ClosedRecordConstructorDescriptor.java
index d92aff9..ac6bfe5 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/ClosedRecordConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/ClosedRecordConstructorDescriptor.java
@@ -1,6 +1,7 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ARecordType;
@@ -11,8 +12,6 @@
public class ClosedRecordConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
- protected static final FunctionIdentifier FID_CLOSED = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "closed-record-constructor", FunctionIdentifier.VARARGS);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new ClosedRecordConstructorDescriptor();
@@ -29,7 +28,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID_CLOSED;
+ return AsterixBuiltinFunctions.CLOSED_RECORD_CONSTRUCTOR;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java
index f23df3a..5dcb838 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java
@@ -1,19 +1,22 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
+import java.io.DataOutput;
+import java.io.IOException;
+
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
@@ -21,8 +24,6 @@
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
import edu.uci.ics.hyracks.dataflow.common.data.util.StringUtils;
-import java.io.DataOutput;
-import java.io.IOException;
/**
* @author Xiaoyu Ma
@@ -30,8 +31,6 @@
public class CodePointToStringDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "codepoint-to-string", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new CodePointToStringDescriptor();
@@ -147,6 +146,6 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.CODEPOINT_TO_STRING;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/ContainsDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/ContainsDescriptor.java
index 5e558be..f2bb83c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/ContainsDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/ContainsDescriptor.java
@@ -2,7 +2,7 @@
import java.io.DataOutput;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
@@ -16,7 +16,6 @@
public class ContainsDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "contains", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new ContainsDescriptor();
@@ -76,7 +75,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.CONTAINS;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CountHashedGramTokensDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CountHashedGramTokensDescriptor.java
index 184d974..c4e8387 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CountHashedGramTokensDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CountHashedGramTokensDescriptor.java
@@ -1,9 +1,8 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
-import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.common.GramTokensEvaluator;
@@ -19,8 +18,6 @@
public class CountHashedGramTokensDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "counthashed-gram-tokens", 3);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new CountHashedGramTokensDescriptor();
@@ -29,7 +26,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.COUNTHASHED_GRAM_TOKENS;
}
@Override
@@ -39,8 +36,7 @@
@Override
public ICopyEvaluator createEvaluator(IDataOutputProvider output) throws AlgebricksException {
- ITokenFactory tokenFactory = new HashedUTF8NGramTokenFactory(ATypeTag.INT32.serialize(),
- ATypeTag.INT32.serialize());
+ ITokenFactory tokenFactory = new HashedUTF8NGramTokenFactory();
NGramUTF8StringBinaryTokenizer tokenizer = new NGramUTF8StringBinaryTokenizer(3, true, false, true,
tokenFactory);
return new GramTokensEvaluator(args, output, tokenizer, BuiltinType.AINT32);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CountHashedWordTokensDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CountHashedWordTokensDescriptor.java
index 7bfbe49..90a4293 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CountHashedWordTokensDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CountHashedWordTokensDescriptor.java
@@ -1,9 +1,8 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
-import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.common.WordTokensEvaluator;
@@ -20,8 +19,6 @@
public class CountHashedWordTokensDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "counthashed-word-tokens", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new CountHashedWordTokensDescriptor();
@@ -30,7 +27,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.COUNTHASHED_WORD_TOKENS;
}
@Override
@@ -40,8 +37,7 @@
@Override
public ICopyEvaluator createEvaluator(IDataOutputProvider output) throws AlgebricksException {
- ITokenFactory tokenFactory = new HashedUTF8WordTokenFactory(ATypeTag.INT32.serialize(),
- ATypeTag.INT32.serialize());
+ ITokenFactory tokenFactory = new HashedUTF8WordTokenFactory();
IBinaryTokenizer tokenizer = new DelimitedUTF8StringBinaryTokenizer(false, true, tokenFactory);
return new WordTokensEvaluator(args, output, tokenizer, BuiltinType.AINT32);
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateCircleDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateCircleDescriptor.java
index 45ea698..5cef4da 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateCircleDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateCircleDescriptor.java
@@ -3,7 +3,6 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.Coordinate;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APointSerializerDeserializer;
@@ -11,6 +10,7 @@
import edu.uci.ics.asterix.om.base.ACircle;
import edu.uci.ics.asterix.om.base.AMutableCircle;
import edu.uci.ics.asterix.om.base.AMutablePoint;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -27,8 +27,6 @@
public class CreateCircleDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "create-circle",
- 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new CreateCircleDescriptor();
@@ -82,7 +80,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.CREATE_CIRCLE;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateLineDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateLineDescriptor.java
index f234dc4..42931b8 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateLineDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateLineDescriptor.java
@@ -3,7 +3,6 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.Coordinate;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APointSerializerDeserializer;
@@ -11,6 +10,7 @@
import edu.uci.ics.asterix.om.base.ALine;
import edu.uci.ics.asterix.om.base.AMutableLine;
import edu.uci.ics.asterix.om.base.AMutablePoint;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -27,7 +27,6 @@
public class CreateLineDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "create-line", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new CreateLineDescriptor();
@@ -84,7 +83,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.CREATE_LINE;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateMBRDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateMBRDescriptor.java
index b1c3564..ad6f6d4 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateMBRDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateMBRDescriptor.java
@@ -1,6 +1,6 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
@@ -12,7 +12,6 @@
public class CreateMBRDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "create-mbr", 3);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new CreateMBRDescriptor();
@@ -26,7 +25,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.CREATE_MBR;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePointDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePointDescriptor.java
index 6cbcba5..6099ab6 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePointDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePointDescriptor.java
@@ -3,11 +3,11 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AMutablePoint;
import edu.uci.ics.asterix.om.base.APoint;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -24,7 +24,6 @@
public class CreatePointDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "create-point", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new CreatePointDescriptor();
@@ -74,7 +73,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.CREATE_POINT;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java
index 26b3ad9..4bd45bb 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java
@@ -3,7 +3,7 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -19,8 +19,6 @@
public class CreatePolygonDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "create-polygon",
- FunctionIdentifier.VARARGS);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new CreatePolygonDescriptor();
@@ -76,7 +74,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.CREATE_POLYGON;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateRectangleDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateRectangleDescriptor.java
index 01c33df..36a9266 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateRectangleDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateRectangleDescriptor.java
@@ -3,7 +3,6 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.Coordinate;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APointSerializerDeserializer;
@@ -11,6 +10,7 @@
import edu.uci.ics.asterix.om.base.AMutablePoint;
import edu.uci.ics.asterix.om.base.AMutableRectangle;
import edu.uci.ics.asterix.om.base.ARectangle;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -27,8 +27,6 @@
public class CreateRectangleDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "create-rectangle", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new CreateRectangleDescriptor();
@@ -71,11 +69,14 @@
APointSerializerDeserializer.getCoordinateOffset(Coordinate.X)),
ADoubleSerializerDeserializer.getDouble(outInput1.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.Y)));
- if (aPoint[0].getX() > aPoint[1].getX() || aPoint[0].getY() > aPoint[1].getY()) {
+ if (aPoint[0].getX() > aPoint[1].getX() && aPoint[0].getY() > aPoint[1].getY()) {
+ aRectangle.setValue(aPoint[1], aPoint[0]);
+ } else if (aPoint[0].getX() < aPoint[1].getX() && aPoint[0].getY() < aPoint[1].getY()) {
+ aRectangle.setValue(aPoint[0], aPoint[1]);
+ } else {
throw new IllegalArgumentException(
- "The low point in the rectangle cannot be larger than the high point");
+ "Rectangle arugment must be either (bottom left point, top right point) or (top right point, bottom left point)");
}
- aRectangle.setValue(aPoint[0], aPoint[1]);
rectangle2DSerde.serialize(aRectangle, out);
} catch (IOException e1) {
throw new AlgebricksException(e1);
@@ -88,7 +89,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.CREATE_RECTANGLE;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceCheckDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceCheckDescriptor.java
index fc65b8e..ca61b5b 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceCheckDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceCheckDescriptor.java
@@ -2,11 +2,10 @@
import java.io.IOException;
-import edu.uci.ics.asterix.builders.IAOrderedListBuilder;
import edu.uci.ics.asterix.builders.OrderedListBuilder;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ABoolean;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.AOrderedListType;
@@ -27,8 +26,6 @@
public class EditDistanceCheckDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "edit-distance-check", 3);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new EditDistanceCheckDescriptor();
@@ -49,14 +46,14 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.EDIT_DISTANCE_CHECK;
}
private static class EditDistanceCheckEvaluator extends EditDistanceEvaluator {
private final ICopyEvaluator edThreshEval;
private int edThresh = -1;
- private IAOrderedListBuilder listBuilder;
+ private final OrderedListBuilder listBuilder;
private ArrayBackedValueStorage inputVal;
@SuppressWarnings("unchecked")
private final ISerializerDeserializer<ABoolean> booleanSerde = AqlSerializerDeserializerProvider.INSTANCE
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceDescriptor.java
index 411e809..7cb44cb 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceDescriptor.java
@@ -1,6 +1,6 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
@@ -14,8 +14,6 @@
public class EditDistanceDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "edit-distance",
- 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new EditDistanceDescriptor();
@@ -36,7 +34,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.EDIT_DISTANCE;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceListIsFilterable.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceListIsFilterable.java
index 7ebeee6..7c47cad 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceListIsFilterable.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceListIsFilterable.java
@@ -2,11 +2,11 @@
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AUnorderedListSerializerDeserializer;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ABoolean;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -33,8 +33,6 @@
public class EditDistanceListIsFilterable extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "edit-distance-list-is-filterable", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new EditDistanceListIsFilterable();
@@ -55,7 +53,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.EDIT_DISTANCE_LIST_IS_FILTERABLE;
}
private static class EditDistanceListIsFilterableEvaluator implements ICopyEvaluator {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceStringIsFilterable.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceStringIsFilterable.java
index 8288456..e8571bf 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceStringIsFilterable.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceStringIsFilterable.java
@@ -2,9 +2,9 @@
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ABoolean;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -33,8 +33,6 @@
public class EditDistanceStringIsFilterable extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "edit-distance-string-is-filterable", 4);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new EditDistanceStringIsFilterable();
@@ -55,7 +53,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.EDIT_DISTANCE_STRING_IS_FILTERABLE;
}
private static class EditDistanceStringIsFilterableEvaluator implements ICopyEvaluator {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EmbedTypeDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EmbedTypeDescriptor.java
index 4c0c704..1477106 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EmbedTypeDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EmbedTypeDescriptor.java
@@ -1,6 +1,6 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.IAType;
@@ -15,7 +15,6 @@
public class EmbedTypeDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "embed-type", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new EmbedTypeDescriptor();
@@ -52,7 +51,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.EMBED_TYPE;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EndsWithDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EndsWithDescriptor.java
index bcf85fe..d5d74bb 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EndsWithDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EndsWithDescriptor.java
@@ -2,7 +2,7 @@
import java.io.DataOutput;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
@@ -16,7 +16,6 @@
public class EndsWithDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "ends-with", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new EndsWithDescriptor();
@@ -72,7 +71,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.ENDS_WITH;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByIndexDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByIndexDescriptor.java
index 2bb81ad..e4aa596 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByIndexDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByIndexDescriptor.java
@@ -1,6 +1,6 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ARecordType;
@@ -12,8 +12,6 @@
public class FieldAccessByIndexDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private static final FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "field-access-by-index", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new FieldAccessByIndexDescriptor();
@@ -28,7 +26,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.FIELD_ACCESS_BY_INDEX;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByNameDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByNameDescriptor.java
index bdc0dff..3c4e6d8 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByNameDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByNameDescriptor.java
@@ -8,6 +8,7 @@
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ARecordSerializerDeserializer;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -27,8 +28,6 @@
public class FieldAccessByNameDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private static final FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "field-access-by-name", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new FieldAccessByNameDescriptor();
@@ -37,7 +36,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.FIELD_ACCESS_BY_NAME;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FuzzyEqDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FuzzyEqDescriptor.java
index 9ad2f2b..b9f9d5e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FuzzyEqDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FuzzyEqDescriptor.java
@@ -1,6 +1,6 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
@@ -12,7 +12,6 @@
public class FuzzyEqDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "fuzzy-eq", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new FuzzyEqDescriptor();
@@ -26,7 +25,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.FUZZY_EQ;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GetItemDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GetItemDescriptor.java
index cbc61cf..ca65c11 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GetItemDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GetItemDescriptor.java
@@ -4,10 +4,10 @@
import java.io.IOException;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -28,7 +28,6 @@
public class GetItemDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "get-item", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new GetItemDescriptor();
@@ -42,7 +41,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.GET_ITEM;
}
private static class GetItemEvalFactory implements ICopyEvaluatorFactory {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GramTokensDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GramTokensDescriptor.java
index 558ae7e..20a2977 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GramTokensDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GramTokensDescriptor.java
@@ -1,9 +1,8 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
-import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.common.GramTokensEvaluator;
@@ -19,7 +18,6 @@
public class GramTokensDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "gram-tokens", 3);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new GramTokensDescriptor();
@@ -28,7 +26,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.GRAM_TOKENS;
}
@Override
@@ -38,8 +36,7 @@
@Override
public ICopyEvaluator createEvaluator(IDataOutputProvider output) throws AlgebricksException {
- ITokenFactory tokenFactory = new UTF8NGramTokenFactory(ATypeTag.STRING.serialize(),
- ATypeTag.INT32.serialize());
+ ITokenFactory tokenFactory = new UTF8NGramTokenFactory();
NGramUTF8StringBinaryTokenizer tokenizer = new NGramUTF8StringBinaryTokenizer(3, true, true, true,
tokenFactory);
return new GramTokensEvaluator(args, output, tokenizer, BuiltinType.ASTRING);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/HashedGramTokensDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/HashedGramTokensDescriptor.java
index 04088a2..e86f86a6 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/HashedGramTokensDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/HashedGramTokensDescriptor.java
@@ -1,9 +1,8 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
-import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.common.GramTokensEvaluator;
@@ -19,8 +18,6 @@
public class HashedGramTokensDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "hashed-gram-tokens", 3);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new HashedGramTokensDescriptor();
@@ -29,7 +26,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.HASHED_GRAM_TOKENS;
}
@Override
@@ -39,8 +36,7 @@
@Override
public ICopyEvaluator createEvaluator(IDataOutputProvider output) throws AlgebricksException {
- ITokenFactory tokenFactory = new HashedUTF8NGramTokenFactory(ATypeTag.INT32.serialize(),
- ATypeTag.INT32.serialize());
+ ITokenFactory tokenFactory = new HashedUTF8NGramTokenFactory();
NGramUTF8StringBinaryTokenizer tokenizer = new NGramUTF8StringBinaryTokenizer(3, true, true, true,
tokenFactory);
return new GramTokensEvaluator(args, output, tokenizer, BuiltinType.AINT32);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/HashedWordTokensDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/HashedWordTokensDescriptor.java
index dcd5f70..d6da522 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/HashedWordTokensDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/HashedWordTokensDescriptor.java
@@ -1,9 +1,8 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
-import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.common.WordTokensEvaluator;
@@ -20,8 +19,6 @@
public class HashedWordTokensDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "hashed-word-tokens", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new HashedWordTokensDescriptor();
@@ -30,7 +27,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.HASHED_WORD_TOKENS;
}
@Override
@@ -40,8 +37,7 @@
@Override
public ICopyEvaluator createEvaluator(IDataOutputProvider output) throws AlgebricksException {
- ITokenFactory tokenFactory = new HashedUTF8WordTokenFactory(ATypeTag.INT32.serialize(),
- ATypeTag.INT32.serialize());
+ ITokenFactory tokenFactory = new HashedUTF8WordTokenFactory();
IBinaryTokenizer tokenizer = new DelimitedUTF8StringBinaryTokenizer(true, true, tokenFactory);
return new WordTokensEvaluator(args, output, tokenizer, BuiltinType.AINT32);
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/InjectFailureDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/InjectFailureDescriptor.java
index 000c387..3247475 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/InjectFailureDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/InjectFailureDescriptor.java
@@ -2,8 +2,8 @@
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ABooleanSerializerDeserializer;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -20,8 +20,6 @@
public class InjectFailureDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "inject-failure", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new InjectFailureDescriptor();
@@ -30,7 +28,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.INJECT_FAILURE;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/IsNullDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/IsNullDescriptor.java
index 4f3a83c..c25de2d 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/IsNullDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/IsNullDescriptor.java
@@ -4,12 +4,12 @@
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AObjectSerializerDeserializer;
import edu.uci.ics.asterix.om.base.ABoolean;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.AlgebricksBuiltinFunctions;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
@@ -22,8 +22,6 @@
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(AlgebricksBuiltinFunctions.ALGEBRICKS_NS,
- "is-null", 1);
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
@@ -64,7 +62,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.IS_NULL;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LenDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LenDescriptor.java
index 2b354e0..abea4e3 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LenDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LenDescriptor.java
@@ -3,13 +3,13 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AUnorderedListSerializerDeserializer;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AInt32;
import edu.uci.ics.asterix.om.base.AMutableInt32;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -28,7 +28,6 @@
public class LenDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "len", 1);
private final static byte SER_ORDEREDLIST_TYPE_TAG = ATypeTag.ORDEREDLIST.serialize();
private final static byte SER_UNORDEREDLIST_TYPE_TAG = ATypeTag.UNORDEREDLIST.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
@@ -102,7 +101,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.LEN;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LikeDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LikeDescriptor.java
index 2d7d4ae..4344f33 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LikeDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LikeDescriptor.java
@@ -7,13 +7,13 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.common.utils.UTF8CharSequence;
import edu.uci.ics.asterix.formats.nontagged.AqlBinaryComparatorFactoryProvider;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ABoolean;
import edu.uci.ics.asterix.om.base.ANull;
import edu.uci.ics.asterix.om.base.AString;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -39,7 +39,6 @@
public class LikeDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "like", 2);
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
@@ -49,7 +48,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.LIKE;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NotDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NotDescriptor.java
index dc7dcd2..41ec790 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NotDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NotDescriptor.java
@@ -6,13 +6,13 @@
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ABoolean;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.AlgebricksBuiltinFunctions;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
@@ -25,8 +25,6 @@
public class NotDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(AlgebricksBuiltinFunctions.ALGEBRICKS_NS,
- "not", 1);
private final static byte SER_BOOLEAN_TYPE_TAG = ATypeTag.BOOLEAN.serialize();
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
@@ -38,7 +36,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.NOT;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericAbsDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericAbsDescriptor.java
index 01cc999..c013750 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericAbsDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericAbsDescriptor.java
@@ -7,7 +7,6 @@
import java.io.DataOutput;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
@@ -22,17 +21,18 @@
import edu.uci.ics.asterix.om.base.AMutableInt64;
import edu.uci.ics.asterix.om.base.AMutableInt8;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
@@ -41,7 +41,6 @@
public class NumericAbsDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "numeric-abs", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new NumericAbsDescriptor();
@@ -50,7 +49,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.NUMERIC_ABS;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericAddDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericAddDescriptor.java
index c2791b9..0181698 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericAddDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericAddDescriptor.java
@@ -1,16 +1,14 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.AlgebricksBuiltinFunctions;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
public class NumericAddDescriptor extends AbstractNumericArithmeticEval {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(AlgebricksBuiltinFunctions.ALGEBRICKS_NS,
- "numeric-add", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new NumericAddDescriptor();
@@ -19,7 +17,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.NUMERIC_ADD;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericCeilingDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericCeilingDescriptor.java
index 9c52846..14d1f78 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericCeilingDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericCeilingDescriptor.java
@@ -7,7 +7,6 @@
import java.io.DataOutput;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
@@ -22,17 +21,18 @@
import edu.uci.ics.asterix.om.base.AMutableInt64;
import edu.uci.ics.asterix.om.base.AMutableInt8;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
@@ -42,8 +42,6 @@
public class NumericCeilingDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "numeric-ceiling", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new NumericCeilingDescriptor();
@@ -52,7 +50,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.NUMERIC_CEILING;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericDivideDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericDivideDescriptor.java
index 87a4257..4cc3e03 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericDivideDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericDivideDescriptor.java
@@ -1,6 +1,6 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
@@ -9,8 +9,6 @@
public class NumericDivideDescriptor extends AbstractNumericArithmeticEval {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "numeric-divide",
- 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new NumericDivideDescriptor();
@@ -19,7 +17,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.NUMERIC_DIVIDE;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericFloorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericFloorDescriptor.java
index 6626a12..99dd240 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericFloorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericFloorDescriptor.java
@@ -7,7 +7,6 @@
import java.io.DataOutput;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
@@ -22,17 +21,18 @@
import edu.uci.ics.asterix.om.base.AMutableInt64;
import edu.uci.ics.asterix.om.base.AMutableInt8;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
@@ -41,8 +41,6 @@
public class NumericFloorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "numeric-floor",
- 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new NumericFloorDescriptor();
@@ -51,7 +49,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.NUMERIC_FLOOR;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericModuloDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericModuloDescriptor.java
index a38c4e2..b7fba62 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericModuloDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericModuloDescriptor.java
@@ -16,7 +16,6 @@
import java.io.DataOutput;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
@@ -31,6 +30,7 @@
import edu.uci.ics.asterix.om.base.AMutableInt64;
import edu.uci.ics.asterix.om.base.AMutableInt8;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -54,7 +54,6 @@
public class NumericModuloDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "numeric-mod", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new NumericModuloDescriptor();
@@ -63,7 +62,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.NUMERIC_MOD;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericMultiplyDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericMultiplyDescriptor.java
index 606f2ec..2dcb349 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericMultiplyDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericMultiplyDescriptor.java
@@ -1,6 +1,6 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
@@ -9,8 +9,6 @@
public class NumericMultiplyDescriptor extends AbstractNumericArithmeticEval {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "numeric-multiply", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new NumericMultiplyDescriptor();
@@ -19,7 +17,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.NUMERIC_MULTIPLY;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundDescriptor.java
index 588877c..bc565ce 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundDescriptor.java
@@ -7,7 +7,6 @@
import java.io.DataOutput;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
@@ -22,17 +21,18 @@
import edu.uci.ics.asterix.om.base.AMutableInt64;
import edu.uci.ics.asterix.om.base.AMutableInt8;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
@@ -41,8 +41,6 @@
public class NumericRoundDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "numeric-round",
- 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new NumericRoundDescriptor();
@@ -51,7 +49,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.NUMERIC_ROUND;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundHalfToEven2Descriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundHalfToEven2Descriptor.java
index 43bed94..06cf69a 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundHalfToEven2Descriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundHalfToEven2Descriptor.java
@@ -5,34 +5,44 @@
*/
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.*;
+import java.io.DataOutput;
+import java.math.BigDecimal;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt8SerializerDeserializer;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
-import edu.uci.ics.asterix.om.base.*;
+import edu.uci.ics.asterix.om.base.AMutableDouble;
+import edu.uci.ics.asterix.om.base.AMutableFloat;
+import edu.uci.ics.asterix.om.base.AMutableInt16;
+import edu.uci.ics.asterix.om.base.AMutableInt32;
+import edu.uci.ics.asterix.om.base.AMutableInt64;
+import edu.uci.ics.asterix.om.base.AMutableInt8;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
-import java.io.DataOutput;
-import java.math.BigDecimal;
public class NumericRoundHalfToEven2Descriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "numeric-round-half-to-even2", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new NumericRoundHalfToEven2Descriptor();
@@ -41,7 +51,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.NUMERIC_ROUND_HALF_TO_EVEN2;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundHalfToEvenDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundHalfToEvenDescriptor.java
index af61a52..1b54090 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundHalfToEvenDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundHalfToEvenDescriptor.java
@@ -5,32 +5,42 @@
*/
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.*;
+import java.io.DataOutput;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt8SerializerDeserializer;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
-import edu.uci.ics.asterix.om.base.*;
+import edu.uci.ics.asterix.om.base.AMutableDouble;
+import edu.uci.ics.asterix.om.base.AMutableFloat;
+import edu.uci.ics.asterix.om.base.AMutableInt16;
+import edu.uci.ics.asterix.om.base.AMutableInt32;
+import edu.uci.ics.asterix.om.base.AMutableInt64;
+import edu.uci.ics.asterix.om.base.AMutableInt8;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
-import java.io.DataOutput;
public class NumericRoundHalfToEvenDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "numeric-round-half-to-even", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new NumericRoundHalfToEvenDescriptor();
@@ -39,7 +49,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.NUMERIC_ROUND_HALF_TO_EVEN;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericSubtractDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericSubtractDescriptor.java
index 1eb1119..7ce452e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericSubtractDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericSubtractDescriptor.java
@@ -2,7 +2,6 @@
import java.io.DataOutput;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
@@ -17,6 +16,7 @@
import edu.uci.ics.asterix.om.base.AMutableInt64;
import edu.uci.ics.asterix.om.base.AMutableInt8;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -37,8 +37,6 @@
public class NumericSubtractDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "numeric-subtract", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new NumericSubtractDescriptor();
@@ -47,7 +45,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.NUMERIC_SUBTRACT;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericUnaryMinusDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericUnaryMinusDescriptor.java
index cabd44b..6fec336 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericUnaryMinusDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericUnaryMinusDescriptor.java
@@ -2,7 +2,6 @@
import java.io.DataOutput;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
@@ -17,6 +16,7 @@
import edu.uci.ics.asterix.om.base.AMutableInt64;
import edu.uci.ics.asterix.om.base.AMutableInt8;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -37,8 +37,6 @@
public class NumericUnaryMinusDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "numeric-unary-minus", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new NumericUnaryMinusDescriptor();
@@ -130,7 +128,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.NUMERIC_UNARY_MINUS;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OpenRecordConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OpenRecordConstructorDescriptor.java
index 59689d1..77869ba 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OpenRecordConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OpenRecordConstructorDescriptor.java
@@ -4,7 +4,7 @@
import java.io.IOException;
import edu.uci.ics.asterix.builders.RecordBuilder;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ARecordType;
@@ -20,8 +20,6 @@
public class OpenRecordConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
- protected static final FunctionIdentifier FID_OPEN = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "open-record-constructor", FunctionIdentifier.VARARGS);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new OpenRecordConstructorDescriptor();
@@ -39,7 +37,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID_OPEN;
+ return AsterixBuiltinFunctions.OPEN_RECORD_CONSTRUCTOR;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrDescriptor.java
index 9fc30f6..44bba5c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrDescriptor.java
@@ -4,13 +4,13 @@
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ABoolean;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.AlgebricksBuiltinFunctions;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
@@ -23,8 +23,6 @@
public class OrDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(AlgebricksBuiltinFunctions.ALGEBRICKS_NS, "or",
- FunctionIdentifier.VARARGS);
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
@@ -34,7 +32,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.OR;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrderedListConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrderedListConstructorDescriptor.java
index 496c524..bd19cad 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrderedListConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrderedListConstructorDescriptor.java
@@ -4,7 +4,7 @@
import java.io.IOException;
import edu.uci.ics.asterix.builders.OrderedListBuilder;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.AOrderedListType;
@@ -21,8 +21,6 @@
public class OrderedListConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "ordered-list-constructor", FunctionIdentifier.VARARGS);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new OrderedListConstructorDescriptor();
@@ -37,7 +35,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.ORDERED_LIST_CONSTRUCTOR;
}
@Override
@@ -96,7 +94,7 @@
try {
for (int i = 0; i < argEvals.length; i++) {
inputVal.reset();
- argEvals[i].evaluate(tuple);
+ argEvals[i].evaluate(tuple);
builder.addItem(inputVal);
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenDescriptor.java
index 61f4c21..019f655 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenDescriptor.java
@@ -27,7 +27,7 @@
public class PrefixLenDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "prefix-len", 3);
+ private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "prefix-len@3", 3);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new PrefixLenDescriptor();
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenJaccardDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenJaccardDescriptor.java
index 9874991..4138932 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenJaccardDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenJaccardDescriptor.java
@@ -3,11 +3,11 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AInt32;
import edu.uci.ics.asterix.om.base.AMutableInt32;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -26,8 +26,6 @@
public class PrefixLenJaccardDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "prefix-len-jaccard", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new PrefixLenJaccardDescriptor();
@@ -92,7 +90,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.PREFIX_LEN_JACCARD;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/RegExpDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/RegExpDescriptor.java
index f225db7..be01d28 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/RegExpDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/RegExpDescriptor.java
@@ -6,13 +6,13 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.common.utils.UTF8CharSequence;
import edu.uci.ics.asterix.formats.nontagged.AqlBinaryComparatorFactoryProvider;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ABoolean;
import edu.uci.ics.asterix.om.base.ANull;
import edu.uci.ics.asterix.om.base.AString;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -38,7 +38,6 @@
public class RegExpDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "reg-exp", 2);
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
@@ -48,7 +47,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.REG_EXP;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityDescriptor.java
index 3fe3a29..a2d9cc7 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityDescriptor.java
@@ -35,7 +35,7 @@
public class SimilarityDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "similarity", 7);
+ private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "similarity@7", 7);
private final static byte SER_ORDEREDLIST_TYPE_TAG = ATypeTag.ORDEREDLIST.serialize();
private final static byte SER_UNORDEREDLIST_TYPE_TAG = ATypeTag.UNORDEREDLIST.serialize();
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardCheckDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardCheckDescriptor.java
index c50af79..eb13fde 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardCheckDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardCheckDescriptor.java
@@ -1,6 +1,6 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
@@ -14,8 +14,6 @@
public class SimilarityJaccardCheckDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "similarity-jaccard-check", 3);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SimilarityJaccardCheckDescriptor();
@@ -36,6 +34,6 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SIMILARITY_JACCARD_CHECK;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardDescriptor.java
index 77d9dba..f5f9caf 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardDescriptor.java
@@ -1,6 +1,6 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
@@ -14,8 +14,6 @@
public class SimilarityJaccardDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "similarity-jaccard", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SimilarityJaccardDescriptor();
@@ -36,7 +34,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SIMILARITY_JACCARD;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardPrefixCheckDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardPrefixCheckDescriptor.java
index 501c32f..b909bc0 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardPrefixCheckDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardPrefixCheckDescriptor.java
@@ -2,13 +2,12 @@
import java.io.IOException;
-import edu.uci.ics.asterix.builders.IAOrderedListBuilder;
import edu.uci.ics.asterix.builders.OrderedListBuilder;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ABoolean;
import edu.uci.ics.asterix.om.base.AFloat;
import edu.uci.ics.asterix.om.base.AMutableFloat;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.AOrderedListType;
@@ -27,8 +26,6 @@
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "similarity-jaccard-prefix-check", 6);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SimilarityJaccardPrefixCheckDescriptor();
@@ -49,12 +46,12 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SIMILARITY_JACCARD_PREFIX_CHECK;
}
private static class SimilarityJaccardPrefixCheckEvaluator extends SimilarityJaccardPrefixEvaluator {
- private final IAOrderedListBuilder listBuilder;
+ private final OrderedListBuilder listBuilder;
private ArrayBackedValueStorage inputVal;
@SuppressWarnings("unchecked")
private final ISerializerDeserializer<ABoolean> booleanSerde = AqlSerializerDeserializerProvider.INSTANCE
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardPrefixDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardPrefixDescriptor.java
index 1994de9..3c2f981 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardPrefixDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardPrefixDescriptor.java
@@ -1,6 +1,7 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
@@ -14,8 +15,6 @@
public class SimilarityJaccardPrefixDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "similarity-jaccard-prefix", 6);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SimilarityJaccardPrefixDescriptor();
@@ -36,7 +35,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SIMILARITY_JACCARD_PREFIX;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardSortedCheckDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardSortedCheckDescriptor.java
index 7e28a0a..962f736 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardSortedCheckDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardSortedCheckDescriptor.java
@@ -1,6 +1,6 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
@@ -15,8 +15,6 @@
public class SimilarityJaccardSortedCheckDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "similarity-jaccard-sorted-check", 3);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SimilarityJaccardSortedCheckDescriptor();
@@ -37,6 +35,6 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SIMILARITY_JACCARD_SORTED_CHECK;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardSortedDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardSortedDescriptor.java
index 1877ea6..d14801c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardSortedDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardSortedDescriptor.java
@@ -1,6 +1,6 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
@@ -15,8 +15,6 @@
public class SimilarityJaccardSortedDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "similarity-jaccard-sorted", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SimilarityJaccardSortedDescriptor();
@@ -37,7 +35,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SIMILARITY_JACCARD_SORTED;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialAreaDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialAreaDescriptor.java
index c641f1a..d887894 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialAreaDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialAreaDescriptor.java
@@ -3,15 +3,18 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.Coordinate;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ACircleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ARectangleSerializerDeserializer;
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.common.SpatialUtils;
@@ -20,6 +23,7 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
@@ -28,7 +32,6 @@
public class SpatialAreaDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "spatial-area", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SpatialAreaDescriptor();
@@ -44,9 +47,13 @@
public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
return new ICopyEvaluator() {
- private DataOutput out = output.getDataOutput();
- private ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
- private ICopyEvaluator eval = args[0].createEvaluator(argOut);
+ private final DataOutput out = output.getDataOutput();
+ private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+ private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
+
+ @SuppressWarnings("unchecked")
+ private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ANULL);
@Override
public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
@@ -66,11 +73,15 @@
throw new AlgebricksException("Polygon must have at least 3 points");
}
area = Math.abs(SpatialUtils.polygonArea(argOut.getByteArray(), numOfPoints));
+ out.writeByte(ATypeTag.DOUBLE.serialize());
+ out.writeDouble(area);
break;
case CIRCLE:
double radius = ADoubleSerializerDeserializer.getDouble(argOut.getByteArray(),
ACircleSerializerDeserializer.getRadiusOffset());
area = SpatialUtils.pi() * radius * radius;
+ out.writeByte(ATypeTag.DOUBLE.serialize());
+ out.writeDouble(area);
break;
case RECTANGLE:
double x1 = ADoubleSerializerDeserializer.getDouble(argOut.getByteArray(),
@@ -87,13 +98,16 @@
ARectangleSerializerDeserializer
.getUpperRightCoordinateOffset(Coordinate.Y));
area = (x2 - x1) * (y2 - y1);
+ out.writeByte(ATypeTag.DOUBLE.serialize());
+ out.writeDouble(area);
+ break;
+ case NULL:
+ nullSerde.serialize(ANull.NULL, out);
break;
default:
throw new NotImplementedException("spatial-area does not support the type: " + tag
+ " It is only implemented for POLYGON, CIRCLE and RECTANGLE.");
}
- out.writeByte(ATypeTag.DOUBLE.serialize());
- out.writeDouble(area);
} catch (HyracksDataException hde) {
throw new AlgebricksException(hde);
} catch (IOException e) {
@@ -107,7 +121,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SPATIAL_AREA;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialCellDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialCellDescriptor.java
index 1426f91..6583f19 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialCellDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialCellDescriptor.java
@@ -3,14 +3,15 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.Coordinate;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APointSerializerDeserializer;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AMutablePoint;
import edu.uci.ics.asterix.om.base.AMutableRectangle;
+import edu.uci.ics.asterix.om.base.ANull;
import edu.uci.ics.asterix.om.base.ARectangle;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -30,7 +31,6 @@
public class SpatialCellDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "spatial-cell", 4);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SpatialCellDescriptor();
@@ -46,20 +46,24 @@
public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
return new ICopyEvaluator() {
- private DataOutput out = output.getDataOutput();
+ private final DataOutput out = output.getDataOutput();
- private ArrayBackedValueStorage outInput0 = new ArrayBackedValueStorage();
- private ArrayBackedValueStorage outInput1 = new ArrayBackedValueStorage();
- private ArrayBackedValueStorage outInput2 = new ArrayBackedValueStorage();
- private ArrayBackedValueStorage outInput3 = new ArrayBackedValueStorage();
- private ICopyEvaluator eval0 = args[0].createEvaluator(outInput0);
- private ICopyEvaluator eval1 = args[1].createEvaluator(outInput1);
- private ICopyEvaluator eval2 = args[2].createEvaluator(outInput2);
- private ICopyEvaluator eval3 = args[3].createEvaluator(outInput3);
- private AMutableRectangle aRectangle = new AMutableRectangle(null, null);
- private AMutablePoint[] aPoint = { new AMutablePoint(0, 0), new AMutablePoint(0, 0) };
+ private final ArrayBackedValueStorage outInput0 = new ArrayBackedValueStorage();
+ private final ArrayBackedValueStorage outInput1 = new ArrayBackedValueStorage();
+ private final ArrayBackedValueStorage outInput2 = new ArrayBackedValueStorage();
+ private final ArrayBackedValueStorage outInput3 = new ArrayBackedValueStorage();
+ private final ICopyEvaluator eval0 = args[0].createEvaluator(outInput0);
+ private final ICopyEvaluator eval1 = args[1].createEvaluator(outInput1);
+ private final ICopyEvaluator eval2 = args[2].createEvaluator(outInput2);
+ private final ICopyEvaluator eval3 = args[3].createEvaluator(outInput3);
+ private final AMutableRectangle aRectangle = new AMutableRectangle(null, null);
+ private final AMutablePoint[] aPoint = { new AMutablePoint(0, 0), new AMutablePoint(0, 0) };
+
@SuppressWarnings("unchecked")
- private ISerializerDeserializer<ARectangle> rectangleSerde = AqlSerializerDeserializerProvider.INSTANCE
+ private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ANULL);
+ @SuppressWarnings("unchecked")
+ private final ISerializerDeserializer<ARectangle> rectangleSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.ARECTANGLE);
@Override
@@ -96,6 +100,8 @@
aPoint[1].setValue(x + xInc, y + yInc);
aRectangle.setValue(aPoint[0], aPoint[1]);
rectangleSerde.serialize(aRectangle, out);
+ } else if (tag == ATypeTag.NULL) {
+ nullSerde.serialize(ANull.NULL, out);
} else {
throw new NotImplementedException("spatial-cell does not support the type: " + tag
+ " It is only implemented for POINT.");
@@ -111,7 +117,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SPATIAL_CELL;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialDistanceDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialDistanceDescriptor.java
index d83f62e..688a72c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialDistanceDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialDistanceDescriptor.java
@@ -3,13 +3,16 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.Coordinate;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APointSerializerDeserializer;
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -17,6 +20,7 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
@@ -25,8 +29,6 @@
public class SpatialDistanceDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "spatial-distance", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SpatialDistanceDescriptor();
@@ -42,11 +44,15 @@
public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
return new ICopyEvaluator() {
- private DataOutput out = output.getDataOutput();
- private ArrayBackedValueStorage outInput0 = new ArrayBackedValueStorage();
- private ArrayBackedValueStorage outInput1 = new ArrayBackedValueStorage();
- private ICopyEvaluator eval0 = args[0].createEvaluator(outInput0);
- private ICopyEvaluator eval1 = args[1].createEvaluator(outInput1);
+ private final DataOutput out = output.getDataOutput();
+ private final ArrayBackedValueStorage outInput0 = new ArrayBackedValueStorage();
+ private final ArrayBackedValueStorage outInput1 = new ArrayBackedValueStorage();
+ private final ICopyEvaluator eval0 = args[0].createEvaluator(outInput0);
+ private final ICopyEvaluator eval1 = args[1].createEvaluator(outInput1);
+
+ @SuppressWarnings("unchecked")
+ private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ANULL);
@Override
public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
@@ -76,6 +82,8 @@
throw new NotImplementedException("spatial-distance does not support the type: "
+ tag1 + " It is only implemented for POINT.");
}
+ } else if (tag0 == ATypeTag.NULL || tag1 == ATypeTag.NULL) {
+ nullSerde.serialize(ANull.NULL, out);
} else {
throw new NotImplementedException("spatial-distance does not support the type: " + tag0
+ " It is only implemented for POINT.");
@@ -95,7 +103,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SPATIAL_DISTANCE;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java
index 25a03fe..bd3aef5 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java
@@ -2,7 +2,6 @@
import java.io.DataOutput;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.Coordinate;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ACircleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
@@ -14,6 +13,7 @@
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ARectangleSerializerDeserializer;
import edu.uci.ics.asterix.formats.nontagged.AqlBinaryComparatorFactoryProvider;
import edu.uci.ics.asterix.om.base.ABoolean;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -36,8 +36,6 @@
public class SpatialIntersectDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "spatial-intersect", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SpatialIntersectDescriptor();
@@ -1059,7 +1057,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SPATIAL_INTERSECT;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StartsWithDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StartsWithDescriptor.java
index 015a94b..4ac02cf 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StartsWithDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StartsWithDescriptor.java
@@ -2,7 +2,7 @@
import java.io.DataOutput;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
@@ -16,7 +16,6 @@
public class StartsWithDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "starts-with", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new StartsWithDescriptor();
@@ -65,7 +64,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.STARTS_WITH;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringConcatDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringConcatDescriptor.java
index 1c2cee7..f975579 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringConcatDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringConcatDescriptor.java
@@ -1,18 +1,21 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
+import java.io.DataOutput;
+import java.io.IOException;
+
import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.common.functions.FunctionConstants;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
-import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.asterix.runtime.evaluators.common.AsterixListAccessor;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
@@ -21,8 +24,6 @@
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
import edu.uci.ics.hyracks.dataflow.common.data.util.StringUtils;
-import java.io.DataOutput;
-import java.io.IOException;
/**
* @author Xiaoyu Ma
@@ -30,16 +31,11 @@
public class StringConcatDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "string-concat",
- 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new StringConcatDescriptor();
}
};
- private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
- private final static byte SER_ORDEREDLIST_TYPE_TAG = ATypeTag.ORDEREDLIST.serialize();
- private final byte stringTypeTag = ATypeTag.STRING.serialize();
@Override
public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) {
@@ -51,10 +47,11 @@
public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
return new ICopyEvaluator() {
- private DataOutput out = output.getDataOutput();
- private ICopyEvaluatorFactory listEvalFactory = args[0];
- private ArrayBackedValueStorage outInputList = new ArrayBackedValueStorage();
- private ICopyEvaluator evalList = listEvalFactory.createEvaluator(outInputList);
+ private final AsterixListAccessor listAccessor = new AsterixListAccessor();
+ private final DataOutput out = output.getDataOutput();
+ private final ICopyEvaluatorFactory listEvalFactory = args[0];
+ private final ArrayBackedValueStorage outInputList = new ArrayBackedValueStorage();
+ private final ICopyEvaluator evalList = listEvalFactory.createEvaluator(outInputList);
@SuppressWarnings("unchecked")
private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.ANULL);
@@ -64,32 +61,39 @@
try {
outInputList.reset();
evalList.evaluate(tuple);
- byte[] serOrderedList = outInputList.getByteArray();
- if (serOrderedList[0] == SER_NULL_TYPE_TAG) {
+ byte[] listBytes = outInputList.getByteArray();
+ try {
+ listAccessor.reset(listBytes, 0);
+ } catch (AsterixException e) {
+ throw new AlgebricksException(e);
+ }
+ if (listAccessor.getItemType() == ATypeTag.NULL) {
nullSerde.serialize(ANull.NULL, out);
return;
}
- if (serOrderedList[0] != SER_ORDEREDLIST_TYPE_TAG) {
- throw new AlgebricksException("Expects String List."
- + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serOrderedList[0]));
- }
- int size = AOrderedListSerializerDeserializer.getNumberOfItems(serOrderedList);
try {
// calculate length first
- int utf_8_len = 0;
- for (int i = 0; i < size; i++) {
- int itemOffset = AOrderedListSerializerDeserializer
- .getItemOffset(serOrderedList, i);
- utf_8_len += UTF8StringPointable.getUTFLength(serOrderedList, itemOffset);
+ int utf8Len = 0;
+ for (int i = 0; i < listAccessor.size(); i++) {
+ int itemOffset = listAccessor.getItemOffset(i);
+ ATypeTag itemType = listAccessor.getItemType(itemOffset);
+ if (itemType != ATypeTag.STRING) {
+ if (itemType == ATypeTag.NULL) {
+ nullSerde.serialize(ANull.NULL, out);
+ return;
+ }
+ throw new AlgebricksException("Unsupported type " + itemType
+ + " in list passed to string-concat function.");
+ }
+ utf8Len += UTF8StringPointable.getUTFLength(listBytes, itemOffset);
}
- out.writeByte(stringTypeTag);
- StringUtils.writeUTF8Len(utf_8_len, out);
- for (int i = 0; i < size; i++) {
- int itemOffset = AOrderedListSerializerDeserializer
- .getItemOffset(serOrderedList, i);
- utf_8_len = UTF8StringPointable.getUTFLength(serOrderedList, itemOffset);
- for (int j = 0; j < utf_8_len; j++) {
- out.writeByte(serOrderedList[2 + itemOffset + j]);
+ out.writeByte(ATypeTag.STRING.serialize());
+ StringUtils.writeUTF8Len(utf8Len, out);
+ for (int i = 0; i < listAccessor.size(); i++) {
+ int itemOffset = listAccessor.getItemOffset(i);
+ utf8Len = UTF8StringPointable.getUTFLength(listBytes, itemOffset);
+ for (int j = 0; j < utf8Len; j++) {
+ out.writeByte(listBytes[2 + itemOffset + j]);
}
}
} catch (AsterixException ex) {
@@ -106,6 +110,6 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.STRING_CONCAT;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEndWithDescrtiptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEndWithDescrtiptor.java
index 2c2ad2e..aed2199 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEndWithDescrtiptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEndWithDescrtiptor.java
@@ -4,27 +4,26 @@
*/
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import java.io.DataOutput;
+
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
-import java.io.DataOutput;
-
/**
* @author Xiaoyu Ma
*/
public class StringEndWithDescrtiptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "end-with", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new StringEndWithDescrtiptor();
@@ -73,6 +72,6 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.STRING_END_WITH;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEqualDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEqualDescriptor.java
index 2f6237f..f71b09f 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEqualDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEqualDescriptor.java
@@ -1,27 +1,25 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import java.io.DataOutput;
+
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
-import java.io.DataOutput;
-
/**
* @author Xiaoyu Ma
*/
public class StringEqualDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "string-equal",
- 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new StringEqualDescriptor();
@@ -69,6 +67,6 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.STRING_EQUAL;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringJoinDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringJoinDescriptor.java
index 5bbc9df3..c379c3e3 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringJoinDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringJoinDescriptor.java
@@ -1,18 +1,21 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
+import java.io.DataOutput;
+import java.io.IOException;
+
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
@@ -21,8 +24,6 @@
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
import edu.uci.ics.hyracks.dataflow.common.data.util.StringUtils;
-import java.io.DataOutput;
-import java.io.IOException;
/**
* @author Xiaoyu Ma
@@ -30,7 +31,6 @@
public class StringJoinDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "string-join", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new StringJoinDescriptor();
@@ -132,6 +132,6 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.STRING_JOIN;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringLengthDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringLengthDescriptor.java
index 8f44d7d..bb39b49 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringLengthDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringLengthDescriptor.java
@@ -1,17 +1,20 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import java.io.DataOutput;
+import java.io.IOException;
+
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AInt32;
import edu.uci.ics.asterix.om.base.AMutableInt32;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
@@ -19,14 +22,10 @@
import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
-import java.io.DataOutput;
-import java.io.IOException;
public class StringLengthDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "string-length",
- 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new StringLengthDescriptor();
@@ -82,7 +81,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.STRING_LENGTH;
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringLowerCaseDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringLowerCaseDescriptor.java
index 25a966e..6bc79ac 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringLowerCaseDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringLowerCaseDescriptor.java
@@ -1,15 +1,19 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
+import java.io.DataOutput;
+import java.io.IOException;
+
import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
@@ -18,8 +22,6 @@
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
import edu.uci.ics.hyracks.dataflow.common.data.util.StringUtils;
-import java.io.DataOutput;
-import java.io.IOException;
/**
* @author Xiaoyu Ma
@@ -27,7 +29,6 @@
public class StringLowerCaseDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "lowercase", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new StringLowerCaseDescriptor();
@@ -92,7 +93,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.STRING_LOWERCASE;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringMatchesDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringMatchesDescriptor.java
index a021961..75814df 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringMatchesDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringMatchesDescriptor.java
@@ -6,11 +6,11 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.common.utils.UTF8CharSequence;
import edu.uci.ics.asterix.formats.nontagged.AqlBinaryComparatorFactoryProvider;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AString;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -32,7 +32,6 @@
public class StringMatchesDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "matches", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new StringMatchesDescriptor();
@@ -107,6 +106,6 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.STRING_MATCHES;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringMatchesWithFlagDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringMatchesWithFlagDescriptor.java
index df5e587..31dde5b 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringMatchesWithFlagDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringMatchesWithFlagDescriptor.java
@@ -10,11 +10,11 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.common.utils.UTF8CharSequence;
import edu.uci.ics.asterix.formats.nontagged.AqlBinaryComparatorFactoryProvider;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AString;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -36,7 +36,6 @@
public class StringMatchesWithFlagDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "matches2", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new StringMatchesWithFlagDescriptor();
@@ -134,6 +133,6 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.STRING_MATCHES_WITH_FLAG;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringReplaceDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringReplaceDescriptor.java
index ecc8b34..32af44e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringReplaceDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringReplaceDescriptor.java
@@ -11,6 +11,7 @@
import edu.uci.ics.asterix.formats.nontagged.AqlBinaryComparatorFactoryProvider;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AString;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -32,7 +33,6 @@
public class StringReplaceDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "replace", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new StringReplaceDescriptor();
@@ -135,6 +135,6 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.STRING_REPLACE;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringReplaceWithFlagsDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringReplaceWithFlagsDescriptor.java
index 84b6ca3..e665654 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringReplaceWithFlagsDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringReplaceWithFlagsDescriptor.java
@@ -6,11 +6,11 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.common.utils.UTF8CharSequence;
import edu.uci.ics.asterix.formats.nontagged.AqlBinaryComparatorFactoryProvider;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AString;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -32,7 +32,6 @@
public class StringReplaceWithFlagsDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "replace2", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new StringReplaceWithFlagsDescriptor();
@@ -158,6 +157,6 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.STRING_REPLACE_WITH_FLAG;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringStartWithDescrtiptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringStartWithDescrtiptor.java
index 18009d2..e7f2576 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringStartWithDescrtiptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringStartWithDescrtiptor.java
@@ -2,7 +2,7 @@
import java.io.DataOutput;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
@@ -20,7 +20,6 @@
public class StringStartWithDescrtiptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "start-with", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new StringStartWithDescrtiptor();
@@ -67,6 +66,6 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.STRING_START_WITH;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringToCodePointDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringToCodePointDescriptor.java
index 45f5efc..fdd45e2 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringToCodePointDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringToCodePointDescriptor.java
@@ -3,13 +3,12 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.builders.IAOrderedListBuilder;
import edu.uci.ics.asterix.builders.OrderedListBuilder;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AInt32;
import edu.uci.ics.asterix.om.base.AMutableInt32;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.AOrderedListType;
@@ -33,8 +32,6 @@
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "string-to-codepoint", 1);
public static final IFunctionDescriptorFactory FACTORY1 = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new StringToCodePointDescriptor();
@@ -61,7 +58,7 @@
protected final ICopyEvaluator stringEval = args[0].createEvaluator(argOut);
protected final AOrderedListType intListType = new AOrderedListType(BuiltinType.AINT32, null);
- private IAOrderedListBuilder listBuilder = new OrderedListBuilder();
+ private OrderedListBuilder listBuilder = new OrderedListBuilder();
private ArrayBackedValueStorage inputVal = new ArrayBackedValueStorage();
@SuppressWarnings("unchecked")
@@ -141,7 +138,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.STRING_TO_CODEPOINT;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/Substring2Descriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/Substring2Descriptor.java
index eff1ec9..338c9a9 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/Substring2Descriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/Substring2Descriptor.java
@@ -3,7 +3,7 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -21,7 +21,6 @@
public class Substring2Descriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "substring2", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new Substring2Descriptor();
@@ -85,7 +84,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SUBSTRING2;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringAfterDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringAfterDescriptor.java
index 8e88ac8..7594dd2 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringAfterDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringAfterDescriptor.java
@@ -1,26 +1,25 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
-import java.io.DataOutput;
-import java.io.IOException;
public class SubstringAfterDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "substring-after", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SubstringAfterDescriptor();
@@ -95,7 +94,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SUBSTRING_AFTER;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringBeforeDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringBeforeDescriptor.java
index 081941a..2c53756 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringBeforeDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringBeforeDescriptor.java
@@ -3,7 +3,7 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -20,8 +20,6 @@
public class SubstringBeforeDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "substring-before", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SubstringBeforeDescriptor();
@@ -95,7 +93,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SUBSTRING_BEFORE;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringDescriptor.java
index ad132fb..480f4a2 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringDescriptor.java
@@ -3,7 +3,7 @@
import java.io.DataOutput;
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -21,7 +21,6 @@
public class SubstringDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "substring", 3);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SubstringDescriptor();
@@ -95,7 +94,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SUBSTRING;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SwitchCaseDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SwitchCaseDescriptor.java
index 7f95051..ac62f96 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SwitchCaseDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SwitchCaseDescriptor.java
@@ -2,7 +2,7 @@
import java.io.IOException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
@@ -18,8 +18,6 @@
public class SwitchCaseDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "switch-case",
- FunctionIdentifier.VARARGS);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new SwitchCaseDescriptor();
@@ -28,7 +26,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SWITCH_CASE;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/UnorderedListConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/UnorderedListConstructorDescriptor.java
index c38a68c..3e8a606 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/UnorderedListConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/UnorderedListConstructorDescriptor.java
@@ -4,7 +4,7 @@
import java.io.IOException;
import edu.uci.ics.asterix.builders.UnorderedListBuilder;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -21,8 +21,6 @@
public class UnorderedListConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "unordered-list-constructor", FunctionIdentifier.VARARGS);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new UnorderedListConstructorDescriptor();
@@ -37,7 +35,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.UNORDERED_LIST_CONSTRUCTOR;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/WordTokensDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/WordTokensDescriptor.java
index 5e9065b..791ee6b 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/WordTokensDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/WordTokensDescriptor.java
@@ -1,9 +1,8 @@
package edu.uci.ics.asterix.runtime.evaluators.functions;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
-import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.common.WordTokensEvaluator;
@@ -20,7 +19,6 @@
public class WordTokensDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "word-tokens", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new WordTokensDescriptor();
@@ -29,7 +27,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.WORD_TOKENS;
}
@Override
@@ -39,8 +37,7 @@
@Override
public ICopyEvaluator createEvaluator(IDataOutputProvider output) throws AlgebricksException {
- ITokenFactory tokenFactory = new UTF8WordTokenFactory(ATypeTag.STRING.serialize(),
- ATypeTag.INT32.serialize());
+ ITokenFactory tokenFactory = new UTF8WordTokenFactory();
IBinaryTokenizer tokenizer = new DelimitedUTF8StringBinaryTokenizer(true, true, tokenFactory);
return new WordTokensEvaluator(args, output, tokenizer, BuiltinType.ASTRING);
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java
index 5e24b39..ef13030 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java
@@ -39,20 +39,31 @@
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.AUnionType;
import edu.uci.ics.asterix.om.types.AUnorderedListType;
+import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.runtime.aggregates.collections.ListifyAggregateDescriptor;
+import edu.uci.ics.asterix.runtime.aggregates.scalar.ScalarAvgAggregateDescriptor;
+import edu.uci.ics.asterix.runtime.aggregates.scalar.ScalarCountAggregateDescriptor;
+import edu.uci.ics.asterix.runtime.aggregates.scalar.ScalarMaxAggregateDescriptor;
+import edu.uci.ics.asterix.runtime.aggregates.scalar.ScalarMinAggregateDescriptor;
+import edu.uci.ics.asterix.runtime.aggregates.scalar.ScalarSumAggregateDescriptor;
import edu.uci.ics.asterix.runtime.aggregates.serializable.std.SerializableAvgAggregateDescriptor;
import edu.uci.ics.asterix.runtime.aggregates.serializable.std.SerializableCountAggregateDescriptor;
import edu.uci.ics.asterix.runtime.aggregates.serializable.std.SerializableGlobalAvgAggregateDescriptor;
import edu.uci.ics.asterix.runtime.aggregates.serializable.std.SerializableLocalAvgAggregateDescriptor;
+import edu.uci.ics.asterix.runtime.aggregates.serializable.std.SerializableLocalSumAggregateDescriptor;
import edu.uci.ics.asterix.runtime.aggregates.serializable.std.SerializableSumAggregateDescriptor;
import edu.uci.ics.asterix.runtime.aggregates.std.AvgAggregateDescriptor;
import edu.uci.ics.asterix.runtime.aggregates.std.CountAggregateDescriptor;
import edu.uci.ics.asterix.runtime.aggregates.std.GlobalAvgAggregateDescriptor;
import edu.uci.ics.asterix.runtime.aggregates.std.LocalAvgAggregateDescriptor;
+import edu.uci.ics.asterix.runtime.aggregates.std.LocalMaxAggregateDescriptor;
+import edu.uci.ics.asterix.runtime.aggregates.std.LocalMinAggregateDescriptor;
+import edu.uci.ics.asterix.runtime.aggregates.std.LocalSumAggregateDescriptor;
import edu.uci.ics.asterix.runtime.aggregates.std.MaxAggregateDescriptor;
import edu.uci.ics.asterix.runtime.aggregates.std.MinAggregateDescriptor;
import edu.uci.ics.asterix.runtime.aggregates.std.SumAggregateDescriptor;
+import edu.uci.ics.asterix.runtime.aggregates.stream.EmptyStreamAggregateDescriptor;
import edu.uci.ics.asterix.runtime.aggregates.stream.NonEmptyStreamAggregateDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.accessors.TemporalDayAccessor;
import edu.uci.ics.asterix.runtime.evaluators.accessors.TemporalHourAccessor;
@@ -61,6 +72,11 @@
import edu.uci.ics.asterix.runtime.evaluators.accessors.TemporalMonthAccessor;
import edu.uci.ics.asterix.runtime.evaluators.accessors.TemporalSecondAccessor;
import edu.uci.ics.asterix.runtime.evaluators.accessors.TemporalYearAccessor;
+import edu.uci.ics.asterix.runtime.evaluators.accessors.CircleCenterAccessor;
+import edu.uci.ics.asterix.runtime.evaluators.accessors.CircleRadiusAccessor;
+import edu.uci.ics.asterix.runtime.evaluators.accessors.LineRectanglePolygonAccessor;
+import edu.uci.ics.asterix.runtime.evaluators.accessors.PointXCoordinateAccessor;
+import edu.uci.ics.asterix.runtime.evaluators.accessors.PointYCoordinateAccessor;
import edu.uci.ics.asterix.runtime.evaluators.common.CreateMBREvalFactory;
import edu.uci.ics.asterix.runtime.evaluators.common.FieldAccessByIndexEvalFactory;
import edu.uci.ics.asterix.runtime.evaluators.common.FunctionManagerImpl;
@@ -93,6 +109,7 @@
import edu.uci.ics.asterix.runtime.evaluators.functions.AnyCollectionMemberDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.CastRecordDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.ClosedRecordConstructorDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.CodePointToStringDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.ContainsDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.CountHashedGramTokensDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.CountHashedWordTokensDescriptor;
@@ -120,10 +137,16 @@
import edu.uci.ics.asterix.runtime.evaluators.functions.LenDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.LikeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.NotDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.NumericAbsDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.NumericAddDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.NumericCeilingDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.NumericDivideDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.NumericFloorDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.NumericModuloDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.NumericMultiplyDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.NumericRoundDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.NumericRoundHalfToEven2Descriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.NumericRoundHalfToEvenDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.NumericSubtractDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.NumericUnaryMinusDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.OpenRecordConstructorDescriptor;
@@ -146,28 +169,21 @@
import edu.uci.ics.asterix.runtime.evaluators.functions.SwitchCaseDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.UnorderedListConstructorDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.WordTokensDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.NumericAbsDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.NumericCeilingDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.NumericFloorDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.NumericRoundDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.NumericRoundHalfToEvenDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.NumericRoundHalfToEven2Descriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.StringEqualDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.StringStartWithDescrtiptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.StringConcatDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.StringEndWithDescrtiptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.StringMatchesDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.StringEqualDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.StringJoinDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.StringLengthDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.StringLowerCaseDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.StringMatchesDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.StringMatchesWithFlagDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.StringReplaceDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.StringReplaceWithFlagsDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.StringLengthDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.Substring2Descriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.SubstringBeforeDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.SubstringAfterDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.StringStartWithDescrtiptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.StringToCodePointDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.CodePointToStringDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.StringConcatDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.StringJoinDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.Substring2Descriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.SubstringAfterDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.SubstringBeforeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.AddDateDurationDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.AddDatetimeDurationDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.AddTimeDurationDescriptor;
@@ -253,6 +269,9 @@
private static LogicalVariable METADATA_DUMMY_VAR = new LogicalVariable(-1);
private static final HashMap<ATypeTag, IValueParserFactory> typeToValueParserFactMap = new HashMap<ATypeTag, IValueParserFactory>();
+
+ public static final String NON_TAGGED_DATA_FORMAT = "edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat";
+
static {
typeToValueParserFactMap.put(ATypeTag.INT32, IntegerParserFactory.INSTANCE);
typeToValueParserFactMap.put(ATypeTag.FLOAT, FloatParserFactory.INSTANCE);
@@ -308,10 +327,10 @@
temp.add(IsNullDescriptor.FACTORY);
temp.add(NotDescriptor.FACTORY);
temp.add(LenDescriptor.FACTORY);
+ temp.add(EmptyStreamAggregateDescriptor.FACTORY);
temp.add(NonEmptyStreamAggregateDescriptor.FACTORY);
temp.add(RangeDescriptor.FACTORY);
- // Xiaoyu Ma add for numeric unary functions
temp.add(NumericAbsDescriptor.FACTORY);
temp.add(NumericCeilingDescriptor.FACTORY);
temp.add(NumericFloorDescriptor.FACTORY);
@@ -343,8 +362,11 @@
temp.add(LocalAvgAggregateDescriptor.FACTORY);
temp.add(GlobalAvgAggregateDescriptor.FACTORY);
temp.add(SumAggregateDescriptor.FACTORY);
+ temp.add(LocalSumAggregateDescriptor.FACTORY);
temp.add(MaxAggregateDescriptor.FACTORY);
+ temp.add(LocalMaxAggregateDescriptor.FACTORY);
temp.add(MinAggregateDescriptor.FACTORY);
+ temp.add(LocalMinAggregateDescriptor.FACTORY);
// serializable aggregates
temp.add(SerializableCountAggregateDescriptor.FACTORY);
@@ -352,6 +374,14 @@
temp.add(SerializableLocalAvgAggregateDescriptor.FACTORY);
temp.add(SerializableGlobalAvgAggregateDescriptor.FACTORY);
temp.add(SerializableSumAggregateDescriptor.FACTORY);
+ temp.add(SerializableLocalSumAggregateDescriptor.FACTORY);
+
+ // scalar aggregates
+ temp.add(ScalarCountAggregateDescriptor.FACTORY);
+ temp.add(ScalarAvgAggregateDescriptor.FACTORY);
+ temp.add(ScalarSumAggregateDescriptor.FACTORY);
+ temp.add(ScalarMaxAggregateDescriptor.FACTORY);
+ temp.add(ScalarMinAggregateDescriptor.FACTORY);
// new functions - constructors
temp.add(ABooleanConstructorDescriptor.FACTORY);
@@ -385,6 +415,11 @@
temp.add(SpatialIntersectDescriptor.FACTORY);
temp.add(CreateMBRDescriptor.FACTORY);
temp.add(SpatialCellDescriptor.FACTORY);
+ temp.add(PointXCoordinateAccessor.FACTORY);
+ temp.add(PointYCoordinateAccessor.FACTORY);
+ temp.add(CircleRadiusAccessor.FACTORY);
+ temp.add(CircleCenterAccessor.FACTORY);
+ temp.add(LineRectanglePolygonAccessor.FACTORY);
// fuzzyjoin function
temp.add(FuzzyEqDescriptor.FACTORY);
@@ -621,6 +656,10 @@
((ListifyAggregateDescriptor) fd).reset(new AOrderedListType(null, null));
} else {
IAType itemType = (IAType) context.getType(f.getArguments().get(0).getValue());
+ // Convert UNION types into ANY.
+ if (itemType instanceof AUnionType) {
+ itemType = BuiltinType.ANY;
+ }
((ListifyAggregateDescriptor) fd).reset(new AOrderedListType(itemType, null));
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/ADMDataParser.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/ADMDataParser.java
new file mode 100644
index 0000000..8606088
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/ADMDataParser.java
@@ -0,0 +1,925 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.runtime.operators.file;
+
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayDeque;
+import java.util.BitSet;
+import java.util.List;
+import java.util.Queue;
+
+import edu.uci.ics.asterix.adm.parser.nontagged.AdmLexer;
+import edu.uci.ics.asterix.adm.parser.nontagged.AdmLexerConstants;
+import edu.uci.ics.asterix.adm.parser.nontagged.ParseException;
+import edu.uci.ics.asterix.adm.parser.nontagged.Token;
+import edu.uci.ics.asterix.builders.IARecordBuilder;
+import edu.uci.ics.asterix.builders.IAsterixListBuilder;
+import edu.uci.ics.asterix.builders.OrderedListBuilder;
+import edu.uci.ics.asterix.builders.RecordBuilder;
+import edu.uci.ics.asterix.builders.UnorderedListBuilder;
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ACircleSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADateSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADateTimeSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ALineSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APoint3DSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APointSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APolygonSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ARectangleSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ATimeSerializerDeserializer;
+import edu.uci.ics.asterix.om.base.ABoolean;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.types.AOrderedListType;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.AUnionType;
+import edu.uci.ics.asterix.om.types.AUnorderedListType;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+
+/**
+ * Parser for ADM formatted data.
+ */
+public class ADMDataParser extends AbstractDataParser implements IDataParser {
+
+ protected AdmLexer admLexer;
+ protected ARecordType recordType;
+ protected boolean datasetRec;
+
+ private int nullableFieldId = 0;
+
+ private Queue<ArrayBackedValueStorage> baaosPool = new ArrayDeque<ArrayBackedValueStorage>();
+ private Queue<IARecordBuilder> recordBuilderPool = new ArrayDeque<IARecordBuilder>();
+ private Queue<IAsterixListBuilder> orderedListBuilderPool = new ArrayDeque<IAsterixListBuilder>();
+ private Queue<IAsterixListBuilder> unorderedListBuilderPool = new ArrayDeque<IAsterixListBuilder>();
+
+ private String mismatchErrorMessage = "Mismatch Type, expecting a value of type ";
+
+ @Override
+ public boolean parse(DataOutput out) throws HyracksDataException {
+ try {
+ return parseAdmInstance((IAType) recordType, datasetRec, out);
+ } catch (Exception e) {
+ throw new HyracksDataException(e);
+ }
+ }
+
+ @Override
+ public void initialize(InputStream in, ARecordType recordType, boolean datasetRec) {
+ admLexer = new AdmLexer(in);
+ this.recordType = recordType;
+ this.datasetRec = datasetRec;
+ }
+
+ protected boolean parseAdmInstance(IAType objectType, boolean datasetRec, DataOutput out) throws AsterixException,
+ IOException {
+ Token token;
+ try {
+ token = admLexer.next();
+ } catch (ParseException pe) {
+ throw new AsterixException(pe);
+ }
+ if (token.kind == AdmLexerConstants.EOF) {
+ return false;
+ } else {
+ admFromLexerStream(token, objectType, out, datasetRec);
+ return true;
+ }
+ }
+
+ private void admFromLexerStream(Token token, IAType objectType, DataOutput out, Boolean datasetRec)
+ throws AsterixException, IOException {
+
+ switch (token.kind) {
+ case AdmLexerConstants.NULL_LITERAL: {
+ if (checkType(ATypeTag.NULL, objectType, out)) {
+ nullSerde.serialize(ANull.NULL, out);
+ } else
+ throw new AsterixException(" This field can not be null ");
+ break;
+ }
+ case AdmLexerConstants.TRUE_LITERAL: {
+ if (checkType(ATypeTag.BOOLEAN, objectType, out)) {
+ booleanSerde.serialize(ABoolean.TRUE, out);
+ } else
+ throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
+ break;
+ }
+ case AdmLexerConstants.BOOLEAN_CONS: {
+ parseConstructor(ATypeTag.BOOLEAN, objectType, out);
+ break;
+ }
+ case AdmLexerConstants.FALSE_LITERAL: {
+ if (checkType(ATypeTag.BOOLEAN, objectType, out)) {
+ booleanSerde.serialize(ABoolean.FALSE, out);
+ } else
+ throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
+ break;
+ }
+ case AdmLexerConstants.DOUBLE_LITERAL: {
+ if (checkType(ATypeTag.DOUBLE, objectType, out)) {
+ aDouble.setValue(Double.parseDouble(token.image));
+ doubleSerde.serialize(aDouble, out);
+ } else
+ throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
+ break;
+ }
+ case AdmLexerConstants.DOUBLE_CONS: {
+ parseConstructor(ATypeTag.DOUBLE, objectType, out);
+ break;
+ }
+ case AdmLexerConstants.FLOAT_LITERAL: {
+ if (checkType(ATypeTag.FLOAT, objectType, out)) {
+ aFloat.setValue(Float.parseFloat(token.image));
+ floatSerde.serialize(aFloat, out);
+ } else
+ throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
+ break;
+ }
+ case AdmLexerConstants.FLOAT_CONS: {
+ parseConstructor(ATypeTag.FLOAT, objectType, out);
+ break;
+ }
+ case AdmLexerConstants.INT8_LITERAL: {
+ if (checkType(ATypeTag.INT8, objectType, out)) {
+ parseInt8(token.image, out);
+ } else
+ throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
+ break;
+ }
+ case AdmLexerConstants.INT8_CONS: {
+ parseConstructor(ATypeTag.INT8, objectType, out);
+ break;
+ }
+ case AdmLexerConstants.INT16_LITERAL: {
+ if (checkType(ATypeTag.INT16, objectType, out)) {
+ parseInt16(token.image, out);
+ } else
+ throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
+ break;
+ }
+ case AdmLexerConstants.INT16_CONS: {
+ parseConstructor(ATypeTag.INT16, objectType, out);
+ break;
+ }
+ case AdmLexerConstants.INT_LITERAL:
+ case AdmLexerConstants.INT32_LITERAL: {
+ if (checkType(ATypeTag.INT32, objectType, out)) {
+ parseInt32(token.image, out);
+ } else
+ throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
+ break;
+ }
+ case AdmLexerConstants.INT32_CONS: {
+ parseConstructor(ATypeTag.INT32, objectType, out);
+ break;
+ }
+ case AdmLexerConstants.INT64_LITERAL: {
+ if (checkType(ATypeTag.INT64, objectType, out)) {
+ parseInt64(token.image, out);
+ } else
+ throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
+ break;
+ }
+ case AdmLexerConstants.INT64_CONS: {
+ parseConstructor(ATypeTag.INT64, objectType, out);
+ break;
+ }
+ case AdmLexerConstants.STRING_LITERAL: {
+ if (checkType(ATypeTag.STRING, objectType, out)) {
+ aString.setValue(token.image.substring(1, token.image.length() - 1));
+ stringSerde.serialize(aString, out);
+ } else
+ throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
+ break;
+ }
+ case AdmLexerConstants.STRING_CONS: {
+ parseConstructor(ATypeTag.STRING, objectType, out);
+ break;
+ }
+ case AdmLexerConstants.DATE_CONS: {
+ parseConstructor(ATypeTag.DATE, objectType, out);
+ break;
+ }
+ case AdmLexerConstants.TIME_CONS: {
+ parseConstructor(ATypeTag.TIME, objectType, out);
+ break;
+ }
+ case AdmLexerConstants.DATETIME_CONS: {
+ parseConstructor(ATypeTag.DATETIME, objectType, out);
+ break;
+ }
+ case AdmLexerConstants.DURATION_CONS: {
+ parseConstructor(ATypeTag.DURATION, objectType, out);
+ break;
+ }
+ case AdmLexerConstants.POINT_CONS: {
+ parseConstructor(ATypeTag.POINT, objectType, out);
+ break;
+ }
+ case AdmLexerConstants.POINT3D_CONS: {
+ parseConstructor(ATypeTag.POINT3D, objectType, out);
+ break;
+ }
+ case AdmLexerConstants.CIRCLE_CONS: {
+ parseConstructor(ATypeTag.CIRCLE, objectType, out);
+ break;
+ }
+ case AdmLexerConstants.RECTANGLE_CONS: {
+ parseConstructor(ATypeTag.RECTANGLE, objectType, out);
+ break;
+ }
+ case AdmLexerConstants.LINE_CONS: {
+ parseConstructor(ATypeTag.LINE, objectType, out);
+ break;
+ }
+ case AdmLexerConstants.POLYGON_CONS: {
+ parseConstructor(ATypeTag.POLYGON, objectType, out);
+ break;
+ }
+ case AdmLexerConstants.START_UNORDERED_LIST: {
+ if (checkType(ATypeTag.UNORDEREDLIST, objectType, out)) {
+ objectType = getComplexType(objectType, ATypeTag.UNORDEREDLIST);
+ parseUnorderedList((AUnorderedListType) objectType, out);
+ } else
+ throw new AsterixException(mismatchErrorMessage + objectType.getTypeTag());
+ break;
+ }
+
+ case AdmLexerConstants.START_ORDERED_LIST: {
+ if (checkType(ATypeTag.ORDEREDLIST, objectType, out)) {
+ objectType = getComplexType(objectType, ATypeTag.ORDEREDLIST);
+ parseOrderedList((AOrderedListType) objectType, out);
+ } else
+ throw new AsterixException(mismatchErrorMessage + objectType.getTypeTag());
+ break;
+ }
+ case AdmLexerConstants.START_RECORD: {
+ if (checkType(ATypeTag.RECORD, objectType, out)) {
+ objectType = getComplexType(objectType, ATypeTag.RECORD);
+ parseRecord((ARecordType) objectType, out, datasetRec);
+ } else
+ throw new AsterixException(mismatchErrorMessage + objectType.getTypeTag());
+ break;
+ }
+ case AdmLexerConstants.EOF: {
+ break;
+ }
+ default: {
+ throw new AsterixException("Unexpected ADM token kind: " + admLexer.tokenKindToString(token.kind) + ".");
+ }
+ }
+ }
+
+ private void parseDatetime(String datetime, DataOutput out) throws AsterixException, IOException {
+ try {
+ ADateTimeSerializerDeserializer.parse(datetime, out);
+ } catch (HyracksDataException e) {
+ throw new AsterixException(e);
+ }
+ }
+
+ private void parseDuration(String duration, DataOutput out) throws AsterixException {
+ try {
+ ADurationSerializerDeserializer.parse(duration, out);
+ } catch (HyracksDataException e) {
+ throw new AsterixException(e);
+ }
+
+ }
+
+ private IAType getComplexType(IAType aObjectType, ATypeTag tag) {
+
+ if (aObjectType == null) {
+ return null;
+ }
+
+ if (aObjectType.getTypeTag() == tag)
+ return aObjectType;
+
+ if (aObjectType.getTypeTag() == ATypeTag.UNION) {
+ unionList = ((AUnionType) aObjectType).getUnionList();
+ for (int i = 0; i < unionList.size(); i++)
+ if (unionList.get(i).getTypeTag() == tag) {
+ return unionList.get(i);
+ }
+ }
+ return null; // wont get here
+ }
+
+ List<IAType> unionList;
+
+ private boolean checkType(ATypeTag expectedTypeTag, IAType aObjectType, DataOutput out) throws IOException {
+
+ if (aObjectType == null)
+ return true;
+
+ if (aObjectType.getTypeTag() != ATypeTag.UNION) {
+ if (expectedTypeTag == aObjectType.getTypeTag())
+ return true;
+ } else { // union
+ unionList = ((AUnionType) aObjectType).getUnionList();
+ for (int i = 0; i < unionList.size(); i++)
+ if (unionList.get(i).getTypeTag() == expectedTypeTag)
+ return true;
+ }
+ return false;
+ }
+
+ private void parseRecord(ARecordType recType, DataOutput out, Boolean datasetRec) throws IOException,
+ AsterixException {
+
+ ArrayBackedValueStorage fieldValueBuffer = getTempBuffer();
+ ArrayBackedValueStorage fieldNameBuffer = getTempBuffer();
+ IARecordBuilder recBuilder = getRecordBuilder();
+
+ // Boolean[] nulls = null;
+ BitSet nulls = null;
+ if (datasetRec) {
+ if (recType != null) {
+ nulls = new BitSet(recType.getFieldNames().length);
+ recBuilder.reset(recType);
+ } else
+ recBuilder.reset(null);
+ } else if (recType != null) {
+ nulls = new BitSet(recType.getFieldNames().length);
+ recBuilder.reset(recType);
+ } else
+ recBuilder.reset(null);
+
+ recBuilder.init();
+ Token token = null;
+ boolean inRecord = true;
+ boolean expectingRecordField = false;
+ boolean first = true;
+
+ Boolean openRecordField = false;
+ int fieldId = 0;
+ IAType fieldType = null;
+ do {
+ token = nextToken();
+ switch (token.kind) {
+ case AdmLexerConstants.END_RECORD: {
+ if (expectingRecordField) {
+ throw new AsterixException("Found END_RECORD while expecting a record field.");
+ }
+ inRecord = false;
+ break;
+ }
+ case AdmLexerConstants.STRING_LITERAL: {
+ // we've read the name of the field
+ // now read the content
+ fieldNameBuffer.reset();
+ fieldValueBuffer.reset();
+ expectingRecordField = false;
+
+ if (recType != null) {
+ String fldName = token.image.substring(1, token.image.length() - 1);
+ fieldId = recBuilder.getFieldId(fldName);
+ if (fieldId < 0 && !recType.isOpen()) {
+ throw new AsterixException("This record is closed, you can not add extra fields !!");
+ } else if (fieldId < 0 && recType.isOpen()) {
+ aStringFieldName.setValue(token.image.substring(1, token.image.length() - 1));
+ stringSerde.serialize(aStringFieldName, fieldNameBuffer.getDataOutput());
+ openRecordField = true;
+ fieldType = null;
+ } else {
+ // a closed field
+ nulls.set(fieldId);
+ fieldType = recType.getFieldTypes()[fieldId];
+ openRecordField = false;
+ }
+ } else {
+ aStringFieldName.setValue(token.image.substring(1, token.image.length() - 1));
+ stringSerde.serialize(aStringFieldName, fieldNameBuffer.getDataOutput());
+ openRecordField = true;
+ fieldType = null;
+ }
+
+ token = nextToken();
+ if (token.kind != AdmLexerConstants.COLON) {
+ throw new AsterixException("Unexpected ADM token kind: "
+ + admLexer.tokenKindToString(token.kind) + " while expecting \":\".");
+ }
+
+ token = nextToken();
+ this.admFromLexerStream(token, fieldType, fieldValueBuffer.getDataOutput(), false);
+ if (openRecordField) {
+ if (fieldValueBuffer.getByteArray()[0] != ATypeTag.NULL.serialize())
+ recBuilder.addField(fieldNameBuffer, fieldValueBuffer);
+ } else if (recType.getFieldTypes()[fieldId].getTypeTag() == ATypeTag.UNION) {
+ if (NonTaggedFormatUtil.isOptionalField((AUnionType) recType.getFieldTypes()[fieldId])) {
+ if (fieldValueBuffer.getByteArray()[0] != ATypeTag.NULL.serialize()) {
+ recBuilder.addField(fieldId, fieldValueBuffer);
+ }
+ }
+ } else {
+ recBuilder.addField(fieldId, fieldValueBuffer);
+ }
+
+ break;
+ }
+ case AdmLexerConstants.COMMA: {
+ if (first) {
+ throw new AsterixException("Found COMMA before any record field.");
+ }
+ if (expectingRecordField) {
+ throw new AsterixException("Found COMMA while expecting a record field.");
+ }
+ expectingRecordField = true;
+ break;
+ }
+ default: {
+ throw new AsterixException("Unexpected ADM token kind: " + admLexer.tokenKindToString(token.kind)
+ + " while parsing record fields.");
+ }
+ }
+ first = false;
+ } while (inRecord);
+
+ if (recType != null) {
+ nullableFieldId = checkNullConstraints(recType, nulls);
+ if (nullableFieldId != -1)
+ throw new AsterixException("Field " + nullableFieldId + " can not be null");
+ }
+ recBuilder.write(out, true);
+ returnRecordBuilder(recBuilder);
+ returnTempBuffer(fieldNameBuffer);
+ returnTempBuffer(fieldValueBuffer);
+ }
+
+ private int checkNullConstraints(ARecordType recType, BitSet nulls) {
+
+ boolean isNull = false;
+ for (int i = 0; i < recType.getFieldTypes().length; i++)
+ if (nulls.get(i) == false) {
+ IAType type = recType.getFieldTypes()[i];
+ if (type.getTypeTag() != ATypeTag.NULL && type.getTypeTag() != ATypeTag.UNION)
+ return i;
+
+ if (type.getTypeTag() == ATypeTag.UNION) { // union
+ unionList = ((AUnionType) type).getUnionList();
+ for (int j = 0; j < unionList.size(); j++)
+ if (unionList.get(j).getTypeTag() == ATypeTag.NULL) {
+ isNull = true;
+ break;
+ }
+ if (!isNull)
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ private void parseOrderedList(AOrderedListType oltype, DataOutput out) throws IOException, AsterixException {
+
+ ArrayBackedValueStorage itemBuffer = getTempBuffer();
+ OrderedListBuilder orderedListBuilder = (OrderedListBuilder) getOrderedListBuilder();
+
+ IAType itemType = null;
+ if (oltype != null)
+ itemType = oltype.getItemType();
+ orderedListBuilder.reset(oltype);
+
+ Token token = null;
+ boolean inList = true;
+ boolean expectingListItem = false;
+ boolean first = true;
+ do {
+ token = nextToken();
+ if (token.kind == AdmLexerConstants.END_ORDERED_LIST) {
+ if (expectingListItem) {
+ throw new AsterixException("Found END_COLLECTION while expecting a list item.");
+ }
+ inList = false;
+ } else if (token.kind == AdmLexerConstants.COMMA) {
+ if (first) {
+ throw new AsterixException("Found COMMA before any list item.");
+ }
+ if (expectingListItem) {
+ throw new AsterixException("Found COMMA while expecting a list item.");
+ }
+ expectingListItem = true;
+ } else {
+ expectingListItem = false;
+ itemBuffer.reset();
+
+ admFromLexerStream(token, itemType, itemBuffer.getDataOutput(), false);
+ orderedListBuilder.addItem(itemBuffer);
+ }
+ first = false;
+ } while (inList);
+ orderedListBuilder.write(out, true);
+ returnOrderedListBuilder(orderedListBuilder);
+ returnTempBuffer(itemBuffer);
+ }
+
+ private void parseUnorderedList(AUnorderedListType uoltype, DataOutput out) throws IOException, AsterixException {
+
+ ArrayBackedValueStorage itemBuffer = getTempBuffer();
+ UnorderedListBuilder unorderedListBuilder = (UnorderedListBuilder) getUnorderedListBuilder();
+
+ IAType itemType = null;
+
+ if (uoltype != null)
+ itemType = uoltype.getItemType();
+ unorderedListBuilder.reset(uoltype);
+
+ Token token = null;
+ boolean inList = true;
+ boolean expectingListItem = false;
+ boolean first = true;
+ do {
+ token = nextToken();
+ if (token.kind == AdmLexerConstants.END_UNORDERED_LIST) {
+ if (expectingListItem) {
+ throw new AsterixException("Found END_COLLECTION while expecting a list item.");
+ }
+ inList = false;
+ } else if (token.kind == AdmLexerConstants.COMMA) {
+ if (first) {
+ throw new AsterixException("Found COMMA before any list item.");
+ }
+ if (expectingListItem) {
+ throw new AsterixException("Found COMMA while expecting a list item.");
+ }
+ expectingListItem = true;
+ } else {
+ expectingListItem = false;
+ itemBuffer.reset();
+ admFromLexerStream(token, itemType, itemBuffer.getDataOutput(), false);
+ unorderedListBuilder.addItem(itemBuffer);
+ }
+ first = false;
+ } while (inList);
+ unorderedListBuilder.write(out, true);
+ returnUnorderedListBuilder(unorderedListBuilder);
+ returnTempBuffer(itemBuffer);
+ }
+
+ private Token nextToken() throws AsterixException {
+ try {
+ return admLexer.next();
+ } catch (ParseException pe) {
+ throw new AsterixException(pe);
+ }
+ }
+
+ private IARecordBuilder getRecordBuilder() {
+ RecordBuilder recBuilder = (RecordBuilder) recordBuilderPool.poll();
+ if (recBuilder != null)
+ return recBuilder;
+ else
+ return new RecordBuilder();
+ }
+
+ private void returnRecordBuilder(IARecordBuilder recBuilder) {
+ this.recordBuilderPool.add(recBuilder);
+ }
+
+ private IAsterixListBuilder getOrderedListBuilder() {
+ OrderedListBuilder orderedListBuilder = (OrderedListBuilder) orderedListBuilderPool.poll();
+ if (orderedListBuilder != null)
+ return orderedListBuilder;
+ else
+ return new OrderedListBuilder();
+ }
+
+ private void returnOrderedListBuilder(IAsterixListBuilder orderedListBuilder) {
+ this.orderedListBuilderPool.add(orderedListBuilder);
+ }
+
+ private IAsterixListBuilder getUnorderedListBuilder() {
+ UnorderedListBuilder unorderedListBuilder = (UnorderedListBuilder) unorderedListBuilderPool.poll();
+ if (unorderedListBuilder != null)
+ return unorderedListBuilder;
+ else
+ return new UnorderedListBuilder();
+ }
+
+ private void returnUnorderedListBuilder(IAsterixListBuilder unorderedListBuilder) {
+ this.unorderedListBuilderPool.add(unorderedListBuilder);
+ }
+
+ private ArrayBackedValueStorage getTempBuffer() {
+ ArrayBackedValueStorage tmpBaaos = baaosPool.poll();
+ if (tmpBaaos != null) {
+ return tmpBaaos;
+ } else {
+ return new ArrayBackedValueStorage();
+ }
+ }
+
+ private void returnTempBuffer(ArrayBackedValueStorage tempBaaos) {
+ baaosPool.add(tempBaaos);
+ }
+
+ private void parseConstructor(ATypeTag typeTag, IAType objectType, DataOutput out) throws AsterixException {
+ try {
+ Token token = admLexer.next();
+ if (token.kind == AdmLexerConstants.CONSTRUCTOR_OPEN) {
+ if (checkType(typeTag, objectType, out)) {
+ token = admLexer.next();
+ if (token.kind == AdmLexerConstants.STRING_LITERAL) {
+ switch (typeTag) {
+ case BOOLEAN:
+ parseBoolean(token.image.substring(1, token.image.length() - 1), out);
+ break;
+ case INT8:
+ parseInt8(token.image.substring(1, token.image.length() - 1), out);
+ break;
+ case INT16:
+ parseInt16(token.image.substring(1, token.image.length() - 1), out);
+ break;
+ case INT32:
+ parseInt32(token.image.substring(1, token.image.length() - 1), out);
+ break;
+ case INT64:
+ parseInt64(token.image.substring(1, token.image.length() - 1), out);
+ break;
+ case FLOAT:
+ aFloat.setValue(Float.parseFloat(token.image.substring(1, token.image.length() - 1)));
+ floatSerde.serialize(aFloat, out);
+ break;
+ case DOUBLE:
+ aDouble.setValue(Double.parseDouble(token.image.substring(1, token.image.length() - 1)));
+ doubleSerde.serialize(aDouble, out);
+ break;
+ case STRING:
+ aString.setValue(token.image.substring(1, token.image.length() - 1));
+ stringSerde.serialize(aString, out);
+ break;
+ case TIME:
+ parseTime(token.image.substring(1, token.image.length() - 1), out);
+ break;
+ case DATE:
+ parseDate(token.image.substring(1, token.image.length() - 1), out);
+ break;
+ case DATETIME:
+ parseDatetime(token.image.substring(1, token.image.length() - 1), out);
+ break;
+ case DURATION:
+ parseDuration(token.image.substring(1, token.image.length() - 1), out);
+ break;
+ case POINT:
+ parsePoint(token.image.substring(1, token.image.length() - 1), out);
+ break;
+ case POINT3D:
+ parsePoint3d(token.image.substring(1, token.image.length() - 1), out);
+ break;
+ case CIRCLE:
+ parseCircle(token.image.substring(1, token.image.length() - 1), out);
+ break;
+ case RECTANGLE:
+ parseRectangle(token.image.substring(1, token.image.length() - 1), out);
+ break;
+ case LINE:
+ parseLine(token.image.substring(1, token.image.length() - 1), out);
+ break;
+ case POLYGON:
+ parsePolygon(token.image.substring(1, token.image.length() - 1), out);
+ break;
+
+ }
+ token = admLexer.next();
+ if (token.kind == AdmLexerConstants.CONSTRUCTOR_CLOSE)
+ return;
+ }
+ }
+ }
+ } catch (Exception e) {
+ throw new AsterixException(e);
+ }
+ throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
+ }
+
+ private void parseBoolean(String bool, DataOutput out) throws AsterixException {
+ String errorMessage = "This can not be an instance of boolean";
+ try {
+ if (bool.equals("true"))
+ booleanSerde.serialize(ABoolean.TRUE, out);
+ else if (bool.equals("false"))
+ booleanSerde.serialize(ABoolean.FALSE, out);
+ else
+ throw new AsterixException(errorMessage);
+ } catch (HyracksDataException e) {
+ throw new AsterixException(errorMessage);
+ }
+ }
+
+ private void parseInt8(String int8, DataOutput out) throws AsterixException {
+ String errorMessage = "This can not be an instance of int8";
+ try {
+ boolean positive = true;
+ byte value = 0;
+ int offset = 0;
+
+ if (int8.charAt(offset) == '+')
+ offset++;
+ else if (int8.charAt(offset) == '-') {
+ offset++;
+ positive = false;
+ }
+ for (; offset < int8.length(); offset++) {
+ if (int8.charAt(offset) >= '0' && int8.charAt(offset) <= '9')
+ value = (byte) (value * 10 + int8.charAt(offset) - '0');
+ else if (int8.charAt(offset) == 'i' && int8.charAt(offset + 1) == '8' && offset + 2 == int8.length())
+ break;
+ else
+ throw new AsterixException(errorMessage);
+ }
+ if (value < 0)
+ throw new AsterixException(errorMessage);
+ if (value > 0 && !positive)
+ value *= -1;
+ aInt8.setValue(value);
+ int8Serde.serialize(aInt8, out);
+ } catch (HyracksDataException e) {
+ throw new AsterixException(errorMessage);
+ }
+ }
+
+ private void parseInt16(String int16, DataOutput out) throws AsterixException {
+ String errorMessage = "This can not be an instance of int16";
+ try {
+ boolean positive = true;
+ short value = 0;
+ int offset = 0;
+
+ if (int16.charAt(offset) == '+')
+ offset++;
+ else if (int16.charAt(offset) == '-') {
+ offset++;
+ positive = false;
+ }
+ for (; offset < int16.length(); offset++) {
+ if (int16.charAt(offset) >= '0' && int16.charAt(offset) <= '9')
+ value = (short) (value * 10 + int16.charAt(offset) - '0');
+ else if (int16.charAt(offset) == 'i' && int16.charAt(offset + 1) == '1'
+ && int16.charAt(offset + 2) == '6' && offset + 3 == int16.length())
+ break;
+ else
+ throw new AsterixException(errorMessage);
+ }
+ if (value < 0)
+ throw new AsterixException(errorMessage);
+ if (value > 0 && !positive)
+ value *= -1;
+ aInt16.setValue(value);
+ int16Serde.serialize(aInt16, out);
+ } catch (HyracksDataException e) {
+ throw new AsterixException(errorMessage);
+ }
+ }
+
+ private void parseInt32(String int32, DataOutput out) throws AsterixException {
+
+ String errorMessage = "This can not be an instance of int32";
+ try {
+ boolean positive = true;
+ int value = 0;
+ int offset = 0;
+
+ if (int32.charAt(offset) == '+')
+ offset++;
+ else if (int32.charAt(offset) == '-') {
+ offset++;
+ positive = false;
+ }
+ for (; offset < int32.length(); offset++) {
+ if (int32.charAt(offset) >= '0' && int32.charAt(offset) <= '9')
+ value = (value * 10 + int32.charAt(offset) - '0');
+ else if (int32.charAt(offset) == 'i' && int32.charAt(offset + 1) == '3'
+ && int32.charAt(offset + 2) == '2' && offset + 3 == int32.length())
+ break;
+ else
+ throw new AsterixException(errorMessage);
+ }
+ if (value < 0)
+ throw new AsterixException(errorMessage);
+ if (value > 0 && !positive)
+ value *= -1;
+
+ aInt32.setValue(value);
+ int32Serde.serialize(aInt32, out);
+ } catch (HyracksDataException e) {
+ throw new AsterixException(errorMessage);
+ }
+ }
+
+ private void parseInt64(String int64, DataOutput out) throws AsterixException {
+ String errorMessage = "This can not be an instance of int64";
+ try {
+ boolean positive = true;
+ long value = 0;
+ int offset = 0;
+
+ if (int64.charAt(offset) == '+')
+ offset++;
+ else if (int64.charAt(offset) == '-') {
+ offset++;
+ positive = false;
+ }
+ for (; offset < int64.length(); offset++) {
+ if (int64.charAt(offset) >= '0' && int64.charAt(offset) <= '9')
+ value = (value * 10 + int64.charAt(offset) - '0');
+ else if (int64.charAt(offset) == 'i' && int64.charAt(offset + 1) == '6'
+ && int64.charAt(offset + 2) == '4' && offset + 3 == int64.length())
+ break;
+ else
+ throw new AsterixException(errorMessage);
+ }
+ if (value < 0)
+ throw new AsterixException(errorMessage);
+ if (value > 0 && !positive)
+ value *= -1;
+
+ aInt64.setValue(value);
+ int64Serde.serialize(aInt64, out);
+ } catch (HyracksDataException e) {
+ throw new AsterixException(errorMessage);
+ }
+ }
+
+ private void parsePoint(String point, DataOutput out) throws AsterixException {
+ try {
+ APointSerializerDeserializer.parse(point, out);
+ } catch (HyracksDataException e) {
+ throw new AsterixException(e);
+ }
+ }
+
+ private void parsePoint3d(String point3d, DataOutput out) throws AsterixException {
+ try {
+ APoint3DSerializerDeserializer.parse(point3d, out);
+ } catch (HyracksDataException e) {
+ throw new AsterixException(e);
+ }
+ }
+
+ private void parseCircle(String circle, DataOutput out) throws AsterixException {
+ try {
+ ACircleSerializerDeserializer.parse(circle, out);
+ } catch (HyracksDataException e) {
+ throw new AsterixException(e);
+ }
+ }
+
+ private void parseRectangle(String rectangle, DataOutput out) throws AsterixException {
+ try {
+ ARectangleSerializerDeserializer.parse(rectangle, out);
+ } catch (HyracksDataException e) {
+ throw new AsterixException(e);
+ }
+ }
+
+ private void parseLine(String line, DataOutput out) throws AsterixException {
+ try {
+ ALineSerializerDeserializer.parse(line, out);
+ } catch (HyracksDataException e) {
+ throw new AsterixException(e);
+ }
+ }
+
+ private void parsePolygon(String polygon, DataOutput out) throws AsterixException, IOException {
+ try {
+ APolygonSerializerDeserializer.parse(polygon, out);
+ } catch (HyracksDataException e) {
+ throw new AsterixException(e);
+ }
+ }
+
+ private void parseTime(String time, DataOutput out) throws AsterixException {
+ try {
+ ATimeSerializerDeserializer.parse(time, out);
+ } catch (HyracksDataException e) {
+ throw new AsterixException(e);
+ }
+ }
+
+ private void parseDate(String date, DataOutput out) throws AsterixException, IOException {
+ try {
+ ADateSerializerDeserializer.parse(date, out);
+ } catch (HyracksDataException e) {
+ throw new AsterixException(e);
+ }
+ }
+
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AbstractDataParser.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AbstractDataParser.java
new file mode 100644
index 0000000..fc2d7ca
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AbstractDataParser.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.runtime.operators.file;
+
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.ABoolean;
+import edu.uci.ics.asterix.om.base.ADouble;
+import edu.uci.ics.asterix.om.base.AFloat;
+import edu.uci.ics.asterix.om.base.AInt16;
+import edu.uci.ics.asterix.om.base.AInt32;
+import edu.uci.ics.asterix.om.base.AInt64;
+import edu.uci.ics.asterix.om.base.AInt8;
+import edu.uci.ics.asterix.om.base.AMutableDouble;
+import edu.uci.ics.asterix.om.base.AMutableFloat;
+import edu.uci.ics.asterix.om.base.AMutableInt16;
+import edu.uci.ics.asterix.om.base.AMutableInt32;
+import edu.uci.ics.asterix.om.base.AMutableInt64;
+import edu.uci.ics.asterix.om.base.AMutableInt8;
+import edu.uci.ics.asterix.om.base.AMutableString;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.base.AString;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+
+/**
+ * Base class for data parsers. Includes the common set of definitions for
+ * serializers/deserializers for built-in ADM types.
+ */
+public abstract class AbstractDataParser implements IDataParser {
+
+ protected AMutableInt8 aInt8 = new AMutableInt8((byte) 0);
+ protected AMutableInt16 aInt16 = new AMutableInt16((short) 0);
+ protected AMutableInt32 aInt32 = new AMutableInt32(0);
+ protected AMutableInt64 aInt64 = new AMutableInt64(0);
+ protected AMutableDouble aDouble = new AMutableDouble(0);
+ protected AMutableFloat aFloat = new AMutableFloat(0);
+ protected AMutableString aString = new AMutableString("");
+ protected AMutableString aStringFieldName = new AMutableString("");
+
+ // Serializers
+ @SuppressWarnings("unchecked")
+ protected ISerializerDeserializer<ADouble> doubleSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ADOUBLE);
+ @SuppressWarnings("unchecked")
+ protected ISerializerDeserializer<AString> stringSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ASTRING);
+ @SuppressWarnings("unchecked")
+ protected ISerializerDeserializer<AFloat> floatSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.AFLOAT);
+ @SuppressWarnings("unchecked")
+ protected ISerializerDeserializer<AInt8> int8Serde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.AINT8);
+ @SuppressWarnings("unchecked")
+ protected ISerializerDeserializer<AInt16> int16Serde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.AINT16);
+ @SuppressWarnings("unchecked")
+ protected ISerializerDeserializer<AInt32> int32Serde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.AINT32);
+ @SuppressWarnings("unchecked")
+ protected ISerializerDeserializer<AInt64> int64Serde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.AINT64);
+ @SuppressWarnings("unchecked")
+ protected ISerializerDeserializer<ABoolean> booleanSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ABOOLEAN);
+ @SuppressWarnings("unchecked")
+ protected ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ANULL);
+
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AbstractTupleParser.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AbstractTupleParser.java
index 6e83689..cb05529 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AbstractTupleParser.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AbstractTupleParser.java
@@ -1,72 +1,91 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package edu.uci.ics.asterix.runtime.operators.file;
+import java.io.DataOutput;
+import java.io.IOException;
import java.io.InputStream;
+import java.nio.ByteBuffer;
-import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
-import edu.uci.ics.asterix.om.base.ABoolean;
-import edu.uci.ics.asterix.om.base.ADouble;
-import edu.uci.ics.asterix.om.base.AFloat;
-import edu.uci.ics.asterix.om.base.AInt16;
-import edu.uci.ics.asterix.om.base.AInt32;
-import edu.uci.ics.asterix.om.base.AInt64;
-import edu.uci.ics.asterix.om.base.AInt8;
-import edu.uci.ics.asterix.om.base.AMutableDouble;
-import edu.uci.ics.asterix.om.base.AMutableFloat;
-import edu.uci.ics.asterix.om.base.AMutableInt16;
-import edu.uci.ics.asterix.om.base.AMutableInt32;
-import edu.uci.ics.asterix.om.base.AMutableInt64;
-import edu.uci.ics.asterix.om.base.AMutableInt8;
-import edu.uci.ics.asterix.om.base.AMutableString;
-import edu.uci.ics.asterix.om.base.ANull;
-import edu.uci.ics.asterix.om.base.AString;
-import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.types.ARecordType;
import edu.uci.ics.hyracks.api.comm.IFrameWriter;
-import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
+import edu.uci.ics.hyracks.dataflow.common.comm.io.FrameTupleAppender;
+import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
import edu.uci.ics.hyracks.dataflow.std.file.ITupleParser;
+/**
+ * An Abstract class implementation for ITupleParser. It provides common
+ * functionality involved in parsing data in an external format and packing
+ * frames with formed tuples.
+ */
public abstract class AbstractTupleParser implements ITupleParser {
- // Mutable Types..
- protected AMutableInt8 aInt8 = new AMutableInt8((byte) 0);
- protected AMutableInt16 aInt16 = new AMutableInt16((short) 0);
- protected AMutableInt32 aInt32 = new AMutableInt32(0);
- protected AMutableInt64 aInt64 = new AMutableInt64(0);
- protected AMutableDouble aDouble = new AMutableDouble(0);
- protected AMutableFloat aFloat = new AMutableFloat(0);
- protected AMutableString aString = new AMutableString("");
- protected AMutableString aStringFieldName = new AMutableString("");
+ protected ArrayTupleBuilder tb = new ArrayTupleBuilder(1);
+ protected DataOutput dos = tb.getDataOutput();
+ protected final FrameTupleAppender appender;
+ protected final ByteBuffer frame;
+ protected final ARecordType recType;
+ protected final IHyracksTaskContext ctx;
- // Serializers
- @SuppressWarnings("unchecked")
- protected ISerializerDeserializer<ADouble> doubleSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ADOUBLE);
- @SuppressWarnings("unchecked")
- protected ISerializerDeserializer<AString> stringSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ASTRING);
- @SuppressWarnings("unchecked")
- protected ISerializerDeserializer<AFloat> floatSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AFLOAT);
- @SuppressWarnings("unchecked")
- protected ISerializerDeserializer<AInt8> int8Serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT8);
- @SuppressWarnings("unchecked")
- protected ISerializerDeserializer<AInt16> int16Serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT16);
- @SuppressWarnings("unchecked")
- protected ISerializerDeserializer<AInt32> int32Serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT32);
- @SuppressWarnings("unchecked")
- protected ISerializerDeserializer<AInt64> int64Serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT64);
- @SuppressWarnings("unchecked")
- protected ISerializerDeserializer<ABoolean> booleanSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ABOOLEAN);
- @SuppressWarnings("unchecked")
- protected ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
+ public AbstractTupleParser(IHyracksTaskContext ctx, ARecordType recType) {
+ appender = new FrameTupleAppender(ctx.getFrameSize());
+ frame = ctx.allocateFrame();
+ this.recType = recType;
+ this.ctx = ctx;
+ }
-
- @Override
- public abstract void parse(InputStream in, IFrameWriter writer) throws HyracksDataException;
+ public abstract IDataParser getDataParser();
+
+ @Override
+ public void parse(InputStream in, IFrameWriter writer) throws HyracksDataException {
+
+ appender.reset(frame, true);
+ IDataParser parser = getDataParser();
+ try {
+ parser.initialize(in, recType, true);
+ while (true) {
+ tb.reset();
+ if (!parser.parse(tb.getDataOutput())) {
+ break;
+ }
+ tb.addFieldEndOffset();
+ addTupleToFrame(writer);
+ }
+ if (appender.getTupleCount() > 0) {
+ FrameUtils.flushFrame(frame, writer);
+ }
+ } catch (AsterixException ae) {
+ throw new HyracksDataException(ae);
+ } catch (IOException ioe) {
+ throw new HyracksDataException(ioe);
+ }
+ }
+
+ protected void addTupleToFrame(IFrameWriter writer) throws HyracksDataException {
+ if (!appender.append(tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize())) {
+ FrameUtils.flushFrame(frame, writer);
+ appender.reset(frame, true);
+ if (!appender.append(tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize())) {
+ throw new IllegalStateException();
+ }
+ }
+
+ }
+
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmSchemafullRecordParserFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmSchemafullRecordParserFactory.java
index f343660..a9287c8 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmSchemafullRecordParserFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmSchemafullRecordParserFactory.java
@@ -1,1098 +1,41 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package edu.uci.ics.asterix.runtime.operators.file;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.ByteBuffer;
-import java.util.ArrayDeque;
-import java.util.BitSet;
-import java.util.List;
-import java.util.Queue;
-
-import edu.uci.ics.asterix.adm.parser.nontagged.AdmLexer;
-import edu.uci.ics.asterix.adm.parser.nontagged.AdmLexerConstants;
-import edu.uci.ics.asterix.adm.parser.nontagged.ParseException;
-import edu.uci.ics.asterix.adm.parser.nontagged.Token;
-import edu.uci.ics.asterix.builders.IAOrderedListBuilder;
-import edu.uci.ics.asterix.builders.IARecordBuilder;
-import edu.uci.ics.asterix.builders.IAUnorderedListBuilder;
-import edu.uci.ics.asterix.builders.OrderedListBuilder;
-import edu.uci.ics.asterix.builders.RecordBuilder;
-import edu.uci.ics.asterix.builders.UnorderedListBuilder;
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ACircleSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADateSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADateTimeSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AIntervalSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ALineSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APoint3DSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APointSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APolygonSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ARectangleSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ATimeSerializerDeserializer;
-import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
-import edu.uci.ics.asterix.om.base.ABoolean;
-import edu.uci.ics.asterix.om.base.ADouble;
-import edu.uci.ics.asterix.om.base.AFloat;
-import edu.uci.ics.asterix.om.base.AInt16;
-import edu.uci.ics.asterix.om.base.AInt32;
-import edu.uci.ics.asterix.om.base.AInt64;
-import edu.uci.ics.asterix.om.base.AInt8;
-import edu.uci.ics.asterix.om.base.AMutableDouble;
-import edu.uci.ics.asterix.om.base.AMutableFloat;
-import edu.uci.ics.asterix.om.base.AMutableInt16;
-import edu.uci.ics.asterix.om.base.AMutableInt32;
-import edu.uci.ics.asterix.om.base.AMutableInt64;
-import edu.uci.ics.asterix.om.base.AMutableInt8;
-import edu.uci.ics.asterix.om.base.AMutableString;
-import edu.uci.ics.asterix.om.base.ANull;
-import edu.uci.ics.asterix.om.base.AString;
-import edu.uci.ics.asterix.om.types.AOrderedListType;
import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.AUnionType;
-import edu.uci.ics.asterix.om.types.AUnorderedListType;
-import edu.uci.ics.asterix.om.types.BuiltinType;
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
-import edu.uci.ics.hyracks.api.comm.IFrameWriter;
import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.FrameTupleAppender;
-import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
import edu.uci.ics.hyracks.dataflow.std.file.ITupleParser;
import edu.uci.ics.hyracks.dataflow.std.file.ITupleParserFactory;
+/**
+ * A Tuple parser factory for creating a tuple parser capable of parsing
+ * ADM data.
+ */
public class AdmSchemafullRecordParserFactory implements ITupleParserFactory {
private static final long serialVersionUID = 1L;
protected ARecordType recType;
- private enum IntervalType {
- DATE_INTERVAL,
- TIME_INTERVAL,
- DATETIME_INTERVAL
- }
-
public AdmSchemafullRecordParserFactory(ARecordType recType) {
this.recType = recType;
}
@Override
public ITupleParser createTupleParser(final IHyracksTaskContext ctx) {
- return new ITupleParser() {
- private AdmLexer admLexer;
- private ArrayTupleBuilder tb = new ArrayTupleBuilder(1);
- private DataOutput dos = tb.getDataOutput();
- private FrameTupleAppender appender = new FrameTupleAppender(ctx.getFrameSize());
- private ByteBuffer frame = ctx.allocateFrame();
-
- private int nullableFieldId = 0;
-
- private Queue<ArrayBackedValueStorage> baaosPool = new ArrayDeque<ArrayBackedValueStorage>();
- private Queue<IARecordBuilder> recordBuilderPool = new ArrayDeque<IARecordBuilder>();
- private Queue<IAOrderedListBuilder> orderedListBuilderPool = new ArrayDeque<IAOrderedListBuilder>();
- private Queue<IAUnorderedListBuilder> unorderedListBuilderPool = new ArrayDeque<IAUnorderedListBuilder>();
-
- private String mismatchErrorMessage = "Mismatch Type, expecting a value of type ";
-
- // Mutable Types..
- private AMutableInt8 aInt8 = new AMutableInt8((byte) 0);
- private AMutableInt16 aInt16 = new AMutableInt16((short) 0);
- private AMutableInt32 aInt32 = new AMutableInt32(0);
- private AMutableInt64 aInt64 = new AMutableInt64(0);
- private AMutableDouble aDouble = new AMutableDouble(0);
- private AMutableFloat aFloat = new AMutableFloat(0);
- private AMutableString aString = new AMutableString("");
- private AMutableString aStringFieldName = new AMutableString("");
-
- // Serializers
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ADouble> doubleSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ADOUBLE);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<AString> stringSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ASTRING);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<AFloat> floatSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AFLOAT);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<AInt8> int8Serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT8);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<AInt16> int16Serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT16);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<AInt32> int32Serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT32);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<AInt64> int64Serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT64);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ABoolean> booleanSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ABOOLEAN);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
-
- @Override
- public void parse(InputStream in, IFrameWriter writer) throws HyracksDataException {
- admLexer = new AdmLexer(in);
- appender.reset(frame, true);
- int tupleNum = 0;
- try {
- while (true) {
- tb.reset();
- if (!parseAdmInstance(recType, true, dos)) {
- break;
- }
- tb.addFieldEndOffset();
- if (!appender.append(tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize())) {
- FrameUtils.flushFrame(frame, writer);
- appender.reset(frame, true);
- if (!appender.append(tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize())) {
- throw new IllegalStateException();
- }
- }
- tupleNum++;
- }
- if (appender.getTupleCount() > 0) {
- FrameUtils.flushFrame(frame, writer);
- }
- } catch (AsterixException ae) {
- throw new HyracksDataException(ae);
- } catch (IOException ioe) {
- throw new HyracksDataException(ioe);
- }
- }
-
- private boolean parseAdmInstance(IAType objectType, Boolean datasetRec, DataOutput out)
- throws AsterixException, IOException {
- Token token;
- try {
- token = admLexer.next();
- } catch (ParseException pe) {
- throw new AsterixException(pe);
- }
- if (token.kind == AdmLexerConstants.EOF) {
- return false;
- } else {
- admFromLexerStream(token, objectType, out, datasetRec);
- return true;
- }
- }
-
- private void admFromLexerStream(Token token, IAType objectType, DataOutput out, Boolean datasetRec)
- throws AsterixException, IOException {
-
- switch (token.kind) {
- case AdmLexerConstants.NULL_LITERAL: {
- if (checkType(ATypeTag.NULL, objectType, out)) {
- nullSerde.serialize(ANull.NULL, out);
- } else
- throw new AsterixException(" This field can not be null ");
- break;
- }
- case AdmLexerConstants.TRUE_LITERAL: {
- if (checkType(ATypeTag.BOOLEAN, objectType, out)) {
- booleanSerde.serialize(ABoolean.TRUE, out);
- } else
- throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
- break;
- }
- case AdmLexerConstants.BOOLEAN_CONS: {
- parseConstructor(ATypeTag.BOOLEAN, objectType, out);
- break;
- }
- case AdmLexerConstants.FALSE_LITERAL: {
- if (checkType(ATypeTag.BOOLEAN, objectType, out)) {
- booleanSerde.serialize(ABoolean.FALSE, out);
- } else
- throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
- break;
- }
- case AdmLexerConstants.DOUBLE_LITERAL: {
- if (checkType(ATypeTag.DOUBLE, objectType, out)) {
- aDouble.setValue(Double.parseDouble(token.image));
- doubleSerde.serialize(aDouble, out);
- } else
- throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
- break;
- }
- case AdmLexerConstants.DOUBLE_CONS: {
- parseConstructor(ATypeTag.DOUBLE, objectType, out);
- break;
- }
- case AdmLexerConstants.FLOAT_LITERAL: {
- if (checkType(ATypeTag.FLOAT, objectType, out)) {
- aFloat.setValue(Float.parseFloat(token.image));
- floatSerde.serialize(aFloat, out);
- } else
- throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
- break;
- }
- case AdmLexerConstants.FLOAT_CONS: {
- parseConstructor(ATypeTag.FLOAT, objectType, out);
- break;
- }
- case AdmLexerConstants.INT8_LITERAL: {
- if (checkType(ATypeTag.INT8, objectType, out)) {
- parseInt8(token.image, out);
- } else
- throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
- break;
- }
- case AdmLexerConstants.INT8_CONS: {
- parseConstructor(ATypeTag.INT8, objectType, out);
- break;
- }
- case AdmLexerConstants.INT16_LITERAL: {
- if (checkType(ATypeTag.INT16, objectType, out)) {
- parseInt16(token.image, out);
- } else
- throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
- break;
- }
- case AdmLexerConstants.INT16_CONS: {
- parseConstructor(ATypeTag.INT16, objectType, out);
- break;
- }
- case AdmLexerConstants.INT_LITERAL:
- case AdmLexerConstants.INT32_LITERAL: {
- if (checkType(ATypeTag.INT32, objectType, out)) {
- parseInt32(token.image, out);
- } else
- throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
- break;
- }
- case AdmLexerConstants.INT32_CONS: {
- parseConstructor(ATypeTag.INT32, objectType, out);
- break;
- }
- case AdmLexerConstants.INT64_LITERAL: {
- if (checkType(ATypeTag.INT64, objectType, out)) {
- parseInt64(token.image, out);
- } else
- throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
- break;
- }
- case AdmLexerConstants.INT64_CONS: {
- parseConstructor(ATypeTag.INT64, objectType, out);
- break;
- }
- case AdmLexerConstants.STRING_LITERAL: {
- if (checkType(ATypeTag.STRING, objectType, out)) {
- aString.setValue(token.image.substring(1, token.image.length() - 1));
- stringSerde.serialize(aString, out);
- } else
- throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
- break;
- }
- case AdmLexerConstants.STRING_CONS: {
- parseConstructor(ATypeTag.STRING, objectType, out);
- break;
- }
- case AdmLexerConstants.DATE_CONS: {
- parseConstructor(ATypeTag.DATE, objectType, out);
- break;
- }
- case AdmLexerConstants.DATE_LITERAL: {
- parseDate(token.image, out);
- break;
- }
- case AdmLexerConstants.TIME_CONS: {
- parseConstructor(ATypeTag.TIME, objectType, out);
- break;
- }
- case AdmLexerConstants.TIME_LITERAL: {
- parseTime(token.image, out);
- break;
- }
- case AdmLexerConstants.DATETIME_CONS: {
- parseConstructor(ATypeTag.DATETIME, objectType, out);
- break;
- }
- case AdmLexerConstants.DATETIME_LITERAL: {
- parseDatetime(token.image, out);
- break;
- }
- case AdmLexerConstants.DURATION_CONS: {
- parseConstructor(ATypeTag.DURATION, objectType, out);
- break;
- }
- case AdmLexerConstants.DURATION_LITERAL: {
- parseDuration(token.image, out);
- break;
- }
- case AdmLexerConstants.INTERVAL_CONS: {
- parseConstructor(ATypeTag.INTERVAL, objectType, out);
- break;
- }
- case AdmLexerConstants.TIME_INTERVAL_CONS: {
- parseIntervalConstructor(objectType, out, IntervalType.TIME_INTERVAL);
- break;
- }
- case AdmLexerConstants.DATE_INTERVAL_CONS: {
- parseIntervalConstructor(objectType, out, IntervalType.DATE_INTERVAL);
- break;
- }
- case AdmLexerConstants.DATETIME_INTERVAL_CONS: {
- parseIntervalConstructor(objectType, out, IntervalType.DATETIME_INTERVAL);
- break;
- }
- case AdmLexerConstants.POINT_CONS: {
- parseConstructor(ATypeTag.POINT, objectType, out);
- break;
- }
- case AdmLexerConstants.POINT3D_CONS: {
- parseConstructor(ATypeTag.POINT3D, objectType, out);
- break;
- }
- case AdmLexerConstants.CIRCLE_CONS: {
- parseConstructor(ATypeTag.CIRCLE, objectType, out);
- break;
- }
- case AdmLexerConstants.RECTANGLE_CONS: {
- parseConstructor(ATypeTag.RECTANGLE, objectType, out);
- break;
- }
- case AdmLexerConstants.LINE_CONS: {
- parseConstructor(ATypeTag.LINE, objectType, out);
- break;
- }
- case AdmLexerConstants.POLYGON_CONS: {
- parseConstructor(ATypeTag.POLYGON, objectType, out);
- break;
- }
- case AdmLexerConstants.START_UNORDERED_LIST: {
- if (checkType(ATypeTag.UNORDEREDLIST, objectType, out)) {
- objectType = getComplexType(objectType, ATypeTag.UNORDEREDLIST);
- parseUnorderedList((AUnorderedListType) objectType, out);
- } else
- throw new AsterixException(mismatchErrorMessage + objectType.getTypeTag());
- break;
- }
-
- case AdmLexerConstants.START_ORDERED_LIST: {
- if (checkType(ATypeTag.ORDEREDLIST, objectType, out)) {
- objectType = getComplexType(objectType, ATypeTag.ORDEREDLIST);
- parseOrderedList((AOrderedListType) objectType, out);
- } else
- throw new AsterixException(mismatchErrorMessage + objectType.getTypeTag());
- break;
- }
- case AdmLexerConstants.START_RECORD: {
- if (checkType(ATypeTag.RECORD, objectType, out)) {
- objectType = getComplexType(objectType, ATypeTag.RECORD);
- parseRecord((ARecordType) objectType, out, datasetRec);
- } else
- throw new AsterixException(mismatchErrorMessage + objectType.getTypeTag());
- break;
- }
- case AdmLexerConstants.EOF: {
- break;
- }
- default: {
- throw new AsterixException("Unexpected ADM token kind: "
- + admLexer.tokenKindToString(token.kind) + ".");
- }
- }
- }
-
- private void parseIntervalConstructor(IAType objectType, DataOutput out, IntervalType intervalType)
- throws AsterixException {
- try {
- Token token = admLexer.next();
- if (token.kind == AdmLexerConstants.CONSTRUCTOR_OPEN) {
- token = admLexer.next();
- if (token.kind == AdmLexerConstants.STRING_LITERAL) {
- switch (intervalType) {
- case DATE_INTERVAL:
- parseDateInterval(token.image.substring(1, token.image.length() - 1), out);
- break;
- case TIME_INTERVAL:
- parseTimeInterval(token.image.substring(1, token.image.length() - 1), out);
- break;
- case DATETIME_INTERVAL:
- parseDatetimeInterval(token.image.substring(1, token.image.length() - 1), out);
- break;
- }
- token = admLexer.next();
- if (token.kind == AdmLexerConstants.CONSTRUCTOR_CLOSE)
- return;
- }
- }
- } catch (Exception e) {
- throw new AsterixException(e);
- }
- throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
- }
-
- private void parseConstructor(ATypeTag typeTag, IAType objectType, DataOutput out) throws AsterixException {
- try {
- Token token = admLexer.next();
- if (token.kind == AdmLexerConstants.CONSTRUCTOR_OPEN) {
- if (checkType(typeTag, objectType, out)) {
- token = admLexer.next();
- if (token.kind == AdmLexerConstants.STRING_LITERAL) {
- switch (typeTag) {
- case BOOLEAN:
- parseBoolean(token.image.substring(1, token.image.length() - 1), out);
- break;
- case INT8:
- parseInt8(token.image.substring(1, token.image.length() - 1), out);
- break;
- case INT16:
- parseInt16(token.image.substring(1, token.image.length() - 1), out);
- break;
- case INT32:
- parseInt32(token.image.substring(1, token.image.length() - 1), out);
- break;
- case INT64:
- parseInt64(token.image.substring(1, token.image.length() - 1), out);
- break;
- case FLOAT:
- aFloat.setValue(Float.parseFloat(token.image.substring(1,
- token.image.length() - 1)));
- floatSerde.serialize(aFloat, out);
- break;
- case DOUBLE:
- aDouble.setValue(Double.parseDouble(token.image.substring(1,
- token.image.length() - 1)));
- doubleSerde.serialize(aDouble, out);
- break;
- case STRING:
- aString.setValue(token.image.substring(1, token.image.length() - 1));
- stringSerde.serialize(aString, out);
- break;
- case TIME:
- parseTime(token.image.substring(1, token.image.length() - 1), out);
- break;
- case DATE:
- parseDate(token.image.substring(1, token.image.length() - 1), out);
- break;
- case DATETIME:
- parseDatetime(token.image.substring(1, token.image.length() - 1), out);
- break;
- case DURATION:
- parseDuration(token.image.substring(1, token.image.length() - 1), out);
- break;
- case POINT:
- parsePoint(token.image.substring(1, token.image.length() - 1), out);
- break;
- case POINT3D:
- parsePoint3d(token.image.substring(1, token.image.length() - 1), out);
- break;
- case CIRCLE:
- parseCircle(token.image.substring(1, token.image.length() - 1), out);
- break;
- case RECTANGLE:
- parseRectangle(token.image.substring(1, token.image.length() - 1), out);
- break;
- case LINE:
- parseLine(token.image.substring(1, token.image.length() - 1), out);
- break;
- case POLYGON:
- parsePolygon(token.image.substring(1, token.image.length() - 1), out);
- break;
-
- }
- token = admLexer.next();
- if (token.kind == AdmLexerConstants.CONSTRUCTOR_CLOSE)
- return;
- }
- }
- }
- } catch (Exception e) {
- throw new AsterixException(e);
- }
- throw new AsterixException(mismatchErrorMessage + objectType.getTypeName());
- }
-
- private void parseBoolean(String bool, DataOutput out) throws AsterixException {
- String errorMessage = "This can not be an instance of boolean";
- try {
- if (bool.equals("true"))
- booleanSerde.serialize(ABoolean.TRUE, out);
- else if (bool.equals("false"))
- booleanSerde.serialize(ABoolean.FALSE, out);
- else
- throw new AsterixException(errorMessage);
- } catch (HyracksDataException e) {
- throw new AsterixException(errorMessage);
- }
- }
-
- private void parseInt8(String int8, DataOutput out) throws AsterixException {
- String errorMessage = "This can not be an instance of int8";
- try {
- boolean positive = true;
- byte value = 0;
- int offset = 0;
-
- if (int8.charAt(offset) == '+')
- offset++;
- else if (int8.charAt(offset) == '-') {
- offset++;
- positive = false;
- }
- for (; offset < int8.length(); offset++) {
- if (int8.charAt(offset) >= '0' && int8.charAt(offset) <= '9')
- value = (byte) (value * 10 + int8.charAt(offset) - '0');
- else if (int8.charAt(offset) == 'i' && int8.charAt(offset + 1) == '8'
- && offset + 2 == int8.length())
- break;
- else
- throw new AsterixException(errorMessage);
- }
- if (value < 0)
- throw new AsterixException(errorMessage);
- if (value > 0 && !positive)
- value *= -1;
- aInt8.setValue(value);
- int8Serde.serialize(aInt8, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(errorMessage);
- }
- }
-
- private void parseInt16(String int16, DataOutput out) throws AsterixException {
- String errorMessage = "This can not be an instance of int16";
- try {
- boolean positive = true;
- short value = 0;
- int offset = 0;
-
- if (int16.charAt(offset) == '+')
- offset++;
- else if (int16.charAt(offset) == '-') {
- offset++;
- positive = false;
- }
- for (; offset < int16.length(); offset++) {
- if (int16.charAt(offset) >= '0' && int16.charAt(offset) <= '9')
- value = (short) (value * 10 + int16.charAt(offset) - '0');
- else if (int16.charAt(offset) == 'i' && int16.charAt(offset + 1) == '1'
- && int16.charAt(offset + 2) == '6' && offset + 3 == int16.length())
- break;
- else
- throw new AsterixException(errorMessage);
- }
- if (value < 0)
- throw new AsterixException(errorMessage);
- if (value > 0 && !positive)
- value *= -1;
- aInt16.setValue(value);
- int16Serde.serialize(aInt16, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(errorMessage);
- }
- }
-
- private void parseInt32(String int32, DataOutput out) throws AsterixException {
-
- String errorMessage = "This can not be an instance of int32";
- try {
- boolean positive = true;
- int value = 0;
- int offset = 0;
-
- if (int32.charAt(offset) == '+')
- offset++;
- else if (int32.charAt(offset) == '-') {
- offset++;
- positive = false;
- }
- for (; offset < int32.length(); offset++) {
- if (int32.charAt(offset) >= '0' && int32.charAt(offset) <= '9')
- value = (value * 10 + int32.charAt(offset) - '0');
- else if (int32.charAt(offset) == 'i' && int32.charAt(offset + 1) == '3'
- && int32.charAt(offset + 2) == '2' && offset + 3 == int32.length())
- break;
- else
- throw new AsterixException(errorMessage);
- }
- if (value < 0)
- throw new AsterixException(errorMessage);
- if (value > 0 && !positive)
- value *= -1;
-
- aInt32.setValue(value);
- int32Serde.serialize(aInt32, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(errorMessage);
- }
- }
-
- private void parseInt64(String int64, DataOutput out) throws AsterixException {
- String errorMessage = "This can not be an instance of int64";
- try {
- boolean positive = true;
- long value = 0;
- int offset = 0;
-
- if (int64.charAt(offset) == '+')
- offset++;
- else if (int64.charAt(offset) == '-') {
- offset++;
- positive = false;
- }
- for (; offset < int64.length(); offset++) {
- if (int64.charAt(offset) >= '0' && int64.charAt(offset) <= '9')
- value = (value * 10 + int64.charAt(offset) - '0');
- else if (int64.charAt(offset) == 'i' && int64.charAt(offset + 1) == '6'
- && int64.charAt(offset + 2) == '4' && offset + 3 == int64.length())
- break;
- else
- throw new AsterixException(errorMessage);
- }
- if (value < 0)
- throw new AsterixException(errorMessage);
- if (value > 0 && !positive)
- value *= -1;
-
- aInt64.setValue(value);
- int64Serde.serialize(aInt64, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(errorMessage);
- }
- }
-
- private void parsePoint(String point, DataOutput out) throws AsterixException {
- try {
- APointSerializerDeserializer.parse(point, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parsePoint3d(String point3d, DataOutput out) throws AsterixException {
- try {
- APoint3DSerializerDeserializer.parse(point3d, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parseCircle(String circle, DataOutput out) throws AsterixException {
- try {
- ACircleSerializerDeserializer.parse(circle, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parseRectangle(String rectangle, DataOutput out) throws AsterixException {
- try {
- ARectangleSerializerDeserializer.parse(rectangle, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parseLine(String line, DataOutput out) throws AsterixException {
- try {
- ALineSerializerDeserializer.parse(line, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parsePolygon(String polygon, DataOutput out) throws AsterixException, IOException {
- try {
- APolygonSerializerDeserializer.parse(polygon, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parseTime(String time, DataOutput out) throws AsterixException {
- try {
- ATimeSerializerDeserializer.parse(time, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parseDate(String date, DataOutput out) throws AsterixException, IOException {
- try {
- ADateSerializerDeserializer.parse(date, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parseDatetime(String datetime, DataOutput out) throws AsterixException, IOException {
- try {
- ADateTimeSerializerDeserializer.parse(datetime, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parseDuration(String duration, DataOutput out) throws AsterixException {
- try {
- ADurationSerializerDeserializer.parse(duration, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parseTimeInterval(String timeInterval, DataOutput out) throws AsterixException {
- try {
- AIntervalSerializerDeserializer.parseTime(timeInterval, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parseDateInterval(String dateInterval, DataOutput out) throws AsterixException {
- try {
- AIntervalSerializerDeserializer.parseDate(dateInterval, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parseDatetimeInterval(String datetimeInterval, DataOutput out) throws AsterixException {
- try {
- AIntervalSerializerDeserializer.parseDatetime(datetimeInterval, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private IAType getComplexType(IAType aObjectType, ATypeTag tag) {
-
- if (aObjectType == null) {
- return null;
- }
-
- if (aObjectType.getTypeTag() == tag)
- return aObjectType;
-
- if (aObjectType.getTypeTag() == ATypeTag.UNION) {
- unionList = ((AUnionType) aObjectType).getUnionList();
- for (int i = 0; i < unionList.size(); i++)
- if (unionList.get(i).getTypeTag() == tag) {
- return unionList.get(i);
- }
- }
- return null; // wont get here
- }
-
- List<IAType> unionList;
-
- private boolean checkType(ATypeTag expectedTypeTag, IAType aObjectType, DataOutput out) throws IOException {
-
- if (aObjectType == null)
- return true;
-
- if (aObjectType.getTypeTag() != ATypeTag.UNION) {
- if (expectedTypeTag == aObjectType.getTypeTag())
- return true;
- } else { // union
- unionList = ((AUnionType) aObjectType).getUnionList();
- for (int i = 0; i < unionList.size(); i++)
- if (unionList.get(i).getTypeTag() == expectedTypeTag)
- return true;
- }
- return false;
- }
-
- private void parseRecord(ARecordType recType, DataOutput out, Boolean datasetRec) throws IOException,
- AsterixException {
-
- ArrayBackedValueStorage fieldValueBuffer = getTempBuffer();
- ArrayBackedValueStorage fieldNameBuffer = getTempBuffer();
- IARecordBuilder recBuilder = getRecordBuilder();
-
- // Boolean[] nulls = null;
- BitSet nulls = null;
- if (datasetRec) {
- if (recType != null) {
- nulls = new BitSet(recType.getFieldNames().length);
- recBuilder.reset(recType);
- } else
- recBuilder.reset(null);
- } else if (recType != null) {
- nulls = new BitSet(recType.getFieldNames().length);
- recBuilder.reset(recType);
- } else
- recBuilder.reset(null);
-
- recBuilder.init();
- Token token = null;
- boolean inRecord = true;
- boolean expectingRecordField = false;
- boolean first = true;
-
- Boolean openRecordField = false;
- int fieldId = 0;
- IAType fieldType = null;
- do {
- token = nextToken();
- switch (token.kind) {
- case AdmLexerConstants.END_RECORD: {
- if (expectingRecordField) {
- throw new AsterixException("Found END_RECORD while expecting a record field.");
- }
- inRecord = false;
- break;
- }
- case AdmLexerConstants.STRING_LITERAL: {
- // we've read the name of the field
- // now read the content
- fieldNameBuffer.reset();
- fieldValueBuffer.reset();
- expectingRecordField = false;
-
- if (recType != null) {
- String fldName = token.image.substring(1, token.image.length() - 1);
- fieldId = recBuilder.getFieldId(fldName);
- if (fieldId < 0 && !recType.isOpen()) {
- throw new AsterixException("This record is closed, you can not add extra fields !!");
- } else if (fieldId < 0 && recType.isOpen()) {
- aStringFieldName.setValue(token.image.substring(1, token.image.length() - 1));
- stringSerde.serialize(aStringFieldName, fieldNameBuffer.getDataOutput());
- openRecordField = true;
- fieldType = null;
- } else {
- // a closed field
- nulls.set(fieldId);
- fieldType = recType.getFieldTypes()[fieldId];
- openRecordField = false;
- }
- } else {
- aStringFieldName.setValue(token.image.substring(1, token.image.length() - 1));
- stringSerde.serialize(aStringFieldName, fieldNameBuffer.getDataOutput());
- openRecordField = true;
- fieldType = null;
- }
-
- token = nextToken();
- if (token.kind != AdmLexerConstants.COLON) {
- throw new AsterixException("Unexpected ADM token kind: "
- + admLexer.tokenKindToString(token.kind) + " while expecting \":\".");
- }
-
- token = nextToken();
- this.admFromLexerStream(token, fieldType, fieldValueBuffer.getDataOutput(), false);
- if (openRecordField) {
- if (fieldValueBuffer.getByteArray()[0] != ATypeTag.NULL.serialize())
- recBuilder.addField(fieldNameBuffer, fieldValueBuffer);
- } else if (recType.getFieldTypes()[fieldId].getTypeTag() == ATypeTag.UNION) {
- if (NonTaggedFormatUtil.isOptionalField((AUnionType) recType.getFieldTypes()[fieldId])) {
- if (fieldValueBuffer.getByteArray()[0] != ATypeTag.NULL.serialize()) {
- recBuilder.addField(fieldId, fieldValueBuffer);
- }
- }
- } else {
- recBuilder.addField(fieldId, fieldValueBuffer);
- }
-
- break;
- }
- case AdmLexerConstants.COMMA: {
- if (first) {
- throw new AsterixException("Found COMMA before any record field.");
- }
- if (expectingRecordField) {
- throw new AsterixException("Found COMMA while expecting a record field.");
- }
- expectingRecordField = true;
- break;
- }
- default: {
- throw new AsterixException("Unexpected ADM token kind: "
- + admLexer.tokenKindToString(token.kind) + " while parsing record fields.");
- }
- }
- first = false;
- } while (inRecord);
-
- if (recType != null) {
- nullableFieldId = checkNullConstraints(recType, nulls);
- if (nullableFieldId != -1)
- throw new AsterixException("Field " + nullableFieldId + " can not be null");
- }
- recBuilder.write(out, true);
- returnRecordBuilder(recBuilder);
- returnTempBuffer(fieldNameBuffer);
- returnTempBuffer(fieldValueBuffer);
- }
-
- private int checkNullConstraints(ARecordType recType, BitSet nulls) {
-
- boolean isNull = false;
- for (int i = 0; i < recType.getFieldTypes().length; i++)
- if (nulls.get(i) == false) {
- IAType type = recType.getFieldTypes()[i];
- if (type.getTypeTag() != ATypeTag.NULL && type.getTypeTag() != ATypeTag.UNION)
- return i;
-
- if (type.getTypeTag() == ATypeTag.UNION) { // union
- unionList = ((AUnionType) type).getUnionList();
- for (int j = 0; j < unionList.size(); j++)
- if (unionList.get(j).getTypeTag() == ATypeTag.NULL) {
- isNull = true;
- break;
- }
- if (!isNull)
- return i;
- }
- }
- return -1;
- }
-
- private void parseOrderedList(AOrderedListType oltype, DataOutput out) throws IOException, AsterixException {
-
- ArrayBackedValueStorage itemBuffer = getTempBuffer();
- OrderedListBuilder orderedListBuilder = (OrderedListBuilder) getOrderedListBuilder();
-
- IAType itemType = null;
- if (oltype != null)
- itemType = oltype.getItemType();
- orderedListBuilder.reset(oltype);
-
- Token token = null;
- boolean inList = true;
- boolean expectingListItem = false;
- boolean first = true;
- do {
- token = nextToken();
- if (token.kind == AdmLexerConstants.END_ORDERED_LIST) {
- if (expectingListItem) {
- throw new AsterixException("Found END_COLLECTION while expecting a list item.");
- }
- inList = false;
- } else if (token.kind == AdmLexerConstants.COMMA) {
- if (first) {
- throw new AsterixException("Found COMMA before any list item.");
- }
- if (expectingListItem) {
- throw new AsterixException("Found COMMA while expecting a list item.");
- }
- expectingListItem = true;
- } else {
- expectingListItem = false;
- itemBuffer.reset();
-
- admFromLexerStream(token, itemType, itemBuffer.getDataOutput(), false);
- orderedListBuilder.addItem(itemBuffer);
- }
- first = false;
- } while (inList);
- orderedListBuilder.write(out, true);
- returnOrderedListBuilder(orderedListBuilder);
- returnTempBuffer(itemBuffer);
- }
-
- private void parseUnorderedList(AUnorderedListType uoltype, DataOutput out) throws IOException,
- AsterixException {
-
- ArrayBackedValueStorage itemBuffer = getTempBuffer();
- UnorderedListBuilder unorderedListBuilder = (UnorderedListBuilder) getUnorderedListBuilder();
-
- IAType itemType = null;
-
- if (uoltype != null)
- itemType = uoltype.getItemType();
- unorderedListBuilder.reset(uoltype);
-
- Token token = null;
- boolean inList = true;
- boolean expectingListItem = false;
- boolean first = true;
- do {
- token = nextToken();
- if (token.kind == AdmLexerConstants.END_UNORDERED_LIST) {
- if (expectingListItem) {
- throw new AsterixException("Found END_COLLECTION while expecting a list item.");
- }
- inList = false;
- } else if (token.kind == AdmLexerConstants.COMMA) {
- if (first) {
- throw new AsterixException("Found COMMA before any list item.");
- }
- if (expectingListItem) {
- throw new AsterixException("Found COMMA while expecting a list item.");
- }
- expectingListItem = true;
- } else {
- expectingListItem = false;
- itemBuffer.reset();
- admFromLexerStream(token, itemType, itemBuffer.getDataOutput(), false);
- unorderedListBuilder.addItem(itemBuffer);
- }
- first = false;
- } while (inList);
- unorderedListBuilder.write(out, true);
- returnUnorderedListBuilder(unorderedListBuilder);
- returnTempBuffer(itemBuffer);
- }
-
- private Token nextToken() throws AsterixException {
- try {
- return admLexer.next();
- } catch (ParseException pe) {
- throw new AsterixException(pe);
- }
- }
-
- private IARecordBuilder getRecordBuilder() {
- RecordBuilder recBuilder = (RecordBuilder) recordBuilderPool.poll();
- if (recBuilder != null)
- return recBuilder;
- else
- return new RecordBuilder();
- }
-
- private void returnRecordBuilder(IARecordBuilder recBuilder) {
- this.recordBuilderPool.add(recBuilder);
- }
-
- private IAOrderedListBuilder getOrderedListBuilder() {
- OrderedListBuilder orderedListBuilder = (OrderedListBuilder) orderedListBuilderPool.poll();
- if (orderedListBuilder != null)
- return orderedListBuilder;
- else
- return new OrderedListBuilder();
- }
-
- private void returnOrderedListBuilder(IAOrderedListBuilder orderedListBuilder) {
- this.orderedListBuilderPool.add(orderedListBuilder);
- }
-
- private IAUnorderedListBuilder getUnorderedListBuilder() {
- UnorderedListBuilder unorderedListBuilder = (UnorderedListBuilder) unorderedListBuilderPool.poll();
- if (unorderedListBuilder != null)
- return unorderedListBuilder;
- else
- return new UnorderedListBuilder();
- }
-
- private void returnUnorderedListBuilder(IAUnorderedListBuilder unorderedListBuilder) {
- this.unorderedListBuilderPool.add(unorderedListBuilder);
- }
-
- private ArrayBackedValueStorage getTempBuffer() {
- ArrayBackedValueStorage tmpBaaos = baaosPool.poll();
- if (tmpBaaos != null) {
- return tmpBaaos;
- } else {
- return new ArrayBackedValueStorage();
- }
- }
-
- private void returnTempBuffer(ArrayBackedValueStorage tempBaaos) {
- baaosPool.add(tempBaaos);
- }
- };
+ return new AdmTupleParser(ctx, recType);
}
+
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmTupleParser.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmTupleParser.java
index 96540c3..9be4c00 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmTupleParser.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmTupleParser.java
@@ -1,1047 +1,35 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package edu.uci.ics.asterix.runtime.operators.file;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.ByteBuffer;
-import java.util.ArrayDeque;
-import java.util.BitSet;
-import java.util.List;
-import java.util.Queue;
-
-import edu.uci.ics.asterix.adm.parser.nontagged.AdmLexer;
-import edu.uci.ics.asterix.adm.parser.nontagged.AdmLexerConstants;
-import edu.uci.ics.asterix.adm.parser.nontagged.ParseException;
-import edu.uci.ics.asterix.adm.parser.nontagged.Token;
-import edu.uci.ics.asterix.builders.IAOrderedListBuilder;
-import edu.uci.ics.asterix.builders.IARecordBuilder;
-import edu.uci.ics.asterix.builders.IAUnorderedListBuilder;
-import edu.uci.ics.asterix.builders.OrderedListBuilder;
-import edu.uci.ics.asterix.builders.RecordBuilder;
-import edu.uci.ics.asterix.builders.UnorderedListBuilder;
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ACircleSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADateSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADateTimeSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ALineSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APoint3DSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APointSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APolygonSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ARectangleSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ATimeSerializerDeserializer;
-import edu.uci.ics.asterix.om.base.ABoolean;
-import edu.uci.ics.asterix.om.base.ANull;
-import edu.uci.ics.asterix.om.types.AOrderedListType;
import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.AUnionType;
-import edu.uci.ics.asterix.om.types.AUnorderedListType;
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
-import edu.uci.ics.hyracks.api.comm.IFrameWriter;
import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.FrameTupleAppender;
-import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
-public class AdmTupleParser extends AbstractTupleParser {
+/**
+ * An extension of AbstractTupleParser that provides functionality for
+ * parsing delimited files.
+ */
+public class AdmTupleParser extends AbstractTupleParser {
- protected AdmLexer admLexer;
- protected ArrayTupleBuilder tb = new ArrayTupleBuilder(1);
- protected DataOutput dos = tb.getDataOutput();
- protected final FrameTupleAppender appender;
- protected final ByteBuffer frame;
- protected final ARecordType recType;
+ public AdmTupleParser(IHyracksTaskContext ctx, ARecordType recType) {
+ super(ctx, recType);
+ }
- private int nullableFieldId = 0;
-
- private Queue<ArrayBackedValueStorage> baaosPool = new ArrayDeque<ArrayBackedValueStorage>();
- private Queue<IARecordBuilder> recordBuilderPool = new ArrayDeque<IARecordBuilder>();
- private Queue<IAOrderedListBuilder> orderedListBuilderPool = new ArrayDeque<IAOrderedListBuilder>();
- private Queue<IAUnorderedListBuilder> unorderedListBuilderPool = new ArrayDeque<IAUnorderedListBuilder>();
-
- private String mismatchErrorMessage = "Mismatch Type, expecting a value of type ";
-
-
- public AdmTupleParser(IHyracksTaskContext ctx, ARecordType recType) {
- appender = new FrameTupleAppender(ctx.getFrameSize());
- frame = ctx.allocateFrame();
- this.recType = recType;
-
- }
-
- @Override
- public void parse(InputStream in, IFrameWriter writer)
- throws HyracksDataException {
- admLexer = new AdmLexer(in);
- appender.reset(frame, true);
- int tupleNum = 0;
- try {
- while (true) {
- tb.reset();
- if (!parseAdmInstance(recType, true, dos)) {
- break;
- }
- tb.addFieldEndOffset();
- if (!appender.append(tb.getFieldEndOffsets(),
- tb.getByteArray(), 0, tb.getSize())) {
- FrameUtils.flushFrame(frame, writer);
- appender.reset(frame, true);
- if (!appender.append(tb.getFieldEndOffsets(),
- tb.getByteArray(), 0, tb.getSize())) {
- throw new IllegalStateException();
- }
- }
- tupleNum++;
- }
- if (appender.getTupleCount() > 0) {
- FrameUtils.flushFrame(frame, writer);
- }
- } catch (AsterixException ae) {
- throw new HyracksDataException(ae);
- } catch (IOException ioe) {
- throw new HyracksDataException(ioe);
- }
- }
-
- protected boolean parseAdmInstance(IAType objectType, Boolean datasetRec,
- DataOutput out) throws AsterixException, IOException {
- Token token;
- try {
- token = admLexer.next();
- } catch (ParseException pe) {
- throw new AsterixException(pe);
- }
- if (token.kind == AdmLexerConstants.EOF) {
- return false;
- } else {
- admFromLexerStream(token, objectType, out, datasetRec);
- return true;
- }
- }
-
- private void admFromLexerStream(Token token, IAType objectType,
- DataOutput out, Boolean datasetRec) throws AsterixException,
- IOException {
-
- switch (token.kind) {
- case AdmLexerConstants.NULL_LITERAL: {
- if (checkType(ATypeTag.NULL, objectType, out)) {
- nullSerde.serialize(ANull.NULL, out);
- } else
- throw new AsterixException(" This field can not be null ");
- break;
- }
- case AdmLexerConstants.TRUE_LITERAL: {
- if (checkType(ATypeTag.BOOLEAN, objectType, out)) {
- booleanSerde.serialize(ABoolean.TRUE, out);
- } else
- throw new AsterixException(mismatchErrorMessage
- + objectType.getTypeName());
- break;
- }
- case AdmLexerConstants.BOOLEAN_CONS: {
- parseConstructor(ATypeTag.BOOLEAN, objectType, out);
- break;
- }
- case AdmLexerConstants.FALSE_LITERAL: {
- if (checkType(ATypeTag.BOOLEAN, objectType, out)) {
- booleanSerde.serialize(ABoolean.FALSE, out);
- } else
- throw new AsterixException(mismatchErrorMessage
- + objectType.getTypeName());
- break;
- }
- case AdmLexerConstants.DOUBLE_LITERAL: {
- if (checkType(ATypeTag.DOUBLE, objectType, out)) {
- aDouble.setValue(Double.parseDouble(token.image));
- doubleSerde.serialize(aDouble, out);
- } else
- throw new AsterixException(mismatchErrorMessage
- + objectType.getTypeName());
- break;
- }
- case AdmLexerConstants.DOUBLE_CONS: {
- parseConstructor(ATypeTag.DOUBLE, objectType, out);
- break;
- }
- case AdmLexerConstants.FLOAT_LITERAL: {
- if (checkType(ATypeTag.FLOAT, objectType, out)) {
- aFloat.setValue(Float.parseFloat(token.image));
- floatSerde.serialize(aFloat, out);
- } else
- throw new AsterixException(mismatchErrorMessage
- + objectType.getTypeName());
- break;
- }
- case AdmLexerConstants.FLOAT_CONS: {
- parseConstructor(ATypeTag.FLOAT, objectType, out);
- break;
- }
- case AdmLexerConstants.INT8_LITERAL: {
- if (checkType(ATypeTag.INT8, objectType, out)) {
- parseInt8(token.image, out);
- } else
- throw new AsterixException(mismatchErrorMessage
- + objectType.getTypeName());
- break;
- }
- case AdmLexerConstants.INT8_CONS: {
- parseConstructor(ATypeTag.INT8, objectType, out);
- break;
- }
- case AdmLexerConstants.INT16_LITERAL: {
- if (checkType(ATypeTag.INT16, objectType, out)) {
- parseInt16(token.image, out);
- } else
- throw new AsterixException(mismatchErrorMessage
- + objectType.getTypeName());
- break;
- }
- case AdmLexerConstants.INT16_CONS: {
- parseConstructor(ATypeTag.INT16, objectType, out);
- break;
- }
- case AdmLexerConstants.INT_LITERAL:
- case AdmLexerConstants.INT32_LITERAL: {
- if (checkType(ATypeTag.INT32, objectType, out)) {
- parseInt32(token.image, out);
- } else
- throw new AsterixException(mismatchErrorMessage
- + objectType.getTypeName());
- break;
- }
- case AdmLexerConstants.INT32_CONS: {
- parseConstructor(ATypeTag.INT32, objectType, out);
- break;
- }
- case AdmLexerConstants.INT64_LITERAL: {
- if (checkType(ATypeTag.INT64, objectType, out)) {
- parseInt64(token.image, out);
- } else
- throw new AsterixException(mismatchErrorMessage
- + objectType.getTypeName());
- break;
- }
- case AdmLexerConstants.INT64_CONS: {
- parseConstructor(ATypeTag.INT64, objectType, out);
- break;
- }
- case AdmLexerConstants.STRING_LITERAL: {
- if (checkType(ATypeTag.STRING, objectType, out)) {
- aString.setValue(token.image.substring(1,
- token.image.length() - 1));
- stringSerde.serialize(aString, out);
- } else
- throw new AsterixException(mismatchErrorMessage
- + objectType.getTypeName());
- break;
- }
- case AdmLexerConstants.STRING_CONS: {
- parseConstructor(ATypeTag.STRING, objectType, out);
- break;
- }
- case AdmLexerConstants.DATE_CONS: {
- parseConstructor(ATypeTag.DATE, objectType, out);
- break;
- }
- case AdmLexerConstants.TIME_CONS: {
- parseConstructor(ATypeTag.TIME, objectType, out);
- break;
- }
- case AdmLexerConstants.DATETIME_CONS: {
- parseConstructor(ATypeTag.DATETIME, objectType, out);
- break;
- }
- case AdmLexerConstants.DURATION_CONS: {
- parseConstructor(ATypeTag.DURATION, objectType, out);
- break;
- }
- case AdmLexerConstants.POINT_CONS: {
- parseConstructor(ATypeTag.POINT, objectType, out);
- break;
- }
- case AdmLexerConstants.POINT3D_CONS: {
- parseConstructor(ATypeTag.POINT3D, objectType, out);
- break;
- }
- case AdmLexerConstants.CIRCLE_CONS: {
- parseConstructor(ATypeTag.CIRCLE, objectType, out);
- break;
- }
- case AdmLexerConstants.RECTANGLE_CONS: {
- parseConstructor(ATypeTag.RECTANGLE, objectType, out);
- break;
- }
- case AdmLexerConstants.LINE_CONS: {
- parseConstructor(ATypeTag.LINE, objectType, out);
- break;
- }
- case AdmLexerConstants.POLYGON_CONS: {
- parseConstructor(ATypeTag.POLYGON, objectType, out);
- break;
- }
- case AdmLexerConstants.START_UNORDERED_LIST: {
- if (checkType(ATypeTag.UNORDEREDLIST, objectType, out)) {
- objectType = getComplexType(objectType, ATypeTag.UNORDEREDLIST);
- parseUnorderedList((AUnorderedListType) objectType, out);
- } else
- throw new AsterixException(mismatchErrorMessage
- + objectType.getTypeTag());
- break;
- }
-
- case AdmLexerConstants.START_ORDERED_LIST: {
- if (checkType(ATypeTag.ORDEREDLIST, objectType, out)) {
- objectType = getComplexType(objectType, ATypeTag.ORDEREDLIST);
- parseOrderedList((AOrderedListType) objectType, out);
- } else
- throw new AsterixException(mismatchErrorMessage
- + objectType.getTypeTag());
- break;
- }
- case AdmLexerConstants.START_RECORD: {
- if (checkType(ATypeTag.RECORD, objectType, out)) {
- objectType = getComplexType(objectType, ATypeTag.RECORD);
- parseRecord((ARecordType) objectType, out, datasetRec);
- } else
- throw new AsterixException(mismatchErrorMessage
- + objectType.getTypeTag());
- break;
- }
- case AdmLexerConstants.EOF: {
- break;
- }
- default: {
- throw new AsterixException("Unexpected ADM token kind: "
- + admLexer.tokenKindToString(token.kind) + ".");
- }
- }
- }
-
- private void parseDatetime(String datetime, DataOutput out)
- throws AsterixException, IOException {
- try {
- ADateTimeSerializerDeserializer.parse(datetime, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parseDuration(String duration, DataOutput out)
- throws AsterixException {
- try {
- ADurationSerializerDeserializer.parse(duration, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
-
- }
-
- private IAType getComplexType(IAType aObjectType, ATypeTag tag) {
-
- if (aObjectType == null) {
- return null;
- }
-
- if (aObjectType.getTypeTag() == tag)
- return aObjectType;
-
- if (aObjectType.getTypeTag() == ATypeTag.UNION) {
- unionList = ((AUnionType) aObjectType).getUnionList();
- for (int i = 0; i < unionList.size(); i++)
- if (unionList.get(i).getTypeTag() == tag) {
- return unionList.get(i);
- }
- }
- return null; // wont get here
- }
-
- List<IAType> unionList;
-
- private boolean checkType(ATypeTag expectedTypeTag, IAType aObjectType,
- DataOutput out) throws IOException {
-
- if (aObjectType == null)
- return true;
-
- if (aObjectType.getTypeTag() != ATypeTag.UNION) {
- if (expectedTypeTag == aObjectType.getTypeTag())
- return true;
- } else { // union
- unionList = ((AUnionType) aObjectType).getUnionList();
- for (int i = 0; i < unionList.size(); i++)
- if (unionList.get(i).getTypeTag() == expectedTypeTag)
- return true;
- }
- return false;
- }
-
- private void parseRecord(ARecordType recType, DataOutput out,
- Boolean datasetRec) throws IOException, AsterixException {
-
- ArrayBackedValueStorage fieldValueBuffer = getTempBuffer();
- ArrayBackedValueStorage fieldNameBuffer = getTempBuffer();
- IARecordBuilder recBuilder = getRecordBuilder();
-
- // Boolean[] nulls = null;
- BitSet nulls = null;
- if (datasetRec) {
- if (recType != null) {
- nulls = new BitSet(recType.getFieldNames().length);
- recBuilder.reset(recType);
- } else
- recBuilder.reset(null);
- } else if (recType != null) {
- nulls = new BitSet(recType.getFieldNames().length);
- recBuilder.reset(recType);
- } else
- recBuilder.reset(null);
-
- recBuilder.init();
- Token token = null;
- boolean inRecord = true;
- boolean expectingRecordField = false;
- boolean first = true;
-
- Boolean openRecordField = false;
- int fieldId = 0;
- IAType fieldType = null;
- do {
- token = nextToken();
- switch (token.kind) {
- case AdmLexerConstants.END_RECORD: {
- if (expectingRecordField) {
- throw new AsterixException(
- "Found END_RECORD while expecting a record field.");
- }
- inRecord = false;
- break;
- }
- case AdmLexerConstants.STRING_LITERAL: {
- // we've read the name of the field
- // now read the content
- fieldNameBuffer.reset();
- fieldValueBuffer.reset();
- expectingRecordField = false;
-
- if (recType != null) {
- String fldName = token.image.substring(1,
- token.image.length() - 1);
- fieldId = recBuilder.getFieldId(fldName);
- if (fieldId < 0 && !recType.isOpen()) {
- throw new AsterixException(
- "This record is closed, you can not add extra fields !!");
- } else if (fieldId < 0 && recType.isOpen()) {
- aStringFieldName.setValue(token.image.substring(1,
- token.image.length() - 1));
- stringSerde.serialize(aStringFieldName,
- fieldNameBuffer.getDataOutput());
- openRecordField = true;
- fieldType = null;
- } else {
- // a closed field
- nulls.set(fieldId);
- fieldType = recType.getFieldTypes()[fieldId];
- openRecordField = false;
- }
- } else {
- aStringFieldName.setValue(token.image.substring(1,
- token.image.length() - 1));
- stringSerde.serialize(aStringFieldName,
- fieldNameBuffer.getDataOutput());
- openRecordField = true;
- fieldType = null;
- }
-
- token = nextToken();
- if (token.kind != AdmLexerConstants.COLON) {
- throw new AsterixException("Unexpected ADM token kind: "
- + admLexer.tokenKindToString(token.kind)
- + " while expecting \":\".");
- }
-
- token = nextToken();
- this.admFromLexerStream(token, fieldType,
- fieldValueBuffer.getDataOutput(), false);
- if (openRecordField) {
- if (fieldValueBuffer.getByteArray()[0] != ATypeTag.NULL
- .serialize())
- recBuilder.addField(fieldNameBuffer, fieldValueBuffer);
- } else if (recType.getFieldTypes()[fieldId].getTypeTag() == ATypeTag.UNION) {
- if (NonTaggedFormatUtil
- .isOptionalField((AUnionType) recType
- .getFieldTypes()[fieldId])) {
- if (fieldValueBuffer.getByteArray()[0] != ATypeTag.NULL
- .serialize()) {
- recBuilder.addField(fieldId, fieldValueBuffer);
- }
- }
- } else {
- recBuilder.addField(fieldId, fieldValueBuffer);
- }
-
- break;
- }
- case AdmLexerConstants.COMMA: {
- if (first) {
- throw new AsterixException(
- "Found COMMA before any record field.");
- }
- if (expectingRecordField) {
- throw new AsterixException(
- "Found COMMA while expecting a record field.");
- }
- expectingRecordField = true;
- break;
- }
- default: {
- throw new AsterixException("Unexpected ADM token kind: "
- + admLexer.tokenKindToString(token.kind)
- + " while parsing record fields.");
- }
- }
- first = false;
- } while (inRecord);
-
- if (recType != null) {
- nullableFieldId = checkNullConstraints(recType, nulls);
- if (nullableFieldId != -1)
- throw new AsterixException("Field " + nullableFieldId
- + " can not be null");
- }
- recBuilder.write(out, true);
- returnRecordBuilder(recBuilder);
- returnTempBuffer(fieldNameBuffer);
- returnTempBuffer(fieldValueBuffer);
- }
-
- private int checkNullConstraints(ARecordType recType, BitSet nulls) {
-
- boolean isNull = false;
- for (int i = 0; i < recType.getFieldTypes().length; i++)
- if (nulls.get(i) == false) {
- IAType type = recType.getFieldTypes()[i];
- if (type.getTypeTag() != ATypeTag.NULL
- && type.getTypeTag() != ATypeTag.UNION)
- return i;
-
- if (type.getTypeTag() == ATypeTag.UNION) { // union
- unionList = ((AUnionType) type).getUnionList();
- for (int j = 0; j < unionList.size(); j++)
- if (unionList.get(j).getTypeTag() == ATypeTag.NULL) {
- isNull = true;
- break;
- }
- if (!isNull)
- return i;
- }
- }
- return -1;
- }
-
- private void parseOrderedList(AOrderedListType oltype, DataOutput out)
- throws IOException, AsterixException {
-
- ArrayBackedValueStorage itemBuffer = getTempBuffer();
- OrderedListBuilder orderedListBuilder = (OrderedListBuilder) getOrderedListBuilder();
-
- IAType itemType = null;
- if (oltype != null)
- itemType = oltype.getItemType();
- orderedListBuilder.reset(oltype);
-
- Token token = null;
- boolean inList = true;
- boolean expectingListItem = false;
- boolean first = true;
- do {
- token = nextToken();
- if (token.kind == AdmLexerConstants.END_ORDERED_LIST) {
- if (expectingListItem) {
- throw new AsterixException(
- "Found END_COLLECTION while expecting a list item.");
- }
- inList = false;
- } else if (token.kind == AdmLexerConstants.COMMA) {
- if (first) {
- throw new AsterixException(
- "Found COMMA before any list item.");
- }
- if (expectingListItem) {
- throw new AsterixException(
- "Found COMMA while expecting a list item.");
- }
- expectingListItem = true;
- } else {
- expectingListItem = false;
- itemBuffer.reset();
-
- admFromLexerStream(token, itemType, itemBuffer.getDataOutput(),
- false);
- orderedListBuilder.addItem(itemBuffer);
- }
- first = false;
- } while (inList);
- orderedListBuilder.write(out, true);
- returnOrderedListBuilder(orderedListBuilder);
- returnTempBuffer(itemBuffer);
- }
-
- private void parseUnorderedList(AUnorderedListType uoltype, DataOutput out)
- throws IOException, AsterixException {
-
- ArrayBackedValueStorage itemBuffer = getTempBuffer();
- UnorderedListBuilder unorderedListBuilder = (UnorderedListBuilder) getUnorderedListBuilder();
-
- IAType itemType = null;
-
- if (uoltype != null)
- itemType = uoltype.getItemType();
- unorderedListBuilder.reset(uoltype);
-
- Token token = null;
- boolean inList = true;
- boolean expectingListItem = false;
- boolean first = true;
- do {
- token = nextToken();
- if (token.kind == AdmLexerConstants.END_UNORDERED_LIST) {
- if (expectingListItem) {
- throw new AsterixException(
- "Found END_COLLECTION while expecting a list item.");
- }
- inList = false;
- } else if (token.kind == AdmLexerConstants.COMMA) {
- if (first) {
- throw new AsterixException(
- "Found COMMA before any list item.");
- }
- if (expectingListItem) {
- throw new AsterixException(
- "Found COMMA while expecting a list item.");
- }
- expectingListItem = true;
- } else {
- expectingListItem = false;
- itemBuffer.reset();
- admFromLexerStream(token, itemType, itemBuffer.getDataOutput(),
- false);
- unorderedListBuilder.addItem(itemBuffer);
- }
- first = false;
- } while (inList);
- unorderedListBuilder.write(out, true);
- returnUnorderedListBuilder(unorderedListBuilder);
- returnTempBuffer(itemBuffer);
- }
-
- private Token nextToken() throws AsterixException {
- try {
- return admLexer.next();
- } catch (ParseException pe) {
- throw new AsterixException(pe);
- }
- }
-
- private IARecordBuilder getRecordBuilder() {
- RecordBuilder recBuilder = (RecordBuilder) recordBuilderPool.poll();
- if (recBuilder != null)
- return recBuilder;
- else
- return new RecordBuilder();
- }
-
- private void returnRecordBuilder(IARecordBuilder recBuilder) {
- this.recordBuilderPool.add(recBuilder);
- }
-
- private IAOrderedListBuilder getOrderedListBuilder() {
- OrderedListBuilder orderedListBuilder = (OrderedListBuilder) orderedListBuilderPool
- .poll();
- if (orderedListBuilder != null)
- return orderedListBuilder;
- else
- return new OrderedListBuilder();
- }
-
- private void returnOrderedListBuilder(
- IAOrderedListBuilder orderedListBuilder) {
- this.orderedListBuilderPool.add(orderedListBuilder);
- }
-
- private IAUnorderedListBuilder getUnorderedListBuilder() {
- UnorderedListBuilder unorderedListBuilder = (UnorderedListBuilder) unorderedListBuilderPool
- .poll();
- if (unorderedListBuilder != null)
- return unorderedListBuilder;
- else
- return new UnorderedListBuilder();
- }
-
- private void returnUnorderedListBuilder(
- IAUnorderedListBuilder unorderedListBuilder) {
- this.unorderedListBuilderPool.add(unorderedListBuilder);
- }
-
- private ArrayBackedValueStorage getTempBuffer() {
- ArrayBackedValueStorage tmpBaaos = baaosPool.poll();
- if (tmpBaaos != null) {
- return tmpBaaos;
- } else {
- return new ArrayBackedValueStorage();
- }
- }
-
- private void returnTempBuffer(ArrayBackedValueStorage tempBaaos) {
- baaosPool.add(tempBaaos);
- }
-
- private void parseConstructor(ATypeTag typeTag, IAType objectType,
- DataOutput out) throws AsterixException {
- try {
- Token token = admLexer.next();
- if (token.kind == AdmLexerConstants.CONSTRUCTOR_OPEN) {
- if (checkType(typeTag, objectType, out)) {
- token = admLexer.next();
- if (token.kind == AdmLexerConstants.STRING_LITERAL) {
- switch (typeTag) {
- case BOOLEAN:
- parseBoolean(
- token.image.substring(1,
- token.image.length() - 1), out);
- break;
- case INT8:
- parseInt8(
- token.image.substring(1,
- token.image.length() - 1), out);
- break;
- case INT16:
- parseInt16(
- token.image.substring(1,
- token.image.length() - 1), out);
- break;
- case INT32:
- parseInt32(
- token.image.substring(1,
- token.image.length() - 1), out);
- break;
- case INT64:
- parseInt64(
- token.image.substring(1,
- token.image.length() - 1), out);
- break;
- case FLOAT:
- aFloat.setValue(Float.parseFloat(token.image
- .substring(1, token.image.length() - 1)));
- floatSerde.serialize(aFloat, out);
- break;
- case DOUBLE:
- aDouble.setValue(Double.parseDouble(token.image
- .substring(1, token.image.length() - 1)));
- doubleSerde.serialize(aDouble, out);
- break;
- case STRING:
- aString.setValue(token.image.substring(1,
- token.image.length() - 1));
- stringSerde.serialize(aString, out);
- break;
- case TIME:
- parseTime(
- token.image.substring(1,
- token.image.length() - 1), out);
- break;
- case DATE:
- parseDate(
- token.image.substring(1,
- token.image.length() - 1), out);
- break;
- case DATETIME:
- parseDatetime(
- token.image.substring(1,
- token.image.length() - 1), out);
- break;
- case DURATION:
- parseDuration(
- token.image.substring(1,
- token.image.length() - 1), out);
- break;
- case POINT:
- parsePoint(
- token.image.substring(1,
- token.image.length() - 1), out);
- break;
- case POINT3D:
- parsePoint3d(
- token.image.substring(1,
- token.image.length() - 1), out);
- break;
- case CIRCLE:
- parseCircle(
- token.image.substring(1,
- token.image.length() - 1), out);
- break;
- case RECTANGLE:
- parseRectangle(
- token.image.substring(1,
- token.image.length() - 1), out);
- break;
- case LINE:
- parseLine(
- token.image.substring(1,
- token.image.length() - 1), out);
- break;
- case POLYGON:
- parsePolygon(
- token.image.substring(1,
- token.image.length() - 1), out);
- break;
-
- }
- token = admLexer.next();
- if (token.kind == AdmLexerConstants.CONSTRUCTOR_CLOSE)
- return;
- }
- }
- }
- } catch (Exception e) {
- throw new AsterixException(e);
- }
- throw new AsterixException(mismatchErrorMessage
- + objectType.getTypeName());
- }
-
- private void parseBoolean(String bool, DataOutput out)
- throws AsterixException {
- String errorMessage = "This can not be an instance of boolean";
- try {
- if (bool.equals("true"))
- booleanSerde.serialize(ABoolean.TRUE, out);
- else if (bool.equals("false"))
- booleanSerde.serialize(ABoolean.FALSE, out);
- else
- throw new AsterixException(errorMessage);
- } catch (HyracksDataException e) {
- throw new AsterixException(errorMessage);
- }
- }
-
- private void parseInt8(String int8, DataOutput out) throws AsterixException {
- String errorMessage = "This can not be an instance of int8";
- try {
- boolean positive = true;
- byte value = 0;
- int offset = 0;
-
- if (int8.charAt(offset) == '+')
- offset++;
- else if (int8.charAt(offset) == '-') {
- offset++;
- positive = false;
- }
- for (; offset < int8.length(); offset++) {
- if (int8.charAt(offset) >= '0' && int8.charAt(offset) <= '9')
- value = (byte) (value * 10 + int8.charAt(offset) - '0');
- else if (int8.charAt(offset) == 'i'
- && int8.charAt(offset + 1) == '8'
- && offset + 2 == int8.length())
- break;
- else
- throw new AsterixException(errorMessage);
- }
- if (value < 0)
- throw new AsterixException(errorMessage);
- if (value > 0 && !positive)
- value *= -1;
- aInt8.setValue(value);
- int8Serde.serialize(aInt8, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(errorMessage);
- }
- }
-
- private void parseInt16(String int16, DataOutput out)
- throws AsterixException {
- String errorMessage = "This can not be an instance of int16";
- try {
- boolean positive = true;
- short value = 0;
- int offset = 0;
-
- if (int16.charAt(offset) == '+')
- offset++;
- else if (int16.charAt(offset) == '-') {
- offset++;
- positive = false;
- }
- for (; offset < int16.length(); offset++) {
- if (int16.charAt(offset) >= '0' && int16.charAt(offset) <= '9')
- value = (short) (value * 10 + int16.charAt(offset) - '0');
- else if (int16.charAt(offset) == 'i'
- && int16.charAt(offset + 1) == '1'
- && int16.charAt(offset + 2) == '6'
- && offset + 3 == int16.length())
- break;
- else
- throw new AsterixException(errorMessage);
- }
- if (value < 0)
- throw new AsterixException(errorMessage);
- if (value > 0 && !positive)
- value *= -1;
- aInt16.setValue(value);
- int16Serde.serialize(aInt16, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(errorMessage);
- }
- }
-
- private void parseInt32(String int32, DataOutput out)
- throws AsterixException {
-
- String errorMessage = "This can not be an instance of int32";
- try {
- boolean positive = true;
- int value = 0;
- int offset = 0;
-
- if (int32.charAt(offset) == '+')
- offset++;
- else if (int32.charAt(offset) == '-') {
- offset++;
- positive = false;
- }
- for (; offset < int32.length(); offset++) {
- if (int32.charAt(offset) >= '0' && int32.charAt(offset) <= '9')
- value = (value * 10 + int32.charAt(offset) - '0');
- else if (int32.charAt(offset) == 'i'
- && int32.charAt(offset + 1) == '3'
- && int32.charAt(offset + 2) == '2'
- && offset + 3 == int32.length())
- break;
- else
- throw new AsterixException(errorMessage);
- }
- if (value < 0)
- throw new AsterixException(errorMessage);
- if (value > 0 && !positive)
- value *= -1;
-
- aInt32.setValue(value);
- int32Serde.serialize(aInt32, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(errorMessage);
- }
- }
-
- private void parseInt64(String int64, DataOutput out)
- throws AsterixException {
- String errorMessage = "This can not be an instance of int64";
- try {
- boolean positive = true;
- long value = 0;
- int offset = 0;
-
- if (int64.charAt(offset) == '+')
- offset++;
- else if (int64.charAt(offset) == '-') {
- offset++;
- positive = false;
- }
- for (; offset < int64.length(); offset++) {
- if (int64.charAt(offset) >= '0' && int64.charAt(offset) <= '9')
- value = (value * 10 + int64.charAt(offset) - '0');
- else if (int64.charAt(offset) == 'i'
- && int64.charAt(offset + 1) == '6'
- && int64.charAt(offset + 2) == '4'
- && offset + 3 == int64.length())
- break;
- else
- throw new AsterixException(errorMessage);
- }
- if (value < 0)
- throw new AsterixException(errorMessage);
- if (value > 0 && !positive)
- value *= -1;
-
- aInt64.setValue(value);
- int64Serde.serialize(aInt64, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(errorMessage);
- }
- }
-
- private void parsePoint(String point, DataOutput out)
- throws AsterixException {
- try {
- APointSerializerDeserializer.parse(point, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parsePoint3d(String point3d, DataOutput out)
- throws AsterixException {
- try {
- APoint3DSerializerDeserializer.parse(point3d, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parseCircle(String circle, DataOutput out)
- throws AsterixException {
- try {
- ACircleSerializerDeserializer.parse(circle, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parseRectangle(String rectangle, DataOutput out)
- throws AsterixException {
- try {
- ARectangleSerializerDeserializer.parse(rectangle, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parseLine(String line, DataOutput out) throws AsterixException {
- try {
- ALineSerializerDeserializer.parse(line, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parsePolygon(String polygon, DataOutput out)
- throws AsterixException, IOException {
- try {
- APolygonSerializerDeserializer.parse(polygon, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parseTime(String time, DataOutput out) throws AsterixException {
- try {
- ATimeSerializerDeserializer.parse(time, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
-
- private void parseDate(String date, DataOutput out)
- throws AsterixException, IOException {
- try {
- ADateSerializerDeserializer.parse(date, out);
- } catch (HyracksDataException e) {
- throw new AsterixException(e);
- }
- }
+ @Override
+ public IDataParser getDataParser() {
+ return new ADMDataParser();
+ }
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/DelimitedDataParser.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/DelimitedDataParser.java
new file mode 100644
index 0000000..c9560fe
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/DelimitedDataParser.java
@@ -0,0 +1,326 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.runtime.operators.file;
+
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.Arrays;
+
+import edu.uci.ics.asterix.builders.IARecordBuilder;
+import edu.uci.ics.asterix.builders.RecordBuilder;
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.base.AMutableString;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParser;
+import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParserFactory;
+
+public class DelimitedDataParser extends AbstractDataParser implements IDataParser {
+
+ protected final IValueParserFactory[] valueParserFactories;
+ protected final char fieldDelimiter;
+ protected final ARecordType recordType;
+
+ private IARecordBuilder recBuilder;
+ private ArrayBackedValueStorage fieldValueBuffer;
+ private DataOutput fieldValueBufferOutput;
+ private IValueParser[] valueParsers;
+ private FieldCursor cursor;
+ private byte[] fieldTypeTags;
+ private int[] fldIds;
+ private ArrayBackedValueStorage[] nameBuffers;
+
+ public DelimitedDataParser(ARecordType recordType, IValueParserFactory[] valueParserFactories, char fieldDelimter) {
+ this.recordType = recordType;
+ this.valueParserFactories = valueParserFactories;
+ this.fieldDelimiter = fieldDelimter;
+ }
+
+ @Override
+ public void initialize(InputStream in, ARecordType recordType, boolean datasetRec) throws AsterixException,
+ IOException {
+
+ valueParsers = new IValueParser[valueParserFactories.length];
+ for (int i = 0; i < valueParserFactories.length; ++i) {
+ valueParsers[i] = valueParserFactories[i].createValueParser();
+ }
+
+ fieldValueBuffer = new ArrayBackedValueStorage();
+ fieldValueBufferOutput = fieldValueBuffer.getDataOutput();
+ recBuilder = new RecordBuilder();
+ recBuilder.reset(recordType);
+ recBuilder.init();
+
+ int n = recordType.getFieldNames().length;
+ fieldTypeTags = new byte[n];
+ for (int i = 0; i < n; i++) {
+ ATypeTag tag = recordType.getFieldTypes()[i].getTypeTag();
+ fieldTypeTags[i] = tag.serialize();
+ }
+
+ fldIds = new int[n];
+ nameBuffers = new ArrayBackedValueStorage[n];
+ AMutableString str = new AMutableString(null);
+ for (int i = 0; i < n; i++) {
+ String name = recordType.getFieldNames()[i];
+ fldIds[i] = recBuilder.getFieldId(name);
+ if (fldIds[i] < 0) {
+ if (!recordType.isOpen()) {
+ throw new HyracksDataException("Illegal field " + name + " in closed type " + recordType);
+ } else {
+ nameBuffers[i] = new ArrayBackedValueStorage();
+ fieldNameToBytes(name, str, nameBuffers[i]);
+ }
+ }
+ }
+
+ cursor = new FieldCursor(new InputStreamReader(in));
+
+ }
+
+ @Override
+ public boolean parse(DataOutput out) throws AsterixException, IOException {
+
+ if (cursor.nextRecord()) {
+ recBuilder.reset(recordType);
+ recBuilder.init();
+ for (int i = 0; i < valueParsers.length; ++i) {
+ if (!cursor.nextField()) {
+ break;
+ }
+ fieldValueBuffer.reset();
+ fieldValueBufferOutput.writeByte(fieldTypeTags[i]);
+ valueParsers[i]
+ .parse(cursor.buffer, cursor.fStart, cursor.fEnd - cursor.fStart, fieldValueBufferOutput);
+ if (fldIds[i] < 0) {
+ recBuilder.addField(nameBuffers[i], fieldValueBuffer);
+ } else {
+ recBuilder.addField(fldIds[i], fieldValueBuffer);
+ }
+ }
+ recBuilder.write(out, true);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ protected void fieldNameToBytes(String fieldName, AMutableString str, ArrayBackedValueStorage buffer)
+ throws HyracksDataException {
+ buffer.reset();
+ DataOutput out = buffer.getDataOutput();
+ str.setValue(fieldName);
+ try {
+ stringSerde.serialize(str, out);
+ } catch (IOException e) {
+ throw new HyracksDataException(e);
+ }
+ }
+
+ protected enum State {
+ INIT,
+ IN_RECORD,
+ EOR,
+ CR,
+ EOF
+ }
+
+ protected class FieldCursor {
+ private static final int INITIAL_BUFFER_SIZE = 4096;
+ private static final int INCREMENT = 4096;
+
+ private final Reader in;
+
+ private char[] buffer;
+ private int start;
+ private int end;
+ private State state;
+
+ private int fStart;
+ private int fEnd;
+
+ public FieldCursor(Reader in) {
+ this.in = in;
+ buffer = new char[INITIAL_BUFFER_SIZE];
+ start = 0;
+ end = 0;
+ state = State.INIT;
+ }
+
+ public boolean nextRecord() throws IOException {
+ while (true) {
+ switch (state) {
+ case INIT:
+ boolean eof = !readMore();
+ if (eof) {
+ state = State.EOF;
+ return false;
+ } else {
+ state = State.IN_RECORD;
+ return true;
+ }
+
+ case IN_RECORD:
+ int p = start;
+ while (true) {
+ if (p >= end) {
+ int s = start;
+ eof = !readMore();
+ if (eof) {
+ state = State.EOF;
+ return start < end;
+ }
+ p -= (s - start);
+ }
+ char ch = buffer[p];
+ if (ch == '\n') {
+ start = p + 1;
+ state = State.EOR;
+ break;
+ } else if (ch == '\r') {
+ start = p + 1;
+ state = State.CR;
+ break;
+ }
+ ++p;
+ }
+ break;
+
+ case CR:
+ if (start >= end) {
+ eof = !readMore();
+ if (eof) {
+ state = State.EOF;
+ return false;
+ }
+ }
+ char ch = buffer[start];
+ if (ch == '\n') {
+ ++start;
+ state = State.EOR;
+ } else {
+ state = State.IN_RECORD;
+ return true;
+ }
+
+ case EOR:
+ if (start >= end) {
+ eof = !readMore();
+ if (eof) {
+ state = State.EOF;
+ return false;
+ }
+ }
+ state = State.IN_RECORD;
+ return start < end;
+
+ case EOF:
+ return false;
+ }
+ }
+ }
+
+ public boolean nextField() throws IOException {
+ switch (state) {
+ case INIT:
+ case EOR:
+ case EOF:
+ case CR:
+ return false;
+
+ case IN_RECORD:
+ boolean eof;
+ int p = start;
+ while (true) {
+ if (p >= end) {
+ int s = start;
+ eof = !readMore();
+ if (eof) {
+ state = State.EOF;
+ return true;
+ }
+ p -= (s - start);
+ }
+ char ch = buffer[p];
+ if (ch == fieldDelimiter) {
+ fStart = start;
+ fEnd = p;
+ start = p + 1;
+ return true;
+ } else if (ch == '\n') {
+ fStart = start;
+ fEnd = p;
+ start = p + 1;
+ state = State.EOR;
+ return true;
+ } else if (ch == '\r') {
+ fStart = start;
+ fEnd = p;
+ start = p + 1;
+ state = State.CR;
+ return true;
+ }
+ ++p;
+ }
+ }
+ throw new IllegalStateException();
+ }
+
+ protected boolean readMore() throws IOException {
+ if (start > 0) {
+ System.arraycopy(buffer, start, buffer, 0, end - start);
+ }
+ end -= start;
+ start = 0;
+
+ if (end == buffer.length) {
+ buffer = Arrays.copyOf(buffer, buffer.length + INCREMENT);
+ }
+
+ int n = in.read(buffer, end, buffer.length - end);
+ if (n < 0) {
+ return false;
+ }
+ end += n;
+ return true;
+ }
+
+ public int getfStart() {
+ return fStart;
+ }
+
+ public void setfStart(int fStart) {
+ this.fStart = fStart;
+ }
+
+ public int getfEnd() {
+ return fEnd;
+ }
+
+ public void setfEnd(int fEnd) {
+ this.fEnd = fEnd;
+ }
+
+ public char[] getBuffer() {
+ return buffer;
+ }
+ }
+
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/DelimitedDataTupleParser.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/DelimitedDataTupleParser.java
index abd2ade..c029b64 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/DelimitedDataTupleParser.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/DelimitedDataTupleParser.java
@@ -1,331 +1,40 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package edu.uci.ics.asterix.runtime.operators.file;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-
-import edu.uci.ics.asterix.builders.IARecordBuilder;
-import edu.uci.ics.asterix.builders.RecordBuilder;
-import edu.uci.ics.asterix.om.base.AMutableString;
import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.hyracks.api.comm.IFrameWriter;
import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.FrameTupleAppender;
-import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
-import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParser;
import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParserFactory;
+/**
+ * An extension of AbstractTupleParser that provides functionality for
+ * parsing delimited files.
+ */
public class DelimitedDataTupleParser extends AbstractTupleParser {
- protected final IValueParserFactory[] valueParserFactories;
- protected final char fieldDelimiter;
- protected final IHyracksTaskContext ctx;
- protected final ARecordType recType;
- protected ArrayTupleBuilder tb = new ArrayTupleBuilder(1);
- protected DataOutput recDos = tb.getDataOutput();
- protected final FrameTupleAppender appender;
- protected final ByteBuffer frame;
-
+ private final DelimitedDataParser dataParser;
- public DelimitedDataTupleParser(IHyracksTaskContext ctx,
- ARecordType recType, IValueParserFactory[] valueParserFactories,
- char fieldDelimter) {
- this.valueParserFactories = valueParserFactories;
- this.fieldDelimiter = fieldDelimter;
- this.ctx = ctx;
- this.recType = recType;
- appender = new FrameTupleAppender(ctx.getFrameSize());
- frame = ctx.allocateFrame();
- }
+ public DelimitedDataTupleParser(IHyracksTaskContext ctx, ARecordType recType,
+ IValueParserFactory[] valueParserFactories, char fieldDelimter) {
+ super(ctx, recType);
+ dataParser = new DelimitedDataParser(recType, valueParserFactories, fieldDelimter);
+ }
- @Override
- public void parse(InputStream in, IFrameWriter writer)
- throws HyracksDataException {
- try {
- IValueParser[] valueParsers = new IValueParser[valueParserFactories.length];
- for (int i = 0; i < valueParserFactories.length; ++i) {
- valueParsers[i] = valueParserFactories[i].createValueParser();
- }
-
- appender.reset(frame, true);
-
-
- ArrayBackedValueStorage fieldValueBuffer = new ArrayBackedValueStorage();
- DataOutput fieldValueBufferOutput = fieldValueBuffer
- .getDataOutput();
- IARecordBuilder recBuilder = new RecordBuilder();
- recBuilder.reset(recType);
- recBuilder.init();
-
- int n = recType.getFieldNames().length;
- byte[] fieldTypeTags = new byte[n];
- for (int i = 0; i < n; i++) {
- ATypeTag tag = recType.getFieldTypes()[i].getTypeTag();
- fieldTypeTags[i] = tag.serialize();
- }
-
- int[] fldIds = new int[n];
- ArrayBackedValueStorage[] nameBuffers = new ArrayBackedValueStorage[n];
- AMutableString str = new AMutableString(null);
- for (int i = 0; i < n; i++) {
- String name = recType.getFieldNames()[i];
- fldIds[i] = recBuilder.getFieldId(name);
- if (fldIds[i] < 0) {
- if (!recType.isOpen()) {
- throw new HyracksDataException("Illegal field " + name
- + " in closed type " + recType);
- } else {
- nameBuffers[i] = new ArrayBackedValueStorage();
- fieldNameToBytes(name, str, nameBuffers[i]);
- }
- }
- }
-
- FieldCursor cursor = new FieldCursor(new InputStreamReader(in));
- while (cursor.nextRecord()) {
- tb.reset();
- recBuilder.reset(recType);
- recBuilder.init();
-
- for (int i = 0; i < valueParsers.length; ++i) {
- if (!cursor.nextField()) {
- break;
- }
- fieldValueBuffer.reset();
- fieldValueBufferOutput.writeByte(fieldTypeTags[i]);
- valueParsers[i]
- .parse(cursor.buffer, cursor.fStart, cursor.fEnd
- - cursor.fStart, fieldValueBufferOutput);
- if (fldIds[i] < 0) {
- recBuilder.addField(nameBuffers[i], fieldValueBuffer);
- } else {
- recBuilder.addField(fldIds[i], fieldValueBuffer);
- }
- }
- recBuilder.write(recDos, true);
- tb.addFieldEndOffset();
-
- if (!appender.append(tb.getFieldEndOffsets(),
- tb.getByteArray(), 0, tb.getSize())) {
- FrameUtils.flushFrame(frame, writer);
- appender.reset(frame, true);
- if (!appender.append(tb.getFieldEndOffsets(),
- tb.getByteArray(), 0, tb.getSize())) {
- throw new IllegalStateException();
- }
- }
- }
- if (appender.getTupleCount() > 0) {
- FrameUtils.flushFrame(frame, writer);
- }
- } catch (IOException e) {
- throw new HyracksDataException(e);
- }
- }
-
- protected void fieldNameToBytes(String fieldName, AMutableString str,
- ArrayBackedValueStorage buffer) throws HyracksDataException {
- buffer.reset();
- DataOutput out = buffer.getDataOutput();
- str.setValue(fieldName);
- try {
- stringSerde.serialize(str, out);
- } catch (IOException e) {
- throw new HyracksDataException(e);
- }
- }
-
- protected enum State {
- INIT, IN_RECORD, EOR, CR, EOF
- }
-
- protected class FieldCursor {
- private static final int INITIAL_BUFFER_SIZE = 4096;
- private static final int INCREMENT = 4096;
-
- private final Reader in;
-
- private char[] buffer;
- private int start;
- private int end;
- private State state;
-
- private int fStart;
- private int fEnd;
-
- public FieldCursor(Reader in) {
- this.in = in;
- buffer = new char[INITIAL_BUFFER_SIZE];
- start = 0;
- end = 0;
- state = State.INIT;
- }
-
- public boolean nextRecord() throws IOException {
- while (true) {
- switch (state) {
- case INIT:
- boolean eof = !readMore();
- if (eof) {
- state = State.EOF;
- return false;
- } else {
- state = State.IN_RECORD;
- return true;
- }
-
- case IN_RECORD:
- int p = start;
- while (true) {
- if (p >= end) {
- int s = start;
- eof = !readMore();
- if (eof) {
- state = State.EOF;
- return start < end;
- }
- p -= (s - start);
- }
- char ch = buffer[p];
- if (ch == '\n') {
- start = p + 1;
- state = State.EOR;
- break;
- } else if (ch == '\r') {
- start = p + 1;
- state = State.CR;
- break;
- }
- ++p;
- }
- break;
-
- case CR:
- if (start >= end) {
- eof = !readMore();
- if (eof) {
- state = State.EOF;
- return false;
- }
- }
- char ch = buffer[start];
- if (ch == '\n') {
- ++start;
- state = State.EOR;
- } else {
- state = State.IN_RECORD;
- return true;
- }
-
- case EOR:
- if (start >= end) {
- eof = !readMore();
- if (eof) {
- state = State.EOF;
- return false;
- }
- }
- state = State.IN_RECORD;
- return start < end;
-
- case EOF:
- return false;
- }
- }
- }
-
- public boolean nextField() throws IOException {
- switch (state) {
- case INIT:
- case EOR:
- case EOF:
- case CR:
- return false;
-
- case IN_RECORD:
- boolean eof;
- int p = start;
- while (true) {
- if (p >= end) {
- int s = start;
- eof = !readMore();
- if (eof) {
- state = State.EOF;
- return true;
- }
- p -= (s - start);
- }
- char ch = buffer[p];
- if (ch == fieldDelimiter) {
- fStart = start;
- fEnd = p;
- start = p + 1;
- return true;
- } else if (ch == '\n') {
- fStart = start;
- fEnd = p;
- start = p + 1;
- state = State.EOR;
- return true;
- } else if (ch == '\r') {
- fStart = start;
- fEnd = p;
- start = p + 1;
- state = State.CR;
- return true;
- }
- ++p;
- }
- }
- throw new IllegalStateException();
- }
-
- protected boolean readMore() throws IOException {
- if (start > 0) {
- System.arraycopy(buffer, start, buffer, 0, end - start);
- }
- end -= start;
- start = 0;
-
- if (end == buffer.length) {
- buffer = Arrays.copyOf(buffer, buffer.length + INCREMENT);
- }
-
- int n = in.read(buffer, end, buffer.length - end);
- if (n < 0) {
- return false;
- }
- end += n;
- return true;
- }
-
- public int getfStart() {
- return fStart;
- }
-
- public void setfStart(int fStart) {
- this.fStart = fStart;
- }
-
- public int getfEnd() {
- return fEnd;
- }
-
- public void setfEnd(int fEnd) {
- this.fEnd = fEnd;
- }
-
- public char[] getBuffer() {
- return buffer;
- }
- }
+ @Override
+ public IDataParser getDataParser() {
+ return dataParser;
+ }
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/IDataParser.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/IDataParser.java
new file mode 100644
index 0000000..f23aeac
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/IDataParser.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.runtime.operators.file;
+
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.InputStream;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.types.ARecordType;
+
+/**
+ * Interface implemented by a parser
+ */
+public interface IDataParser {
+
+ /**
+ * Initialize the parser prior to actual parsing.
+ *
+ * @param in
+ * input stream to be parsed
+ * @param recordType
+ * record type associated with input data
+ * @param datasetRec
+ * boolean flag set to true if input data represents dataset
+ * records.
+ * @throws AsterixException
+ * @throws IOException
+ */
+ public void initialize(InputStream in, ARecordType recordType, boolean datasetRec) throws AsterixException,
+ IOException;
+
+ /**
+ * Parse data from source input stream and output ADM records.
+ *
+ * @param out
+ * DataOutput instance that for writing the parser output.
+ * @return
+ * @throws AsterixException
+ * @throws IOException
+ */
+ public boolean parse(DataOutput out) throws AsterixException, IOException;
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/NtDelimitedDataTupleParserFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/NtDelimitedDataTupleParserFactory.java
index 3cdf8b9..86fba12 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/NtDelimitedDataTupleParserFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/NtDelimitedDataTupleParserFactory.java
@@ -1,42 +1,34 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package edu.uci.ics.asterix.runtime.operators.file;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-
-import edu.uci.ics.asterix.builders.IARecordBuilder;
-import edu.uci.ics.asterix.builders.RecordBuilder;
-import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
-import edu.uci.ics.asterix.om.base.AMutableString;
-import edu.uci.ics.asterix.om.base.AString;
import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.BuiltinType;
-import edu.uci.ics.hyracks.api.comm.IFrameWriter;
import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.FrameTupleAppender;
-import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
-import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParser;
import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParserFactory;
import edu.uci.ics.hyracks.dataflow.std.file.ITupleParser;
import edu.uci.ics.hyracks.dataflow.std.file.ITupleParserFactory;
+/**
+ * A tuple parser factory for creating a tuple parser capable of parsing
+ * delimited data.
+ */
public class NtDelimitedDataTupleParserFactory implements ITupleParserFactory {
private static final long serialVersionUID = 1L;
protected ARecordType recordType;
protected IValueParserFactory[] valueParserFactories;
protected char fieldDelimiter;
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<AString> stringSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ASTRING);
public NtDelimitedDataTupleParserFactory(ARecordType recordType, IValueParserFactory[] valueParserFactories,
char fieldDelimiter) {
@@ -47,272 +39,7 @@
@Override
public ITupleParser createTupleParser(final IHyracksTaskContext ctx) {
- return new ITupleParser() {
- @Override
- public void parse(InputStream in, IFrameWriter writer) throws HyracksDataException {
- try {
- IValueParser[] valueParsers = new IValueParser[valueParserFactories.length];
- for (int i = 0; i < valueParserFactories.length; ++i) {
- valueParsers[i] = valueParserFactories[i].createValueParser();
- }
- ByteBuffer frame = ctx.allocateFrame();
- FrameTupleAppender appender = new FrameTupleAppender(ctx.getFrameSize());
- appender.reset(frame, true);
- ArrayTupleBuilder tb = new ArrayTupleBuilder(1);
- DataOutput recDos = tb.getDataOutput();
-
- ArrayBackedValueStorage fieldValueBuffer = new ArrayBackedValueStorage();
- DataOutput fieldValueBufferOutput = fieldValueBuffer.getDataOutput();
- IARecordBuilder recBuilder = new RecordBuilder();
- recBuilder.reset(recordType);
- recBuilder.init();
-
- int n = recordType.getFieldNames().length;
- byte[] fieldTypeTags = new byte[n];
- for (int i = 0; i < n; i++) {
- ATypeTag tag = recordType.getFieldTypes()[i].getTypeTag();
- fieldTypeTags[i] = tag.serialize();
- }
-
- int[] fldIds = new int[n];
- ArrayBackedValueStorage[] nameBuffers = new ArrayBackedValueStorage[n];
- AMutableString str = new AMutableString(null);
- for (int i = 0; i < n; i++) {
- String name = recordType.getFieldNames()[i];
- fldIds[i] = recBuilder.getFieldId(name);
- if (fldIds[i] < 0) {
- if (!recordType.isOpen()) {
- throw new HyracksDataException("Illegal field " + name + " in closed type "
- + recordType);
- } else {
- nameBuffers[i] = new ArrayBackedValueStorage();
- fieldNameToBytes(name, str, nameBuffers[i]);
- }
- }
- }
-
- FieldCursor cursor = new FieldCursor(new InputStreamReader(in));
- while (cursor.nextRecord()) {
- tb.reset();
- recBuilder.reset(recordType);
- recBuilder.init();
-
- for (int i = 0; i < valueParsers.length; ++i) {
- if (!cursor.nextField()) {
- break;
- }
- fieldValueBuffer.reset();
- fieldValueBufferOutput.writeByte(fieldTypeTags[i]);
- valueParsers[i].parse(cursor.buffer, cursor.fStart, cursor.fEnd - cursor.fStart,
- fieldValueBufferOutput);
- if (fldIds[i] < 0) {
- recBuilder.addField(nameBuffers[i], fieldValueBuffer);
- } else {
- recBuilder.addField(fldIds[i], fieldValueBuffer);
- }
- }
- recBuilder.write(recDos, true);
- tb.addFieldEndOffset();
-
- if (!appender.append(tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize())) {
- FrameUtils.flushFrame(frame, writer);
- appender.reset(frame, true);
- if (!appender.append(tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize())) {
- throw new IllegalStateException();
- }
- }
- }
- if (appender.getTupleCount() > 0) {
- FrameUtils.flushFrame(frame, writer);
- }
- } catch (IOException e) {
- throw new HyracksDataException(e);
- }
- }
-
- private void fieldNameToBytes(String fieldName, AMutableString str, ArrayBackedValueStorage buffer)
- throws HyracksDataException {
- buffer.reset();
- DataOutput out = buffer.getDataOutput();
- str.setValue(fieldName);
- try {
- stringSerde.serialize(str, out);
- } catch (IOException e) {
- throw new HyracksDataException(e);
- }
- }
-
- };
- }
-
- private enum State {
- INIT,
- IN_RECORD,
- EOR,
- CR,
- EOF
- }
-
- private class FieldCursor {
- private static final int INITIAL_BUFFER_SIZE = 4096;
- private static final int INCREMENT = 4096;
-
- private final Reader in;
-
- private char[] buffer;
- private int start;
- private int end;
- private State state;
-
- private int fStart;
- private int fEnd;
-
- public FieldCursor(Reader in) {
- this.in = in;
- buffer = new char[INITIAL_BUFFER_SIZE];
- start = 0;
- end = 0;
- state = State.INIT;
- }
-
- public boolean nextRecord() throws IOException {
- while (true) {
- switch (state) {
- case INIT:
- boolean eof = !readMore();
- if (eof) {
- state = State.EOF;
- return false;
- } else {
- state = State.IN_RECORD;
- return true;
- }
-
- case IN_RECORD:
- int p = start;
- while (true) {
- if (p >= end) {
- int s = start;
- eof = !readMore();
- if (eof) {
- state = State.EOF;
- return start < end;
- }
- p -= (s - start);
- }
- char ch = buffer[p];
- if (ch == '\n') {
- start = p + 1;
- state = State.EOR;
- break;
- } else if (ch == '\r') {
- start = p + 1;
- state = State.CR;
- break;
- }
- ++p;
- }
- break;
-
- case CR:
- if (start >= end) {
- eof = !readMore();
- if (eof) {
- state = State.EOF;
- return false;
- }
- }
- char ch = buffer[start];
- if (ch == '\n') {
- ++start;
- state = State.EOR;
- } else {
- state = State.IN_RECORD;
- return true;
- }
-
- case EOR:
- if (start >= end) {
- eof = !readMore();
- if (eof) {
- state = State.EOF;
- return false;
- }
- }
- state = State.IN_RECORD;
- return start < end;
-
- case EOF:
- return false;
- }
- }
- }
-
- public boolean nextField() throws IOException {
- switch (state) {
- case INIT:
- case EOR:
- case EOF:
- case CR:
- return false;
-
- case IN_RECORD:
- boolean eof;
- int p = start;
- while (true) {
- if (p >= end) {
- int s = start;
- eof = !readMore();
- if (eof) {
- state = State.EOF;
- return true;
- }
- p -= (s - start);
- }
- char ch = buffer[p];
- if (ch == fieldDelimiter) {
- fStart = start;
- fEnd = p;
- start = p + 1;
- return true;
- } else if (ch == '\n') {
- fStart = start;
- fEnd = p;
- start = p + 1;
- state = State.EOR;
- return true;
- } else if (ch == '\r') {
- fStart = start;
- fEnd = p;
- start = p + 1;
- state = State.CR;
- return true;
- }
- // FIXME incorrect EOF check for temporal delimited file importing
- ++p;
- }
- }
- throw new IllegalStateException();
- }
-
- private boolean readMore() throws IOException {
- if (start > 0) {
- System.arraycopy(buffer, start, buffer, 0, end - start);
- }
- end -= start;
- start = 0;
-
- if (end == buffer.length) {
- buffer = Arrays.copyOf(buffer, buffer.length + INCREMENT);
- }
-
- int n = in.read(buffer, end, buffer.length - end);
- if (n < 0) {
- return false;
- }
- end += n;
- return true;
- }
+ return new DelimitedDataTupleParser(ctx, recordType, valueParserFactories, fieldDelimiter);
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/AFlatValuePointable.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/AFlatValuePointable.java
deleted file mode 100644
index a3547a4..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/AFlatValuePointable.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package edu.uci.ics.asterix.runtime.pointables;
-
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.runtime.pointables.base.IVisitablePointable;
-import edu.uci.ics.asterix.runtime.pointables.visitor.IVisitablePointableVisitor;
-import edu.uci.ics.asterix.runtime.util.container.IObjectFactory;
-import edu.uci.ics.hyracks.data.std.api.IValueReference;
-
-/**
- * This class represents a flat field, e.g., int field, string field, and
- * so on, based on a binary representation.
- */
-public class AFlatValuePointable extends AbstractVisitablePointable {
-
- /**
- * DO NOT allow to create AFlatValuePointable object arbitrarily, force to
- * use object pool based allocator. The factory is not public so that it
- * cannot called in other places than PointableAllocator.
- */
- static IObjectFactory<IVisitablePointable, IAType> FACTORY = new IObjectFactory<IVisitablePointable, IAType>() {
- public AFlatValuePointable create(IAType type) {
- return new AFlatValuePointable();
- }
- };
-
- /**
- * private constructor, to prevent arbitrary creation
- */
- private AFlatValuePointable() {
-
- }
-
- @Override
- public boolean equals(Object o) {
- if (!(o instanceof IValueReference))
- return false;
-
- // get right raw data
- IValueReference ivf = (IValueReference) o;
- byte[] odata = ivf.getByteArray();
- int ostart = ivf.getStartOffset();
- int olen = ivf.getLength();
-
- // get left raw data
- byte[] data = getByteArray();
- int start = getStartOffset();
- int len = getLength();
-
- // bytes length should be equal
- if (len != olen)
- return false;
-
- // check each byte
- for (int i = 0; i < len; i++) {
- if (data[start + i] != odata[ostart + i])
- return false;
- }
- return true;
- }
-
- @Override
- public <R, T> R accept(IVisitablePointableVisitor<R, T> vistor, T tag) throws AsterixException {
- return vistor.visit(this, tag);
- }
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/AListPointable.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/AListPointable.java
deleted file mode 100644
index 6f85694..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/AListPointable.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package edu.uci.ics.asterix.runtime.pointables;
-
-import java.io.DataOutputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.AbstractCollectionType;
-import edu.uci.ics.asterix.om.types.EnumDeserializer;
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
-import edu.uci.ics.asterix.runtime.pointables.base.IVisitablePointable;
-import edu.uci.ics.asterix.runtime.pointables.visitor.IVisitablePointableVisitor;
-import edu.uci.ics.asterix.runtime.util.ResettableByteArrayOutputStream;
-import edu.uci.ics.asterix.runtime.util.container.IObjectFactory;
-
-/**
- * This class interprets the binary data representation of a list, one can
- * call getItems and getItemTags to get pointable objects for items and item
- * type tags.
- *
- */
-public class AListPointable extends AbstractVisitablePointable {
-
- /**
- * DO NOT allow to create AListPointable object arbitrarily, force to use
- * object pool based allocator, in order to have object reuse.
- */
- static IObjectFactory<IVisitablePointable, IAType> FACTORY = new IObjectFactory<IVisitablePointable, IAType>() {
- public IVisitablePointable create(IAType type) {
- return new AListPointable((AbstractCollectionType) type);
- }
- };
-
- private final List<IVisitablePointable> items = new ArrayList<IVisitablePointable>();
- private final List<IVisitablePointable> itemTags = new ArrayList<IVisitablePointable>();
- private final PointableAllocator allocator = new PointableAllocator();
-
- private final ResettableByteArrayOutputStream dataBos = new ResettableByteArrayOutputStream();
- private final DataOutputStream dataDos = new DataOutputStream(dataBos);
-
- private IAType itemType;
- private ATypeTag itemTag;
- private boolean typedItemList = false;
-
- /**
- * private constructor, to prevent constructing it arbitrarily
- *
- * @param inputType
- */
- private AListPointable(AbstractCollectionType inputType) {
- if (inputType != null && inputType.getItemType() != null) {
- itemType = inputType.getItemType();
- if (itemType.getTypeTag() == ATypeTag.ANY) {
- typedItemList = false;
- } else {
- typedItemList = true;
- itemTag = inputType.getItemType().getTypeTag();
- }
- } else {
- this.typedItemList = false;
- }
- }
-
- private void reset() {
- allocator.reset();
- items.clear();
- itemTags.clear();
- dataBos.reset();
- }
-
- @Override
- public void set(byte[] b, int s, int len) {
- reset();
-
- int numberOfitems = AInt32SerializerDeserializer.getInt(b, s + 6);
- int itemOffset;
- if (typedItemList) {
- switch (itemTag) {
- case STRING:
- case RECORD:
- case ORDEREDLIST:
- case UNORDEREDLIST:
- case ANY:
- itemOffset = s + 10 + (numberOfitems * 4);
- break;
- default:
- itemOffset = s + 10;
- }
- } else {
- itemOffset = s + 10 + (numberOfitems * 4);
- }
- int itemLength = 0;
- try {
- if (typedItemList) {
- for (int i = 0; i < numberOfitems; i++) {
- itemLength = NonTaggedFormatUtil.getFieldValueLength(b, itemOffset, itemTag, false);
- IVisitablePointable tag = allocator.allocateEmpty();
- IVisitablePointable item = allocator.allocateFieldValue(itemType);
-
- // set item type tag
- int start = dataBos.size();
- dataDos.writeByte(itemTag.serialize());
- int end = dataBos.size();
- tag.set(dataBos.getByteArray(), start, end - start);
- itemTags.add(tag);
-
- // set item value
- start = dataBos.size();
- dataDos.writeByte(itemTag.serialize());
- dataDos.write(b, itemOffset, itemLength);
- end = dataBos.size();
- item.set(dataBos.getByteArray(), start, end - start);
- itemOffset += itemLength;
- items.add(item);
- }
- } else {
- for (int i = 0; i < numberOfitems; i++) {
- itemTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(b[itemOffset]);
- itemLength = NonTaggedFormatUtil.getFieldValueLength(b, itemOffset, itemTag, true) + 1;
- IVisitablePointable tag = allocator.allocateEmpty();
- IVisitablePointable item = allocator.allocateFieldValue(itemType);
-
- // set item type tag
- int start = dataBos.size();
- dataDos.writeByte(itemTag.serialize());
- int end = dataBos.size();
- tag.set(dataBos.getByteArray(), start, end - start);
- itemTags.add(tag);
-
- // open part field already include the type tag
- item.set(b, itemOffset, itemLength);
- itemOffset += itemLength;
- items.add(item);
- }
- }
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
-
- @Override
- public <R, T> R accept(IVisitablePointableVisitor<R, T> vistor, T tag) throws AsterixException {
- return vistor.visit(this, tag);
- }
-
- public List<IVisitablePointable> getItems() {
- return items;
- }
-
- public List<IVisitablePointable> getItemTags() {
- return itemTags;
- }
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/ARecordPointable.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/ARecordPointable.java
deleted file mode 100644
index 5904170..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/ARecordPointable.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package edu.uci.ics.asterix.runtime.pointables;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.dataflow.data.nontagged.AqlNullWriterFactory;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.AUnionType;
-import edu.uci.ics.asterix.om.types.EnumDeserializer;
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
-import edu.uci.ics.asterix.runtime.pointables.base.IVisitablePointable;
-import edu.uci.ics.asterix.runtime.pointables.visitor.IVisitablePointableVisitor;
-import edu.uci.ics.asterix.runtime.util.ResettableByteArrayOutputStream;
-import edu.uci.ics.asterix.runtime.util.container.IObjectFactory;
-import edu.uci.ics.hyracks.api.dataflow.value.INullWriter;
-
-/**
- * This class interprets the binary data representation of a record. One can
- * call getFieldNames, getFieldTypeTags and getFieldValues to get pointable
- * objects for field names, field type tags, and field values.
- *
- */
-public class ARecordPointable extends AbstractVisitablePointable {
-
- /**
- * DO NOT allow to create ARecordPointable object arbitrarily, force to use
- * object pool based allocator, in order to have object reuse
- */
- static IObjectFactory<IVisitablePointable, IAType> FACTORY = new IObjectFactory<IVisitablePointable, IAType>() {
- public IVisitablePointable create(IAType type) {
- return new ARecordPointable((ARecordType) type);
- }
- };
-
- // access results: field names, field types, and field values
- private final List<IVisitablePointable> fieldNames = new ArrayList<IVisitablePointable>();
- private final List<IVisitablePointable> fieldTypeTags = new ArrayList<IVisitablePointable>();
- private final List<IVisitablePointable> fieldValues = new ArrayList<IVisitablePointable>();
-
- // pointable allocator
- private final PointableAllocator allocator = new PointableAllocator();
-
- private final ResettableByteArrayOutputStream typeBos = new ResettableByteArrayOutputStream();
- private final DataOutputStream typeDos = new DataOutputStream(typeBos);
-
- private final ResettableByteArrayOutputStream dataBos = new ResettableByteArrayOutputStream();
- private final DataOutputStream dataDos = new DataOutputStream(dataBos);
-
- private final ARecordType inputRecType;
-
- private final int numberOfSchemaFields;
- private final int[] fieldOffsets;
- private final IVisitablePointable nullReference = AFlatValuePointable.FACTORY.create(null);
-
- private int closedPartTypeInfoSize = 0;
- private int offsetArrayOffset;
- private ATypeTag typeTag;
-
- /**
- * private constructor, to prevent constructing it arbitrarily
- *
- * @param inputType
- */
- private ARecordPointable(ARecordType inputType) {
- this.inputRecType = inputType;
- IAType[] fieldTypes = inputType.getFieldTypes();
- String[] fieldNameStrs = inputType.getFieldNames();
- numberOfSchemaFields = fieldTypes.length;
-
- // initialize the buffer for closed parts(fieldName bytes+ type bytes) +
- // constant(null bytes)
- typeBos.reset();
- try {
- for (int i = 0; i < numberOfSchemaFields; i++) {
- ATypeTag ftypeTag = fieldTypes[i].getTypeTag();
-
- if (fieldTypes[i].getTypeTag() == ATypeTag.UNION
- && NonTaggedFormatUtil.isOptionalField((AUnionType) fieldTypes[i]))
- // optional field: add the embedded non-null type tag
- ftypeTag = ((AUnionType) fieldTypes[i]).getUnionList()
- .get(NonTaggedFormatUtil.OPTIONAL_TYPE_INDEX_IN_UNION_LIST).getTypeTag();
-
- // add type tag Reference
- int tagStart = typeBos.size();
- typeDos.writeByte(ftypeTag.serialize());
- int tagEnd = typeBos.size();
- IVisitablePointable typeTagReference = AFlatValuePointable.FACTORY.create(null);
- typeTagReference.set(typeBos.getByteArray(), tagStart, tagEnd - tagStart);
- fieldTypeTags.add(typeTagReference);
-
- // add type name Reference (including a astring type tag)
- int nameStart = typeBos.size();
- typeDos.writeByte(ATypeTag.STRING.serialize());
- typeDos.writeUTF(fieldNameStrs[i]);
- int nameEnd = typeBos.size();
- IVisitablePointable typeNameReference = AFlatValuePointable.FACTORY.create(null);
- typeNameReference.set(typeBos.getByteArray(), nameStart, nameEnd - nameStart);
- fieldNames.add(typeNameReference);
- }
-
- // initialize a constant: null value bytes reference
- int nullFieldStart = typeBos.size();
- INullWriter nullWriter = AqlNullWriterFactory.INSTANCE.createNullWriter();
- nullWriter.writeNull(typeDos);
- int nullFieldEnd = typeBos.size();
- nullReference.set(typeBos.getByteArray(), nullFieldStart, nullFieldEnd - nullFieldStart);
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
- closedPartTypeInfoSize = typeBos.size();
- fieldOffsets = new int[numberOfSchemaFields];
- }
-
- private void reset() {
- typeBos.reset(closedPartTypeInfoSize);
- dataBos.reset(0);
- // reset the allocator
- allocator.reset();
-
- // clean up the returned containers
- for (int i = fieldNames.size() - 1; i >= numberOfSchemaFields; i--)
- fieldNames.remove(i);
- for (int i = fieldTypeTags.size() - 1; i >= numberOfSchemaFields; i--)
- fieldTypeTags.remove(i);
- fieldValues.clear();
- }
-
- @Override
- public void set(byte[] b, int start, int len) {
- // clear the previous states
- reset();
- super.set(b, start, len);
-
- boolean isExpanded = false;
- int openPartOffset = 0;
- int s = start;
- int recordOffset = s;
- if (inputRecType == null) {
- openPartOffset = s + AInt32SerializerDeserializer.getInt(b, s + 6);
- s += 8;
- isExpanded = true;
- } else {
- if (inputRecType.isOpen()) {
- isExpanded = b[s + 5] == 1 ? true : false;
- if (isExpanded) {
- openPartOffset = s + AInt32SerializerDeserializer.getInt(b, s + 6);
- s += 10;
- } else {
- s += 6;
- }
- } else {
- s += 5;
- }
- }
- try {
- if (numberOfSchemaFields > 0) {
- s += 4;
- int nullBitMapOffset = 0;
- boolean hasNullableFields = NonTaggedFormatUtil.hasNullableField(inputRecType);
- if (hasNullableFields) {
- nullBitMapOffset = s;
- offsetArrayOffset = s
- + (this.numberOfSchemaFields % 8 == 0 ? numberOfSchemaFields / 8
- : numberOfSchemaFields / 8 + 1);
- } else {
- offsetArrayOffset = s;
- }
- for (int i = 0; i < numberOfSchemaFields; i++) {
- fieldOffsets[i] = AInt32SerializerDeserializer.getInt(b, offsetArrayOffset) + recordOffset;
- offsetArrayOffset += 4;
- }
- for (int fieldNumber = 0; fieldNumber < numberOfSchemaFields; fieldNumber++) {
- if (hasNullableFields) {
- byte b1 = b[nullBitMapOffset + fieldNumber / 8];
- int p = 1 << (7 - (fieldNumber % 8));
- if ((b1 & p) == 0) {
- // set null value (including type tag inside)
- fieldValues.add(nullReference);
- continue;
- }
- }
- IAType[] fieldTypes = inputRecType.getFieldTypes();
- int fieldValueLength = 0;
-
- IAType fieldType = fieldTypes[fieldNumber];
- if (fieldTypes[fieldNumber].getTypeTag() == ATypeTag.UNION) {
- if (NonTaggedFormatUtil.isOptionalField((AUnionType) fieldTypes[fieldNumber])) {
- fieldType = ((AUnionType) fieldTypes[fieldNumber]).getUnionList().get(
- NonTaggedFormatUtil.OPTIONAL_TYPE_INDEX_IN_UNION_LIST);
- typeTag = fieldType.getTypeTag();
- fieldValueLength = NonTaggedFormatUtil.getFieldValueLength(b, fieldOffsets[fieldNumber],
- typeTag, false);
- }
- } else {
- typeTag = fieldTypes[fieldNumber].getTypeTag();
- fieldValueLength = NonTaggedFormatUtil.getFieldValueLength(b, fieldOffsets[fieldNumber],
- typeTag, false);
- }
- // set field value (including the type tag)
- int fstart = dataBos.size();
- dataDos.writeByte(typeTag.serialize());
- dataDos.write(b, fieldOffsets[fieldNumber], fieldValueLength);
- int fend = dataBos.size();
- IVisitablePointable fieldValue = allocator.allocateFieldValue(fieldType);
- fieldValue.set(dataBos.getByteArray(), fstart, fend - fstart);
- fieldValues.add(fieldValue);
- }
- }
- if (isExpanded) {
- int numberOfOpenFields = AInt32SerializerDeserializer.getInt(b, openPartOffset);
- int fieldOffset = openPartOffset + 4 + (8 * numberOfOpenFields);
- for (int i = 0; i < numberOfOpenFields; i++) {
- // set the field name (including a type tag, which is
- // astring)
- int fieldValueLength = NonTaggedFormatUtil.getFieldValueLength(b, fieldOffset, ATypeTag.STRING,
- false);
- int fnstart = dataBos.size();
- dataDos.writeByte(ATypeTag.STRING.serialize());
- dataDos.write(b, fieldOffset, fieldValueLength);
- int fnend = dataBos.size();
- IVisitablePointable fieldName = allocator.allocateEmpty();
- fieldName.set(dataBos.getByteArray(), fnstart, fnend - fnstart);
- fieldNames.add(fieldName);
- fieldOffset += fieldValueLength;
-
- // set the field type tag
- IVisitablePointable fieldTypeTag = allocator.allocateEmpty();
- fieldTypeTag.set(b, fieldOffset, 1);
- fieldTypeTags.add(fieldTypeTag);
- typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(b[fieldOffset]);
-
- // set the field value (already including type tag)
- fieldValueLength = NonTaggedFormatUtil.getFieldValueLength(b, fieldOffset, typeTag, true) + 1;
-
- // allocate
- IVisitablePointable fieldValueAccessor = allocator.allocateFieldValue(typeTag);
- fieldValueAccessor.set(b, fieldOffset, fieldValueLength);
- fieldValues.add(fieldValueAccessor);
- fieldOffset += fieldValueLength;
- }
- }
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
-
- public List<IVisitablePointable> getFieldNames() {
- return fieldNames;
- }
-
- public List<IVisitablePointable> getFieldTypeTags() {
- return fieldTypeTags;
- }
-
- public List<IVisitablePointable> getFieldValues() {
- return fieldValues;
- }
-
- @Override
- public <R, T> R accept(IVisitablePointableVisitor<R, T> vistor, T tag) throws AsterixException {
- return vistor.visit(this, tag);
- }
-
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/AbstractVisitablePointable.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/AbstractVisitablePointable.java
deleted file mode 100644
index 8cfe661..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/AbstractVisitablePointable.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package edu.uci.ics.asterix.runtime.pointables;
-
-import edu.uci.ics.asterix.runtime.pointables.base.IVisitablePointable;
-import edu.uci.ics.hyracks.data.std.api.IValueReference;
-
-/**
- * This class implements several "routine" methods in IVisitablePointable
- * interface, so that subclasses do not need to repeat the same code.
- *
- */
-public abstract class AbstractVisitablePointable implements IVisitablePointable {
-
- private byte[] data;
- private int start;
- private int len;
-
- @Override
- public byte[] getByteArray() {
- return data;
- }
-
- @Override
- public int getLength() {
- return len;
- }
-
- @Override
- public int getStartOffset() {
- return start;
- }
-
- @Override
- public void set(byte[] b, int start, int len) {
- this.data = b;
- this.start = start;
- this.len = len;
- }
-
- @Override
- public void set(IValueReference ivf) {
- set(ivf.getByteArray(), ivf.getStartOffset(), ivf.getLength());
- }
-
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/PointableAllocator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/PointableAllocator.java
deleted file mode 100644
index b6116be..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/PointableAllocator.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package edu.uci.ics.asterix.runtime.pointables;
-
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.runtime.pointables.base.DefaultOpenFieldType;
-import edu.uci.ics.asterix.runtime.pointables.base.IVisitablePointable;
-import edu.uci.ics.asterix.runtime.util.container.IObjectPool;
-import edu.uci.ics.asterix.runtime.util.container.ListObjectPool;
-
-/**
- * This class is the ONLY place to create IVisitablePointable object instances,
- * to enforce use of an object pool.
- */
-public class PointableAllocator {
-
- private IObjectPool<IVisitablePointable, IAType> flatValueAllocator = new ListObjectPool<IVisitablePointable, IAType>(
- AFlatValuePointable.FACTORY);
- private IObjectPool<IVisitablePointable, IAType> recordValueAllocator = new ListObjectPool<IVisitablePointable, IAType>(
- ARecordPointable.FACTORY);
- private IObjectPool<IVisitablePointable, IAType> listValueAllocator = new ListObjectPool<IVisitablePointable, IAType>(
- AListPointable.FACTORY);
-
- public IVisitablePointable allocateEmpty() {
- return flatValueAllocator.allocate(null);
- }
-
- /**
- * allocate closed part value pointable
- *
- * @param type
- * @return the pointable object
- */
- public IVisitablePointable allocateFieldValue(IAType type) {
- if (type == null)
- return flatValueAllocator.allocate(null);
- else if (type.getTypeTag().equals(ATypeTag.RECORD))
- return recordValueAllocator.allocate(type);
- else if (type.getTypeTag().equals(ATypeTag.UNORDEREDLIST) || type.getTypeTag().equals(ATypeTag.ORDEREDLIST))
- return listValueAllocator.allocate(type);
- else
- return flatValueAllocator.allocate(null);
- }
-
- /**
- * allocate open part value pointable
- *
- * @param typeTag
- * @return the pointable object
- */
- public IVisitablePointable allocateFieldValue(ATypeTag typeTag) {
- if (typeTag == null)
- return flatValueAllocator.allocate(null);
- else if (typeTag.equals(ATypeTag.RECORD))
- return recordValueAllocator.allocate(DefaultOpenFieldType.NESTED_OPEN_RECORD_TYPE);
- else if (typeTag.equals(ATypeTag.UNORDEREDLIST))
- return listValueAllocator.allocate(DefaultOpenFieldType.NESTED_OPEN_AUNORDERED_LIST_TYPE);
- else if (typeTag.equals(ATypeTag.ORDEREDLIST))
- return listValueAllocator.allocate(DefaultOpenFieldType.NESTED_OPEN_AORDERED_LIST_TYPE);
- else
- return flatValueAllocator.allocate(null);
- }
-
- public IVisitablePointable allocateListValue(IAType type) {
- return listValueAllocator.allocate(type);
- }
-
- public IVisitablePointable allocateRecordValue(IAType type) {
- return recordValueAllocator.allocate(type);
- }
-
- public void reset() {
- flatValueAllocator.reset();
- recordValueAllocator.reset();
- listValueAllocator.reset();
- }
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/base/DefaultOpenFieldType.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/base/DefaultOpenFieldType.java
deleted file mode 100644
index 987ac02..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/base/DefaultOpenFieldType.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package edu.uci.ics.asterix.runtime.pointables.base;
-
-import edu.uci.ics.asterix.om.types.AOrderedListType;
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.AUnorderedListType;
-import edu.uci.ics.asterix.om.types.BuiltinType;
-import edu.uci.ics.asterix.om.types.IAType;
-
-/**
- * This class serves as the repository for the default record type and list type
- * fields in the open part, e.g., a "record" (nested) field in the open part is
- * always a fully open one, and a "list" field in the open part is always a list
- * of "ANY".
- *
- */
-public class DefaultOpenFieldType {
-
- // nested open field rec type
- public static ARecordType NESTED_OPEN_RECORD_TYPE = new ARecordType("nested-open", new String[] {},
- new IAType[] {}, true);
-
- // nested open list type
- public static AOrderedListType NESTED_OPEN_AORDERED_LIST_TYPE = new AOrderedListType(BuiltinType.ANY,
- "nested-ordered-list");
-
- // nested open list type
- public static AUnorderedListType NESTED_OPEN_AUNORDERED_LIST_TYPE = new AUnorderedListType(BuiltinType.ANY,
- "nested-unordered-list");
-
- public static IAType getDefaultOpenFieldType(ATypeTag tag) {
- if (tag.equals(ATypeTag.RECORD))
- return NESTED_OPEN_RECORD_TYPE;
- if (tag.equals(ATypeTag.ORDEREDLIST))
- return NESTED_OPEN_AORDERED_LIST_TYPE;
- if (tag.equals(ATypeTag.UNORDEREDLIST))
- return NESTED_OPEN_AUNORDERED_LIST_TYPE;
- else
- return null;
- }
-
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/base/IVisitablePointable.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/base/IVisitablePointable.java
deleted file mode 100644
index 28c61c2..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/base/IVisitablePointable.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package edu.uci.ics.asterix.runtime.pointables.base;
-
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.runtime.pointables.visitor.IVisitablePointableVisitor;
-import edu.uci.ics.hyracks.data.std.api.IPointable;
-
-/**
- * This interface extends IPointable with a visitor interface in order to ease
- * programming for recursive record structures.
- */
-public interface IVisitablePointable extends IPointable {
-
- public <R, T> R accept(IVisitablePointableVisitor<R, T> vistor, T tag) throws AsterixException;
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/ACastVisitor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/ACastVisitor.java
deleted file mode 100644
index 822e37c..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/ACastVisitor.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package edu.uci.ics.asterix.runtime.pointables.cast;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.AbstractCollectionType;
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.runtime.pointables.AFlatValuePointable;
-import edu.uci.ics.asterix.runtime.pointables.AListPointable;
-import edu.uci.ics.asterix.runtime.pointables.ARecordPointable;
-import edu.uci.ics.asterix.runtime.pointables.base.IVisitablePointable;
-import edu.uci.ics.asterix.runtime.pointables.visitor.IVisitablePointableVisitor;
-import edu.uci.ics.hyracks.algebricks.common.utils.Triple;
-
-/**
- * This class is a IVisitablePointableVisitor implementation which recursively
- * visit a given record, list or flat value of a given type, and cast it to a
- * specified type. For example:
- *
- * A record { "hobby": {{"music", "coding"}}, "id": "001", "name":
- * "Person Three"} which confirms to closed type ( id: string, name: string,
- * hobby: {{string}}? ) can be casted to a open type (id: string )
- *
- * Since the open/closed part of a record has a completely different underlying
- * memory/storage layout, the visitor will change the layout as specified at
- * runtime.
- */
-public class ACastVisitor implements IVisitablePointableVisitor<Void, Triple<IVisitablePointable, IAType, Boolean>> {
-
- private final Map<IVisitablePointable, ARecordCaster> raccessorToCaster = new HashMap<IVisitablePointable, ARecordCaster>();
- private final Map<IVisitablePointable, AListCaster> laccessorToCaster = new HashMap<IVisitablePointable, AListCaster>();
-
- @Override
- public Void visit(AListPointable accessor, Triple<IVisitablePointable, IAType, Boolean> arg)
- throws AsterixException {
- AListCaster caster = laccessorToCaster.get(accessor);
- if (caster == null) {
- caster = new AListCaster();
- laccessorToCaster.put(accessor, caster);
- }
- try {
- caster.castList(accessor, arg.first, (AbstractCollectionType) arg.second, this);
- } catch (Exception e) {
- throw new AsterixException(e);
- }
- return null;
- }
-
- @Override
- public Void visit(ARecordPointable accessor, Triple<IVisitablePointable, IAType, Boolean> arg)
- throws AsterixException {
- ARecordCaster caster = raccessorToCaster.get(accessor);
- if (caster == null) {
- caster = new ARecordCaster();
- raccessorToCaster.put(accessor, caster);
- }
- try {
- caster.castRecord(accessor, arg.first, (ARecordType) arg.second, this);
- } catch (Exception e) {
- throw new AsterixException(e);
- }
- return null;
- }
-
- @Override
- public Void visit(AFlatValuePointable accessor, Triple<IVisitablePointable, IAType, Boolean> arg) {
- // set the pointer for result
- arg.first.set(accessor);
- return null;
- }
-
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/AListCaster.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/AListCaster.java
deleted file mode 100644
index e10fb72..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/AListCaster.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package edu.uci.ics.asterix.runtime.pointables.cast;
-
-import java.io.DataOutput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.util.List;
-
-import edu.uci.ics.asterix.builders.OrderedListBuilder;
-import edu.uci.ics.asterix.builders.UnorderedListBuilder;
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.om.types.AOrderedListType;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.AUnorderedListType;
-import edu.uci.ics.asterix.om.types.AbstractCollectionType;
-import edu.uci.ics.asterix.om.types.EnumDeserializer;
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.runtime.pointables.AListPointable;
-import edu.uci.ics.asterix.runtime.pointables.PointableAllocator;
-import edu.uci.ics.asterix.runtime.pointables.base.DefaultOpenFieldType;
-import edu.uci.ics.asterix.runtime.pointables.base.IVisitablePointable;
-import edu.uci.ics.asterix.runtime.util.ResettableByteArrayOutputStream;
-import edu.uci.ics.hyracks.algebricks.common.utils.Triple;
-
-/**
- * This class is to do the runtime type cast for a list. It is ONLY visible to
- * ACastVisitor.
- */
-class AListCaster {
- // pointable allocator
- private final PointableAllocator allocator = new PointableAllocator();
-
- // for storing the cast result
- private final IVisitablePointable itemTempReference = allocator.allocateEmpty();
- private final Triple<IVisitablePointable, IAType, Boolean> itemVisitorArg = new Triple<IVisitablePointable, IAType, Boolean>(
- itemTempReference, null, null);
-
- private final UnorderedListBuilder unOrderedListBuilder = new UnorderedListBuilder();
- private final OrderedListBuilder orderedListBuilder = new OrderedListBuilder();
-
- private final ResettableByteArrayOutputStream dataBos = new ResettableByteArrayOutputStream();
- private final DataOutput dataDos = new DataOutputStream(dataBos);
- private IAType reqItemType;
-
- public AListCaster() {
-
- }
-
- public void castList(AListPointable listAccessor, IVisitablePointable resultAccessor,
- AbstractCollectionType reqType, ACastVisitor visitor) throws IOException, AsterixException {
- if (reqType.getTypeTag().equals(ATypeTag.UNORDEREDLIST)) {
- unOrderedListBuilder.reset((AUnorderedListType) reqType);
- }
- if (reqType.getTypeTag().equals(ATypeTag.ORDEREDLIST)) {
- orderedListBuilder.reset((AOrderedListType) reqType);
- }
- dataBos.reset();
-
- List<IVisitablePointable> itemTags = listAccessor.getItemTags();
- List<IVisitablePointable> items = listAccessor.getItems();
-
- int start = dataBos.size();
- for (int i = 0; i < items.size(); i++) {
- IVisitablePointable itemTypeTag = itemTags.get(i);
- IVisitablePointable item = items.get(i);
- ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(itemTypeTag.getByteArray()[itemTypeTag
- .getStartOffset()]);
- if (reqItemType == null || reqItemType.getTypeTag().equals(ATypeTag.ANY)) {
- itemVisitorArg.second = DefaultOpenFieldType.getDefaultOpenFieldType(typeTag);
- item.accept(visitor, itemVisitorArg);
- } else {
- if (typeTag != reqItemType.getTypeTag())
- throw new AsterixException("mismatched item type");
- itemVisitorArg.second = reqItemType;
- item.accept(visitor, itemVisitorArg);
- }
- if (reqType.getTypeTag().equals(ATypeTag.ORDEREDLIST)) {
- orderedListBuilder.addItem(itemVisitorArg.first);
- }
- if (reqType.getTypeTag().equals(ATypeTag.UNORDEREDLIST)) {
- unOrderedListBuilder.addItem(itemVisitorArg.first);
- }
- }
- if (reqType.getTypeTag().equals(ATypeTag.ORDEREDLIST)) {
- orderedListBuilder.write(dataDos, true);
- }
- if (reqType.getTypeTag().equals(ATypeTag.UNORDEREDLIST)) {
- unOrderedListBuilder.write(dataDos, true);
- }
- int end = dataBos.size();
- resultAccessor.set(dataBos.getByteArray(), start, end - start);
- }
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/ARecordCaster.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/ARecordCaster.java
deleted file mode 100644
index 8ef2ef0..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/ARecordCaster.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package edu.uci.ics.asterix.runtime.pointables.cast;
-
-import java.io.DataOutput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import edu.uci.ics.asterix.builders.RecordBuilder;
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.dataflow.data.nontagged.AqlNullWriterFactory;
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.AUnionType;
-import edu.uci.ics.asterix.om.types.EnumDeserializer;
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
-import edu.uci.ics.asterix.runtime.pointables.ARecordPointable;
-import edu.uci.ics.asterix.runtime.pointables.PointableAllocator;
-import edu.uci.ics.asterix.runtime.pointables.base.DefaultOpenFieldType;
-import edu.uci.ics.asterix.runtime.pointables.base.IVisitablePointable;
-import edu.uci.ics.asterix.runtime.util.ResettableByteArrayOutputStream;
-import edu.uci.ics.hyracks.algebricks.common.utils.Triple;
-import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
-import edu.uci.ics.hyracks.api.dataflow.value.INullWriter;
-import edu.uci.ics.hyracks.data.std.accessors.PointableBinaryComparatorFactory;
-import edu.uci.ics.hyracks.data.std.api.IValueReference;
-import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
-
-/**
- * This class is to do the runtime type cast for a record. It is ONLY visible to
- * ACastVisitor.
- */
-class ARecordCaster {
-
- // pointable allocator
- private final PointableAllocator allocator = new PointableAllocator();
-
- private final List<IVisitablePointable> reqFieldNames = new ArrayList<IVisitablePointable>();
- private final List<IVisitablePointable> reqFieldTypeTags = new ArrayList<IVisitablePointable>();
- private ARecordType cachedReqType = null;
-
- private final ResettableByteArrayOutputStream bos = new ResettableByteArrayOutputStream();
- private final DataOutputStream dos = new DataOutputStream(bos);
-
- private final RecordBuilder recBuilder = new RecordBuilder();
- private final IVisitablePointable nullReference = allocator.allocateEmpty();
- private final IVisitablePointable nullTypeTag = allocator.allocateEmpty();
-
- private final IBinaryComparator fieldNameComparator = PointableBinaryComparatorFactory.of(
- UTF8StringPointable.FACTORY).createBinaryComparator();
-
- private final ByteArrayAccessibleOutputStream outputBos = new ByteArrayAccessibleOutputStream();
- private final DataOutputStream outputDos = new DataOutputStream(outputBos);
-
- private final IVisitablePointable fieldTempReference = allocator.allocateEmpty();
- private final Triple<IVisitablePointable, IAType, Boolean> nestedVisitorArg = new Triple<IVisitablePointable, IAType, Boolean>(
- fieldTempReference, null, null);
-
- private int numInputFields = 0;
-
- // describe closed fields in the required type
- private int[] fieldPermutation;
- private boolean[] optionalFields;
-
- // describe fields (open or not) in the input records
- private boolean[] openFields;
- private int[] fieldNamesSortedIndex;
- private int[] reqFieldNamesSortedIndex;
-
- public ARecordCaster() {
- try {
- bos.reset();
- int start = bos.size();
- INullWriter nullWriter = AqlNullWriterFactory.INSTANCE.createNullWriter();
- nullWriter.writeNull(dos);
- int end = bos.size();
- nullReference.set(bos.getByteArray(), start, end - start);
- start = bos.size();
- dos.write(ATypeTag.NULL.serialize());
- end = bos.size();
- nullTypeTag.set(bos.getByteArray(), start, end);
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
- }
-
- public void castRecord(ARecordPointable recordAccessor, IVisitablePointable resultAccessor, ARecordType reqType,
- ACastVisitor visitor) throws IOException, AsterixException {
- List<IVisitablePointable> fieldNames = recordAccessor.getFieldNames();
- List<IVisitablePointable> fieldTypeTags = recordAccessor.getFieldTypeTags();
- List<IVisitablePointable> fieldValues = recordAccessor.getFieldValues();
- numInputFields = fieldNames.size();
-
- if (openFields == null || numInputFields > openFields.length) {
- openFields = new boolean[numInputFields];
- fieldNamesSortedIndex = new int[numInputFields];
- }
- if (cachedReqType == null || !reqType.equals(cachedReqType)) {
- loadRequiredType(reqType);
- }
-
- // clear the previous states
- reset();
- matchClosedPart(fieldNames, fieldTypeTags, fieldValues);
- writeOutput(fieldNames, fieldTypeTags, fieldValues, outputDos, visitor);
- resultAccessor.set(outputBos.getByteArray(), 0, outputBos.size());
- }
-
- private void reset() {
- for (int i = 0; i < numInputFields; i++)
- openFields[i] = true;
- for (int i = 0; i < fieldPermutation.length; i++)
- fieldPermutation[i] = -1;
- for (int i = 0; i < numInputFields; i++)
- fieldNamesSortedIndex[i] = i;
- outputBos.reset();
- }
-
- private void loadRequiredType(ARecordType reqType) throws IOException {
- reqFieldNames.clear();
- reqFieldTypeTags.clear();
-
- cachedReqType = reqType;
- int numSchemaFields = reqType.getFieldTypes().length;
- IAType[] fieldTypes = reqType.getFieldTypes();
- String[] fieldNames = reqType.getFieldNames();
- fieldPermutation = new int[numSchemaFields];
- optionalFields = new boolean[numSchemaFields];
- for (int i = 0; i < optionalFields.length; i++)
- optionalFields[i] = false;
-
- bos.reset(nullReference.getStartOffset() + nullReference.getLength());
- for (int i = 0; i < numSchemaFields; i++) {
- ATypeTag ftypeTag = fieldTypes[i].getTypeTag();
- String fname = fieldNames[i];
-
- // add type tag pointable
- if (fieldTypes[i].getTypeTag() == ATypeTag.UNION
- && NonTaggedFormatUtil.isOptionalField((AUnionType) fieldTypes[i])) {
- // optional field: add the embedded non-null type tag
- ftypeTag = ((AUnionType) fieldTypes[i]).getUnionList()
- .get(NonTaggedFormatUtil.OPTIONAL_TYPE_INDEX_IN_UNION_LIST).getTypeTag();
- optionalFields[i] = true;
- }
- int tagStart = bos.size();
- dos.writeByte(ftypeTag.serialize());
- int tagEnd = bos.size();
- IVisitablePointable typeTagPointable = allocator.allocateEmpty();
- typeTagPointable.set(bos.getByteArray(), tagStart, tagEnd - tagStart);
- reqFieldTypeTags.add(typeTagPointable);
-
- // add type name pointable (including a string type tag)
- int nameStart = bos.size();
- dos.write(ATypeTag.STRING.serialize());
- dos.writeUTF(fname);
- int nameEnd = bos.size();
- IVisitablePointable typeNamePointable = allocator.allocateEmpty();
- typeNamePointable.set(bos.getByteArray(), nameStart, nameEnd - nameStart);
- reqFieldNames.add(typeNamePointable);
- }
-
- reqFieldNamesSortedIndex = new int[reqFieldNames.size()];
- for (int i = 0; i < reqFieldNamesSortedIndex.length; i++)
- reqFieldNamesSortedIndex[i] = i;
- // sort the field name index
- quickSort(reqFieldNamesSortedIndex, reqFieldNames, 0, reqFieldNamesSortedIndex.length - 1);
- }
-
- private void matchClosedPart(List<IVisitablePointable> fieldNames, List<IVisitablePointable> fieldTypeTags,
- List<IVisitablePointable> fieldValues) {
- // sort-merge based match
- quickSort(fieldNamesSortedIndex, fieldNames, 0, numInputFields - 1);
- int fnStart = 0;
- int reqFnStart = 0;
- while (fnStart < numInputFields && reqFnStart < reqFieldNames.size()) {
- int fnPos = fieldNamesSortedIndex[fnStart];
- int reqFnPos = reqFieldNamesSortedIndex[reqFnStart];
- int c = compare(fieldNames.get(fnPos), reqFieldNames.get(reqFnPos));
- if (c == 0) {
- IVisitablePointable fieldTypeTag = fieldTypeTags.get(fnPos);
- IVisitablePointable reqFieldTypeTag = reqFieldTypeTags.get(reqFnPos);
- if (fieldTypeTag.equals(reqFieldTypeTag) || (
- // match the null type of optional field
- optionalFields[reqFnPos] && fieldTypeTag.equals(nullTypeTag))) {
- fieldPermutation[reqFnPos] = fnPos;
- openFields[fnPos] = false;
- }
- fnStart++;
- reqFnStart++;
- }
- if (c > 0)
- reqFnStart++;
- if (c < 0)
- fnStart++;
- }
-
- // check unmatched fields in the input type
- for (int i = 0; i < openFields.length; i++) {
- if (openFields[i] == true && !cachedReqType.isOpen())
- throw new IllegalStateException("type mismatch: including extra closed fields");
- }
-
- // check unmatched fields in the required type
- for (int i = 0; i < fieldPermutation.length; i++) {
- if (fieldPermutation[i] < 0) {
- IAType t = cachedReqType.getFieldTypes()[i];
- if (!(t.getTypeTag() == ATypeTag.UNION && NonTaggedFormatUtil.isOptionalField((AUnionType) t))) {
- // no matched field in the input for a required closed field
- throw new IllegalStateException("type mismatch: miss a required closed field");
- }
- }
- }
- }
-
- private void writeOutput(List<IVisitablePointable> fieldNames, List<IVisitablePointable> fieldTypeTags,
- List<IVisitablePointable> fieldValues, DataOutput output, ACastVisitor visitor) throws IOException,
- AsterixException {
- // reset the states of the record builder
- recBuilder.reset(cachedReqType);
- recBuilder.init();
-
- // write the closed part
- for (int i = 0; i < fieldPermutation.length; i++) {
- int pos = fieldPermutation[i];
- IVisitablePointable field;
- if (pos >= 0) {
- field = fieldValues.get(pos);
- } else {
- field = nullReference;
- }
- IAType fType = cachedReqType.getFieldTypes()[i];
- nestedVisitorArg.second = fType;
-
- // recursively casting, the result of casting can always be thought
- // as flat
- if (optionalFields[i]) {
- nestedVisitorArg.second = ((AUnionType) fType).getUnionList().get(
- NonTaggedFormatUtil.OPTIONAL_TYPE_INDEX_IN_UNION_LIST);
- }
- field.accept(visitor, nestedVisitorArg);
- recBuilder.addField(i, nestedVisitorArg.first);
- }
-
- // write the open part
- for (int i = 0; i < numInputFields; i++) {
- if (openFields[i]) {
- IVisitablePointable name = fieldNames.get(i);
- IVisitablePointable field = fieldValues.get(i);
- IVisitablePointable fieldTypeTag = fieldTypeTags.get(i);
-
- ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(fieldTypeTag.getByteArray()[fieldTypeTag.getStartOffset()]);
- nestedVisitorArg.second = DefaultOpenFieldType.getDefaultOpenFieldType(typeTag);
- field.accept(visitor, nestedVisitorArg);
- recBuilder.addField(name, nestedVisitorArg.first);
- }
- }
- recBuilder.write(output, true);
- }
-
- private void quickSort(int[] index, List<IVisitablePointable> names, int start, int end) {
- if (end <= start)
- return;
- int i = partition(index, names, start, end);
- quickSort(index, names, start, i - 1);
- quickSort(index, names, i + 1, end);
- }
-
- private int partition(int[] index, List<IVisitablePointable> names, int left, int right) {
- int i = left - 1;
- int j = right;
- while (true) {
- // grow from the left
- while (compare(names.get(index[++i]), names.get(index[right])) < 0)
- ;
- // lower from the right
- while (compare(names.get(index[right]), names.get(index[--j])) < 0)
- if (j == left)
- break;
- if (i >= j)
- break;
- // swap i and j
- swap(index, i, j);
- }
- // swap i and right
- swap(index, i, right); // swap with partition element
- return i;
- }
-
- private void swap(int[] array, int i, int j) {
- int temp = array[i];
- array[i] = array[j];
- array[j] = temp;
- }
-
- private int compare(IValueReference a, IValueReference b) {
- // start+1 and len-1 due to the type tag
- return fieldNameComparator.compare(a.getByteArray(), a.getStartOffset() + 1, a.getLength() - 1,
- b.getByteArray(), b.getStartOffset() + 1, b.getLength() - 1);
- }
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/visitor/IVisitablePointableVisitor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/visitor/IVisitablePointableVisitor.java
deleted file mode 100644
index 669e3fc..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/visitor/IVisitablePointableVisitor.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package edu.uci.ics.asterix.runtime.pointables.visitor;
-
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.runtime.pointables.AFlatValuePointable;
-import edu.uci.ics.asterix.runtime.pointables.AListPointable;
-import edu.uci.ics.asterix.runtime.pointables.ARecordPointable;
-
-/**
- * This interface is a visitor for all the three different IVisitablePointable
- * (Note that right now we have three pointable implementations for type
- * casting) implementations.
- */
-public interface IVisitablePointableVisitor<R, T> {
-
- public R visit(AListPointable accessor, T arg) throws AsterixException;
-
- public R visit(ARecordPointable accessor, T arg) throws AsterixException;
-
- public R visit(AFlatValuePointable accessor, T arg) throws AsterixException;
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/runningaggregates/base/AbstractRunningAggregateFunctionDynamicDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/runningaggregates/base/AbstractRunningAggregateFunctionDynamicDescriptor.java
index c8f12f0..9be4046 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/runningaggregates/base/AbstractRunningAggregateFunctionDynamicDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/runningaggregates/base/AbstractRunningAggregateFunctionDynamicDescriptor.java
@@ -1,10 +1,9 @@
package edu.uci.ics.asterix.runtime.runningaggregates.base;
import edu.uci.ics.asterix.common.functions.FunctionDescriptorTag;
-import edu.uci.ics.asterix.runtime.base.IRunningAggregateFunctionDynamicDescriptor;
+import edu.uci.ics.asterix.om.functions.AbstractFunctionDescriptor;
-public abstract class AbstractRunningAggregateFunctionDynamicDescriptor implements
- IRunningAggregateFunctionDynamicDescriptor {
+public abstract class AbstractRunningAggregateFunctionDynamicDescriptor extends AbstractFunctionDescriptor {
private static final long serialVersionUID = 1L;
public FunctionDescriptorTag getFunctionDescriptorTag() {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/runningaggregates/std/TidRunningAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/runningaggregates/std/TidRunningAggregateDescriptor.java
index 6c9f4dc..a43b9bf 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/runningaggregates/std/TidRunningAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/runningaggregates/std/TidRunningAggregateDescriptor.java
@@ -2,10 +2,10 @@
import java.io.DataOutput;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AInt32;
import edu.uci.ics.asterix.om.base.AMutableInt32;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -23,7 +23,6 @@
public class TidRunningAggregateDescriptor extends AbstractRunningAggregateFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "tid", 0);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new TidRunningAggregateDescriptor();
@@ -75,7 +74,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.TID;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/base/AbstractUnnestingFunctionDynamicDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/base/AbstractUnnestingFunctionDynamicDescriptor.java
index 52a44ae..bcab30f 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/base/AbstractUnnestingFunctionDynamicDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/base/AbstractUnnestingFunctionDynamicDescriptor.java
@@ -1,9 +1,9 @@
package edu.uci.ics.asterix.runtime.unnestingfunctions.base;
import edu.uci.ics.asterix.common.functions.FunctionDescriptorTag;
-import edu.uci.ics.asterix.runtime.base.IUnnestingFunctionDynamicDescriptor;
+import edu.uci.ics.asterix.om.functions.AbstractFunctionDescriptor;
-public abstract class AbstractUnnestingFunctionDynamicDescriptor implements IUnnestingFunctionDynamicDescriptor {
+public abstract class AbstractUnnestingFunctionDynamicDescriptor extends AbstractFunctionDescriptor {
private static final long serialVersionUID = 1L;
public FunctionDescriptorTag getFunctionDescriptorTag() {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/RangeDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/RangeDescriptor.java
index a81172d..dade5b19 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/RangeDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/RangeDescriptor.java
@@ -2,9 +2,9 @@
import java.io.DataOutput;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.AMutableInt32;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -26,7 +26,6 @@
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "range", 2);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new RangeDescriptor();
@@ -35,7 +34,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.RANGE;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/ScanCollectionDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/ScanCollectionDescriptor.java
index 7963b00..c70cdf8 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/ScanCollectionDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/ScanCollectionDescriptor.java
@@ -1,20 +1,28 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package edu.uci.ics.asterix.runtime.unnestingfunctions.std;
import java.io.DataOutput;
import java.io.IOException;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AUnorderedListSerializerDeserializer;
-import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
-import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.BuiltinType;
-import edu.uci.ics.asterix.om.types.EnumDeserializer;
-import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
+import edu.uci.ics.asterix.runtime.evaluators.common.AsterixListAccessor;
import edu.uci.ics.asterix.runtime.unnestingfunctions.base.AbstractUnnestingFunctionDynamicDescriptor;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
@@ -22,7 +30,6 @@
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyUnnestingFunction;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyUnnestingFunctionFactory;
-import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
@@ -30,8 +37,6 @@
public class ScanCollectionDescriptor extends AbstractUnnestingFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "scan-collection", 1);
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
return new ScanCollectionDescriptor();
@@ -40,7 +45,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SCAN_COLLECTION;
}
@Override
@@ -48,17 +53,10 @@
return new ScanCollectionUnnestingFunctionFactory(args[0]);
}
- private static class ScanCollectionUnnestingFunctionFactory implements ICopyUnnestingFunctionFactory {
+ public static class ScanCollectionUnnestingFunctionFactory implements ICopyUnnestingFunctionFactory {
private static final long serialVersionUID = 1L;
-
private ICopyEvaluatorFactory listEvalFactory;
- private final static byte SER_ORDEREDLIST_TYPE_TAG = ATypeTag.ORDEREDLIST.serialize();
- private final static byte SER_UNORDEREDLIST_TYPE_TAG = ATypeTag.UNORDEREDLIST.serialize();
- private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
- private ATypeTag itemTag;
- private byte serItemTypeTag;
- private boolean selfDescList = false;
public ScanCollectionUnnestingFunctionFactory(ICopyEvaluatorFactory arg) {
this.listEvalFactory = arg;
@@ -71,84 +69,37 @@
return new ICopyUnnestingFunction() {
+ private final AsterixListAccessor listAccessor = new AsterixListAccessor();
private ArrayBackedValueStorage inputVal = new ArrayBackedValueStorage();
private ICopyEvaluator argEval = listEvalFactory.createEvaluator(inputVal);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
- private int numItems;
- private int pos;
- private int itemOffset;
- private int itemLength;
- private byte serListTag;
+ private int itemIndex;
@Override
public void init(IFrameTupleReference tuple) throws AlgebricksException {
try {
inputVal.reset();
argEval.evaluate(tuple);
- byte[] serList = inputVal.getByteArray();
-
- if (serList[0] == SER_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
- return;
- }
-
- if (serList[0] != SER_ORDEREDLIST_TYPE_TAG && serList[0] != SER_UNORDEREDLIST_TYPE_TAG) {
- throw new AlgebricksException("Scan collection is not defined for values of type"
- + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serList[0]));
- }
-
- serListTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(inputVal.getByteArray()[0])
- .serialize();
- if (serListTag == SER_ORDEREDLIST_TYPE_TAG)
- numItems = AOrderedListSerializerDeserializer.getNumberOfItems(inputVal.getByteArray());
- else
- numItems = AUnorderedListSerializerDeserializer.getNumberOfItems(inputVal.getByteArray());
-
- itemTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serList[1]);
- if (itemTag == ATypeTag.ANY)
- selfDescList = true;
- else
- serItemTypeTag = serList[1];
-
- pos = 0;
- } catch (IOException e) {
+ listAccessor.reset(inputVal.getByteArray(), 0);
+ itemIndex = 0;
+ } catch (AsterixException e) {
throw new AlgebricksException(e);
}
}
@Override
public boolean step() throws AlgebricksException {
-
try {
- if (pos < numItems) {
- byte[] serList = inputVal.getByteArray();
-
- try {
- if (serListTag == SER_ORDEREDLIST_TYPE_TAG) {
- itemOffset = AOrderedListSerializerDeserializer.getItemOffset(serList, pos);
- } else {
- itemOffset = AUnorderedListSerializerDeserializer.getItemOffset(serList, pos);
- }
- if (selfDescList)
- itemTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serList[itemOffset]);
- itemLength = NonTaggedFormatUtil.getFieldValueLength(serList, itemOffset, itemTag,
- selfDescList);
- if (!selfDescList)
- out.writeByte(serItemTypeTag);
- out.write(serList, itemOffset, itemLength + (!selfDescList ? 0 : 1));
- } catch (AsterixException e) {
- throw new AlgebricksException(e);
- }
- ++pos;
+ if (itemIndex < listAccessor.size()) {
+ listAccessor.writeItem(itemIndex, out);
+ ++itemIndex;
return true;
- } else
- return false;
-
+ }
} catch (IOException e) {
throw new AlgebricksException(e);
+ } catch (AsterixException e) {
+ throw new AlgebricksException(e);
}
+ return false;
}
};
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java
index 8ebfd15..67b0e9f 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java
@@ -4,11 +4,11 @@
import java.io.IOException;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AUnorderedListSerializerDeserializer;
import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -31,8 +31,6 @@
public class SubsetCollectionDescriptor extends AbstractUnnestingFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- "subset-collection", 3);
private final static byte SER_ORDEREDLIST_TYPE_TAG = ATypeTag.ORDEREDLIST.serialize();
private final static byte SER_UNORDEREDLIST_TYPE_TAG = ATypeTag.UNORDEREDLIST.serialize();
@@ -142,7 +140,7 @@
@Override
public FunctionIdentifier getIdentifier() {
- return FID;
+ return AsterixBuiltinFunctions.SUBSET_COLLECTION;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/AsterixRuntimeUtil.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/AsterixRuntimeUtil.java
deleted file mode 100644
index 5326c56..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/AsterixRuntimeUtil.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2009-2011 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.asterix.runtime.util;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Map;
-import java.util.Set;
-
-import edu.uci.ics.asterix.common.api.AsterixAppContextInfoImpl;
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-
-public class AsterixRuntimeUtil {
-
- public static Set<String> getNodeControllersOnIP(String ipAddress) throws AsterixException {
- Map<String, Set<String>> nodeControllerInfo = AsterixAppContextInfoImpl.getNodeControllerMap();
- Set<String> nodeControllersAtLocation = nodeControllerInfo.get(ipAddress);
- return nodeControllersAtLocation;
- }
-
- public static Set<String> getNodeControllersOnHostName(String hostName) throws UnknownHostException {
- Map<String, Set<String>> nodeControllerInfo = AsterixAppContextInfoImpl.getNodeControllerMap();
- String address;
- address = InetAddress.getByName(hostName).getHostAddress();
- if (address.equals("127.0.1.1")) {
- address = "127.0.0.1";
- }
- Set<String> nodeControllersAtLocation = nodeControllerInfo.get(address);
- return nodeControllersAtLocation;
- }
-
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/ResettableByteArrayOutputStream.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/ResettableByteArrayOutputStream.java
deleted file mode 100644
index 968c3f2..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/ResettableByteArrayOutputStream.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package edu.uci.ics.asterix.runtime.util;
-
-import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
-
-/**
- * This class extends ByteArrayAccessibleOutputStream to allow reset to a given
- * size.
- *
- */
-public class ResettableByteArrayOutputStream extends ByteArrayAccessibleOutputStream {
-
- public void reset(int size) {
- count = size;
- }
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/IObjectFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/IObjectFactory.java
deleted file mode 100644
index 85f0fa3..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/IObjectFactory.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package edu.uci.ics.asterix.runtime.util.container;
-
-/**
- * A factory interface to create objects.
- */
-public interface IObjectFactory<E, T> {
-
- /**
- * create an element of type E
- *
- * @param arg
- * @return an E element
- */
- public E create(T arg);
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/IObjectPool.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/IObjectPool.java
deleted file mode 100644
index dd2c3bf..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/IObjectPool.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package edu.uci.ics.asterix.runtime.util.container;
-
-/**
- * A reusable object pool interface.
- */
-public interface IObjectPool<E, T> {
-
- /**
- * Give client an E instance
- *
- * @param arg
- * the argument to create E
- * @return an E instance
- */
- public E allocate(T arg);
-
- /**
- * Mark all instances in the pool as unused
- */
- public void reset();
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/ListObjectPool.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/ListObjectPool.java
deleted file mode 100644
index b8f8e3a..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/ListObjectPool.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package edu.uci.ics.asterix.runtime.util.container;
-
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.List;
-
-/**
- * Object pool backed by a list.
- *
- * The argument for creating E instances could be different. This class also
- * considers arguments in object reusing, e.g., it reuses an E instances ONLY
- * when the construction argument is "equal".
- */
-public class ListObjectPool<E, T> implements IObjectPool<E, T> {
-
- private IObjectFactory<E, T> factory;
-
- /**
- * cache of objects
- */
- private List<E> pool = new ArrayList<E>();
-
- /**
- * args that are used to create each element in the pool
- */
- private List<T> args = new ArrayList<T>();
-
- /**
- * bits indicating which element is in use
- */
- private BitSet usedBits = new BitSet();
-
- public ListObjectPool(IObjectFactory<E, T> factory) {
- this.factory = factory;
- }
-
- @Override
- public E allocate(T arg) {
- int freeSlot = -1;
- while (freeSlot + 1 < pool.size()) {
- freeSlot = usedBits.nextClearBit(freeSlot + 1);
- if (freeSlot >= pool.size())
- break;
-
- // the two cases where an element in the pool is a match
- if ((arg == null && args.get(freeSlot) == null)
- || (arg != null && args.get(freeSlot) != null && arg.equals(args.get(freeSlot)))) {
- // the element is not used and the arg is the same as
- // input arg
- usedBits.set(freeSlot);
- return pool.get(freeSlot);
- }
- }
-
- // if we do not find a reusable object, allocate a new one
- E element = factory.create(arg);
- pool.add(element);
- args.add(arg);
- usedBits.set(pool.size() - 1);
- return element;
- }
-
- @Override
- public void reset() {
- usedBits.clear();
- }
-}
diff --git a/asterix-test-framework/pom.xml b/asterix-test-framework/pom.xml
new file mode 100755
index 0000000..2f0142e
--- /dev/null
+++ b/asterix-test-framework/pom.xml
@@ -0,0 +1,36 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>asterix</artifactId>
+ <groupId>edu.uci.ics.asterix</groupId>
+ <version>0.0.4-SNAPSHOT</version>
+ </parent>
+ <artifactId>asterix-test-framework</artifactId>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.jvnet.jaxb2.maven2</groupId>
+ <artifactId>maven-jaxb2-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ </dependencies>
+</project>
diff --git a/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/context/TestCaseContext.java b/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/context/TestCaseContext.java
new file mode 100644
index 0000000..d5164db
--- /dev/null
+++ b/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/context/TestCaseContext.java
@@ -0,0 +1,103 @@
+package edu.uci.ics.asterix.testframework.context;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import edu.uci.ics.asterix.testframework.xml.TestCase;
+import edu.uci.ics.asterix.testframework.xml.TestCase.CompilationUnit;
+import edu.uci.ics.asterix.testframework.xml.TestGroup;
+import edu.uci.ics.asterix.testframework.xml.TestSuite;
+import edu.uci.ics.asterix.testframework.xml.TestSuiteParser;
+
+public class TestCaseContext {
+ public static final String DEFAULT_TESTSUITE_XML_NAME = "testsuite.xml";
+
+ private File tsRoot;
+
+ private TestSuite testSuite;
+
+ private TestGroup[] testGroups;
+
+ private TestCase testCase;
+
+ public TestCaseContext(File tsRoot, TestSuite testSuite, TestGroup[] testGroups, TestCase testCase) {
+ this.tsRoot = tsRoot;
+ this.testSuite = testSuite;
+ this.testGroups = testGroups;
+ this.testCase = testCase;
+ }
+
+ public File getTsRoot() {
+ return tsRoot;
+ }
+
+ public TestSuite getTestSuite() {
+ return testSuite;
+ }
+
+ public TestGroup[] getTestGroups() {
+ return testGroups;
+ }
+
+ public TestCase getTestCase() {
+ return testCase;
+ }
+
+ public File getTestFile(CompilationUnit cUnit) {
+ File path = tsRoot;
+ path = new File(path, testSuite.getQueryOffsetPath());
+ path = new File(path, testCase.getFilePath());
+ return new File(path, cUnit.getName() + testSuite.getQueryFileExtension());
+ }
+
+ public File getExpectedResultFile(CompilationUnit cUnit) {
+ File path = tsRoot;
+ path = new File(path, testSuite.getResultOffsetPath());
+ path = new File(path, testCase.getFilePath());
+ return new File(path, cUnit.getOutputFile().getValue());
+ }
+
+ public File getActualResultFile(CompilationUnit cUnit, File actualResultsBase) {
+ File path = actualResultsBase;
+ path = new File(path, testSuite.getResultOffsetPath());
+ path = new File(path, testCase.getFilePath());
+ return new File(path, cUnit.getOutputFile().getValue());
+ }
+
+ public static class Builder {
+ public Builder() {
+ }
+
+ public List<TestCaseContext> build(File tsRoot) throws Exception {
+ return build(tsRoot, DEFAULT_TESTSUITE_XML_NAME);
+ }
+
+ public List<TestCaseContext> build(File tsRoot, String tsXMLFilePath) throws Exception {
+ File tsFile = new File(tsRoot, tsXMLFilePath);
+ TestSuiteParser tsp = new TestSuiteParser();
+ TestSuite ts = tsp.parse(tsFile);
+ List<TestCaseContext> tccs = new ArrayList<TestCaseContext>();
+ List<TestGroup> tgPath = new ArrayList<TestGroup>();
+ addContexts(tsRoot, ts, tgPath, ts.getTestGroup(), tccs);
+ return tccs;
+ }
+
+ private void addContexts(File tsRoot, TestSuite ts, List<TestGroup> tgPath, List<TestGroup> testGroups,
+ List<TestCaseContext> tccs) {
+ for (TestGroup tg : testGroups) {
+ tgPath.add(tg);
+ addContexts(tsRoot, ts, tgPath, tccs);
+ tgPath.remove(tgPath.size() - 1);
+ }
+ }
+
+ private void addContexts(File tsRoot, TestSuite ts, List<TestGroup> tgPath, List<TestCaseContext> tccs) {
+ TestGroup tg = tgPath.get(tgPath.size() - 1);
+ for (TestCase tc : tg.getTestCase()) {
+ tccs.add(new TestCaseContext(tsRoot, ts, tgPath.toArray(new TestGroup[tgPath.size()]), tc));
+ }
+ addContexts(tsRoot, ts, tgPath, tg.getTestGroup(), tccs);
+ }
+ }
+}
\ No newline at end of file
diff --git a/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/xml/TestSuiteParser.java b/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/xml/TestSuiteParser.java
new file mode 100644
index 0000000..0c544ac
--- /dev/null
+++ b/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/xml/TestSuiteParser.java
@@ -0,0 +1,15 @@
+package edu.uci.ics.asterix.testframework.xml;
+
+import java.io.File;
+
+import javax.xml.bind.JAXBContext;
+
+public class TestSuiteParser {
+ public TestSuiteParser() {
+ }
+
+ public TestSuite parse(File testSuiteCatalog) throws Exception {
+ JAXBContext ctx = JAXBContext.newInstance(TestSuite.class);
+ return (TestSuite) ctx.createUnmarshaller().unmarshal(testSuiteCatalog);
+ }
+}
\ No newline at end of file
diff --git a/asterix-test-framework/src/main/resources/Catalog.xsd b/asterix-test-framework/src/main/resources/Catalog.xsd
new file mode 100755
index 0000000..feadbd7
--- /dev/null
+++ b/asterix-test-framework/src/main/resources/Catalog.xsd
@@ -0,0 +1,210 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:test="urn:xml.testframework.asterix.ics.uci.edu"
+ targetNamespace="urn:xml.testframework.asterix.ics.uci.edu" elementFormDefault="qualified">
+
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <!-- test-suite - top level element -->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+ <xs:element name="test-suite">
+ <xs:annotation>
+ <xs:documentation>
+ This is the top level element for documents that use this schema.
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="test:test-group" maxOccurs="unbounded"/>
+ </xs:sequence>
+
+ <xs:attribute name="CatalogDesignDate" type="xs:date" use="required"/>
+
+ <xs:attribute name="ResultOffsetPath" type="test:SimplifiedRelativeFilePath" use="required">
+ <xs:annotation>
+ <xs:documentation>
+ offset from root to results
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attribute name="QueryOffsetPath" type="test:SimplifiedRelativeFilePath"
+ use="required">
+ <xs:annotation>
+ <xs:documentation>
+ offset from root to Query expression files
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <!-- file extension for XQuery expression files -->
+ <xs:attribute name="QueryFileExtension" type="xs:string" use="required">
+ <xs:annotation>
+ <xs:documentation>
+ file extension for Query files
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ </xs:complexType>
+
+ <xs:unique name="unique-test-group">
+ <xs:selector xpath=".//test:test-group"/>
+ <xs:field xpath="@name"/>
+ </xs:unique>
+
+ </xs:element>
+
+
+ <!-- SimplifiedRelativeFilePath type -->
+
+ <xs:simpleType name="SimplifiedRelativeFilePath">
+ <xs:restriction base="xs:anyURI">
+ <xs:pattern value="([a-zA-Z0-9\-\.]+/)+"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <!-- test-group -->
+ <!-- -->
+ <!-- Group of test cases and test groups. -->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+ <xs:element name="test-group">
+ <xs:annotation>
+ <xs:documentation>
+ Group of test cases and test groups.
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="test-case" type="test:test-case" minOccurs="0" maxOccurs="unbounded">
+ <xs:unique name="unique-expected-error">
+ <xs:selector xpath=".//test:expected-error"/>
+ <xs:field xpath="."/>
+ </xs:unique>
+ </xs:element>
+
+ <xs:element ref="test:test-group" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <!-- test-case -->
+ <!-- -->
+ <!-- A test case to be run. -->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+ <xs:complexType name="test-case">
+ <xs:sequence>
+ <xs:element name="description" type="test:description"/>
+
+ <xs:element name="compilation-unit" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="description" type="test:description" minOccurs="0"/>
+ <xs:element name="output-file" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>
+ Zero or one file containing expected results for this query.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="compare" type="test:comparison-enum" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+
+
+ <!-- Zero or more expected errors for this query -->
+
+ <xs:element name="expected-error" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>
+ Zero or more expected errors for this query.
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="test:ErrorCode">
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+
+ </xs:sequence>
+
+ <!-- This name is always equal to the name of the test case -->
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Zero or more files containing expected results for this query -->
+
+ </xs:sequence>
+
+ <!-- The filename for this query can be constructed from: -->
+ <!-- the QueryOffsetPath -->
+ <!-- the FilePath -->
+ <!-- the name -->
+ <!-- the QueryFileExtension -->
+
+ <xs:attribute name="FilePath" type="test:SimplifiedRelativeFilePath" use="required"/>
+ <xs:attribute name="date" type="xs:date" use="required"/>
+ </xs:complexType>
+
+ <!-- comparison-enum type -->
+ <!-- Identify the type of comparison used to determine whether an -->
+ <!-- expected result and an actual result match. -->
+
+ <xs:simpleType name="comparison-enum">
+ <xs:annotation>
+ <xs:documentation>
+ Identify the type of comparison used to determine whether an
+ expected result and an actual result match.
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="XML"/>
+ <xs:enumeration value="Text"/>
+ <xs:enumeration value="Inspect"/>
+ <xs:enumeration value="Ignore"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <!-- description type -->
+
+ <xs:complexType name="description">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="last-mod" type="xs:date"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+
+ <!-- ErrorCode type -->
+ <!-- * is used to mean that any error code is acceptable -->
+
+ <xs:simpleType name="ErrorCode">
+ <xs:annotation>
+ <xs:documentation>
+ * is used to mean that any error code is acceptable
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:restriction base="xs:string">
+ <xs:pattern value="\*|([A-Z]{4}[0-9]{4})"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+</xs:schema>
diff --git a/asterix-tools/pom.xml b/asterix-tools/pom.xml
index 472e077..5a8ea70 100644
--- a/asterix-tools/pom.xml
+++ b/asterix-tools/pom.xml
@@ -101,6 +101,12 @@
<dependencies>
<dependency>
<groupId>edu.uci.ics.asterix</groupId>
+ <artifactId>asterix-aql</artifactId>
+ <version>0.0.4-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>edu.uci.ics.asterix</groupId>
<artifactId>asterix-algebra</artifactId>
<version>0.0.4-SNAPSHOT</version>
<scope>compile</scope>
@@ -113,4 +119,4 @@
</dependency>
</dependencies>
-</project>
\ No newline at end of file
+</project>
diff --git a/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/datagen/AdmDataGen.java b/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/datagen/AdmDataGen.java
index 7e4704b..dc83694 100644
--- a/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/datagen/AdmDataGen.java
+++ b/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/datagen/AdmDataGen.java
@@ -16,6 +16,7 @@
import java.util.Map;
import java.util.Random;
+import edu.uci.ics.asterix.aql.base.Statement;
import edu.uci.ics.asterix.aql.expression.Query;
import edu.uci.ics.asterix.aql.parser.AQLParser;
import edu.uci.ics.asterix.aql.parser.ParseException;
@@ -35,15 +36,16 @@
import edu.uci.ics.asterix.common.annotations.RecordDataGenAnnotation;
import edu.uci.ics.asterix.common.annotations.TypeDataGen;
import edu.uci.ics.asterix.common.annotations.UndeclaredFieldsDataGen;
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.metadata.MetadataException;
import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
import edu.uci.ics.asterix.om.types.ARecordType;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.AUnionType;
import edu.uci.ics.asterix.om.types.AbstractCollectionType;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.types.TypeSignature;
import edu.uci.ics.asterix.tools.translator.ADGenDmlTranslator;
import edu.uci.ics.asterix.transaction.management.exception.ACIDException;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -913,8 +915,8 @@
private final File schemaFile;
private final File outputDir;
- private Map<String, IAType> typeMap;
- private Map<String, TypeDataGen> typeAnnotMap;
+ private Map<TypeSignature, IAType> typeMap;
+ private Map<TypeSignature, TypeDataGen> typeAnnotMap;
private DataGeneratorContext dgCtx;
public AdmDataGen(File schemaFile, File outputDir) {
@@ -922,24 +924,24 @@
this.outputDir = outputDir;
}
- public void init() throws IOException, ParseException, AlgebricksException, ACIDException, MetadataException {
+ public void init() throws IOException, ParseException, AsterixException, ACIDException, MetadataException,
+ AlgebricksException {
FileReader aql = new FileReader(schemaFile);
AQLParser parser = new AQLParser(aql);
- Query q = (Query) parser.Statement();
+ List<Statement> statements = parser.Statement();
aql.close();
// TODO: Need to fix how to use transactions here.
MetadataTransactionContext mdTxnCtx = new MetadataTransactionContext(-1);
- ADGenDmlTranslator dmlt = new ADGenDmlTranslator(mdTxnCtx, q.getPrologDeclList());
+ ADGenDmlTranslator dmlt = new ADGenDmlTranslator(mdTxnCtx, statements);
dmlt.translate();
- AqlCompiledMetadataDeclarations acmd = dmlt.getCompiledDeclarations();
- typeMap = acmd.getTypeDeclarations();
- typeAnnotMap = acmd.getTypeDataGenMap();
+ typeMap = dmlt.getTypeMap();
+ typeAnnotMap = dmlt.getTypeDataGenMap();
dgCtx = new DataGeneratorContext();
}
public void dataGen() throws Exception {
- for (Map.Entry<String, IAType> me : typeMap.entrySet()) {
- String tn = me.getKey();
+ for (Map.Entry<TypeSignature, IAType> me : typeMap.entrySet()) {
+ TypeSignature tn = me.getKey();
TypeDataGen tdg = typeAnnotMap.get(tn);
if (tdg.isDataGen()) {
IAType t = me.getValue();
diff --git a/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/external/data/RateControlledFileSystemBasedAdapter.java b/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/external/data/RateControlledFileSystemBasedAdapter.java
new file mode 100644
index 0000000..84b989d
--- /dev/null
+++ b/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/external/data/RateControlledFileSystemBasedAdapter.java
@@ -0,0 +1,279 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.tools.external.data;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.external.adapter.factory.IGenericDatasetAdapterFactory;
+import edu.uci.ics.asterix.external.dataset.adapter.FileSystemBasedAdapter;
+import edu.uci.ics.asterix.external.dataset.adapter.ITypedDatasourceAdapter;
+import edu.uci.ics.asterix.feed.managed.adapter.IManagedFeedAdapter;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.runtime.operators.file.ADMDataParser;
+import edu.uci.ics.asterix.runtime.operators.file.AbstractTupleParser;
+import edu.uci.ics.asterix.runtime.operators.file.DelimitedDataParser;
+import edu.uci.ics.asterix.runtime.operators.file.IDataParser;
+import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
+import edu.uci.ics.hyracks.api.comm.IFrameWriter;
+import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
+import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParserFactory;
+import edu.uci.ics.hyracks.dataflow.std.file.ITupleParser;
+import edu.uci.ics.hyracks.dataflow.std.file.ITupleParserFactory;
+
+/**
+ * An adapter that simulates a feed from the contents of a source file. The file can be on the local file
+ * system or on HDFS. The feed ends when the content of the source file has been ingested.
+ */
+public class RateControlledFileSystemBasedAdapter extends FileSystemBasedAdapter implements ITypedDatasourceAdapter,
+ IManagedFeedAdapter {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String KEY_FILE_SYSTEM = "fs";
+ public static final String LOCAL_FS = "localfs";
+ public static final String HDFS = "hdfs";
+
+ private final FileSystemBasedAdapter coreAdapter;
+ private final Map<String, String> configuration;
+ private final String fileSystem;
+ private final String format;
+
+ public RateControlledFileSystemBasedAdapter(ARecordType atype, Map<String, String> configuration) throws Exception {
+ super(atype);
+ checkRequiredArgs(configuration);
+ fileSystem = configuration.get(KEY_FILE_SYSTEM);
+ String adapterFactoryClass = null;
+ if (fileSystem.equalsIgnoreCase(LOCAL_FS)) {
+ adapterFactoryClass = "edu.uci.ics.asterix.external.adapter.factory.NCFileSystemAdapterFactory";
+ } else if (fileSystem.equals(HDFS)) {
+ adapterFactoryClass = "edu.uci.ics.asterix.external.adapter.factory.HDFSAdapterFactory";
+ } else {
+ throw new AsterixException("Unsupported file system type " + fileSystem);
+ }
+ format = configuration.get(KEY_FORMAT);
+ IGenericDatasetAdapterFactory adapterFactory = (IGenericDatasetAdapterFactory) Class.forName(
+ adapterFactoryClass).newInstance();
+ coreAdapter = (FileSystemBasedAdapter) adapterFactory.createAdapter(configuration, atype);
+ this.configuration = configuration;
+ }
+
+ private void checkRequiredArgs(Map<String, String> configuration) throws Exception {
+ if (configuration.get(KEY_FILE_SYSTEM) == null) {
+ throw new Exception("File system type not specified. (fs=?) File system could be 'localfs' or 'hdfs'");
+ }
+ if (configuration.get(IGenericDatasetAdapterFactory.KEY_TYPE_NAME) == null) {
+ throw new Exception("Record type not specified (output-type-name=?)");
+ }
+ if (configuration.get(KEY_PATH) == null) {
+ throw new Exception("File path not specified (path=?)");
+ }
+ if (configuration.get(KEY_FORMAT) == null) {
+ throw new Exception("File format not specified (format=?)");
+ }
+ }
+
+ @Override
+ public InputStream getInputStream(int partition) throws IOException {
+ return coreAdapter.getInputStream(partition);
+ }
+
+ @Override
+ public void initialize(IHyracksTaskContext ctx) throws Exception {
+ coreAdapter.initialize(ctx);
+ this.ctx = ctx;
+ }
+
+ @Override
+ public void configure(Map<String, String> arguments) throws Exception {
+ coreAdapter.configure(arguments);
+ }
+
+ @Override
+ public AdapterType getAdapterType() {
+ return coreAdapter.getAdapterType();
+ }
+
+ @Override
+ protected ITupleParser getTupleParser() throws Exception {
+ ITupleParser parser = null;
+ if (format.equals(FORMAT_DELIMITED_TEXT)) {
+ parser = getRateControlledDelimitedDataTupleParser((ARecordType) atype);
+ } else if (format.equals(FORMAT_ADM)) {
+ parser = getRateControlledADMDataTupleParser((ARecordType) atype);
+ } else {
+ throw new IllegalArgumentException(" format " + configuration.get(KEY_FORMAT) + " not supported");
+ }
+ return parser;
+
+ }
+
+ protected ITupleParser getRateControlledDelimitedDataTupleParser(ARecordType recordType) throws AsterixException {
+ ITupleParser parser;
+ int n = recordType.getFieldTypes().length;
+ IValueParserFactory[] fieldParserFactories = new IValueParserFactory[n];
+ for (int i = 0; i < n; i++) {
+ ATypeTag tag = recordType.getFieldTypes()[i].getTypeTag();
+ IValueParserFactory vpf = typeToValueParserFactMap.get(tag);
+ if (vpf == null) {
+ throw new NotImplementedException("No value parser factory for delimited fields of type " + tag);
+ }
+ fieldParserFactories[i] = vpf;
+
+ }
+ String delimiterValue = (String) configuration.get(KEY_DELIMITER);
+ if (delimiterValue != null && delimiterValue.length() > 1) {
+ throw new AsterixException("improper delimiter");
+ }
+
+ Character delimiter = delimiterValue.charAt(0);
+ parser = new RateControlledTupleParserFactory(recordType, fieldParserFactories, delimiter, configuration)
+ .createTupleParser(ctx);
+ return parser;
+ }
+
+ protected ITupleParser getRateControlledADMDataTupleParser(ARecordType recordType) throws AsterixException {
+ ITupleParser parser = null;
+ try {
+ parser = new RateControlledTupleParserFactory(recordType, configuration).createTupleParser(ctx);
+ return parser;
+ } catch (Exception e) {
+ throw new AsterixException(e);
+ }
+
+ }
+
+ @Override
+ public ARecordType getAdapterOutputType() {
+ return (ARecordType) atype;
+ }
+
+ @Override
+ public void alter(Map<String, String> properties) {
+ ((RateControlledTupleParser) parser).setInterTupleInterval(Long.parseLong(properties
+ .get(RateControlledTupleParser.INTER_TUPLE_INTERVAL)));
+ }
+
+ @Override
+ public void stop() {
+ ((RateControlledTupleParser) parser).stop();
+ }
+
+ @Override
+ public AlgebricksPartitionConstraint getPartitionConstraint() throws Exception {
+ return coreAdapter.getPartitionConstraint();
+ }
+}
+
+class RateControlledTupleParserFactory implements ITupleParserFactory {
+
+ private static final long serialVersionUID = 1L;
+
+ private final ARecordType recordType;
+ private final IDataParser dataParser;
+ private final Map<String, String> configuration;
+
+ public RateControlledTupleParserFactory(ARecordType recordType, IValueParserFactory[] valueParserFactories,
+ char fieldDelimiter, Map<String, String> configuration) {
+ this.recordType = recordType;
+ dataParser = new DelimitedDataParser(recordType, valueParserFactories, fieldDelimiter);
+ this.configuration = configuration;
+ }
+
+ public RateControlledTupleParserFactory(ARecordType recordType, Map<String, String> configuration) {
+ this.recordType = recordType;
+ dataParser = new ADMDataParser();
+ this.configuration = configuration;
+ }
+
+ @Override
+ public ITupleParser createTupleParser(IHyracksTaskContext ctx) {
+ return new RateControlledTupleParser(ctx, recordType, dataParser, configuration);
+ }
+
+}
+
+class RateControlledTupleParser extends AbstractTupleParser {
+
+ private final IDataParser dataParser;
+ private long interTupleInterval;
+ private boolean delayConfigured;
+ private boolean continueIngestion = true;
+
+ public static final String INTER_TUPLE_INTERVAL = "tuple-interval";
+
+ public RateControlledTupleParser(IHyracksTaskContext ctx, ARecordType recType, IDataParser dataParser,
+ Map<String, String> configuration) {
+ super(ctx, recType);
+ this.dataParser = dataParser;
+ String propValue = configuration.get(INTER_TUPLE_INTERVAL);
+ if (propValue != null) {
+ interTupleInterval = Long.parseLong(propValue);
+ } else {
+ interTupleInterval = 0;
+ }
+ delayConfigured = interTupleInterval != 0;
+ }
+
+ public void setInterTupleInterval(long val) {
+ this.interTupleInterval = val;
+ this.delayConfigured = val > 0;
+ }
+
+ public void stop() {
+ continueIngestion = false;
+ }
+
+ @Override
+ public IDataParser getDataParser() {
+ return dataParser;
+ }
+
+ @Override
+ public void parse(InputStream in, IFrameWriter writer) throws HyracksDataException {
+
+ appender.reset(frame, true);
+ IDataParser parser = getDataParser();
+ try {
+ parser.initialize(in, recType, true);
+ while (continueIngestion) {
+ tb.reset();
+ if (!parser.parse(tb.getDataOutput())) {
+ break;
+ }
+ tb.addFieldEndOffset();
+ if (delayConfigured) {
+ Thread.sleep(interTupleInterval);
+ }
+ addTupleToFrame(writer);
+ }
+ if (appender.getTupleCount() > 0) {
+ FrameUtils.flushFrame(frame, writer);
+ }
+ } catch (AsterixException ae) {
+ throw new HyracksDataException(ae);
+ } catch (IOException ioe) {
+ throw new HyracksDataException(ioe);
+ } catch (InterruptedException ie) {
+ throw new HyracksDataException(ie);
+ }
+ }
+}
diff --git a/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/external/data/RateControlledFileSystemBasedAdapterFactory.java b/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/external/data/RateControlledFileSystemBasedAdapterFactory.java
new file mode 100644
index 0000000..6c32acb
--- /dev/null
+++ b/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/external/data/RateControlledFileSystemBasedAdapterFactory.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.tools.external.data;
+
+import java.util.Map;
+
+import edu.uci.ics.asterix.external.adapter.factory.IGenericDatasetAdapterFactory;
+import edu.uci.ics.asterix.external.dataset.adapter.IDatasourceAdapter;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.IAType;
+
+/**
+ * Factory class for creating @see{RateControllerFileSystemBasedAdapter} The
+ * adapter simulates a feed from the contents of a source file. The file can be
+ * on the local file system or on HDFS. The feed ends when the content of the
+ * source file has been ingested.
+ */
+public class RateControlledFileSystemBasedAdapterFactory implements IGenericDatasetAdapterFactory {
+
+ @Override
+ public IDatasourceAdapter createAdapter(Map<String, String> configuration, IAType type) throws Exception {
+ return new RateControlledFileSystemBasedAdapter((ARecordType) type, configuration);
+ }
+
+ @Override
+ public String getName() {
+ return "file_feed";
+ }
+
+}
\ No newline at end of file
diff --git a/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/translator/ADGenDmlTranslator.java b/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/translator/ADGenDmlTranslator.java
index 5ee83cf..7b91fcb 100644
--- a/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/translator/ADGenDmlTranslator.java
+++ b/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/translator/ADGenDmlTranslator.java
@@ -1,30 +1,76 @@
package edu.uci.ics.asterix.tools.translator;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import edu.uci.ics.asterix.aql.base.Statement;
+import edu.uci.ics.asterix.aql.expression.DataverseDecl;
+import edu.uci.ics.asterix.aql.expression.TypeDecl;
+import edu.uci.ics.asterix.common.annotations.TypeDataGen;
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.metadata.MetadataException;
import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
-import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.types.TypeSignature;
import edu.uci.ics.asterix.translator.AbstractAqlTranslator;
+import edu.uci.ics.asterix.translator.TypeTranslator;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
public class ADGenDmlTranslator extends AbstractAqlTranslator {
- private final MetadataTransactionContext mdTxnCtx;
- private List<Statement> aqlStatements;
- private AqlCompiledMetadataDeclarations compiledDeclarations;
+ private final MetadataTransactionContext mdTxnCtx;
+ private final List<Statement> aqlStatements;
+ private Map<TypeSignature, IAType> types;
+ private Map<TypeSignature, TypeDataGen> typeDataGenMap;
- public ADGenDmlTranslator(MetadataTransactionContext mdTxnCtx, List<Statement> aqlStatements) {
- this.mdTxnCtx = mdTxnCtx;
- this.aqlStatements = aqlStatements;
- }
+ public ADGenDmlTranslator(MetadataTransactionContext mdTxnCtx,
+ List<Statement> aqlStatements) {
+ this.mdTxnCtx = mdTxnCtx;
+ this.aqlStatements = aqlStatements;
+ }
- public void translate() throws AlgebricksException, MetadataException {
- compiledDeclarations = compileMetadata(mdTxnCtx, aqlStatements, false);
- }
+ public void translate() throws AsterixException, MetadataException,
+ AlgebricksException {
+ String defaultDataverse = getDefaultDataverse();
+ types = new HashMap<TypeSignature, IAType>();
+ typeDataGenMap = new HashMap<TypeSignature, TypeDataGen>();
- public AqlCompiledMetadataDeclarations getCompiledDeclarations() {
- return compiledDeclarations;
- }
+ for (Statement stmt : aqlStatements) {
+ if (stmt.getKind().equals(Statement.Kind.TYPE_DECL)) {
+ TypeDecl td = (TypeDecl) stmt;
+ String typeDataverse = td.getDataverseName() == null ? defaultDataverse
+ : td.getDataverseName().getValue();
+
+ Map<TypeSignature, IAType> typeInStmt = TypeTranslator
+ .computeTypes(mdTxnCtx, td, typeDataverse, types);
+ types.putAll(typeInStmt);
+
+ TypeSignature signature = new TypeSignature(typeDataverse, td
+ .getIdent().getValue());
+ TypeDataGen tdg = td.getDatagenAnnotation();
+ if (tdg != null) {
+ typeDataGenMap.put(signature, tdg);
+ }
+ }
+ }
+ }
+
+ private String getDefaultDataverse() {
+ for (Statement stmt : aqlStatements) {
+ if (stmt.getKind().equals(Statement.Kind.DATAVERSE_DECL)) {
+ return ((DataverseDecl) stmt).getDataverseName().getValue();
+ }
+ }
+ return null;
+ }
+
+ public Map<TypeSignature, IAType> getTypeMap() {
+ return types;
+ }
+
+ public Map<TypeSignature, TypeDataGen> getTypeDataGenMap() {
+ return typeDataGenMap;
+ }
+
}
diff --git a/asterix-transactions/pom.xml b/asterix-transactions/pom.xml
index d7703fd..c440c2a 100644
--- a/asterix-transactions/pom.xml
+++ b/asterix-transactions/pom.xml
@@ -28,7 +28,7 @@
<dependency>
<groupId>edu.uci.ics.hyracks</groupId>
<artifactId>hyracks-storage-am-common</artifactId>
- <version>0.2.1-SNAPSHOT</version>
+ <version>0.2.2-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
diff --git a/build.xml b/build.xml
new file mode 100644
index 0000000..22b2f30
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,75 @@
+<project>
+ <target name="instrument">
+ <antcall target="instrumentAModule">
+ <param name="module" value="asterix-aql"/>
+ <param name="module" value="asterix-om"/>
+ <param name="module" value="asterix-metadata"/>
+ <param name="module" value="asterix-tools"/>
+ <param name="module" value="asterix-common"/>
+ <param name="module" value="asterix-transactions"/>
+ </antcall>
+ </target>
+
+ <target name="report" depends="merge">
+ <property name="src.dir" value="src/main/java/"/>
+ <cobertura-report datafile="sum.ser"
+ format="html"
+ destdir="./target/report">
+ <!-- Add all modules that should be included below -->
+ <!-- fileset dir="./MODULE_NAME_TO_REPLACE/${src.dir}"/ -->
+ <fileset dir="./asterix-aql/${src.dir}"/>
+ <fileset dir="./asterix-om/${src.dir}"/>
+ <fileset dir="./asterix-metadata/${src.dir}"/>
+ <fileset dir="./asterix-tools/${src.dir}"/>
+ <fileset dir="./asterix-common/${src.dir}"/>
+ <fileset dir="./asterix-runtime/${src.dir}"/>
+ <fileset dir="./asterix-transactions/${src.dir}"/>
+ </cobertura-report>
+ </target>
+
+ <target name="merge">
+ <cobertura-merge datafile="sum.ser">
+ <fileset dir=".">
+ <include name="**/cobertura.ser"/>
+ </fileset>
+ </cobertura-merge>
+ </target>
+
+ <target name="instrumentAModule">
+ <property name="classes.dir" value="target/classes"/>
+ <cobertura-instrument todir="./${module}/${classes.dir}">
+ <fileset dir="./asterix-aql/target/classes">
+ <include name="**/*.class"/>
+ </fileset>
+ <fileset dir="./asterix-om/target/classes">
+ <include name="**/*.class"/>
+ </fileset>
+ <fileset dir="./asterix-metadata/target/classes">
+ <include name="**/*.class"/>
+ </fileset>
+ <fileset dir="./asterix-tools/target/classes">
+ <include name="**/*.class"/>
+ </fileset>
+ <fileset dir="./asterix-common/target/classes">
+ <include name="**/*.class"/>
+ </fileset>
+ <fileset dir="./asterix-runtime/target/classes">
+ <include name="**/*.class"/>
+ </fileset>
+ <fileset dir="./asterix-transactions/target/classes">
+ <include name="**/*.class"/>
+ </fileset>
+ </cobertura-instrument>
+ </target>
+
+<property environment="env"/>
+ <property name="COBERTURA_HOME" value="../../.m2/repository/net/sourceforge/cobertura/cobertura/1.9.4.1"/>
+ <property name="cobertura.dir" value="${COBERTURA_HOME}"/>
+ <path id="cobertura.classpath">
+ <fileset dir="${cobertura.dir}">
+ <include name="cobertura.jar"/>
+ <include name="lib/**/*.jar"/>
+ </fileset>
+ </path>
+ <taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
+</project>
diff --git a/pom.xml b/pom.xml
index 35c6bc4..506d57d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -78,6 +78,7 @@
<module>asterix-external-data</module>
<module>asterix-metadata</module>
<module>asterix-dist</module>
+ <module>asterix-test-framework</module>
</modules>
<repositories>
@@ -128,5 +129,12 @@
<url>http://obelix.ics.uci.edu/nexus/content/repositories/algebricks-snapshots/</url>
</repository>
</repositories>
-
+ <dependencies>
+ <dependency>
+ <groupId>net.sourceforge.cobertura</groupId>
+ <artifactId>cobertura</artifactId>
+ <version>1.9.4</version>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
</project>