if (in != null) {
OrderedIntHashSet set = new OrderedIntHashSet();
in.addLeftColumnsForAllAny(rangeVar, set);
Index index = rangeVar.rangeTable.getIndexForColumns(session,
set, false);
int indexedColCount = 0;
for (int j = 0; j < index.getColumnCount(); j++) {
if (set.contains(index.getColumns()[j])) {
indexedColCount++;
} else {
break;
}
}
RangeVariable newRangeVar =
new RangeVariable(in.getRightNode().getTable(), null,
null, null, compileContext);
newRangeVar.isGenerated = true;
RangeVariable[] newList =
new RangeVariable[rangeVariables.length + 1];
ArrayUtil.copyAdjustArray(rangeVariables, newList,
newRangeVar, i, 1);
rangeVariables = newList;
// make two columns as arg
Expression[] exprList = new Expression[index.getColumnCount()];
for (int j = 0; j < indexedColCount; j++) {
int leftIndex = index.getColumns()[j];
int rightIndex = set.getIndex(leftIndex);
Expression e = new ExpressionLogical(rangeVar, leftIndex,
newRangeVar,
rightIndex);