ExpressionsSource expressionsSource = (ExpressionsSource)input;
// If the source was VALUES, see if it's distinct. If so,
// we can possibly reverse the join and benefit from an
// index.
JoinType semiType = JoinType.SEMI;
DistinctState distinct = expressionsSource.getDistinctState();
switch (distinct) {
case DISTINCT:
case DISTINCT_WITH_NULL:
semiType = JoinType.SEMI_INNER_ALREADY_DISTINCT;
break;