ChinmaySKulkarni commented on a change in pull request #736: PHOENIX-5698
Phoenix Query with RVC IN list expression generates wron…
URL: https://github.com/apache/phoenix/pull/736#discussion_r397365328
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/expression/InListExpression.java
##########
@@ -330,4 +342,98 @@ public String toString() {
public InListExpression clone(List<Expression> l) {
return new InListExpression(l, this.rowKeyOrderOptimizable);
}
+
+ public static List<InListColumnKeyValuePair>
getSortedInListColumnKeyValuePair(List<Expression> children,
+
boolean isStateless) {
+ List<InListColumnKeyValuePair> inListColumnKeyValuePairList = new
ArrayList<>();
+ int numberOfColumns = 0;
+
+ for (int i = 0; i < children.size(); i++) {
+ Expression child = children.get(i);
+ if (i == 0) {
+ numberOfColumns = child.getChildren().size();
+ for (int j = 0; j < child.getChildren().size(); j++) {
+ if (child.getChildren().get(j) instanceof
RowKeyColumnExpression) {
+ RowKeyColumnExpression rowKeyColumnExpression =
+
(RowKeyColumnExpression)child.getChildren().get(j);
+ InListColumnKeyValuePair inListColumnKeyValuePair =
+ new
InListColumnKeyValuePair(rowKeyColumnExpression);
+
inListColumnKeyValuePairList.add(inListColumnKeyValuePair);
+ } else {
Review comment:
Add comment here indicating that since at least one of the columns is not
part of the PK, we ignore
----------------------------------------------------------------
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