}
if (ptr.getLength() == 0) {
ptr.set(ByteUtil.EMPTY_BYTE_ARRAY);
return true;
}
KeyRange range = childPart.getKeyRange(rvcElementOp, rhs);
// This can happen when an EQUAL operator is used and the expression cannot possibly match.
if (range == KeyRange.EMPTY_RANGE) {
return false;
}
// We have to take the range and condense it down to a single key. We use which ever
// part of the range is inclusive (which implies being bound as well). This works in all
// cases, including this substring one, which produces a lower inclusive range and an
// upper non inclusive range.
// (a, substr(b,1,1)) IN (('a','b'), ('c','d'))
byte[] key = range.isLowerInclusive() ? range.getLowerRange() : range.getUpperRange();
// FIXME: this is kind of a hack. The above call will fill a fixed width key, but
// we don't want to fill the key yet because it can throw off our the logic we
// use to compute the next key when we evaluate the RHS row value constructor
// below. We could create a new childPart with a delegate column that returns
// null for getByteSize().