Repository: asterixdb Updated Branches: refs/heads/master 64c021e46 -> dfa3c1174
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/dfa3c117/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/OperatorDeepCopyVisitor.java ---------------------------------------------------------------------- diff --git a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/OperatorDeepCopyVisitor.java b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/OperatorDeepCopyVisitor.java index 2450c6c..99123b3 100644 --- a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/OperatorDeepCopyVisitor.java +++ b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/OperatorDeepCopyVisitor.java @@ -74,8 +74,8 @@ public class OperatorDeepCopyVisitor implements ILogicalOperatorVisitor<ILogical @Override public ILogicalOperator visitAggregateOperator(AggregateOperator op, Void arg) throws AlgebricksException { - ArrayList<LogicalVariable> newList = new ArrayList<LogicalVariable>(); - ArrayList<Mutable<ILogicalExpression>> newExpressions = new ArrayList<Mutable<ILogicalExpression>>(); + ArrayList<LogicalVariable> newList = new ArrayList<>(); + ArrayList<Mutable<ILogicalExpression>> newExpressions = new ArrayList<>(); newList.addAll(op.getVariables()); deepCopyExpressionRefs(newExpressions, op.getExpressions()); return new AggregateOperator(newList, newExpressions); @@ -84,8 +84,8 @@ public class OperatorDeepCopyVisitor implements ILogicalOperatorVisitor<ILogical @Override public ILogicalOperator visitRunningAggregateOperator(RunningAggregateOperator op, Void arg) throws AlgebricksException { - ArrayList<LogicalVariable> newList = new ArrayList<LogicalVariable>(); - ArrayList<Mutable<ILogicalExpression>> newExpressions = new ArrayList<Mutable<ILogicalExpression>>(); + ArrayList<LogicalVariable> newList = new ArrayList<>(); + ArrayList<Mutable<ILogicalExpression>> newExpressions = new ArrayList<>(); newList.addAll(op.getVariables()); deepCopyExpressionRefs(newExpressions, op.getExpressions()); return new RunningAggregateOperator(newList, newExpressions); @@ -99,16 +99,14 @@ public class OperatorDeepCopyVisitor implements ILogicalOperatorVisitor<ILogical @Override public ILogicalOperator visitGroupByOperator(GroupByOperator op, Void arg) throws AlgebricksException { - List<Pair<LogicalVariable, Mutable<ILogicalExpression>>> groupByList = new ArrayList<Pair<LogicalVariable, Mutable<ILogicalExpression>>>(); - List<Pair<LogicalVariable, Mutable<ILogicalExpression>>> decoList = new ArrayList<Pair<LogicalVariable, Mutable<ILogicalExpression>>>(); - ArrayList<ILogicalPlan> newSubplans = new ArrayList<ILogicalPlan>(); + List<Pair<LogicalVariable, Mutable<ILogicalExpression>>> groupByList = new ArrayList<>(); + List<Pair<LogicalVariable, Mutable<ILogicalExpression>>> decoList = new ArrayList<>(); + ArrayList<ILogicalPlan> newSubplans = new ArrayList<>(); for (Pair<LogicalVariable, Mutable<ILogicalExpression>> pair : op.getGroupByList()) { - groupByList.add(new Pair<LogicalVariable, Mutable<ILogicalExpression>>(pair.first, - deepCopyExpressionRef(pair.second))); + groupByList.add(new Pair<>(pair.first, deepCopyExpressionRef(pair.second))); } for (Pair<LogicalVariable, Mutable<ILogicalExpression>> pair : op.getDecorList()) { - decoList.add(new Pair<LogicalVariable, Mutable<ILogicalExpression>>(pair.first, - deepCopyExpressionRef(pair.second))); + decoList.add(new Pair<>(pair.first, deepCopyExpressionRef(pair.second))); } GroupByOperator gbyOp = new GroupByOperator(groupByList, decoList, newSubplans); for (ILogicalPlan plan : op.getNestedPlans()) { @@ -148,8 +146,8 @@ public class OperatorDeepCopyVisitor implements ILogicalOperatorVisitor<ILogical @Override public ILogicalOperator visitAssignOperator(AssignOperator op, Void arg) throws AlgebricksException { - ArrayList<LogicalVariable> newList = new ArrayList<LogicalVariable>(); - ArrayList<Mutable<ILogicalExpression>> newExpressions = new ArrayList<Mutable<ILogicalExpression>>(); + ArrayList<LogicalVariable> newList = new ArrayList<>(); + ArrayList<Mutable<ILogicalExpression>> newExpressions = new ArrayList<>(); newList.addAll(op.getVariables()); deepCopyExpressionRefs(newExpressions, op.getExpressions()); return new AssignOperator(newList, newExpressions); @@ -163,7 +161,7 @@ public class OperatorDeepCopyVisitor implements ILogicalOperatorVisitor<ILogical @Override public ILogicalOperator visitProjectOperator(ProjectOperator op, Void arg) throws AlgebricksException { - ArrayList<LogicalVariable> newList = new ArrayList<LogicalVariable>(); + ArrayList<LogicalVariable> newList = new ArrayList<>(); newList.addAll(op.getVariables()); return new ProjectOperator(newList); } @@ -171,7 +169,7 @@ public class OperatorDeepCopyVisitor implements ILogicalOperatorVisitor<ILogical @Override public ILogicalOperator visitPartitioningSplitOperator(PartitioningSplitOperator op, Void arg) throws AlgebricksException { - ArrayList<Mutable<ILogicalExpression>> newExpressions = new ArrayList<Mutable<ILogicalExpression>>(); + ArrayList<Mutable<ILogicalExpression>> newExpressions = new ArrayList<>(); deepCopyExpressionRefs(newExpressions, op.getExpressions()); return new PartitioningSplitOperator(newExpressions, op.getDefaultBranchIndex()); } @@ -183,8 +181,8 @@ public class OperatorDeepCopyVisitor implements ILogicalOperatorVisitor<ILogical @Override public ILogicalOperator visitScriptOperator(ScriptOperator op, Void arg) throws AlgebricksException { - ArrayList<LogicalVariable> newInputList = new ArrayList<LogicalVariable>(); - ArrayList<LogicalVariable> newOutputList = new ArrayList<LogicalVariable>(); + ArrayList<LogicalVariable> newInputList = new ArrayList<>(); + ArrayList<LogicalVariable> newOutputList = new ArrayList<>(); newInputList.addAll(op.getInputVariables()); newOutputList.addAll(op.getOutputVariables()); return new ScriptOperator(op.getScriptDescription(), newInputList, newOutputList); @@ -192,7 +190,7 @@ public class OperatorDeepCopyVisitor implements ILogicalOperatorVisitor<ILogical @Override public ILogicalOperator visitSubplanOperator(SubplanOperator op, Void arg) throws AlgebricksException { - ArrayList<ILogicalPlan> newSubplans = new ArrayList<ILogicalPlan>(); + ArrayList<ILogicalPlan> newSubplans = new ArrayList<>(); SubplanOperator subplanOp = new SubplanOperator(newSubplans); for (ILogicalPlan plan : op.getNestedPlans()) { newSubplans.add(OperatorManipulationUtil.deepCopy(plan, subplanOp)); @@ -202,11 +200,10 @@ public class OperatorDeepCopyVisitor implements ILogicalOperatorVisitor<ILogical @Override public ILogicalOperator visitUnionOperator(UnionAllOperator op, Void arg) throws AlgebricksException { - List<Triple<LogicalVariable, LogicalVariable, LogicalVariable>> newVarMap = new ArrayList<Triple<LogicalVariable, LogicalVariable, LogicalVariable>>(); + List<Triple<LogicalVariable, LogicalVariable, LogicalVariable>> newVarMap = new ArrayList<>(); List<Triple<LogicalVariable, LogicalVariable, LogicalVariable>> varMap = op.getVariableMappings(); for (Triple<LogicalVariable, LogicalVariable, LogicalVariable> triple : varMap) { - newVarMap.add(new Triple<LogicalVariable, LogicalVariable, LogicalVariable>(triple.first, triple.second, - triple.third)); + newVarMap.add(new Triple<>(triple.first, triple.second, triple.third)); } return new UnionAllOperator(newVarMap); } @@ -229,31 +226,31 @@ public class OperatorDeepCopyVisitor implements ILogicalOperatorVisitor<ILogical @Override public ILogicalOperator visitUnnestMapOperator(UnnestMapOperator op, Void arg) throws AlgebricksException { - ArrayList<LogicalVariable> newInputList = new ArrayList<LogicalVariable>(); + ArrayList<LogicalVariable> newInputList = new ArrayList<>(); newInputList.addAll(op.getVariables()); return new UnnestMapOperator(newInputList, deepCopyExpressionRef(op.getExpressionRef()), - new ArrayList<Object>(op.getVariableTypes()), op.propagatesInput()); + new ArrayList<>(op.getVariableTypes()), op.propagatesInput()); } @Override public ILogicalOperator visitLeftOuterUnnestMapOperator(LeftOuterUnnestMapOperator op, Void arg) throws AlgebricksException { - ArrayList<LogicalVariable> newInputList = new ArrayList<LogicalVariable>(); + ArrayList<LogicalVariable> newInputList = new ArrayList<>(); newInputList.addAll(op.getVariables()); return new LeftOuterUnnestMapOperator(newInputList, deepCopyExpressionRef(op.getExpressionRef()), - new ArrayList<Object>(op.getVariableTypes()), op.propagatesInput()); + new ArrayList<>(op.getVariableTypes()), op.propagatesInput()); } @Override public ILogicalOperator visitDataScanOperator(DataSourceScanOperator op, Void arg) throws AlgebricksException { - ArrayList<LogicalVariable> newInputList = new ArrayList<LogicalVariable>(); + ArrayList<LogicalVariable> newInputList = new ArrayList<>(); newInputList.addAll(op.getVariables()); return new DataSourceScanOperator(newInputList, op.getDataSource()); } @Override public ILogicalOperator visitDistinctOperator(DistinctOperator op, Void arg) throws AlgebricksException { - ArrayList<Mutable<ILogicalExpression>> newExpressions = new ArrayList<Mutable<ILogicalExpression>>(); + ArrayList<Mutable<ILogicalExpression>> newExpressions = new ArrayList<>(); deepCopyExpressionRefs(newExpressions, op.getExpressions()); return new DistinctOperator(newExpressions); } @@ -265,7 +262,7 @@ public class OperatorDeepCopyVisitor implements ILogicalOperatorVisitor<ILogical @Override public ILogicalOperator visitWriteOperator(WriteOperator op, Void arg) throws AlgebricksException { - ArrayList<Mutable<ILogicalExpression>> newExpressions = new ArrayList<Mutable<ILogicalExpression>>(); + ArrayList<Mutable<ILogicalExpression>> newExpressions = new ArrayList<>(); deepCopyExpressionRefs(newExpressions, op.getExpressions()); return new WriteOperator(newExpressions, op.getDataSink()); } @@ -273,16 +270,16 @@ public class OperatorDeepCopyVisitor implements ILogicalOperatorVisitor<ILogical @Override public ILogicalOperator visitDistributeResultOperator(DistributeResultOperator op, Void arg) throws AlgebricksException { - ArrayList<Mutable<ILogicalExpression>> newExpressions = new ArrayList<Mutable<ILogicalExpression>>(); + ArrayList<Mutable<ILogicalExpression>> newExpressions = new ArrayList<>(); deepCopyExpressionRefs(newExpressions, op.getExpressions()); return new DistributeResultOperator(newExpressions, op.getDataSink()); } @Override public ILogicalOperator visitWriteResultOperator(WriteResultOperator op, Void arg) throws AlgebricksException { - ArrayList<Mutable<ILogicalExpression>> newKeyExpressions = new ArrayList<Mutable<ILogicalExpression>>(); + ArrayList<Mutable<ILogicalExpression>> newKeyExpressions = new ArrayList<>(); deepCopyExpressionRefs(newKeyExpressions, op.getKeyExpressions()); - List<Mutable<ILogicalExpression>> newLSMComponentFilterExpressions = new ArrayList<Mutable<ILogicalExpression>>(); + List<Mutable<ILogicalExpression>> newLSMComponentFilterExpressions = new ArrayList<>(); deepCopyExpressionRefs(newKeyExpressions, op.getAdditionalFilteringExpressions()); WriteResultOperator writeResultOp = new WriteResultOperator(op.getDataSource(), deepCopyExpressionRef(op.getPayloadExpression()), newKeyExpressions); @@ -293,13 +290,13 @@ public class OperatorDeepCopyVisitor implements ILogicalOperatorVisitor<ILogical @Override public ILogicalOperator visitInsertDeleteUpsertOperator(InsertDeleteUpsertOperator op, Void arg) throws AlgebricksException { - List<Mutable<ILogicalExpression>> newKeyExpressions = new ArrayList<Mutable<ILogicalExpression>>(); + List<Mutable<ILogicalExpression>> newKeyExpressions = new ArrayList<>(); deepCopyExpressionRefs(newKeyExpressions, op.getPrimaryKeyExpressions()); - List<Mutable<ILogicalExpression>> newLSMComponentFilterExpressions = new ArrayList<Mutable<ILogicalExpression>>(); + List<Mutable<ILogicalExpression>> newLSMComponentFilterExpressions = new ArrayList<>(); deepCopyExpressionRefs(newKeyExpressions, op.getAdditionalFilteringExpressions()); - InsertDeleteUpsertOperator insertDeleteOp = new InsertDeleteUpsertOperator(op.getDataSource(), - deepCopyExpressionRef(op.getPayloadExpression()), newKeyExpressions, op.getOperation(), - op.isBulkload()); + InsertDeleteUpsertOperator insertDeleteOp = + new InsertDeleteUpsertOperator(op.getDataSource(), deepCopyExpressionRef(op.getPayloadExpression()), + newKeyExpressions, op.getOperation(), op.isBulkload()); insertDeleteOp.setAdditionalFilteringExpressions(newLSMComponentFilterExpressions); return insertDeleteOp; } @@ -307,32 +304,32 @@ public class OperatorDeepCopyVisitor implements ILogicalOperatorVisitor<ILogical @Override public ILogicalOperator visitIndexInsertDeleteUpsertOperator(IndexInsertDeleteUpsertOperator op, Void arg) throws AlgebricksException { - List<Mutable<ILogicalExpression>> newPrimaryKeyExpressions = new ArrayList<Mutable<ILogicalExpression>>(); + List<Mutable<ILogicalExpression>> newPrimaryKeyExpressions = new ArrayList<>(); deepCopyExpressionRefs(newPrimaryKeyExpressions, op.getPrimaryKeyExpressions()); - List<Mutable<ILogicalExpression>> newSecondaryKeyExpressions = new ArrayList<Mutable<ILogicalExpression>>(); + List<Mutable<ILogicalExpression>> newSecondaryKeyExpressions = new ArrayList<>(); deepCopyExpressionRefs(newSecondaryKeyExpressions, op.getSecondaryKeyExpressions()); - Mutable<ILogicalExpression> newFilterExpression = new MutableObject<ILogicalExpression>( - ((AbstractLogicalExpression) op.getFilterExpression()).cloneExpression()); - List<Mutable<ILogicalExpression>> newLSMComponentFilterExpressions = new ArrayList<Mutable<ILogicalExpression>>(); + Mutable<ILogicalExpression> newFilterExpression = + new MutableObject<>(((AbstractLogicalExpression) op.getFilterExpression()).cloneExpression()); + List<Mutable<ILogicalExpression>> newLSMComponentFilterExpressions = new ArrayList<>(); deepCopyExpressionRefs(newLSMComponentFilterExpressions, op.getAdditionalFilteringExpressions()); IndexInsertDeleteUpsertOperator indexInsertDeleteOp = new IndexInsertDeleteUpsertOperator( op.getDataSourceIndex(), newPrimaryKeyExpressions, newSecondaryKeyExpressions, newFilterExpression, - op.getOperation(), op.isBulkload()); + op.getOperation(), op.isBulkload(), op.getNumberOfAdditionalNonFilteringFields()); indexInsertDeleteOp.setAdditionalFilteringExpressions(newLSMComponentFilterExpressions); return indexInsertDeleteOp; } @Override public ILogicalOperator visitTokenizeOperator(TokenizeOperator op, Void arg) throws AlgebricksException { - List<Mutable<ILogicalExpression>> newPrimaryKeyExpressions = new ArrayList<Mutable<ILogicalExpression>>(); + List<Mutable<ILogicalExpression>> newPrimaryKeyExpressions = new ArrayList<>(); deepCopyExpressionRefs(newPrimaryKeyExpressions, op.getPrimaryKeyExpressions()); - List<Mutable<ILogicalExpression>> newSecondaryKeyExpressions = new ArrayList<Mutable<ILogicalExpression>>(); + List<Mutable<ILogicalExpression>> newSecondaryKeyExpressions = new ArrayList<>(); deepCopyExpressionRefs(newSecondaryKeyExpressions, op.getSecondaryKeyExpressions()); - List<LogicalVariable> newTokenizeVars = new ArrayList<LogicalVariable>(); + List<LogicalVariable> newTokenizeVars = new ArrayList<>(); deepCopyVars(newTokenizeVars, op.getTokenizeVars()); - Mutable<ILogicalExpression> newFilterExpression = new MutableObject<ILogicalExpression>( - ((AbstractLogicalExpression) op.getFilterExpression()).cloneExpression()); - List<Object> newTokenizeVarTypes = new ArrayList<Object>(); + Mutable<ILogicalExpression> newFilterExpression = + new MutableObject<>(((AbstractLogicalExpression) op.getFilterExpression()).cloneExpression()); + List<Object> newTokenizeVarTypes = new ArrayList<>(); deepCopyObjects(newTokenizeVarTypes, op.getTokenizeVarTypes()); TokenizeOperator tokenizeOp = new TokenizeOperator(op.getDataSourceIndex(), newPrimaryKeyExpressions, @@ -349,17 +346,16 @@ public class OperatorDeepCopyVisitor implements ILogicalOperatorVisitor<ILogical private void deepCopyExpressionRefs(List<Mutable<ILogicalExpression>> newExprs, List<Mutable<ILogicalExpression>> oldExprs) { for (Mutable<ILogicalExpression> oldExpr : oldExprs) { - newExprs.add(new MutableObject<ILogicalExpression>( - ((AbstractLogicalExpression) oldExpr.getValue()).cloneExpression())); + newExprs.add(new MutableObject<>(((AbstractLogicalExpression) oldExpr.getValue()).cloneExpression())); } } private Mutable<ILogicalExpression> deepCopyExpressionRef(Mutable<ILogicalExpression> oldExprRef) { ILogicalExpression oldExpr = oldExprRef.getValue(); if (oldExpr == null) { - return new MutableObject<ILogicalExpression>(null); + return new MutableObject<>(null); } - return new MutableObject<ILogicalExpression>(oldExpr.cloneExpression()); + return new MutableObject<>(oldExpr.cloneExpression()); } private List<LogicalVariable> deepCopyVars(List<LogicalVariable> newVars, List<LogicalVariable> oldVars) { @@ -376,12 +372,11 @@ public class OperatorDeepCopyVisitor implements ILogicalOperatorVisitor<ILogical return newObjs; } - private List<Pair<IOrder, Mutable<ILogicalExpression>>> deepCopyOrderAndExpression( - List<Pair<IOrder, Mutable<ILogicalExpression>>> ordersAndExprs) { - List<Pair<IOrder, Mutable<ILogicalExpression>>> newOrdersAndExprs = new ArrayList<Pair<IOrder, Mutable<ILogicalExpression>>>(); + private List<Pair<IOrder, Mutable<ILogicalExpression>>> + deepCopyOrderAndExpression(List<Pair<IOrder, Mutable<ILogicalExpression>>> ordersAndExprs) { + List<Pair<IOrder, Mutable<ILogicalExpression>>> newOrdersAndExprs = new ArrayList<>(); for (Pair<IOrder, Mutable<ILogicalExpression>> pair : ordersAndExprs) { - newOrdersAndExprs - .add(new Pair<IOrder, Mutable<ILogicalExpression>>(pair.first, deepCopyExpressionRef(pair.second))); + newOrdersAndExprs.add(new Pair<>(pair.first, deepCopyExpressionRef(pair.second))); } return newOrdersAndExprs; } http://git-wip-us.apache.org/repos/asf/asterixdb/blob/dfa3c117/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/IndexInsertDeleteUpsertPOperator.java ---------------------------------------------------------------------- diff --git a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/IndexInsertDeleteUpsertPOperator.java b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/IndexInsertDeleteUpsertPOperator.java index f29fd6f..ce86e58 100644 --- a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/IndexInsertDeleteUpsertPOperator.java +++ b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/IndexInsertDeleteUpsertPOperator.java @@ -56,11 +56,12 @@ public class IndexInsertDeleteUpsertPOperator extends AbstractPhysicalOperator { private final List<LogicalVariable> additionalFilteringKeys; private final List<LogicalVariable> prevSecondaryKeys; private final LogicalVariable prevAdditionalFilteringKey; + private final int numOfAdditionalNonFilteringFields; public IndexInsertDeleteUpsertPOperator(List<LogicalVariable> primaryKeys, List<LogicalVariable> secondaryKeys, List<LogicalVariable> additionalFilteringKeys, Mutable<ILogicalExpression> filterExpr, IDataSourceIndex<?, ?> dataSourceIndex, List<LogicalVariable> prevSecondaryKeys, - LogicalVariable prevAdditionalFilteringKey) { + LogicalVariable prevAdditionalFilteringKey, int numOfAdditionalNonFilteringFields) { this.primaryKeys = primaryKeys; this.secondaryKeys = secondaryKeys; if (filterExpr != null) { @@ -72,6 +73,7 @@ public class IndexInsertDeleteUpsertPOperator extends AbstractPhysicalOperator { this.additionalFilteringKeys = additionalFilteringKeys; this.prevSecondaryKeys = prevSecondaryKeys; this.prevAdditionalFilteringKey = prevAdditionalFilteringKey; + this.numOfAdditionalNonFilteringFields = numOfAdditionalNonFilteringFields; } @Override @@ -91,6 +93,9 @@ public class IndexInsertDeleteUpsertPOperator extends AbstractPhysicalOperator { List<LogicalVariable> scanVariables = new ArrayList<LogicalVariable>(); scanVariables.addAll(primaryKeys); scanVariables.add(new LogicalVariable(-1)); + for (int i = 0; i < numOfAdditionalNonFilteringFields; i++) { + scanVariables.add(new LogicalVariable(-1)); + } IPhysicalPropertiesVector r = dataSourceIndex.getDataSource().getPropertiesProvider() .computePropertiesVector(scanVariables); r.getLocalProperties().clear(); @@ -103,7 +108,7 @@ public class IndexInsertDeleteUpsertPOperator extends AbstractPhysicalOperator { @Override public void contributeRuntimeOperator(IHyracksJobBuilder builder, JobGenContext context, ILogicalOperator op, IOperatorSchema propagatedSchema, IOperatorSchema[] inputSchemas, IOperatorSchema outerPlanSchema) - throws AlgebricksException { + throws AlgebricksException { IndexInsertDeleteUpsertOperator insertDeleteUpsertOp = (IndexInsertDeleteUpsertOperator) op; IMetadataProvider mp = context.getMetadataProvider(); http://git-wip-us.apache.org/repos/asf/asterixdb/blob/dfa3c117/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/InsertDeleteUpsertPOperator.java ---------------------------------------------------------------------- diff --git a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/InsertDeleteUpsertPOperator.java b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/InsertDeleteUpsertPOperator.java index 0bc683c..3c9cddf 100644 --- a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/InsertDeleteUpsertPOperator.java +++ b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/InsertDeleteUpsertPOperator.java @@ -83,8 +83,7 @@ public class InsertDeleteUpsertPOperator extends AbstractPhysicalOperator { IPhysicalPropertiesVector reqdByParent, IOptimizationContext context) { List<LogicalVariable> scanVariables = new ArrayList<LogicalVariable>(); scanVariables.addAll(keys); - // Why do we add $$-1 and not the payLoad variable? - scanVariables.add(new LogicalVariable(-1)); + scanVariables.add(payload); if (additionalNonFilteringFields != null) { scanVariables.addAll(additionalNonFilteringFields); } @@ -99,7 +98,7 @@ public class InsertDeleteUpsertPOperator extends AbstractPhysicalOperator { @Override public void contributeRuntimeOperator(IHyracksJobBuilder builder, JobGenContext context, ILogicalOperator op, IOperatorSchema propagatedSchema, IOperatorSchema[] inputSchemas, IOperatorSchema outerPlanSchema) - throws AlgebricksException { + throws AlgebricksException { InsertDeleteUpsertOperator insertDeleteOp = (InsertDeleteUpsertOperator) op; IMetadataProvider mp = context.getMetadataProvider(); IVariableTypeEnvironment typeEnv = context.getTypeEnvironment(op); http://git-wip-us.apache.org/repos/asf/asterixdb/blob/dfa3c117/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/prettyprint/LogicalOperatorPrettyPrintVisitor.java ---------------------------------------------------------------------- diff --git a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/prettyprint/LogicalOperatorPrettyPrintVisitor.java b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/prettyprint/LogicalOperatorPrettyPrintVisitor.java index f1f6217..e85c35c 100644 --- a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/prettyprint/LogicalOperatorPrettyPrintVisitor.java +++ b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/prettyprint/LogicalOperatorPrettyPrintVisitor.java @@ -45,11 +45,11 @@ import org.apache.hyracks.algebricks.core.algebra.operators.logical.InsertDelete import org.apache.hyracks.algebricks.core.algebra.operators.logical.IntersectOperator; import org.apache.hyracks.algebricks.core.algebra.operators.logical.LeftOuterJoinOperator; import org.apache.hyracks.algebricks.core.algebra.operators.logical.LeftOuterUnnestMapOperator; +import org.apache.hyracks.algebricks.core.algebra.operators.logical.LeftOuterUnnestOperator; import org.apache.hyracks.algebricks.core.algebra.operators.logical.LimitOperator; import org.apache.hyracks.algebricks.core.algebra.operators.logical.MaterializeOperator; import org.apache.hyracks.algebricks.core.algebra.operators.logical.NestedTupleSourceOperator; import org.apache.hyracks.algebricks.core.algebra.operators.logical.OrderOperator; -import org.apache.hyracks.algebricks.core.algebra.operators.logical.LeftOuterUnnestOperator; import org.apache.hyracks.algebricks.core.algebra.operators.logical.PartitioningSplitOperator; import org.apache.hyracks.algebricks.core.algebra.operators.logical.ProjectOperator; import org.apache.hyracks.algebricks.core.algebra.operators.logical.ReplicateOperator; @@ -378,15 +378,19 @@ public class LogicalOperatorPrettyPrintVisitor implements ILogicalOperatorVisito throws AlgebricksException { StringBuilder buffer = new StringBuilder(); String header = getIndexOpString(op.getOperation()); - addIndent(buffer, indent).append(header).append(op.getDataSource()).append(" from ") + addIndent(buffer, indent).append(header).append(op.getDataSource()).append(" from record: ") .append(op.getPayloadExpression().getValue().accept(exprVisitor, indent)); if (op.getAdditionalNonFilteringExpressions() != null) { + buffer.append(", meta: "); pprintExprList(op.getAdditionalNonFilteringExpressions(), buffer, indent); } buffer.append(" partitioned by "); pprintExprList(op.getPrimaryKeyExpressions(), buffer, indent); if (op.getOperation() == Kind.UPSERT) { - buffer.append(" out: ([record-before-upsert:" + op.getPrevRecordVar() + "]) "); + buffer.append(" out: ([record-before-upsert:" + op.getPrevRecordVar() + + ((op.getPrevAdditionalNonFilteringVars() != null) + ? (", additional-before-upsert: " + op.getPrevAdditionalNonFilteringVars()) : "") + + "]) "); } if (op.isBulkload()) { buffer.append(" [bulkload]"); http://git-wip-us.apache.org/repos/asf/asterixdb/blob/dfa3c117/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/SetAlgebricksPhysicalOperatorsRule.java ---------------------------------------------------------------------- diff --git a/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/SetAlgebricksPhysicalOperatorsRule.java b/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/SetAlgebricksPhysicalOperatorsRule.java index 6d3692f..8701851 100644 --- a/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/SetAlgebricksPhysicalOperatorsRule.java +++ b/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/SetAlgebricksPhysicalOperatorsRule.java @@ -352,7 +352,8 @@ public class SetAlgebricksPhysicalOperatorsRule implements IAlgebraicRewriteRule } op.setPhysicalOperator(new IndexInsertDeleteUpsertPOperator(primaryKeys, secondaryKeys, additionalFilteringKeys, opInsDel.getFilterExpression(), opInsDel.getDataSourceIndex(), - prevSecondaryKeys, prevAdditionalFilteringKey)); + prevSecondaryKeys, prevAdditionalFilteringKey, + opInsDel.getNumberOfAdditionalNonFilteringFields())); } break; http://git-wip-us.apache.org/repos/asf/asterixdb/blob/dfa3c117/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/tuples/TypeAwareTupleReference.java ---------------------------------------------------------------------- diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/tuples/TypeAwareTupleReference.java b/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/tuples/TypeAwareTupleReference.java index c6a0035..27a767f 100644 --- a/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/tuples/TypeAwareTupleReference.java +++ b/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/tuples/TypeAwareTupleReference.java @@ -19,14 +19,13 @@ package org.apache.hyracks.storage.am.common.tuples; -import static org.apache.hyracks.util.encoding.VarLenIntEncoderDecoder.VarLenIntDecoder; - import java.nio.ByteBuffer; import org.apache.hyracks.api.dataflow.value.ITypeTraits; import org.apache.hyracks.storage.am.common.api.ITreeIndexFrame; import org.apache.hyracks.storage.am.common.api.ITreeIndexTupleReference; import org.apache.hyracks.util.encoding.VarLenIntEncoderDecoder; +import org.apache.hyracks.util.encoding.VarLenIntEncoderDecoder.VarLenIntDecoder; public class TypeAwareTupleReference implements ITreeIndexTupleReference { protected ByteBuffer buf; @@ -36,7 +35,7 @@ public class TypeAwareTupleReference implements ITreeIndexTupleReference { protected int nullFlagsBytes; protected int dataStartOff; - protected ITypeTraits[] typeTraits; + protected final ITypeTraits[] typeTraits; protected VarLenIntDecoder encDec = VarLenIntEncoderDecoder.createDecoder(); protected int[] decodedFieldSlots; http://git-wip-us.apache.org/repos/asf/asterixdb/blob/dfa3c117/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeFileManager.java ---------------------------------------------------------------------- diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeFileManager.java b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeFileManager.java index 653c451..f62f70c 100644 --- a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeFileManager.java +++ b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeFileManager.java @@ -184,7 +184,7 @@ public class LSMBTreeFileManager extends AbstractLSMIndexFileManager { } ComparableFileName cmpBTreeFileName = null; ComparableFileName cmpBloomFilterFileName = null; - while (btreeFileIter.hasNext() && bloomFilterFileIter.hasNext()) { + while (btreeFileIter.hasNext() && (hasBloomFilter ? bloomFilterFileIter.hasNext() : true)) { cmpBTreeFileName = btreeFileIter.next(); if (hasBloomFilter) { cmpBloomFilterFileName = bloomFilterFileIter.next(); http://git-wip-us.apache.org/repos/asf/asterixdb/blob/dfa3c117/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 131ef02..786ce46 100644 --- a/pom.xml +++ b/pom.xml @@ -44,4 +44,35 @@ <module>hyracks-fullstack</module> <module>asterixdb</module> </modules> + <build> + <pluginManagement> + <plugins> + <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.--> + <plugin> + <groupId>org.eclipse.m2e</groupId> + <artifactId>lifecycle-mapping</artifactId> + <version>1.0.0</version> + <configuration> + <lifecycleMappingMetadata> + <pluginExecutions> + <pluginExecution> + <pluginExecutionFilter> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <versionRange>[2.17,)</versionRange> + <goals> + <goal>check</goal> + </goals> + </pluginExecutionFilter> + <action> + <ignore></ignore> + </action> + </pluginExecution> + </pluginExecutions> + </lifecycleMappingMetadata> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> </project>