@@ -32,10 +32,34 @@ public abstract class JoinPartitionIndexWrapper {
3232 * Reference to prior column data.
3333 */
3434 final ColumnData priorData ;
35+ /**
36+ * Reference to prior column data.
37+ */
38+ final IntData priorTest ;
39+ /**
40+ * Reference to prior column data.
41+ */
42+ final IntData nextTest ;
3543 /**
3644 * Index on join column to use.
3745 */
3846 final Index nextIndex ;
47+ /**
48+ * last prior value.
49+ */
50+ int lastValue = -1 ;
51+ /**
52+ * Last first position according to the last value.
53+ */
54+ int lastFirst = -1 ;
55+ /**
56+ * last start index of positions array.
57+ */
58+ int lastPositionsStart = -1 ;
59+ /**
60+ * last end index of positions array.
61+ */
62+ int lastPositionsEnd = -1 ;
3963 /**
4064 * Initialize index wrapper for
4165 * given query and join order.
@@ -55,10 +79,17 @@ public JoinPartitionIndexWrapper(ExpressionInfo equiPred, int[] order) {
5579 nextTable = pos1 <pos2 ?table2 :table1 ;
5680 // Get column data reference for prior table
5781 priorData = equiPred .dataMentioned .get (priorTable );
82+ priorTest = (IntData ) priorData ;
83+ nextTest = (IntData ) equiPred .dataMentioned .get (nextTable );
5884 // Get index for next table
5985 nextIndex = equiPred .indexMentioned .get (nextTable );
6086 }
6187
88+ /**
89+ * Reset temporary variables at the beginning of the join episode.
90+ */
91+ public abstract void reset (int [] tupleIndices );
92+
6293 /**
6394 * Extracts index of table in query column reference.
6495 *
@@ -97,6 +128,9 @@ int tablePos(int[] order, int table) {
97128 */
98129 public abstract int nextIndex (int [] tupleIndices , int [] nextSize );
99130
131+ public abstract int nextIndexFromLast (int [] tupleIndices , int [] nextSize );
132+ public int nextIndexFromLast (int [] tupleIndices , int [] nextSize , int tid ) {return 0 ;}
133+
100134 /**
101135 * Propose next index in next table that
102136 * satisfies equi-join condition in partitions with
@@ -108,7 +142,9 @@ int tablePos(int[] order, int table) {
108142 * @return next interesting tuple index or cardinality
109143 */
110144 public abstract int nextIndexInScope (int [] tupleIndices , int tid , int [] nextSize );
145+
111146 public abstract int nextIndexInScope (int [] tupleIndices , int tid , int [] nextSize , IntSet finishedThreads );
147+
112148 /**
113149 * Propose next index in next table that
114150 * satisfies equi-join condition with
@@ -129,6 +165,7 @@ int tablePos(int[] order, int table) {
129165 * @return next interesting tuple index or cardinality
130166 */
131167 public abstract boolean evaluateInScope (int [] tupleIndices , int tid );
168+
132169 public abstract boolean evaluateInScope (int [] tupleIndices , int tid , IntSet finishedThreads );
133170
134171 @ Override
0 commit comments