dbwong commented on a change in pull request #708: PHOENIX-5698 Phoenix Query
with RVC IN list expression generates wron…
URL: https://github.com/apache/phoenix/pull/708#discussion_r384409557
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
##########
@@ -590,11 +591,35 @@ private KeySlots newKeyParts(KeySlot slot,
List<Expression> extractNodes, List<K
return new SingleKeySlot(new BaseKeyPart(table,
slot.getKeyPart().getColumn(), extractNodes), slot.getPKPosition(),
slot.getPKSpan(), keyRanges, slot.getOrderPreserving());
}
- private KeySlots
newRowValueConstructorKeyParts(RowValueConstructorExpression rvc,
List<KeySlots> childSlots) {
+ public KeySlots
newRowValueConstructorKeyParts(RowValueConstructorExpression rvc,
List<KeySlots> childSlots) {
if (childSlots.isEmpty() || rvc.isStateless()) {
return null;
}
-
+ if (!this.orderMatter) {
+ Collections.sort(childSlots, new Comparator<KeySlots>() {
+ @Override
+ public int compare(KeySlots o1, KeySlots o2) {
+ return o1.getSlots().get(0).getPKPosition() -
Review comment:
I think get(0) is valid because we don't allow nesting on RVCs which is the
only case I'm currently aware of that uses multiple slots. Is that the case?
And if so we should comment.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services