public int compare(Integer rel1Idx, Integer rel2Idx) { RelOptCost c1 = mq.getCumulativeCost(chosenSemiJoins[rel1Idx]); RelOptCost c2 = mq.getCumulativeCost(chosenSemiJoins[rel2Idx]); // nulls are arbitrarily sorted if ((c1 == null) || (c2 == null)) { return -1; } return (c1.isLt(c2)) ? -1 : ((c1.equals(c2)) ? 0 : 1); } }
public int compare(Integer rel1Idx, Integer rel2Idx) { RelOptCost c1 = mq.getCumulativeCost(chosenSemiJoins[rel1Idx]); RelOptCost c2 = mq.getCumulativeCost(chosenSemiJoins[rel2Idx]); // nulls are arbitrarily sorted if ((c1 == null) || (c2 == null)) { return -1; } return (c1.isLt(c2)) ? -1 : ((c1.equals(c2)) ? 0 : 1); } }