private void createDerivedJoinResultsFromOpsList(String theCallingIndexId, ExecutionContext context, List opsList) throws FunctionDomainException, TypeMismatchException, NameResolutionException, QueryInvocationTargetException { Iterator iter = opsList.iterator(); while (iter.hasNext()) { CompiledValue cv = (CompiledValue) iter.next(); this.currentOp = cv; if (cv.getType() == CompiledValue.COMPARISON) { createDerivedJoinResultsFromCC(theCallingIndexId, (CompiledComparison) cv, context); } } // Now let's derive from our derivatives (for multiple join clauses that can be chained, such as // a.id = 1 and a.id = b.id and b.id = c.id List<Object[]> newDerivatives = new ArrayList<Object[]>(this.newDerivatives); this.newDerivatives.clear(); if (newDerivatives.size() > 0) { Iterator<Object[]> iterator = newDerivatives.iterator(); while (iterator.hasNext()) { Object[] idDerivedAndResults = iterator.next(); derivedDerivative(idDerivedAndResults, context, this.getExpansionList()); } } }
public void computeDerivedJoinResults(IndexInfo theCallingIndex, ExecutionContext context, CompiledValue iterOps) throws FunctionDomainException, TypeMismatchException, NameResolutionException, QueryInvocationTargetException { // Call this computeDerivedResults() // We are looking for join conditions so we can filter eval instead of iterate eval // Then we can apply the rest of the ops on the results if (theCallingIndex != null && iterOps != null) { if (iterOps instanceof CompiledJunction) { List opsList = ((CompiledJunction) iterOps).getOperands(); this.setOriginalOps(opsList); createDerivedJoinResultsFromOpsList( (QueryUtils.getCompiledIdFromPath(theCallingIndex._path)).getId(), context, opsList); } else if (iterOps.getType() == CompiledValue.COMPARISON) { createDerivedJoinResultsFromCC( (QueryUtils.getCompiledIdFromPath(theCallingIndex._path)).getId(), (CompiledComparison) iterOps, context); } } }