Source:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { if(literalsOnly && literalExprPtr != null) { ptr.set(literalExprPtr.get(), literalExprPtr.getOffset(), literalExprPtr.getLength()); return true; } try { int j; final int numChildExpressions = children.size(); for(j = counter; j < numChildExpressions; j++) { final Expression expression = children.get(j); if(expression.evaluate(tuple, ptr)) { PDataType dt = IndexUtil.getIndexColumnDataType(true , expression.getDataType()); dt.coerceBytes(ptr, expression.getDataType(), expression.getColumnModifier(), expression.getColumnModifier()); ptrs[j] = new ImmutableBytesWritable(); ptrs[j].set(ptr.get(), ptr.getOffset(), ptr.getLength()); size = size + (dt.isFixedWidth() ? ptr.getLength() : ptr.getLength() + 1); counter++; } else if(tuple == null || tuple.isImmutable()) { ptrs[j] = new ImmutableBytesWritable(); ptrs[j].set(ByteUtil.EMPTY_BYTE_ARRAY); counter++; } else { return false; } } if(j == numChildExpressions) { TrustedByteArrayOutputStream output = new TrustedByteArrayOutputStream(size); try { for(int i = 0; i< numChildExpressions; i++) { ImmutableBytesWritable tempPtr = ptrs[i]; if(tempPtr != null) { if(i > 0) { final Expression expression = children.get(i); if (!IndexUtil.getIndexColumnDataType(true , expression.getDataType()).isFixedWidth()) { output.write(QueryConstants.SEPARATOR_BYTE); } } output.write(tempPtr.get(), tempPtr.getOffset(), tempPtr.getLength()); } } byte[] outputBytes = output.getBuffer(); int numSeparatorByte = 0; for(int k = output.size() -1 ; k >=0 ; k--) { if(outputBytes[k] == QueryConstants.SEPARATOR_BYTE) { numSeparatorByte++; } else { break; } } ptr.set(outputBytes, 0, output.size() - numSeparatorByte); return true; } finally { output.close(); } } return false; } catch (IOException e) { throw new RuntimeException(e); } }

Target:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { if(literalExprPtr != null) { ptr.set(literalExprPtr.get(), literalExprPtr.getOffset(), literalExprPtr.getLength()); return true; } try { int j; final int numChildExpressions = children.size(); for(j = counter; j < numChildExpressions; j++) { final Expression expression = children.get(j); if(expression != null && expression.evaluate(tuple, ptr)) { if(expression.getDataType() != null) { PDataType dt = IndexUtil.getIndexColumnDataType(true , expression.getDataType()); dt.coerceBytes(ptr, expression.getDataType(), expression.getColumnModifier(), expression.getColumnModifier()); ptrs[j] = new ImmutableBytesWritable(); ptrs[j].set(ptr.get(), ptr.getOffset(), ptr.getLength()); size = size + (dt.isFixedWidth() ? ptr.getLength() : ptr.getLength() + 1); counter++; } } else if(tuple == null || tuple.isImmutable()) { ptrs[j] = new ImmutableBytesWritable(); ptrs[j].set(ByteUtil.EMPTY_BYTE_ARRAY); counter++; } else { return false; } } if(j == numChildExpressions) { TrustedByteArrayOutputStream output = new TrustedByteArrayOutputStream(size); try { for(int i = 0; i< numChildExpressions; i++) { ImmutableBytesWritable tempPtr = ptrs[i]; if(tempPtr != null) { if(i > 0) { final Expression expression = children.get(i); if (!IndexUtil.getIndexColumnDataType(true , expression.getDataType()).isFixedWidth()) { output.write(QueryConstants.SEPARATOR_BYTE); } } output.write(tempPtr.get(), tempPtr.getOffset(), tempPtr.getLength()); } } byte[] outputBytes = output.getBuffer(); int numSeparatorByte = 0; for(int k = output.size() -1 ; k >=0 ; k--) { if(outputBytes[k] == QueryConstants.SEPARATOR_BYTE) { numSeparatorByte++; } else { break; } } ptr.set(outputBytes, 0, output.size() - numSeparatorByte); return true; } finally { output.close(); } } return false; } catch (IOException e) { throw new RuntimeException(e); } }