Github user dbwong commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/362#discussion_r230494407
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java ---
@@ -242,6 +260,12 @@ public static Expression
pushKeyExpressionsToScan(StatementContext context, Filt
cnf.add(leftRanges);
clipLeftSpan = 0;
prevSortOrder = sortOrder;
+ // since we have to clip the portion with the same
sort order, we can no longer
+ // extract the nodes from the where clause
+ // for eg. for the schema A VARCHAR DESC, B VARCHAR
ASC and query WHERE (A,B) < ('a','b')
+ // the range (* - a\xFFb) is converted to (~a-*)(*-b)
+ // so we still need to filter on A,B
--- End diff --
So 2 clarifications:
One there is no attempt today to unentwine the RVC comparison into pieces
for different columns.
Two, the filter still needs A as the behavior is different if A == 'a' or
if A > 'a', if A=='a' then we consider B only, otherwise we do not consider B.
The scan considers rows both A == 'a' and A > 'a'
---