kadirozde commented on code in PR #1780:
URL: https://github.com/apache/phoenix/pull/1780#discussion_r1449987045
##########
phoenix-core-client/src/main/java/org/apache/phoenix/compile/ProjectionCompiler.java:
##########
@@ -497,42 +502,106 @@ public static RowProjector compile(StatementContext
context, SelectStatement sta
index++;
}
- for (int i = arrayProjectedColumnRefs.size() - 1; i >= 0; i--) {
- Expression expression = arrayProjectedColumnRefs.get(i);
- Integer count = arrayExpressionCounts.get(expression);
+ for (int i = serverParsedProjectedColumnRefs.size() - 1; i >= 0; i--) {
+ Expression expression = serverParsedProjectedColumnRefs.get(i);
+ Integer count = serverParsedExpressionCounts.get(expression);
if (count != 0) {
- arrayKVRefs.remove(i);
- arrayKVFuncs.remove(i);
- arrayOldFuncs.remove(i);
+ serverParsedKVRefs.remove(i);
+ serverParsedKVFuncs.remove(i);
+ serverParsedOldFuncs.remove(i);
}
}
- if (arrayKVFuncs.size() > 0 && arrayKVRefs.size() > 0) {
- serailizeArrayIndexInformationAndSetInScan(context, arrayKVFuncs,
arrayKVRefs);
+ if (serverParsedKVFuncs.size() > 0 && serverParsedKVRefs.size() > 0) {
Review Comment:
The replacement map was only for array index functions (old vs new). Now
that JSON path function inherits from the array index function, the code gives
the impression that the replacement is needed for the JSON path function too.
The code has been introduce to handle this replacement even though there is no
such replacement is needed for the JSON functions as far as I understand. That
is another reason I suggested that JSON path should not inherit from ArrayIndex
but from Scalar.
The refactoring I suggested is to keep track of array index and JSON
functions separately and old vs new replacement should be applied to array
index only. Maybe I misunderstood the whole thing.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]