Github user twdsilva commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/355#discussion_r226383941
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/expression/ComparisonExpression.java
---
@@ -327,6 +328,9 @@ public boolean evaluate(Tuple tuple,
ImmutableBytesWritable ptr) {
rhsLength = StringUtil.getUnpaddedCharLength(rhsBytes,
rhsOffset, rhsLength, rhsSortOrder);
}
if (lhsDataType == PChar.INSTANCE) {
+ // Due to length of PChar columns may be modified, in order to
the values of filters can match original data,
+ // we make rhsLength equal with lhsLength.
--- End diff --
In Comparison.evaluate() when a value is being read from a column whose
length is modified, do you get the original value or the modified value (either
a substring or with extra padding)?
Please add a test for this.
---