From: <tho...@us...> - 2013-11-26 18:21:13
|
Revision: 7597 http://bigdata.svn.sourceforge.net/bigdata/?rev=7597&view=rev Author: thompsonbry Date: 2013-11-26 18:21:06 +0000 (Tue, 26 Nov 2013) Log Message: ----------- Checkpoint on #763 (analytic query mode stochastic errors). I have not yet identified the root cause. These edits simplify some code paths but have no semantics change and do not fix the problem. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/join/HTreeHashJoinUtility.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/join/HTreeHashJoinUtility.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/join/HTreeHashJoinUtility.java 2013-11-26 14:21:05 UTC (rev 7596) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/join/HTreeHashJoinUtility.java 2013-11-26 18:21:06 UTC (rev 7597) @@ -349,6 +349,7 @@ * Human readable representation of the {@link IHashJoinUtility} metadata * (but not the solutions themselves). */ + @Override public String toString() { final StringBuilder sb = new StringBuilder(); @@ -417,30 +418,35 @@ } + @Override public JoinTypeEnum getJoinType() { return joinType; } - + + @Override public IVariable<?> getAskVar() { return askVar; } - + + @Override public IVariable<?>[] getJoinVars() { return joinVars; } - + + @Override public IVariable<?>[] getSelectVars() { return selectVars; } - + + @Override public IConstraint[] getConstraints() { return constraints; @@ -1114,8 +1120,8 @@ nJoinsConsidered.increment(); - if (noJoinVars&& - nJoinsConsidered.get() == noJoinVarsLimit) { + if (noJoinVars + && nJoinsConsidered.get() == noJoinVarsLimit) { if (nleftConsidered.get() > 1 && nrightConsidered.get() > 1) { @@ -1354,7 +1360,7 @@ * * Note: EXISTS depends on this to have the correct cardinality. If * EXISTS allows duplicate solutions into the join set then having - * multiple left solutions which satisify the EXISTS filter will + * multiple left solutions which satisfy the EXISTS filter will * cause multiple copies of the right solution to be output! If you * change the joinSet to allow duplicates, then it MUST NOT allow * them for EXISTS! @@ -1424,8 +1430,15 @@ final ITuple<?> t = sitr.next(); - IBindingSet rightSolution = decodeSolution(t); + final ByteArrayBuffer tb = t.getValueBuffer(); + /* + * Note: This MUST be treated as effectively immutable since we + * may have to output multiple solutions for each rightSolution. + * Those output solutions MUST NOT side-effect [rightSolutions]. + */ + final IBindingSet rightSolution = decodeSolution(t); + // The hash code is based on the entire solution for the // joinSet. final int hashCode = rightSolution.hashCode(); @@ -1442,8 +1455,6 @@ final ITuple<?> xt = jitr.next(); - final ByteArrayBuffer tb = t.getValueBuffer(); - final ByteArrayBuffer xb = xt.getValueBuffer(); if (0 == BytesUtil.compareBytesWithLenAndOffset( @@ -1466,25 +1477,27 @@ * it as an optional solution. */ - if (selectVars != null) {// && selectVars.length > 0) { + IBindingSet bs = rightSolution; - // Only output the projected variables. - rightSolution = rightSolution.copy(selectVars); + if (selectVars != null) { + // Drop variables which are not projected. + bs = bs.copy(selectVars); + } - encoder.resolveCachedValues(rightSolution); + encoder.resolveCachedValues(bs); if (f != null) { - if (selectVars == null) - rightSolution = rightSolution.clone(); - - rightSolution.set( askVar, f); + if (bs == rightSolution) + bs = rightSolution.clone(); + bs.set(askVar, f); + } - outputBuffer.add(rightSolution); + outputBuffer.add(bs); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |