int compare = 1; if (!target.isExpresssionDistinct()) { compare = compare(previousTuple, target.getCurrentTuple(), target.getExpressionIndexes(), target.getExpressionIndexes()); if (compare < 0) { boolean ignore = false;
result = 1; } else { result = compare(this.leftSource.getCurrentTuple(), this.rightSource.getCurrentTuple(), this.leftSource.getExpressionIndexes(), this.rightSource.getExpressionIndexes());
result = 1; } else { result = compare(this.leftSource.getCurrentTuple(), this.rightSource.getCurrentTuple(), this.leftSource.getExpressionIndexes(), this.rightSource.getExpressionIndexes());
int compare = 1; if (!target.isExpresssionDistinct()) { compare = compare(previousTuple, target.getCurrentTuple(), target.getExpressionIndexes(), target.getExpressionIndexes()); if (compare < 0) { boolean ignore = false;
result = 1; } else { result = compare(this.leftSource.getCurrentTuple(), this.rightSource.getCurrentTuple(), this.leftSource.getExpressionIndexes(), this.rightSource.getExpressionIndexes());
protected boolean compareToPrevious(SourceState target) throws TeiidComponentException, TeiidProcessingException { if (!target.getIterator().hasNext()) { target.setMaxProbeMatch(target.getIterator().getCurrentIndex()); return false; } List previousTuple = target.getCurrentTuple(); target.saveNext(); if (target.getMaxProbeMatch() >= target.getIterator().getCurrentIndex()) { return true; } if (previousTuple != null) { int compare = 1; if (!target.isExpresssionDistinct()) { compare = compare(previousTuple, target.getCurrentTuple(), target.getExpressionIndexes(), target.getExpressionIndexes()); if (compare < 0) { //sanity check - this means the sort order is not as expected //note this is not a complete check - it will not detect all invalid circumstances as we exit early throw new TeiidComponentException(QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31202)); } } if (compare != 0) { target.setMaxProbeMatch(target.getIterator().getCurrentIndex() - 1); return false; } } target.setMaxProbeMatch(target.getIterator().getCurrentIndex()); return true; }